draw.io is a JavaScript, client-side editor for general diagramming.
26.0.4 release
David Bensonab8f923d054c
diff --git a/ChangeLog b/ChangeLogindex 4cc7c74c9..77d8398e8 100644--- a/ChangeLog+++ b/ChangeLog@@ -1,3 +1,8 @@+06-JAN-2024: 26.0.4++- Disables dark mode in viewer by default [jgraph/drawio#3701]+- Adds dark mode option in embed dialog+03-JAN-2024: 26.0.3- Fixes slope angle property for parallelogram and hexagon [jgraph/drawio#3672]diff --git a/VERSION b/VERSIONindex 61308cb35..65ac09cd7 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-26.0.3\ No newline at end of file+26.0.4\ No newline at end of filediff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.jsindex 99a124ab3..acf210f92 100644--- a/src/main/webapp/js/app.min.js+++ b/src/main/webapp/js/app.min.js@@ -64,7 +64,7 @@ if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==url"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};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||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.0.3",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.0.4",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&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:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().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:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||@@ -12231,8 +12231,8 @@ RemoteLibrary.prototype.saveAs=function(b,e,f){};RemoteLibrary.prototype.updateFvar StorageDialog=function(b,e,f){function c(L,F,d,g,m,t){function v(){mxEvent.addListener(y,"click",null!=t?t:function(){d==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(d,!0);e()})):d==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(d,!0);e()}),function(V){b.spinner.stop();b.handleError(V)}):(b.setMode(d,!0),e())})}u++;++q>f&&(mxUtils.br(E),q=1);var y=document.createElement("a");y.style.overflow="hidden";y.style.display="inline-block";y.className="geBaseButton";y.style.boxSizing="border-box";y.style.fontSize="11px";y.style.position="relative";y.style.margin="4px";y.style.marginTop="8px";y.style.marginBottom="0px";y.style.padding="8px 10px 8px 10px";y.style.width="88px";y.style.height="100px";y.style.whiteSpace="nowrap";y.setAttribute("title",F);var B=document.createElement("div");B.style.textOverflow="ellipsis";B.style.overflow="hidden";B.style.position="absolute";B.style.bottom="8px";B.style.left="0px";B.style.right="0px";mxUtils.write(B,F);y.appendChild(B);if(null!=L){var I=document.createElement("img");I.setAttribute("src",L);I.setAttribute("border","0");I.setAttribute("align","absmiddle");I.style.width="60px";I.style.height="60px";I.style.paddingBottom="6px";y.appendChild(I)}else B.style.paddingTop="5px",B.style.whiteSpace="normal",mxClient.IS_IOS?(y.style.padding="0px 10px 20px 10px",y.style.top=-"6px"):mxClient.IS_FF&&(B.style.paddingTop="0px",B.style.marginTop="-2px");if(null!=m)for(L=0;L<m.length;L++)mxUtils.br(B),mxUtils.write(B,m[L]);if(null!=g&&null==b[g]){I.style.visibility="hidden";mxUtils.setOpacity(B,10);var K=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});K.spin(y);var J=window.setTimeout(function(){null==b[g]&&(K.stop(),y.style.display="none")},3E4);b.addListener("clientLoaded",-mxUtils.bind(this,function(V,Q){null!=b[g]&&Q.getProperty("client")==b[g]&&(window.clearTimeout(J),mxUtils.setOpacity(B,100),I.style.visibility="",K.stop(),v(),"drive"==g&&null!=H.parentNode&&H.parentNode.removeChild(H))}))}else v();E.appendChild(y)}f=null!=f?f:2;var k=document.createElement("div");k.style.textAlign="center";k.style.whiteSpace="nowrap";k.style.paddingTop="0px";k.style.paddingBottom="20px";var n=document.createElement("div");n.style.border="1px solid #d3d3d3";n.style.borderWidth="1px 0px 1px 0px";+"6px"):mxClient.IS_FF&&(B.style.paddingTop="0px",B.style.marginTop="-2px");if(null!=m)for(L=0;L<m.length;L++)mxUtils.br(B),mxUtils.write(B,m[L]);if(null!=g&&null==b[g]){I.style.visibility="hidden";mxUtils.setOpacity(B,10);var J=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});J.spin(y);var K=window.setTimeout(function(){null==b[g]&&(J.stop(),y.style.display="none")},3E4);b.addListener("clientLoaded",+mxUtils.bind(this,function(V,Q){null!=b[g]&&Q.getProperty("client")==b[g]&&(window.clearTimeout(K),mxUtils.setOpacity(B,100),I.style.visibility="",J.stop(),v(),"drive"==g&&null!=H.parentNode&&H.parentNode.removeChild(H))}))}else v();E.appendChild(y)}f=null!=f?f:2;var k=document.createElement("div");k.style.textAlign="center";k.style.whiteSpace="nowrap";k.style.paddingTop="0px";k.style.paddingBottom="20px";var n=document.createElement("div");n.style.border="1px solid #d3d3d3";n.style.borderWidth="1px 0px 1px 0px";n.style.padding="10px 0px 20px 0px";var q=0,u=0,E=document.createElement("div");E.style.paddingTop="2px";n.appendChild(E);var H=document.createElement("p"),D=document.createElement("p");D.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(D,mxResources.get("saveDiagramsTo")+":");k.appendChild(D);k.appendChild(n);q=0;"function"===typeof window.DriveClient&&c(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&c(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");"1"!=urlParams.noDevice&&c(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||c(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.DropboxClient&&c(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox");null!=b.gitHub&&c(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=b.gitLab&&c(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");n=document.createElement("span");n.style.position="absolute";n.style.cursor="pointer";n.style.bottom="27px";n.style.color="gray";n.style.userSelect="none";n.style.textAlign="center";n.style.left="50%";mxUtils.setPrefixedStyle(n.style,"transform","translate(-50%,0)");mxUtils.write(n,mxResources.get("decideLater"));@@ -12259,15 +12259,15 @@ mxUtils.button("",function(){try{var d="https://twitter.com/intent/tweet?text="+" max)"),F.style.verticalAlign="bottom",F.style.paddingTop="4px",F.style.minWidth="46px",F.className="geBtn",n.appendChild(F))}!b.isOffline()&&5E5>e.length&&(F=mxUtils.button("",function(){try{var d="mailto:?subject="+encodeURIComponent(E||b.defaultFilename)+"&body="+encodeURIComponent(D.value);b.openLink(d)}catch(g){b.handleError({message:g.message||mxResources.get("drawingTooLarge")})}}),u=document.createElement("img"),u.className="geAdaptiveAsset",u.setAttribute("src",Editor.mailImage),u.setAttribute("width","18"),u.setAttribute("height","18"),u.setAttribute("border","0"),u.style.marginBottom="5px",F.appendChild(u),F.style.verticalAlign="bottom",F.style.paddingTop="4px",F.style.minWidth="46px",F.className="geBtn",n.appendChild(F));u=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});n.appendChild(u);F=mxUtils.button(mxResources.get("copy"),function(){D.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?D.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});5E5>e.length?mxClient.IS_SF||null!=document.documentMode?u.className="geBtn gePrimaryBtn":(n.appendChild(F),F.className="geBtn gePrimaryBtn",u.className="geBtn"):null!=L&&(n.appendChild(L),u.className="geBtn",L.className="geBtn gePrimaryBtn");c.appendChild(n);this.container=c};EmbedDialog.showPreviewOption=!0;-var GoogleSitesDialog=function(b,e){function f(){var V=null!=J&&null!=J.getTitle()?J.getTitle():this.defaultFilename;if(I.checked&&""!=F.value){var Q="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(F.value));null!=V&&(Q+="&title="+encodeURIComponent(V));0<K.length&&(Q+="&s="+K);""!=d.value&&"0"!=d.value&&(Q+="&border="+d.value);""!=L.value&&(Q+="&height="+L.value);Q+="&pan="+(g.checked?"1":"0");Q+="&zoom="+(m.checked?"1":"0");Q+="&fit="+(B.checked?"1":"0");-Q+="&resize="+(y.checked?"1":"0");Q+="&x0="+Number(D.value);Q+="&y0="+E;k.mathEnabled&&(Q+="&math=1");v.checked?Q+="&edit=_blank":t.checked&&(Q+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));H.value=Q}else J.constructor==DriveFile||J.constructor==DropboxFile?(Q="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=F.value?Q+=encodeURIComponent(mxUtils.htmlEntities(F.value))+"&type=3":(Q+=J.getHash().substring(1),Q=J.constructor==DropboxFile?Q+"&type=2":Q+"&type=1"),null!=+var GoogleSitesDialog=function(b,e){function f(){var V=null!=K&&null!=K.getTitle()?K.getTitle():this.defaultFilename;if(I.checked&&""!=F.value){var Q="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(F.value));null!=V&&(Q+="&title="+encodeURIComponent(V));0<J.length&&(Q+="&s="+J);""!=d.value&&"0"!=d.value&&(Q+="&border="+d.value);""!=L.value&&(Q+="&height="+L.value);Q+="&pan="+(g.checked?"1":"0");Q+="&zoom="+(m.checked?"1":"0");Q+="&fit="+(B.checked?"1":"0");+Q+="&resize="+(y.checked?"1":"0");Q+="&x0="+Number(D.value);Q+="&y0="+E;k.mathEnabled&&(Q+="&math=1");v.checked?Q+="&edit=_blank":t.checked&&(Q+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));H.value=Q}else K.constructor==DriveFile||K.constructor==DropboxFile?(Q="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=F.value?Q+=encodeURIComponent(mxUtils.htmlEntities(F.value))+"&type=3":(Q+=K.getHash().substring(1),Q=K.constructor==DropboxFile?Q+"&type=2":Q+"&type=1"),null!=V&&(Q+="&title="+encodeURIComponent(V)),""!=L.value&&(V=parseInt(L.value)+parseInt(D.value),Q+="&height="+V),H.value=Q):H.value=""}var c=document.createElement("div"),k=b.editor.graph,n=k.getGraphBounds(),q=k.view.scale,u=Math.floor(n.x/q-k.view.translate.x),E=Math.floor(n.y/q-k.view.translate.y);mxUtils.write(c,mxResources.get("googleGadget")+":");mxUtils.br(c);var H=document.createElement("input");H.setAttribute("type","text");H.style.marginBottom="8px";H.style.marginTop="2px";H.style.width="410px";c.appendChild(H);mxUtils.br(c);this.init=function(){H.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?H.select():document.execCommand("selectAll",!1,null)};mxUtils.write(c,mxResources.get("top")+":");var D=document.createElement("input");D.setAttribute("type","text");D.setAttribute("size","4");D.style.marginRight="16px";D.style.marginLeft="4px";D.value=u;c.appendChild(D);mxUtils.write(c,mxResources.get("height")+":");var L=document.createElement("input");L.setAttribute("type","text");L.setAttribute("size","4");L.style.marginLeft="4px";L.value=Math.ceil(n.height/q);c.appendChild(L);mxUtils.br(c);n=document.createElement("hr");n.setAttribute("size","1");n.style.marginBottom="16px";n.style.marginTop="16px";c.appendChild(n);mxUtils.write(c,mxResources.get("publicDiagramUrl")+":");mxUtils.br(c);var F=document.createElement("input");F.setAttribute("type","text");F.setAttribute("size","28");F.style.marginBottom="8px";F.style.marginTop="2px";F.style.width="410px";F.value=e||"";c.appendChild(F);mxUtils.br(c);mxUtils.write(c,mxResources.get("borderWidth")+":");var d=document.createElement("input");d.setAttribute("type","text");d.setAttribute("size","3");d.style.marginBottom="8px";d.style.marginLeft="4px";d.value="0";c.appendChild(d);mxUtils.br(c);var g=document.createElement("input");g.setAttribute("type","checkbox");g.setAttribute("checked","checked");g.defaultChecked=!0;g.style.marginLeft="16px";c.appendChild(g);mxUtils.write(c,mxResources.get("pan")+" ");var m=document.createElement("input");m.setAttribute("type","checkbox");m.setAttribute("checked","checked");m.defaultChecked=!0;m.style.marginLeft="8px";c.appendChild(m);mxUtils.write(c,mxResources.get("zoom")+" ");var t=document.createElement("input");t.setAttribute("type","checkbox");t.style.marginLeft="8px";t.setAttribute("title",window.location.href);c.appendChild(t);mxUtils.write(c,mxResources.get("edit")+" ");var v=document.createElement("input");v.setAttribute("type","checkbox");v.style.marginLeft="8px";c.appendChild(v);mxUtils.write(c,mxResources.get("asNew")+" ");mxUtils.br(c);var y=document.createElement("input");y.setAttribute("type","checkbox");y.setAttribute("checked","checked");y.defaultChecked=!0;y.style.marginLeft="16px";c.appendChild(y);mxUtils.write(c,mxResources.get("resize")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft="8px";c.appendChild(B);mxUtils.write(c,mxResources.get("fit")+" ");var I=document.createElement("input");I.setAttribute("type","checkbox");I.style.marginLeft=-"8px";c.appendChild(I);mxUtils.write(c,mxResources.get("embed")+" ");var K=b.getBasenames().join(";"),J=b.getCurrentFile();mxEvent.addListener(g,"change",f);mxEvent.addListener(m,"change",f);mxEvent.addListener(y,"change",f);mxEvent.addListener(B,"change",f);mxEvent.addListener(t,"change",f);mxEvent.addListener(v,"change",f);mxEvent.addListener(I,"change",f);mxEvent.addListener(L,"change",f);mxEvent.addListener(D,"change",f);mxEvent.addListener(d,"change",f);mxEvent.addListener(F,"change",f);f();+"8px";c.appendChild(I);mxUtils.write(c,mxResources.get("embed")+" ");var J=b.getBasenames().join(";"),K=b.getCurrentFile();mxEvent.addListener(g,"change",f);mxEvent.addListener(m,"change",f);mxEvent.addListener(y,"change",f);mxEvent.addListener(B,"change",f);mxEvent.addListener(t,"change",f);mxEvent.addListener(v,"change",f);mxEvent.addListener(I,"change",f);mxEvent.addListener(L,"change",f);mxEvent.addListener(D,"change",f);mxEvent.addListener(d,"change",f);mxEvent.addListener(F,"change",f);f();mxEvent.addListener(H,"click",function(){H.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?H.select():document.execCommand("selectAll",!1,null)});e=document.createElement("div");e.style.paddingTop="12px";e.style.textAlign="right";n=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});n.className="geBtn gePrimaryBtn";e.appendChild(n);c.appendChild(e);this.container=c},CreateGraphDialog=function(b,e,f){var c=document.createElement("div");c.style.textAlign="right";this.init=function(){var k=document.createElement("div");k.style.position="relative";k.style.border="1px solid gray";k.style.boxSizing="border-box";k.style.width="100%";k.style.height="360px";k.style.overflow="hidden";k.style.marginBottom="16px";mxEvent.disableContextMenu(k);c.appendChild(k);var n=new Graph(k);n.setCellsCloneable(!0);n.setPanning(!0);n.setAllowDanglingEdges(!1);n.connectionHandler.select=!1;n.view.setTranslate(20,20);n.border=20;n.panningHandler.useLeftButtonForPanning=!0;mxClient.IS_SVG&&null!=n.view.getDrawPane()&&(k=n.view.getDrawPane().ownerSVGElement,null!=k&&(k.style.position="absolute"));var q="curved=1;";n.cellRenderer.installCellOverlayListeners=function(g,m,t){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(t.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(v){m.fireEvent(new mxEventObject("pointerdown","event",v,"state",g))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(t.node,"touchstart",function(v){m.fireEvent(new mxEventObject("pointerdown",@@ -12280,37 +12280,37 @@ function(g){n.clearCellOverlays();var m=n.getModel().getChildren(n.getDefaultParc.appendChild(k);this.graph=n};this.container=c};CreateGraphDialog.prototype.connectImage=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==":IMAGE_PATH+"/handle-connect.png",26,26);-var BackgroundImageDialog=function(b,e,f,c,k){function n(){null==p||p==mxConstants.NONE?(O.style.display="none",V.checked=!1):(O.style.backgroundColor=p,O.style.display="",V.checked=!0)}var q=b.editor.graph,u=document.createElement("div");u.style.whiteSpace="nowrap";var E=document.createElement("h2");mxUtils.write(E,mxResources.get("background"));E.style.marginTop="0px";u.appendChild(E);var H=null!=f&&null!=f.originalSrc;E=!1;var D=document.createElement("input");D.style.cssText="margin-right:8px;margin-bottom:8px;";+var BackgroundImageDialog=function(b,e,f,c,k){function n(){null==p||p==mxConstants.NONE?(P.style.display="none",V.checked=!1):(P.style.backgroundColor=p,P.style.display="",V.checked=!0)}var q=b.editor.graph,u=document.createElement("div");u.style.whiteSpace="nowrap";var E=document.createElement("h2");mxUtils.write(E,mxResources.get("background"));E.style.marginTop="0px";u.appendChild(E);var H=null!=f&&null!=f.originalSrc;E=!1;var D=document.createElement("input");D.style.cssText="margin-right:8px;margin-bottom:8px;";D.setAttribute("value","url");D.setAttribute("type","radio");D.setAttribute("name","geBackgroundImageDialogOption");var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-bottom:8px;";L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name","geBackgroundImageDialogOption");var F=document.createElement("input");F.setAttribute("type","text");F.style.marginBottom="8px";F.style.width="360px";F.value=H||null==f?"":f.src;var d=document.createElement("select");d.style.width="360px";if(null!=b.pages)for(var g=0;g<b.pages.length;g++){var m=document.createElement("option");mxUtils.write(m,b.pages[g].getName()||mxResources.get("pageWithNumber",[g+1]));m.setAttribute("value","data:page/id,"+b.pages[g].getId());b.pages[g]==b.currentPage&&m.setAttribute("disabled","disabled");null!=f&&f.originalSrc==m.getAttribute("value")&&(m.setAttribute("selected","selected"),E=!0);d.appendChild(m)}H||null!=b.pages&&1!=b.pages.length||(D.style.display="none",L.style.display=-"none",d.style.display="none");var t=document.createElement("option"),v=!1,y=!1,B=function(A,C){v||null!=A&&y||(L.checked?null!=C&&C(t.selected?null:d.value):""==F.value||b.isOffline()?(K.value="",J.value="",null!=C&&C("")):(F.value=mxUtils.trim(F.value),b.loadImage(F.value,function(M){K.value=M.width;J.value=M.height;null!=C&&C(F.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));K.value="";J.value="";null!=C&&C(null)})))},I=mxUtils.bind(this,+"none",d.style.display="none");var t=document.createElement("option"),v=!1,y=!1,B=function(A,C){v||null!=A&&y||(L.checked?null!=C&&C(t.selected?null:d.value):""==F.value||b.isOffline()?(J.value="",K.value="",null!=C&&C("")):(F.value=mxUtils.trim(F.value),b.loadImage(F.value,function(M){J.value=M.width;K.value=M.height;null!=C&&C(F.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));J.value="";K.value="";null!=C&&C(null)})))},I=mxUtils.bind(this,function(A){b.importFiles(A,0,0,b.maxBackgroundSize,function(C,M,S,l,x,G){F.value=C;B();F.focus()},function(){},function(C){return"image/"==C.type.substring(0,6)},function(C){for(var M=0;M<C.length;M++)C[M]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){H?d.focus():F.focus();mxEvent.addListener(d,"focus",function(){D.removeAttribute("checked");L.setAttribute("checked","checked");L.checked=!0});mxEvent.addListener(F,"focus",function(){L.removeAttribute("checked");D.setAttribute("checked","checked");D.checked=!0});if(Graph.fileSupport){F.setAttribute("placeholder",mxResources.get("dragImagesHere"));var A=u.parentNode,C=null;mxEvent.addListener(A,"dragleave",function(M){null!=C&&(C.parentNode.removeChild(C),C=null);M.stopPropagation();M.preventDefault()});mxEvent.addListener(A,"dragover",mxUtils.bind(this,function(M){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=b.highlightElement(A));M.stopPropagation();M.preventDefault()}));mxEvent.addListener(A,"drop",mxUtils.bind(this,function(M){null!=C&&(C.parentNode.removeChild(C),C=null);if(0<M.dataTransfer.files.length)I(M.dataTransfer.files);else if(0<=mxUtils.indexOf(M.dataTransfer.types,"text/uri-list")){var S=M.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(S)&&(F.value=decodeURIComponent(S),B())}M.stopPropagation();M.preventDefault()}),!1)}};u.appendChild(D);u.appendChild(F);mxUtils.br(u);g=document.createElement("span");g.style.marginLeft="30px";mxUtils.write(g,mxResources.get("width")+-":");u.appendChild(g);var K=document.createElement("input");K.setAttribute("type","text");K.style.width="60px";K.style.marginLeft="8px";K.style.marginRight="16px";K.value=null==f||H?"":f.width;u.appendChild(K);mxUtils.write(u,mxResources.get("height")+":");var J=document.createElement("input");J.setAttribute("type","text");J.style.width="60px";J.style.marginLeft="8px";J.style.marginRight="16px";J.value=null==f||H?"":f.height;u.appendChild(J);mxUtils.br(u);mxUtils.br(u);mxEvent.addListener(F,"change",+":");u.appendChild(g);var J=document.createElement("input");J.setAttribute("type","text");J.style.width="60px";J.style.marginLeft="8px";J.style.marginRight="16px";J.value=null==f||H?"":f.width;u.appendChild(J);mxUtils.write(u,mxResources.get("height")+":");var K=document.createElement("input");K.setAttribute("type","text");K.style.width="60px";K.style.marginLeft="8px";K.style.marginRight="16px";K.value=null==f||H?"":f.height;u.appendChild(K);mxUtils.br(u);mxUtils.br(u);mxEvent.addListener(F,"change",B);ImageDialog.filePicked=function(A){A.action==google.picker.Action.PICKED&&null!=A.docs[0].thumbnails&&(A=A.docs[0].thumbnails[A.docs[0].thumbnails.length-1],null!=A&&(F.value=A.url,B()));F.focus()};u.appendChild(L);u.appendChild(d);mxUtils.br(u);mxUtils.br(u);H?(L.setAttribute("checked","checked"),L.checked=!0):(D.setAttribute("checked","checked"),D.checked=!0);!E&&L.checked&&(mxUtils.write(t,mxResources.get("pageNotFound")),t.setAttribute("disabled","disabled"),t.setAttribute("selected","selected"),t.setAttribute("value","pageNotFound"),d.appendChild(t),mxEvent.addListener(d,"change",function(){null==t.parentNode||t.selected||t.parentNode.removeChild(t)}));f=document.createElement("div");f.style.display=k?"inline-flex":"none";f.style.alignItems="center";f.style.cursor="default";f.style.minWidth="40%";f.style.height="20px";var V=document.createElement("input");V.setAttribute("type","checkbox");V.style.margin="0px 10px 0px 4px";V.style.verticalAlign="bottom";V.defaultChecked=c!=mxConstants.NONE&&null!=c;V.checked=V.defaultChecked;f.appendChild(V);mxUtils.write(f,mxResources.get("fillColor"));k=f.cloneNode(!1);var Q=document.createElement("input");Q.setAttribute("type","checkbox");Q.style.margin="0px 10px 0px 30px";Q.style.verticalAlign="bottom";Q.defaultChecked=q.shadowVisible;Q.checked=Q.defaultChecked;k.appendChild(Q);mxUtils.write(k,mxResources.get("shadow"));mxClient.IS_SVG&&!mxClient.IS_SF||Q.setAttribute("disabled","disabled");mxEvent.addListener(k,"click",function(A){mxEvent.getSource(A)!=-Q&&(Q.checked=!Q.checked)});var O=document.createElement("button");O.style.width="36px";O.style.height="18px";O.style.cursor="pointer";O.style.marginLeft="10px";O.style.backgroundPosition="center center";O.style.backgroundRepeat="no-repeat";O.style.verticalAlign="bottom";O.className="geColorBtn";var p=c;n();mxEvent.addListener(f,"click",function(A){mxEvent.getSource(A)!=V&&(V.checked=!V.checked);p=V.checked?"#ffffff":null;n()});mxEvent.addListener(O,"click",function(A){b.pickColor(p||"none",function(C){p=-C;n()});mxEvent.consume(A)});f.appendChild(O);u.appendChild(f);u.appendChild(k);mxUtils.br(u);c=document.createElement("div");c.style.marginTop="30px";c.style.textAlign="right";q=mxUtils.button(mxResources.get("cancel"),function(){v=!0;b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&c.appendChild(q);k=mxUtils.button(mxResources.get("reset"),function(){F.value="";K.value="";J.value="";D.checked=!0;p=mxConstants.NONE;n();v=!1});mxEvent.addGestureListeners(k,function(){v=!0});k.className=+Q&&(Q.checked=!Q.checked)});var P=document.createElement("button");P.style.width="36px";P.style.height="18px";P.style.cursor="pointer";P.style.marginLeft="10px";P.style.backgroundPosition="center center";P.style.backgroundRepeat="no-repeat";P.style.verticalAlign="bottom";P.className="geColorBtn";var p=c;n();mxEvent.addListener(f,"click",function(A){mxEvent.getSource(A)!=V&&(V.checked=!V.checked);p=V.checked?"#ffffff":null;n()});mxEvent.addListener(P,"click",function(A){b.pickColor(p||"none",function(C){p=+C;n()});mxEvent.consume(A)});f.appendChild(P);u.appendChild(f);u.appendChild(k);mxUtils.br(u);c=document.createElement("div");c.style.marginTop="30px";c.style.textAlign="right";q=mxUtils.button(mxResources.get("cancel"),function(){v=!0;b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&c.appendChild(q);k=mxUtils.button(mxResources.get("reset"),function(){F.value="";J.value="";K.value="";D.checked=!0;p=mxConstants.NONE;n();v=!1});mxEvent.addGestureListeners(k,function(){v=!0});k.className="geBtn";k.width="100";c.appendChild(k);if(Graph.fileSupport){var z=document.createElement("input");z.setAttribute("multiple","multiple");z.setAttribute("type","file");mxEvent.addListener(z,"change",function(A){null!=z.files&&(I(z.files),z.type="",z.type="file",z.value="")});z.style.display="none";u.appendChild(z);k=mxUtils.button(mxResources.get("open"),function(){z.click()});k.className="geBtn";c.appendChild(k)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();B(null,function(A){e(""!=-A&&null!=A?new mxImage(A,K.value,J.value):null,null==A,p,!mxClient.IS_SVG||mxClient.IS_SF?null:Q.checked)})});mxEvent.addGestureListeners(applyBtn,function(){y=!0});applyBtn.className="geBtn gePrimaryBtn";c.appendChild(applyBtn);b.editor.cancelFirst||c.appendChild(q);u.appendChild(c);this.container=u},ParseDialog=function(b,e,f){function c(d,g,m){var t=d.split("\n");if("plantUmlPng"==g||"plantUmlSvg"==g||"plantUmlTxt"==g){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var v=function(S,-l,x,G,N){n=mxEvent.isAltDown(m)?n:y.getCenterInsertPoint(new mxRectangle(0,0,G,N));var P=null;y.getModel().beginUpdate();try{P="txt"==l?b.insertAsPreText(x,n.x,n.y):y.insertVertex(null,null,null,n.x,n.y,G,N,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(x)+";"),y.setAttributeForCell(P,"plantUmlData",JSON.stringify({data:S,format:l},null,2))}finally{y.getModel().endUpdate()}null!=P&&(y.setSelectionCell(P),y.scrollCellToVisible(P))},y=b.editor.graph,B="plantUmlTxt"==+A&&null!=A?new mxImage(A,J.value,K.value):null,null==A,p,!mxClient.IS_SVG||mxClient.IS_SF?null:Q.checked)})});mxEvent.addGestureListeners(applyBtn,function(){y=!0});applyBtn.className="geBtn gePrimaryBtn";c.appendChild(applyBtn);b.editor.cancelFirst||c.appendChild(q);u.appendChild(c);this.container=u},ParseDialog=function(b,e,f){function c(d,g,m){var t=d.split("\n");if("plantUmlPng"==g||"plantUmlSvg"==g||"plantUmlTxt"==g){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var v=function(S,+l,x,G,N){n=mxEvent.isAltDown(m)?n:y.getCenterInsertPoint(new mxRectangle(0,0,G,N));var O=null;y.getModel().beginUpdate();try{O="txt"==l?b.insertAsPreText(x,n.x,n.y):y.insertVertex(null,null,null,n.x,n.y,G,N,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(x)+";"),y.setAttributeForCell(O,"plantUmlData",JSON.stringify({data:S,format:l},null,2))}finally{y.getModel().endUpdate()}null!=O&&(y.setSelectionCell(O),y.scrollCellToVisible(O))},y=b.editor.graph,B="plantUmlTxt"==g?"txt":"plantUmlPng"==g?"png":"svg";"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml"==d&&"svg"==B?window.setTimeout(function(){b.spinner.stop();v(d,B,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U2NyaXB0VHlwZT0iYXBwbGljYXRpb24vZWNtYXNjcmlwdCIgY29udGVudFN0eWxlVHlwZT0idGV4dC9jc3MiIGhlaWdodD0iMjEycHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDoyOTVweDtoZWlnaHQ6MjEycHg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyOTUgMjEyIiB3aWR0aD0iMjk1cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogNS4wLDUuMDsiIHgxPSIzMSIgeDI9IjMxIiB5MT0iMzQuNDg4MyIgeTI9IjE3MS43MzA1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDUuMCw1LjA7IiB4MT0iMjY0LjUiIHgyPSIyNjQuNSIgeTE9IjM0LjQ4ODMiIHkyPSIxNzEuNzMwNSIvPjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIzMyIgeD0iMTUiIHk9IjIzLjUzNTIiPkFsaWNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjE3MC43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMzMiIHg9IjE1IiB5PSIxOTEuMjY1NiI+QWxpY2U8L3RleHQ+PHJlY3QgZmlsbD0iI0ZFRkVDRSIgaGVpZ2h0PSIzMC40ODgzIiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuNTsiIHdpZHRoPSI0MCIgeD0iMjQ0LjUiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjIzLjUzNTIiPkJvYjwvdGV4dD48cmVjdCBmaWxsPSIjRkVGRUNFIiBoZWlnaHQ9IjMwLjQ4ODMiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS41OyIgd2lkdGg9IjQwIiB4PSIyNDQuNSIgeT0iMTcwLjczMDUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjE5MS4yNjU2Ij5Cb2I8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSIyNTIuNSw2MS43OTg4LDI2Mi41LDY1Ljc5ODgsMjUyLjUsNjkuNzk4OCwyNTYuNSw2NS43OTg4IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiIHgxPSIzMS41IiB4Mj0iMjU4LjUiIHkxPSI2NS43OTg4IiB5Mj0iNjUuNzk4OCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmdBbmRHbHlwaHMiIHRleHRMZW5ndGg9IjE0NyIgeD0iMzguNSIgeT0iNjEuMDU2NiI+QXV0aGVudGljYXRpb24gUmVxdWVzdDwvdGV4dD48cG9seWdvbiBmaWxsPSIjQTgwMDM2IiBwb2ludHM9IjQyLjUsOTEuMTA5NCwzMi41LDk1LjEwOTQsNDIuNSw5OS4xMDk0LDM4LjUsOTUuMTA5NCIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDIuMCwyLjA7IiB4MT0iMzYuNSIgeDI9IjI2My41IiB5MT0iOTUuMTA5NCIgeTI9Ijk1LjEwOTQiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxNTciIHg9IjQ4LjUiIHk9IjkwLjM2NzIiPkF1dGhlbnRpY2F0aW9uIFJlc3BvbnNlPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiNBODAwMzYiIHBvaW50cz0iMjUyLjUsMTIwLjQxOTksMjYyLjUsMTI0LjQxOTksMjUyLjUsMTI4LjQxOTksMjU2LjUsMTI0LjQxOTkiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIgeDE9IjMxLjUiIHgyPSIyNTguNSIgeTE9IjEyNC40MTk5IiB5Mj0iMTI0LjQxOTkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxOTkiIHg9IjM4LjUiIHk9IjExOS42Nzc3Ij5Bbm90aGVyIGF1dGhlbnRpY2F0aW9uIFJlcXVlc3Q8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSI0Mi41LDE0OS43MzA1LDMyLjUsMTUzLjczMDUsNDIuNSwxNTcuNzMwNSwzOC41LDE1My43MzA1IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogMi4wLDIuMDsiIHgxPSIzNi41IiB4Mj0iMjYzLjUiIHkxPSIxNTMuNzMwNSIgeTI9IjE1My43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMjA5IiB4PSI0OC41IiB5PSIxNDguOTg4MyI+QW5vdGhlciBhdXRoZW50aWNhdGlvbiBSZXNwb25zZTwvdGV4dD48IS0tTUQ1PVs3ZjNlNGQwYzkwMWVmZGJjNTdlYjQ0MjQ5YTNiODE5N10KQHN0YXJ0dW1sDQpza2lucGFyYW0gc2hhZG93aW5nIGZhbHNlDQpBbGljZSAtPiBCb2I6IEF1dGhlbnRpY2F0aW9uIFJlcXVlc3QNCkJvYiAtIC0+IEFsaWNlOiBBdXRoZW50aWNhdGlvbiBSZXNwb25zZQ0KDQpBbGljZSAtPiBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVxdWVzdA0KQWxpY2UgPC0gLSBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVzcG9uc2UNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMC4wMihTdW4gTWFyIDAxIDA0OjIyOjA3IENTVCAyMDIwKQooTUlUIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkphdmEgVmVyc2lvbjogMTIrMzMKT3BlcmF0aW5nIFN5c3RlbTogTWFjIE9TIFgKRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=",-295,212)},200):b.generatePlantUmlImage(d,B,function(S,l,x){b.spinner.stop();v(d,B,S,l,x)},function(S){b.handleError(S)})}}else if("mermaid"==g||"mermaid2drawio"==g){if(b.spinner.spin(document.body,mxResources.get("inserting"))){for(var I=0;I<t.length&&(0==t[I].trim().length||"%%"==t[I].substring(0,2));)I++;if("---"==t[I].trim()){do I++;while(I<t.length&&"---"!=t[I].trim());I++}I=t[I].trim().toLowerCase();t=I.indexOf(" ");I=I.substring(0,0<t?t:I.length);var K="undefined"!==typeof mxMermaidToDrawio&&-"mermaid2drawio"==g&&("graph"==I||"flowchart"==I||"sequencediagram"==I||"classdiagram"==I||"statediagram-v2"==I||"statediagram"==I||"erdiagram"==I||"requirementdiagram"==I||"gitgraph"==I||"mindmap"==I);y=b.editor.graph;K&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(S){b.spinner.stop();y.setSelectionCells(b.importXml(S,Math.max(n.x,20),Math.max(n.y,20),!0,null,null,!0));y.scrollCellToVisible(y.getSelectionCell())}));b.generateMermaidImage(d,null,function(S,l,x){if(!K){n=mxEvent.isAltDown(m)?+295,212)},200):b.generatePlantUmlImage(d,B,function(S,l,x){b.spinner.stop();v(d,B,S,l,x)},function(S){b.handleError(S)})}}else if("mermaid"==g||"mermaid2drawio"==g){if(b.spinner.spin(document.body,mxResources.get("inserting"))){for(var I=0;I<t.length&&(0==t[I].trim().length||"%%"==t[I].substring(0,2));)I++;if("---"==t[I].trim()){do I++;while(I<t.length&&"---"!=t[I].trim());I++}I=t[I].trim().toLowerCase();t=I.indexOf(" ");I=I.substring(0,0<t?t:I.length);var J="undefined"!==typeof mxMermaidToDrawio&&+"mermaid2drawio"==g&&("graph"==I||"flowchart"==I||"sequencediagram"==I||"classdiagram"==I||"statediagram-v2"==I||"statediagram"==I||"erdiagram"==I||"requirementdiagram"==I||"gitgraph"==I||"mindmap"==I);y=b.editor.graph;J&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(S){b.spinner.stop();y.setSelectionCells(b.importXml(S,Math.max(n.x,20),Math.max(n.y,20),!0,null,null,!0));y.scrollCellToVisible(y.getSelectionCell())}));b.generateMermaidImage(d,null,function(S,l,x){if(!J){n=mxEvent.isAltDown(m)?n:y.getCenterInsertPoint(new mxRectangle(0,0,l,x));b.spinner.stop();var G=null;y.getModel().beginUpdate();try{G=y.insertVertex(null,null,null,n.x,n.y,l,x,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+S+";"),y.setAttributeForCell(G,"mermaidData",JSON.stringify({data:d},null,2))}finally{y.getModel().endUpdate()}null!=G&&(y.setSelectionCell(G),y.scrollCellToVisible(G))}},function(S){"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();b.handleError(S)})}}else if("table"==-g){g=null;var J=[],V=0,Q={};for(I=0;I<t.length;I++){var O=mxUtils.trim(t[I]);if("primary key"==O.substring(0,11).toLowerCase()){var p=O.match(/\((.+)\)/);p&&p[1]&&(Q[p[1]]=!0);t.splice(I,1)}else 0<O.toLowerCase().indexOf("primary key")&&(Q[O.split(" ")[0]]=!0,t[I]=mxUtils.trim(O.replace(/primary key/i,"")))}for(I=0;I<t.length;I++)if(O=mxUtils.trim(t[I]),"create table"==O.substring(0,12).toLowerCase())O=mxUtils.trim(O.substring(12)),"("==O.charAt(O.length-1)&&(O=mxUtils.trim(O.substring(0,O.length--1))),g=new mxCell(O,new mxGeometry(V,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),g.vertex=!0,J.push(g),O=b.editor.graph.getPreferredSizeForCell(z),null!=O&&(g.geometry.width=O.width+10);else if(null!=g&&")"==O.charAt(0))V+=g.geometry.width+40,g=null;else if("("!=O&&null!=g){O=O.substring(0,","==O.charAt(O.length-1)?O.length-1:O.length);p=Q[O.split(" ")[0]];var z=new mxCell("",new mxGeometry(0,-0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="+(p?"1":"0")+";");z.vertex=!0;var A=new mxCell(p?"PK":"",new mxGeometry(0,0,30,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;strokeColor=inherit;top=0;left=0;bottom=0;right=0;"+(p?"fontStyle=1;":""));A.vertex=!0;z.insert(A);O=new mxCell(O,new mxGeometry(30,-0,130,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;align=left;strokeColor=inherit;top=0;left=0;bottom=0;right=0;spacingLeft=6;"+(p?"fontStyle=5;":""));O.vertex=!0;z.insert(O);O=b.editor.graph.getPreferredSizeForCell(O);null!=O&&g.geometry.width<O.width+30&&(g.geometry.width=Math.min(320,Math.max(g.geometry.width,O.width+30)));g.insert(z,p?0:null);g.geometry.height+=30}0<J.length&&(y=b.editor.graph,n=mxEvent.isAltDown(m)?n:y.getCenterInsertPoint(y.getBoundingBoxFromGeometry(J,-!0)),y.setSelectionCells(y.importCells(J,n.x,n.y)),y.scrollCellToVisible(y.getSelectionCell()))}else if("list"==g){if(0<t.length){y=b.editor.graph;g=null;J=[];for(I=z=0;I<t.length;I++)";"!=t[I].charAt(0)&&(0==t[I].length?g=null:null==g?(g=new mxCell(t[I],new mxGeometry(z,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),g.vertex=!0,J.push(g),O=y.getPreferredSizeForCell(g),-null!=O&&g.geometry.width<O.width+10&&(g.geometry.width=O.width+10),z+=g.geometry.width+40):"--"==t[I]?(O=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),O.vertex=!0,g.geometry.height+=O.geometry.height,g.insert(O)):0<t[I].length&&(V=new mxCell(t[I],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),-V.vertex=!0,O=y.getPreferredSizeForCell(V),null!=O&&V.geometry.width<O.width&&(V.geometry.width=O.width),g.geometry.width=Math.max(g.geometry.width,V.geometry.width),g.geometry.height+=V.geometry.height,g.insert(V)));if(0<J.length){n=mxEvent.isAltDown(m)?n:y.getCenterInsertPoint(y.getBoundingBoxFromGeometry(J,!0));y.getModel().beginUpdate();try{J=y.importCells(J,n.x,n.y);O=[];for(I=0;I<J.length;I++)O.push(J[I]),O=O.concat(J[I].children);y.fireEvent(new mxEventObject("cellsInserted","cells",O))}finally{y.getModel().endUpdate()}y.setSelectionCells(J);-y.scrollCellToVisible(y.getSelectionCell())}}}else{z=function(S){var l=C[S];null==l&&(l=new mxCell(S,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),l.vertex=!0,C[S]=l,J.push(l));return l};var C={};J=[];for(I=0;I<t.length;I++)if(";"!=t[I].charAt(0)){var M=t[I].split("->");2<=M.length&&(p=z(M[0]),A=z(M[M.length-1]),M=new mxCell(2<M.length?M[1]:"",new mxGeometry),M.edge=!0,M.geometry.relative=!0,p.insertEdge(M,!0),A.insertEdge(M,!1),J.push(M))}if(0<J.length){t=document.createElement("div");t.style.visibility=-"hidden";document.body.appendChild(t);y=new Graph(t);y.getModel().beginUpdate();try{J=y.importCells(J);for(I=0;I<J.length;I++)y.getModel().isVertex(J[I])&&(O=y.getPreferredSizeForCell(J[I]),J[I].geometry.width=Math.max(J[I].geometry.width,O.width),J[I].geometry.height=Math.max(J[I].geometry.height,O.height));I=!0;"horizontalFlow"==g||"verticalFlow"==g?((new mxHierarchicalLayout(y,"horizontalFlow"==g?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(y.getDefaultParent(),J),I=!1):"circle"==-g?(new mxCircleLayout(y)).execute(y.getDefaultParent()):(V=new mxFastOrganicLayout(y),V.disableEdgeStyle=!1,V.forceConstant=180,V.execute(y.getDefaultParent()));I&&(Q=new mxParallelEdgeLayout(y),Q.spacing=30,Q.execute(y.getDefaultParent()))}finally{y.getModel().endUpdate()}y.clearCellOverlays();O=[];b.editor.graph.getModel().beginUpdate();try{J=y.getModel().getChildren(y.getDefaultParent()),n=mxEvent.isAltDown(m)?n:b.editor.graph.getCenterInsertPoint(y.getBoundingBoxFromGeometry(J,!0)),O=b.editor.graph.importCells(J,-n.x,n.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",O))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(O);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());y.destroy();t.parentNode.removeChild(t)}}}function k(){return"list"==u.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==u.value||+g){g=null;var K=[],V=0,Q={};for(I=0;I<t.length;I++){var P=mxUtils.trim(t[I]);if("primary key"==P.substring(0,11).toLowerCase()){var p=P.match(/\((.+)\)/);p&&p[1]&&(Q[p[1]]=!0);t.splice(I,1)}else 0<P.toLowerCase().indexOf("primary key")&&(Q[P.split(" ")[0]]=!0,t[I]=mxUtils.trim(P.replace(/primary key/i,"")))}for(I=0;I<t.length;I++)if(P=mxUtils.trim(t[I]),"create table"==P.substring(0,12).toLowerCase())P=mxUtils.trim(P.substring(12)),"("==P.charAt(P.length-1)&&(P=mxUtils.trim(P.substring(0,P.length-+1))),g=new mxCell(P,new mxGeometry(V,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),g.vertex=!0,K.push(g),P=b.editor.graph.getPreferredSizeForCell(z),null!=P&&(g.geometry.width=P.width+10);else if(null!=g&&")"==P.charAt(0))V+=g.geometry.width+40,g=null;else if("("!=P&&null!=g){P=P.substring(0,","==P.charAt(P.length-1)?P.length-1:P.length);p=Q[P.split(" ")[0]];var z=new mxCell("",new mxGeometry(0,+0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="+(p?"1":"0")+";");z.vertex=!0;var A=new mxCell(p?"PK":"",new mxGeometry(0,0,30,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;strokeColor=inherit;top=0;left=0;bottom=0;right=0;"+(p?"fontStyle=1;":""));A.vertex=!0;z.insert(A);P=new mxCell(P,new mxGeometry(30,+0,130,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;align=left;strokeColor=inherit;top=0;left=0;bottom=0;right=0;spacingLeft=6;"+(p?"fontStyle=5;":""));P.vertex=!0;z.insert(P);P=b.editor.graph.getPreferredSizeForCell(P);null!=P&&g.geometry.width<P.width+30&&(g.geometry.width=Math.min(320,Math.max(g.geometry.width,P.width+30)));g.insert(z,p?0:null);g.geometry.height+=30}0<K.length&&(y=b.editor.graph,n=mxEvent.isAltDown(m)?n:y.getCenterInsertPoint(y.getBoundingBoxFromGeometry(K,+!0)),y.setSelectionCells(y.importCells(K,n.x,n.y)),y.scrollCellToVisible(y.getSelectionCell()))}else if("list"==g){if(0<t.length){y=b.editor.graph;g=null;K=[];for(I=z=0;I<t.length;I++)";"!=t[I].charAt(0)&&(0==t[I].length?g=null:null==g?(g=new mxCell(t[I],new mxGeometry(z,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),g.vertex=!0,K.push(g),P=y.getPreferredSizeForCell(g),+null!=P&&g.geometry.width<P.width+10&&(g.geometry.width=P.width+10),z+=g.geometry.width+40):"--"==t[I]?(P=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),P.vertex=!0,g.geometry.height+=P.geometry.height,g.insert(P)):0<t[I].length&&(V=new mxCell(t[I],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),+V.vertex=!0,P=y.getPreferredSizeForCell(V),null!=P&&V.geometry.width<P.width&&(V.geometry.width=P.width),g.geometry.width=Math.max(g.geometry.width,V.geometry.width),g.geometry.height+=V.geometry.height,g.insert(V)));if(0<K.length){n=mxEvent.isAltDown(m)?n:y.getCenterInsertPoint(y.getBoundingBoxFromGeometry(K,!0));y.getModel().beginUpdate();try{K=y.importCells(K,n.x,n.y);P=[];for(I=0;I<K.length;I++)P.push(K[I]),P=P.concat(K[I].children);y.fireEvent(new mxEventObject("cellsInserted","cells",P))}finally{y.getModel().endUpdate()}y.setSelectionCells(K);+y.scrollCellToVisible(y.getSelectionCell())}}}else{z=function(S){var l=C[S];null==l&&(l=new mxCell(S,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),l.vertex=!0,C[S]=l,K.push(l));return l};var C={};K=[];for(I=0;I<t.length;I++)if(";"!=t[I].charAt(0)){var M=t[I].split("->");2<=M.length&&(p=z(M[0]),A=z(M[M.length-1]),M=new mxCell(2<M.length?M[1]:"",new mxGeometry),M.edge=!0,M.geometry.relative=!0,p.insertEdge(M,!0),A.insertEdge(M,!1),K.push(M))}if(0<K.length){t=document.createElement("div");t.style.visibility=+"hidden";document.body.appendChild(t);y=new Graph(t);y.getModel().beginUpdate();try{K=y.importCells(K);for(I=0;I<K.length;I++)y.getModel().isVertex(K[I])&&(P=y.getPreferredSizeForCell(K[I]),K[I].geometry.width=Math.max(K[I].geometry.width,P.width),K[I].geometry.height=Math.max(K[I].geometry.height,P.height));I=!0;"horizontalFlow"==g||"verticalFlow"==g?((new mxHierarchicalLayout(y,"horizontalFlow"==g?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(y.getDefaultParent(),K),I=!1):"circle"==+g?(new mxCircleLayout(y)).execute(y.getDefaultParent()):(V=new mxFastOrganicLayout(y),V.disableEdgeStyle=!1,V.forceConstant=180,V.execute(y.getDefaultParent()));I&&(Q=new mxParallelEdgeLayout(y),Q.spacing=30,Q.execute(y.getDefaultParent()))}finally{y.getModel().endUpdate()}y.clearCellOverlays();P=[];b.editor.graph.getModel().beginUpdate();try{K=y.getModel().getChildren(y.getDefaultParent()),n=mxEvent.isAltDown(m)?n:b.editor.graph.getCenterInsertPoint(y.getBoundingBoxFromGeometry(K,!0)),P=b.editor.graph.importCells(K,+n.x,n.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",P))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(P);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());y.destroy();t.parentNode.removeChild(t)}}}function k(){return"list"==u.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==u.value||"mermaid2drawio"==u.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==u.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==u.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":"plantUmlSvg"==u.value||"plantUmlTxt"==u.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var n=b.editor.graph.getFreeInsertPoint();e=document.createElement("div");e.style.textAlign="right";var q=document.createElement("textarea");q.style.boxSizing="border-box";q.style.resize="none";q.style.width="100%";q.style.height="354px";q.style.marginBottom="16px";var u=document.createElement("select");u.className="geBtn";if("formatSql"==f||"mermaid"==f&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())u.style.display="none";var E=document.createElement("option");E.setAttribute("value","list");mxUtils.write(E,mxResources.get("list"));"plantUml"!=f&&"mermaid"!=f&&u.appendChild(E);null!=f&&"fromText"!=f||E.setAttribute("selected","selected");E=document.createElement("option");@@ -12321,30 +12321,30 @@ E.setAttribute("value","table");mxUtils.write(E,mxResources.get("formatSql"));"fd.dataTransfer.files[0];var g=new FileReader;g.onload=function(m){q.value=m.target.result};g.readAsText(d)}},!1));e.appendChild(u);mxEvent.addListener(u,"change",function(){var d=k();if(0==q.value.length||q.value==F)F=d,q.value=F});b.isOffline()||"mermaid"!=f&&"plantUml"!=f||(E=mxUtils.button(mxResources.get("help"),function(){b.openLink("mermaid"==f?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),E.className="geBtn",e.appendChild(E));E=mxUtils.button(mxResources.get("close"),function(){q.value==F?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});E.className="geBtn";b.editor.cancelFirst&&e.appendChild(E);H=mxUtils.button(mxResources.get("insert"),function(d){try{b.hideDialog(),c(q.value,u.value,d)}catch(g){b.handleError(g)}});H.className="geBtn gePrimaryBtn";e.appendChild(H);b.editor.cancelFirst||e.appendChild(E);this.container=e},NewDialog=function(b,e,f,c,k,n,q,u,E,H,D,L,F,d,g,m,t,v){function y(la){null!=la&&(na=Aa=la?135:140);la=!0;if(null!=Wa)for(;l<Wa.length&&(la||0!=mxUtils.mod(l,30));){var ya=Wa[l++];ya=p(ya.url,ya.libs,ya.title,ya.tooltip?ya.tooltip:ya.title,ya.select,ya.imgUrl,ya.info,ya.onClick,ya.preview,ya.noImg,ya.clibs,ya.type);la&&ya.click();la=!1}}function B(la,ya,ta,qa,ma,za){if(null!=la&&mxUtils.isAncestorNode(document.body,qa)){la=mxUtils.parseXml(la);la=Editor.parseDiagramNode(la.documentElement,null,!0);var Ja=new mxCodec(la.ownerDocument),Ga=new mxGraphModel;Ja.decode(la,Ga);b.sidebar.createTooltip(qa,Ga.root.children,-Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=ma?mxResources.get(ma):null,!0,new mxPoint(ya,ta),!0,function(){T=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=za&&J(qa,null,null,za,infoObj,clibs)},!0,!1)}}function I(){var la=document.createElement("div");la.style.position="absolute";la.style.overflow="visible";+Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=ma?mxResources.get(ma):null,!0,new mxPoint(ya,ta),!0,function(){T=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=za&&K(qa,null,null,za,infoObj,clibs)},!0,!1)}}function I(){var la=document.createElement("div");la.style.position="absolute";la.style.overflow="visible";la.style.left="8px";la.style.right="8px";la.style.bottom="8px";la.style.top="8px";mxUtils.write(la,mxResources.get("describeYourDiagram")+":");mxUtils.br(la);var ya=document.createElement("input");ya.setAttribute("type","text");ya.setAttribute("placeholder",mxResources.get("processForHiringNewEmployee"));ya.style.width="100%";ya.style.marginTop="6px";ya.style.marginBottom="4px";ya.style.boxSizing="border-box";la.appendChild(ya);la.init=function(){ya.focus()};mxUtils.br(la);var ta=document.createElement("div");ta.style.top="86px";ta.style.left="2px";ta.style.right="2px";ta.style.bottom="2px";ta.style.position="absolute";ta.style.border="1px solid #424242";var qa=document.createElement("div");qa.style.boxSizing="border-box";qa.style.position="relative";qa.style.textAlign="center";qa.style.top="50%";mxUtils.write(qa,mxResources.get("blankDiagram"));ta.appendChild(qa);var ma=document.createElement("select");ma.className="geBtn";ma.style.maxWidth="160px";ma.style.marginLeft="0px";qa=document.createElement("option");mxUtils.write(qa,mxResources.get("diagramType"));qa.setAttribute("value","");ma.appendChild(qa);for(var za=0;za<EditorUi.mermaidDiagramTypes.length;za++){qa=document.createElement("option");var Ja=EditorUi.mermaidDiagramTypes[za],Ga=Ja;Ja==urlParams["smart-template-type"]&&qa.setAttribute("selected","selected");"erDiagram"==Ga&&(Ga="entityRelationshipDiagram");Ga=mxResources.get(Ga,null,Ga.charAt(0).toUpperCase()+Ga.substring(1).replace(/[A-Z]/g," $&"));qa.setAttribute("value",Ja);mxUtils.write(qa,Ga);ma.appendChild(qa)}var La=mxUtils.button(mxResources.get("generate"),function(){var Pa=ya.value,Ka=ma.value.replace(/([A-Z])/g," $1").toLowerCase();Pa="Write the declaration code for a detailed and complex "+(""!=Ka?Ka:"graph")+' that shows "'+(""!=Pa?Pa:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.';Ka=""!=ma.value?" ("+mxUtils.trim(mxUtils.getTextContent(ma.options[ma.selectedIndex]))+")":"";var Ra="gantt"==ma.value||"pie"==ma.value||-"timeline"==ma.value||"quadrantchart"==ma.value||"c4context"==ma.value,Na=ya.value+Ka;"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(Qa){Ra||(sa=ja=Qa,fa="Smart Template: "+Na)}));b.spinner.spin(document.body,mxResources.get("loading"))&&b.generateOpenAiMermaidDiagram(Pa,function(Qa,Ya,Ha,eb){b.spinner.stop();ta.innerHTML="";var Ua=document.createElement("img");Ua.setAttribute("title",Na);Ua.src="data:image/svg+xml;base64,"+Ya.substring(Ya.indexOf(",")++"timeline"==ma.value||"quadrantchart"==ma.value||"c4context"==ma.value,Na=ya.value+Ka;"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(Qa){Ra||(sa=ja=Qa,ha="Smart Template: "+Na)}));b.spinner.spin(document.body,mxResources.get("loading"))&&b.generateOpenAiMermaidDiagram(Pa,function(Qa,Ya,Ha,eb){b.spinner.stop();ta.innerHTML="";var Ua=document.createElement("img");Ua.setAttribute("title",Na);Ua.src="data:image/svg+xml;base64,"+Ya.substring(Ya.indexOf(",")+1);Ua.style.cursor="pointer";Ua.style.width="100%";Ua.style.height="100%";ta.appendChild(Ua);Qa=b.createMermaidXml(Qa,EditorUi.defaultMermaidConfig,Ya,Ha,eb,Na);var ib="<mxfile><diagram>"+Graph.compress(Qa)+"</diagram></mxfile>";if(Ra||"undefined"===typeof mxMermaidToDrawio)sa=ja=Qa;Qa=N.cloneNode(!0);ta.appendChild(Qa);Ya=function(fb){T=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display};Ha=function(fb){T||B(ib,mxEvent.getClientX(fb),mxEvent.getClientY(fb),Ua,Na)};mxEvent.addGestureListeners(Ua,Ya,null,Ha);mxEvent.addGestureListeners(Qa,Ya,null,Ha)},function(Qa){b.spinner.stop();null!=mxMermaidToDrawio.resetListeners&&mxMermaidToDrawio.resetListeners();b.handleError(Qa)})});La.setAttribute("disabled","disabled");La.className="geBtn gePrimaryBtn";qa=function(){window.setTimeout(function(){""!=ya.value?La.removeAttribute("disabled"):La.setAttribute("disabled","disabled")},0)};za=urlParams["smart-template"];null!=za&&"1"!=za&&(ya.value=decodeURIComponent(za),qa(),"1"==urlParams["smart-template-generate"]&&window.setTimeout(function(){La.click()},0));mxEvent.addListener(ya,"change",qa);mxEvent.addListener(ya,"keydown",qa);mxEvent.addListener(ya,"cut",qa);mxEvent.addListener(ya,"paste",qa);mxEvent.addListener(ya,"keydown",function(Pa){13==Pa.keyCode&&La.click()});qa=document.createElement("div");qa.style.height="40px";qa.style.marginTop="4px";qa.style.marginBottom="4px";qa.style.whiteSpace="nowrap";qa.style.overflowX="auto";qa.style.overflowY="hidden";qa.appendChild(ma);qa.appendChild(La);la.appendChild(qa);-la.appendChild(ta);return la}function K(){null!=ja&&ja==sa&&EditorUi.logEvent({category:"OPENAI-DIAGRAM",action:"templateGenerated",label:fa});if(ia&&null!=d)f||b.hideDialog(),d(ia,ua,S.value);else if(c)f||b.hideDialog(),c(ja,S.value,ka,ca);else{var la=S.value;if(null!=la&&0<la.length){var ya=function(qa,ma,za){b.createFile(za,ja,null!=ca&&0<ca.length?ca:null,qa,function(){b.hideDialog()},null,ma,null,null!=da&&0<da.length?da:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var ta=new SaveDialog(b,-la,mxUtils.bind(this,function(qa,ma,za){ya(ma,za,qa.value)}),null,null,null,null,b.mode);b.showDialog(ta.container,420,150,!0,!1);ta.init()}else b.pickFolder(b.mode,function(qa){ya(b.mode,qa,la)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function J(la,ya,ta,qa,ma,za,Ja){return aa!=la?(null!=aa&&(aa.style.backgroundColor="transparent",aa.style.border="2px solid transparent",0<aa.getElementsByTagName("table").length&&(aa.getElementsByTagName("table")[0].style.visibility=+la.appendChild(ta);return la}function J(){null!=ja&&ja==sa&&EditorUi.logEvent({category:"OPENAI-DIAGRAM",action:"templateGenerated",label:ha});if(ia&&null!=d)f||b.hideDialog(),d(ia,ua,S.value);else if(c)f||b.hideDialog(),c(ja,S.value,ka,ca);else{var la=S.value;if(null!=la&&0<la.length){var ya=function(qa,ma,za){b.createFile(za,ja,null!=ca&&0<ca.length?ca:null,qa,function(){b.hideDialog()},null,ma,null,null!=da&&0<da.length?da:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var ta=new SaveDialog(b,+la,mxUtils.bind(this,function(qa,ma,za){ya(ma,za,qa.value)}),null,null,null,null,b.mode);b.showDialog(ta.container,420,150,!0,!1);ta.init()}else b.pickFolder(b.mode,function(qa){ya(b.mode,qa,la)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function K(la,ya,ta,qa,ma,za,Ja){return aa!=la?(null!=aa&&(aa.style.backgroundColor="transparent",aa.style.border="2px solid transparent",0<aa.getElementsByTagName("table").length&&(aa.getElementsByTagName("table")[0].style.visibility="visible"),aa==oa&&(oa.style.backgroundImage=Ea,oa.style.backgroundPosition="center center",oa.style.backgroundRepeat="no-repeat",oa.style.backgroundSize="contain",va.style.visibility="hidden",Ca.style.visibility="hidden",Da.style.visibility="hidden",Ba.style.visibility="hidden",Fa.style.visibility=null!=sa?"visible":"hidden",oa.getElementsByTagName("table")[0].style.visibility="visible")),""!=la.style.backgroundImage&&0<la.getElementsByTagName("table").length&&(la.getElementsByTagName("table")[0].style.visibility="hidden"),la==oa&&(ya=sa,null!=ya?(Fa.style.visibility="visible",Fa.style.visibility=null!=sa?"visible":"hidden",Ba.style.visibility="visible"):(va.style.visibility="visible",Ca.style.visibility="visible",Da.style.visibility="visible",Ba.style.visibility="hidden",Fa.style.visibility="hidden")),G.removeAttribute("disabled"),ja=ya,ca=ta,da=za,aa=la,ia=qa,ka=Ja,ua=ma,aa.style.border=E,!0):!1}function V(){oa.style.backgroundImage="";oa.getElementsByTagName("table")[0].style.visibility="hidden";va.style.visibility=-"visible";Ca.style.visibility="visible";Da.style.visibility="visible";Ba.style.visibility="hidden";Fa.style.visibility="hidden";va.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?va.select():document.execCommand("selectAll",!1,null)}function Q(){va.style.visibility="hidden";Ca.style.visibility="hidden";Da.style.visibility="hidden";oa.style.backgroundImage=Ea;oa.style.backgroundSize="contain";Ba.style.visibility="visible";Fa.style.visibility="visible"}function O(la){var ya=mxUtils.trim(va.value);-if(la||""==ya)null!=fa&&(va.value=fa,Q());else{va.style.visibility="hidden";Ca.style.visibility="hidden";Da.style.visibility="hidden";var ta=!1;la='Write a detailed and complex MermaidJS declaration for "'+(""!=ya?ya:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.';"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(qa){qa!=b.emptyDiagramXml&&(ta=!0,ja=qa)}));oa.style.backgroundImage="url("+Editor.spinImage+-")";oa.style.backgroundSize="12px 12px";b.generateOpenAiMermaidDiagram(la,function(qa,ma,za,Ja){aa==oa&&"hidden"==va.style.visibility&&(Ea="url(data:image/svg+xml;base64,"+ma.substring(ma.indexOf(",")+1)+")",oa.setAttribute("title",ya),sa=ja=qa=ta?ja:b.createMermaidXml(qa,EditorUi.defaultMermaidConfig,ma,za,Ja,ya),fa=ya,Q())},function(qa){aa==oa&&(va.style.visibility="visible",Ca.style.visibility="visible",Da.style.visibility="visible",Ba.style.visibility="visible",Fa.style.visibility="visible",b.handleError(qa))})}}-function p(la,ya,ta,qa,ma,za,Ja,Ga,La,Pa,Ka,Ra){function Na(Oa,$a){null==eb?(Ua=Oa,Ua=/^https?:\/\//.test(Ua)?b.editor.isCorsEnabledForUrl(Ua)?Ua:PROXY_URL+"?url="+encodeURIComponent(Ua):TEMPLATE_PATH+"/"+Ua,mxUtils.get(Ua,mxUtils.bind(this,function(ab){200<=ab.getStatus()&&299>=ab.getStatus()&&(eb=ab.getText());$a(eb,Ua)}))):$a(eb,Ua)}function Qa(Oa,$a){if(null==la||P||b.sidebar.currentElt==Ha)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=R){var ab="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+-R.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+R.naturalWidth+'" height="'+R.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";B(ab,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),ta,la)}else b.sidebar.currentElt=Ha,P=!0,Na(la,function(gb){if(P&&b.sidebar.currentElt==Ha)try{B(gb,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),Ha,$a)}catch(Za){b.sidebar.currentElt=null,b.handleError(Za)}P=!1})}function Ya(){var Oa=document.createElement("table");+"visible";Ca.style.visibility="visible";Da.style.visibility="visible";Ba.style.visibility="hidden";Fa.style.visibility="hidden";va.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?va.select():document.execCommand("selectAll",!1,null)}function Q(){va.style.visibility="hidden";Ca.style.visibility="hidden";Da.style.visibility="hidden";oa.style.backgroundImage=Ea;oa.style.backgroundSize="contain";Ba.style.visibility="visible";Fa.style.visibility="visible"}function P(la){var ya=mxUtils.trim(va.value);+if(la||""==ya)null!=ha&&(va.value=ha,Q());else{va.style.visibility="hidden";Ca.style.visibility="hidden";Da.style.visibility="hidden";var ta=!1;la='Write a detailed and complex MermaidJS declaration for "'+(""!=ya?ya:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.';"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(qa){qa!=b.emptyDiagramXml&&(ta=!0,ja=qa)}));oa.style.backgroundImage="url("+Editor.spinImage++")";oa.style.backgroundSize="12px 12px";b.generateOpenAiMermaidDiagram(la,function(qa,ma,za,Ja){aa==oa&&"hidden"==va.style.visibility&&(Ea="url(data:image/svg+xml;base64,"+ma.substring(ma.indexOf(",")+1)+")",oa.setAttribute("title",ya),sa=ja=qa=ta?ja:b.createMermaidXml(qa,EditorUi.defaultMermaidConfig,ma,za,Ja,ya),ha=ya,Q())},function(qa){aa==oa&&(va.style.visibility="visible",Ca.style.visibility="visible",Da.style.visibility="visible",Ba.style.visibility="visible",Fa.style.visibility="visible",b.handleError(qa))})}}+function p(la,ya,ta,qa,ma,za,Ja,Ga,La,Pa,Ka,Ra){function Na(Oa,$a){null==eb?(Ua=Oa,Ua=/^https?:\/\//.test(Ua)?b.editor.isCorsEnabledForUrl(Ua)?Ua:PROXY_URL+"?url="+encodeURIComponent(Ua):TEMPLATE_PATH+"/"+Ua,mxUtils.get(Ua,mxUtils.bind(this,function(ab){200<=ab.getStatus()&&299>=ab.getStatus()&&(eb=ab.getText());$a(eb,Ua)}))):$a(eb,Ua)}function Qa(Oa,$a){if(null==la||O||b.sidebar.currentElt==Ha)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=R){var ab="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='++R.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+R.naturalWidth+'" height="'+R.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";B(ab,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),ta,la)}else b.sidebar.currentElt=Ha,O=!0,Na(la,function(gb){if(O&&b.sidebar.currentElt==Ha)try{B(gb,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),Ha,$a)}catch(Za){b.sidebar.currentElt=null,b.handleError(Za)}O=!1})}function Ya(){var Oa=document.createElement("table");Oa.setAttribute("width","100%");Oa.setAttribute("height","100%");Oa.style.background="light-dark(rgba(255,255,255,0.85), transparent)";Oa.style.lineHeight="1.3em";Oa.style.border="none";var $a=document.createElement("tbody"),ab=document.createElement("tr"),gb=document.createElement("td");gb.setAttribute("align","center");gb.setAttribute("valign","middle");var Za=document.createElement("span");Za.style.display="inline-block";Za.style.padding="2px 8px";Za.style.userSelect="none";Za.style.borderRadius="8px";Za.style.background="rgba(255,255,255,0.7)";Za.style.overflow="hidden";Za.style.textOverflow="ellipsis";Za.style.maxWidth=na-34+"px";mxUtils.write(Za,mxResources.get(ta,null,ta));gb.appendChild(Za);ab.appendChild(gb);$a.appendChild(ab);Oa.appendChild($a);return Oa}var Ha=null;if("generative"!=Ra||null==oa){Ha=document.createElement("div");Ha.className="geTemplate geAdaptiveAsset";Ha.style.backgroundOrigin="content-box";Ha.style.backgroundPosition="center center";Ha.style.backgroundRepeat="no-repeat";Ha.style.backgroundSize="contain";Ha.style.boxSizing="border-box";Ha.style.borderRadius="12px";Ha.style.position="relative";Ha.style.height=na+"px";Ha.style.width=Aa+"px";Ha.style.padding="4px";Ha.style.border="2px solid transparent";var eb=null,Ua=la;null!=ta?Ha.setAttribute("title",mxResources.get(ta,null,ta)):null!=qa&&0<qa.length&&Ha.setAttribute("title",qa)}else Ha=oa;if(null!=za){Ha.style.display="inline-flex";Ha.style.justifyContent="center";Ha.style.alignItems="center";ma=document.createElement("img");-ma.setAttribute("src",za);ma.setAttribute("alt",qa);ma.style.maxWidth=na+"px";ma.style.maxHeight=Aa+"px";R=ma;var ib=za.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ha.appendChild(ma);ma.onerror=function(){this.src!=ib?this.src=ib:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Oa){J(Ha,null,null,la,Ja,Ka)}),null,null);mxEvent.addListener(Ha,"dblclick",function(Oa){K();mxEvent.consume(Oa)})}else if(!Pa&&null!=la&&0<la.length){var fb=-function(Oa){x.spin(pa)&&Na(la,function($a,ab){x.stop();null!=$a&&(J(Ha,$a,ya,null,null,Ka,ab),Oa&&K())})};za=La||TEMPLATE_PATH+"/"+la.substring(0,la.length-4)+".png";Ha.style.backgroundImage="url("+za+")";null!=ta&&Ha.appendChild(Ya());mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Oa){fb()}),null,null);mxEvent.addListener(Ha,"dblclick",function(Oa){fb(!0);mxEvent.consume(Oa)})}else Ha.appendChild(Ya()),"generative"==Ra&&null==oa&&(Ha.style.backgroundImage=Ea,Ha.style.overflow="visible",-Ha.appendChild(Fa),Ha.appendChild(Ba),Ha.appendChild(va),Ha.appendChild(Ca),Ha.appendChild(Da),oa=Ha),ma&&J(Ha),null!=Ga?(mxEvent.addGestureListeners(Ha,null,null,mxUtils.bind(this,function(Oa){J(Ha,null,null,la,Ja)})),mxEvent.addListener(Ha,"click",Ga)):(mxEvent.addListener(Ha,"click",function(Oa){J(Ha,null,null,la,Ja)&&"generative"==Ra&&null==sa&&V()}),mxEvent.addListener(Ha,"dblclick",function(Oa){"generative"!=Ra?K():"hidden"==va.style.visibility&&V();mxEvent.consume(Oa)}));null!=la&&(za=N.cloneNode(!0),+ma.setAttribute("src",za);ma.setAttribute("alt",qa);ma.style.maxWidth=na+"px";ma.style.maxHeight=Aa+"px";R=ma;var ib=za.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ha.appendChild(ma);ma.onerror=function(){this.src!=ib?this.src=ib:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Oa){K(Ha,null,null,la,Ja,Ka)}),null,null);mxEvent.addListener(Ha,"dblclick",function(Oa){J();mxEvent.consume(Oa)})}else if(!Pa&&null!=la&&0<la.length){var fb=+function(Oa){x.spin(pa)&&Na(la,function($a,ab){x.stop();null!=$a&&(K(Ha,$a,ya,null,null,Ka,ab),Oa&&J())})};za=La||TEMPLATE_PATH+"/"+la.substring(0,la.length-4)+".png";Ha.style.backgroundImage="url("+za+")";null!=ta&&Ha.appendChild(Ya());mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Oa){fb()}),null,null);mxEvent.addListener(Ha,"dblclick",function(Oa){fb(!0);mxEvent.consume(Oa)})}else Ha.appendChild(Ya()),"generative"==Ra&&null==oa&&(Ha.style.backgroundImage=Ea,Ha.style.overflow="visible",+Ha.appendChild(Fa),Ha.appendChild(Ba),Ha.appendChild(va),Ha.appendChild(Ca),Ha.appendChild(Da),oa=Ha),ma&&K(Ha),null!=Ga?(mxEvent.addGestureListeners(Ha,null,null,mxUtils.bind(this,function(Oa){K(Ha,null,null,la,Ja)})),mxEvent.addListener(Ha,"click",Ga)):(mxEvent.addListener(Ha,"click",function(Oa){K(Ha,null,null,la,Ja)&&"generative"==Ra&&null==sa&&V()}),mxEvent.addListener(Ha,"dblclick",function(Oa){"generative"!=Ra?J():"hidden"==va.style.visibility&&V();mxEvent.consume(Oa)}));null!=la&&(za=N.cloneNode(!0),Ha.appendChild(za),mxEvent.addGestureListeners(za,mxUtils.bind(this,function(Oa){T=b.sidebar.currentElt==Ha}),null,null),mxEvent.addListener(za,"click",mxUtils.bind(this,function(Oa){T||Qa(Oa,null!=ta?ta:qa);mxEvent.consume(Oa)})));pa.appendChild(Ha);return Ha}function z(){function la(Na,Qa){Na=mxResources.get(Na,null,Na.substring(0,1).toUpperCase()+Na.substring(1));18<Na.length&&(Na=Na.substring(0,18)+"…");return Na+(null!=Qa?" ("+Qa.length+")":"")}function ya(Na,Qa,Ya){mxEvent.addListener(Qa,"click",function(){Sa!=Qa&&(null!=Sa&&(Sa.style.backgroundColor=""),Sa=Qa,Sa.style.backgroundColor=q,pa.scrollTop=0,pa.innerText="",l=0,null!=Ia[Na].content?(pa.appendChild(Ia[Na].content),ja=sa,Wa=null,null!=Ia[Na].content.init&&Ia[Na].content.init()):(Wa=Ya?Va[Na][Ya]:Ia[Na],W=null,y(!1)))});null!=urlParams["smart-template"]&&"smartTemplate"==Na&&Qa.click()}jb&&(jb=!1,mxEvent.addListener(pa,"scroll",function(Na){pa.scrollTop+pa.clientHeight>=pa.scrollHeight&&(y(),mxEvent.consume(Na))}));if(0<Xa){var ta=document.createElement("div");ta.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(ta,mxResources.get("custom"));ea.appendChild(ta);for(var qa in Ta){var ma=document.createElement("div");ta=qa;var za=Ta[qa];18<ta.length&&(ta=ta.substring(0,18)+"…");ma.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";ma.setAttribute("title",ta+" ("+@@ -12357,11 +12357,11 @@ u=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clIMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";e||u||!f||C.appendChild(M);f&&mxUtils.write(C,(u?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");M=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?M=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?M=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?M=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?M=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?M=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(M=b.trello.extension);var S=document.createElement("input");S.setAttribute("value",b.defaultFilename+M);S.style.marginLeft="10px";S.style.width=e||u?"144px":"244px";this.init=function(){f&&Editor.selectFilename(S);null!=pa.parentNode&&null!=pa.parentNode.parentNode&&mxEvent.addGestureListeners(pa.parentNode.parentNode,mxUtils.bind(this,function(la){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};f&&(C.appendChild(S),v?S.style.width=e||u?"350px":"450px":null!=b.editor.diagramFileTypes&&(v=FilenameDialog.createFileTypes(b,S,b.editor.diagramFileTypes),v.style.marginLeft="6px",v.style.width=e||u?"80px":"180px",C.appendChild(v)));v=!1;var l=0,x=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),G=mxUtils.button(m||mxResources.get("create"),function(){G.setAttribute("disabled",-"disabled");K();G.removeAttribute("disabled")});G.className="geBtn gePrimaryBtn";var N=document.createElement("img");N.setAttribute("src",Editor.magnifyImage);N.setAttribute("title",mxResources.get("preview"));N.className="geAdaptiveAsset geActiveButton";N.style.position="absolute";N.style.borderRadius="16px";N.style.background="white";N.style.cursor="default";N.style.padding="2px";N.style.opacity="0.8";N.style.height="16px";N.style.right="2px";N.style.top="2px";var P=!1,R=null,T=!1;if(L||F){var U=+"disabled");J();G.removeAttribute("disabled")});G.className="geBtn gePrimaryBtn";var N=document.createElement("img");N.setAttribute("src",Editor.magnifyImage);N.setAttribute("title",mxResources.get("preview"));N.className="geAdaptiveAsset geActiveButton";N.style.position="absolute";N.style.borderRadius="16px";N.style.background="white";N.style.cursor="default";N.style.padding="2px";N.style.opacity="0.8";N.style.height="16px";N.style.right="2px";N.style.top="2px";var O=!1,R=null,T=!1;if(L||F){var U=[],W=null,X=null,Y=null,Z=function(la){G.setAttribute("disabled","disabled");for(var ya=0;ya<U.length;ya++)U[ya].className=ya==la?"geBtn gePrimaryBtn":"geBtn"};v=!0;m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.height="30px";A.appendChild(m);u=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){ea.style.display="";ra.style.display="";pa.style.left="160px";Z(0);pa.scrollTop=0;pa.innerText="";l=0;W!=Wa&&(Wa=W,Ia=X,Xa=Y,ea.innerText="",z(),W=null)});U.push(u);m.appendChild(u);var ba=function(la){ea.style.display="none";ra.style.display="none";pa.style.left="30px";Z(la?-1:1);null==W&&(W=Wa);pa.scrollTop=0;pa.innerText="";x.spin(pa);var ya=function(ta,qa,ma){l=0;x.stop();Wa=ta;ma=ma||{};var za=0,Ja;for(Ja in ma)za+=ma[Ja].length;if(qa)pa.innerText=qa;else if(0==ta.length&&0==za)pa.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(pa.innerText="",0<za){ea.style.display="";pa.style.left="160px";ea.innerText="";Xa=0;Ia={"draw.io":ta};-for(Ja in ma)Ia[Ja]=ma[Ja];z()}else y(!0)};la?F(ha.value,ya):L(ya)};L&&(u=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){ba()}),m.appendChild(u),U.push(u));if(F){u=document.createElement("span");u.style.marginLeft="10px";u.innerText=mxResources.get("search")+":";m.appendChild(u);var ha=document.createElement("input");ha.style.marginRight="10px";ha.style.marginLeft="10px";ha.style.width="220px";mxEvent.addListener(ha,"keypress",function(la){13==la.keyCode&&ba(!0)});m.appendChild(ha);-u=mxUtils.button(mxResources.get("search"),function(){ba(!0)});u.className="geBtn";m.appendChild(u)}Z(0)}var ca=null,da=null,ja=null,aa=null,ia=null,ka=null,ua=null,sa=null,fa=null,pa=document.createElement("div");pa.style.border="1px solid #d3d3d3";pa.style.position="absolute";pa.style.left="160px";pa.style.right="34px";m=(f?72:40)+(v?30:0);pa.style.top=m+"px";pa.style.bottom="68px";pa.style.margin="6px 0 0 -1px";pa.style.padding="6px";pa.style.overflow="auto";var ra=document.createElement("div");+for(Ja in ma)Ia[Ja]=ma[Ja];z()}else y(!0)};la?F(fa.value,ya):L(ya)};L&&(u=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){ba()}),m.appendChild(u),U.push(u));if(F){u=document.createElement("span");u.style.marginLeft="10px";u.innerText=mxResources.get("search")+":";m.appendChild(u);var fa=document.createElement("input");fa.style.marginRight="10px";fa.style.marginLeft="10px";fa.style.width="220px";mxEvent.addListener(fa,"keypress",function(la){13==la.keyCode&&ba(!0)});m.appendChild(fa);+u=mxUtils.button(mxResources.get("search"),function(){ba(!0)});u.className="geBtn";m.appendChild(u)}Z(0)}var ca=null,da=null,ja=null,aa=null,ia=null,ka=null,ua=null,sa=null,ha=null,pa=document.createElement("div");pa.style.border="1px solid #d3d3d3";pa.style.position="absolute";pa.style.left="160px";pa.style.right="34px";m=(f?72:40)+(v?30:0);pa.style.top=m+"px";pa.style.bottom="68px";pa.style.margin="6px 0 0 -1px";pa.style.padding="6px";pa.style.overflow="auto";var ra=document.createElement("div");ra.style.cssText="position:absolute;left:30px;width:128px;top:"+m+"px;height:22px;margin-top: 6px;white-space: nowrap;";var xa=document.createElement("input");xa.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";xa.setAttribute("placeholder",mxResources.get("search"));xa.setAttribute("type","text");ra.appendChild(xa);var wa=document.createElement("img");wa.setAttribute("src",Editor.magnifyImage);wa.setAttribute("title",mxResources.get("search"));wa.className="geAdaptiveAsset";wa.style.position="relative";wa.style.cursor="pointer";wa.style.opacity="0.5";wa.style.height="16px";wa.style.left="-20px";wa.style.top="4px";wa.style.background="url('"+b.editor.transparentImage+"')";ra.appendChild(wa);mxEvent.addListener(wa,"click",function(){wa.getAttribute("src")!=Editor.magnifyImage&&(wa.setAttribute("src",Editor.magnifyImage),wa.setAttribute("title",mxResources.get("search")),xa.value="",null!=bb&&(bb.click(),bb=null));xa.focus()});mxEvent.addListener(xa,"keydown",mxUtils.bind(this,function(la){if(13==la.keyCode){var ya=xa.value;if(""==ya)null!=bb&&(bb.click(),bb=null);else{if(null==NewDialog.tagsList[D]){var ta={};for(Ka in Ia)if(null==Ia[Ka].content)for(var qa=Ia[Ka],ma=0;ma<qa.length;ma++){var za=qa[ma];if(null!=za.tags)for(var Ja=za.tags.toLowerCase().split(";"),Ga=0;Ga<Ja.length;Ga++)null==ta[Ja[Ga]]&&(ta[Ja[Ga]]=[]),ta[Ja[Ga]].push(za)}NewDialog.tagsList[D]=ta}var La=ya.toLowerCase().split(" ");ta=NewDialog.tagsList[D];if(0<Xa&&null==ta.__tagsList__){for(Ka in Ta)for(qa=@@ -12369,74 +12369,74 @@ Ta[Ka],ma=0;ma<qa.length;ma++)for(za=qa[ma],Ja=za.title.split(" "),Ja.push(Ka),GmxUtils.write(ta,mxResources.get(0==Ka.length?"noResultsFor":"resultsFor",[ya]));pa.appendChild(ta);null!=Sa&&null==bb&&(Sa.style.backgroundColor="",bb=Sa,Sa=ta);Wa=Ka;W=null;y(!1)}mxEvent.consume(la)}}));mxEvent.addListener(xa,"keyup",mxUtils.bind(this,function(la){""==xa.value?(wa.setAttribute("src",Editor.magnifyImage),wa.setAttribute("title",mxResources.get("search"))):(wa.setAttribute("src",Editor.crossImage),wa.setAttribute("title",mxResources.get("reset")))}));m+=23;var ea=document.createElement("div");ea.style.cssText="position:absolute;left:30px;width:128px;top:"+m+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(pa,"scroll",function(){b.sidebar.hideTooltip()});var na=140,Aa=na,oa=null,Ea="url("+Editor.sparklesImage+")",va=document.createElement("textarea");va.setAttribute("placeholder",mxResources.get("describeYourDiagram"));va.style.position="absolute";va.style.fontFamily="sans-serif";va.style.outline="none";va.style.left="0px";va.style.right="0px";va.style.top="0px";va.style.bottom="38px";va.style.resize="none";va.style.boxSizing="border-box";va.style.fontSize="12px";va.style.border="none";va.style.margin="8px";var Ca=document.createElement("button");Ca.className="geBtn gePrimaryBtn";Ca.style.position="absolute";Ca.style.bottom="0px";Ca.style.height="30px";Ca.style.right="0px";Ca.style.left="0px";Ca.style.margin="8px";Ca.style.fontSize="14px";Ca.style.borderRadius="4px";Ca.setAttribute("disabled","disabled");Ca.setAttribute("title",mxResources.get("ok"));-mxUtils.write(Ca,mxResources.get("ok"));var Fa=N.cloneNode(!0),Ma=!1;mxEvent.addGestureListeners(Fa,function(la){Ma=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(la){if(!Ma&&null!=sa){var ya="<mxfile><diagram>"+Graph.compress(sa)+"</diagram></mxfile>";B(ya,mxEvent.getClientX(la),mxEvent.getClientY(la),oa,fa)}});var Ba=N.cloneNode(!0);Ba.setAttribute("src",Editor.editImage);Ba.setAttribute("title",mxResources.get("edit"));Ba.style.right="";Ba.style.left="2px";var Da=+mxUtils.write(Ca,mxResources.get("ok"));var Fa=N.cloneNode(!0),Ma=!1;mxEvent.addGestureListeners(Fa,function(la){Ma=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(la){if(!Ma&&null!=sa){var ya="<mxfile><diagram>"+Graph.compress(sa)+"</diagram></mxfile>";B(ya,mxEvent.getClientX(la),mxEvent.getClientY(la),oa,ha)}});var Ba=N.cloneNode(!0);Ba.setAttribute("src",Editor.editImage);Ba.setAttribute("title",mxResources.get("edit"));Ba.style.right="";Ba.style.left="2px";var Da=N.cloneNode(!0);Da.setAttribute("src",Editor.helpImage);Da.setAttribute("title",mxResources.get("help"));Da.style.opacity="1";Da.style.right="-8px";Da.style.top="-8px";mxEvent.addListener(Da,"click",function(la){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(la)});va.style.visibility="hidden";Ca.style.visibility="hidden";Ba.style.visibility="hidden";Da.style.visibility="hidden";Fa.style.visibility="hidden";mxEvent.addListener(Ba,"click",V);mxEvent.addListener(va,-"input",function(){""!=va.value?Ca.removeAttribute("disabled"):Ca.setAttribute("disabled","disabled")});mxEvent.addListener(Ca,"click",function(){O()});mxEvent.addListener(va,"keydown",function(la){13!=la.keyCode||mxEvent.isShiftDown(la)?27==la.keyCode&&(O(!0),mxEvent.consume(la)):(O(),mxEvent.consume(la))});var Ia={},Va={},Ta={},Xa=0,jb=!0,Sa=null,bb=null;Ia.basic=[{title:"blankDiagram"}];var Wa=Ia.basic;Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==+"input",function(){""!=va.value?Ca.removeAttribute("disabled"):Ca.setAttribute("disabled","disabled")});mxEvent.addListener(Ca,"click",function(){P()});mxEvent.addListener(va,"keydown",function(la){13!=la.keyCode||mxEvent.isShiftDown(la)?27==la.keyCode&&(P(!0),mxEvent.consume(la)):(P(),mxEvent.consume(la))});var Ia={},Va={},Ta={},Xa=0,jb=!0,Sa=null,bb=null;Ia.basic=[{title:"blankDiagram"}];var Wa=Ia.basic;Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&Ia.basic.push({title:"generate",type:"generative"});Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(Ia.smartTemplate={content:I()});if(!e){var cb=function(){mxUtils.get(db,function(la){if(!hb){hb=!0;la=la.getXml().documentElement.firstChild;for(var ya={};null!=la;){if("undefined"!==typeof la.getAttribute)if("parsererror"==la.nodeName)null!=window.console&&console.log("Parser error in "+D+": "+la.textContent);else if("clibs"==la.nodeName){for(var ta=la.getAttribute("name"),qa=la.getElementsByTagName("add"),ma=[],za=0;za<qa.length;za++)ma.push(encodeURIComponent(mxUtils.getTextContent(qa[za])));null!=ta&&0<ma.length&&(ya[ta]=ma.join(";"))}else if(ma=la.getAttribute("url"),null!=ma){qa=la.getAttribute("section");ta=la.getAttribute("subsection");if(null==qa&&(za=ma.indexOf("/"),qa=ma.substring(0,za),null==ta)){var Ja=ma.indexOf("/",za+1);-1<Ja&&(ta=ma.substring(za+1,Ja))}za=Ia[qa];null==za&&(za=[],Ia[qa]=za);ma=la.getAttribute("clibs");null!=ya[ma]&&(ma=ya[ma]);ma={url:la.getAttribute("url"),libs:la.getAttribute("libs"),title:la.getAttribute("title"),tooltip:la.getAttribute("name")||la.getAttribute("url"),preview:la.getAttribute("preview"),clibs:ma,tags:la.getAttribute("tags")};za.push(ma);null!=ta&&(za=Va[qa],null==za&&(za={},Va[qa]=za),qa=za[ta],null==qa&&(qa=[],za[ta]=qa),qa.push(ma))}la=la.nextSibling}x.stop();z()}})};A.appendChild(ra);A.appendChild(ea);-A.appendChild(pa);var hb=!1,db=D;/^https?:\/\//.test(db)&&!b.editor.isCorsEnabledForUrl(db)&&(db=PROXY_URL+"?url="+encodeURIComponent(db));x.spin(pa);null!=t?t(function(la,ya){Ta=la;Y=Xa=ya;cb()},cb):cb();X=Ia}mxEvent.addListener(S,"keypress",function(la){b.dialog.container.firstChild==A&&13==la.keyCode&&K()});t=document.createElement("div");t.style.marginTop=e?"4px":"16px";t.style.textAlign="right";t.style.position="absolute";t.style.left="40px";t.style.bottom="24px";t.style.right="40px";m=mxUtils.button(mxResources.get("cancel"),-function(){null!=n&&n();b.hideDialog(!0)});m.className="geBtn";!b.editor.cancelFirst||k&&null==n||t.appendChild(m);e||"1"==urlParams.embed||k||mxClient.IS_ANDROID||mxClient.IS_IOS||"1"==urlParams.noDevice||(e=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var la=new FilenameDialog(b,"",mxResources.get("create"),function(ya){null!=ya&&0<ya.length&&b.editor.loadUrl(b.editor.getProxiedUrl(ya),function(ta){ja=ta;ca=null;templateRealURl=ya;b.hideDialog();K()},function(ta){b.handleError(ta)})},+A.appendChild(pa);var hb=!1,db=D;/^https?:\/\//.test(db)&&!b.editor.isCorsEnabledForUrl(db)&&(db=PROXY_URL+"?url="+encodeURIComponent(db));x.spin(pa);null!=t?t(function(la,ya){Ta=la;Y=Xa=ya;cb()},cb):cb();X=Ia}mxEvent.addListener(S,"keypress",function(la){b.dialog.container.firstChild==A&&13==la.keyCode&&J()});t=document.createElement("div");t.style.marginTop=e?"4px":"16px";t.style.textAlign="right";t.style.position="absolute";t.style.left="40px";t.style.bottom="24px";t.style.right="40px";m=mxUtils.button(mxResources.get("cancel"),+function(){null!=n&&n();b.hideDialog(!0)});m.className="geBtn";!b.editor.cancelFirst||k&&null==n||t.appendChild(m);e||"1"==urlParams.embed||k||mxClient.IS_ANDROID||mxClient.IS_IOS||"1"==urlParams.noDevice||(e=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var la=new FilenameDialog(b,"",mxResources.get("create"),function(ya){null!=ya&&0<ya.length&&b.editor.loadUrl(b.editor.getProxiedUrl(ya),function(ta){ja=ta;ca=null;templateRealURl=ya;b.hideDialog();J()},function(ta){b.handleError(ta)})},mxResources.get("url"),null,null,null,!1);b.showDialog(la.container,300,80,!0,!0);la.init()}),e.className="geBtn",t.appendChild(e));Graph.fileSupport&&g&&(g=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var la=document.createElement("input");la.setAttribute("multiple","multiple");la.setAttribute("type","file");mxEvent.addListener(la,"change",function(ya){b.openFiles(la.files,!0);la.value=""});la.style.display="none";document.body.appendChild(la);b.newDlgFileInputElt=la}b.newDlgFileInputElt.click()}),g.className="geBtn",t.appendChild(g));t.appendChild(G);b.editor.cancelFirst||null!=c||k&&null==n||t.appendChild(m);A.appendChild(t);this.container=A};NewDialog.tagsList={};var SaveDialog=function(b,e,f,c,k,n,q,u){function E(A,C,M,S,l,x){var G=null;if(null==c||0>mxUtils.indexOf(c,A))if(l=null!=l?l:b.getTitleForService(A),0<=mxUtils.indexOf(V,A)||null!=b.getServiceForName(A)){G=document.createElement("option");if("pick"==x)G.innerHTML=mxUtils.htmlEntities(l)+" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"...",G.setAttribute("value","pickFolder-"+A),G.setAttribute("title",l+" - "+mxResources.get("pickFolder")+"...");else{var N=A+-(null!=M?"-"+M:""),P=p[N];null!=P&&null!=P.option&&P.option.parentNode.removeChild(P.option);P=null;if(null!=C){"/"==C.charAt(C.length-1)&&(C=C.substring(0,C.length-1));"/"==C.charAt(0)&&(C=C.substring(1));P=C;if(A!=App.MODE_GITHUB&&A==App.MODE_GITLAB){var R=P.lastIndexOf("/");0<=R&&(P=P.substring(R+1))}40<P.length&&(P=P.substring(0,20)+"..."+P.substring(P.length-20))}G.innerHTML=mxUtils.htmlEntities(l)+(null!=P?" – "+mxUtils.htmlEntities(P):"");G.setAttribute("title",l+-(null!=C?" ("+C+")":"")+(null!=M&&decodeURIComponent(M)!=C?" ["+M+"]":""));G.setAttribute("value",N);p[N]={option:G,mode:A,path:C,id:M};SaveDialog.lastValue==N&&null==u?S=!0:null==S&&("root"==x?S=null==u&&b.mode==A||null!=A&&A==u:"pickFolder-"==K.value.substring(0,11)&&(S=!0));S&&G.setAttribute("selected","selected")}K.appendChild(G)}return G}function H(A){b.pickFolder(A,function(C){var M=null;A==App.MODE_GOOGLE&&null!=C.docs&&0<C.docs.length?M={mode:A,path:C.docs[0].name,id:C.docs[0].id}:A==App.MODE_ONEDRIVE&&-null!=C.value&&0<C.value.length?M={mode:A,path:C.value[0].name,id:OneDriveFile.prototype.getIdOf(C.value[0])}:(A==App.MODE_GITHUB||A==App.MODE_GITLAB)&&null!=C&&0<C.length&&(M={mode:A,path:decodeURIComponent(C),id:C});null!=M&&(J.style.display="",b.addRecent(M,"Folders",5),C=E(M.mode,M.path,M.id,!0),K.innerHTML="",p={},D(),M=K.selectedIndex,K.value=C.value,0>K.selectedIndex&&(K.selectedIndex=M))},!0,!0,!0,!0)}function D(){var A=b.getRecent("Folders"),C=0;if(null!=A&&0<A.length){for(var M=0;M<A.length;M++)null!=-E(A[M].mode,A[M].path,A[M].id)&&C++;0<C&&K.appendChild(Q.cloneNode(!0))}E(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");E(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(E(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),E(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.dropbox&&E(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);E(App.MODE_GITHUB,null,null,null,null,"pick");E(App.MODE_GITLAB,null,-null,null,null,"pick");E(App.MODE_TRELLO);A=!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&A&&E(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=c&&0<=mxUtils.indexOf(c,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&E(App.MODE_BROWSER);A&&E("download");Editor.popupsAllowed&&E("_blank",null,null,null,mxResources.get("openInNewWindow"));0<C&&(K.appendChild(Q.cloneNode(!0)),C=K.value,K.appendChild(J),-K.value=C);if("pickFolder-"==K.value.substring(0,11)||"reset"==K.value)C=document.createElement("option"),C.setAttribute("value",""),C.setAttribute("selected","selected"),mxUtils.write(C,mxResources.get("pickFolder")+"..."),K.insertBefore(C,K.firstChild);O=K.value}function L(){if("reset"==K.value)b.resetRecent("Folders"),K.innerHTML="",K.value="",pickFolderOption=null,p={},D();else if("pickFolder-"==K.value.substring(0,11)){var A=K.value.substring(11);K.value=O;H(A)}else if(null!=I&&null!=p[K.value]&&-null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[I.value].extension){A=b.getExtensionForService(p[K.value].mode);var C=B.value;null!=A&&0>e.indexOf(".")&&0>C.indexOf(".")&&(B.value=C+A)}z.innerHTML="";mxUtils.write(z,mxResources.get("download"==K.value||"_blank"==K.value?"ok":"save"));""==K.value?z.setAttribute("disabled","disabled"):z.removeAttribute("disabled")}var F=document.createElement("div");F.style.display="flex";F.style.flexWrap="wrap";F.style.whiteSpace="nowrap";var d=+(null!=M?"-"+M:""),O=p[N];null!=O&&null!=O.option&&O.option.parentNode.removeChild(O.option);O=null;if(null!=C){"/"==C.charAt(C.length-1)&&(C=C.substring(0,C.length-1));"/"==C.charAt(0)&&(C=C.substring(1));O=C;if(A!=App.MODE_GITHUB&&A==App.MODE_GITLAB){var R=O.lastIndexOf("/");0<=R&&(O=O.substring(R+1))}40<O.length&&(O=O.substring(0,20)+"..."+O.substring(O.length-20))}G.innerHTML=mxUtils.htmlEntities(l)+(null!=O?" – "+mxUtils.htmlEntities(O):"");G.setAttribute("title",l++(null!=C?" ("+C+")":"")+(null!=M&&decodeURIComponent(M)!=C?" ["+M+"]":""));G.setAttribute("value",N);p[N]={option:G,mode:A,path:C,id:M};SaveDialog.lastValue==N&&null==u?S=!0:null==S&&("root"==x?S=null==u&&b.mode==A||null!=A&&A==u:"pickFolder-"==J.value.substring(0,11)&&(S=!0));S&&G.setAttribute("selected","selected")}J.appendChild(G)}return G}function H(A){b.pickFolder(A,function(C){var M=null;A==App.MODE_GOOGLE&&null!=C.docs&&0<C.docs.length?M={mode:A,path:C.docs[0].name,id:C.docs[0].id}:A==App.MODE_ONEDRIVE&&+null!=C.value&&0<C.value.length?M={mode:A,path:C.value[0].name,id:OneDriveFile.prototype.getIdOf(C.value[0])}:(A==App.MODE_GITHUB||A==App.MODE_GITLAB)&&null!=C&&0<C.length&&(M={mode:A,path:decodeURIComponent(C),id:C});null!=M&&(K.style.display="",b.addRecent(M,"Folders",5),C=E(M.mode,M.path,M.id,!0),J.innerHTML="",p={},D(),M=J.selectedIndex,J.value=C.value,0>J.selectedIndex&&(J.selectedIndex=M))},!0,!0,!0,!0)}function D(){var A=b.getRecent("Folders"),C=0;if(null!=A&&0<A.length){for(var M=0;M<A.length;M++)null!=+E(A[M].mode,A[M].path,A[M].id)&&C++;0<C&&J.appendChild(Q.cloneNode(!0))}E(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");E(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(E(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),E(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.dropbox&&E(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);E(App.MODE_GITHUB,null,null,null,null,"pick");E(App.MODE_GITLAB,null,+null,null,null,"pick");E(App.MODE_TRELLO);A=!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&A&&E(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=c&&0<=mxUtils.indexOf(c,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&E(App.MODE_BROWSER);A&&E("download");Editor.popupsAllowed&&E("_blank",null,null,null,mxResources.get("openInNewWindow"));0<C&&(J.appendChild(Q.cloneNode(!0)),C=J.value,J.appendChild(K),+J.value=C);if("pickFolder-"==J.value.substring(0,11)||"reset"==J.value)C=document.createElement("option"),C.setAttribute("value",""),C.setAttribute("selected","selected"),mxUtils.write(C,mxResources.get("pickFolder")+"..."),J.insertBefore(C,J.firstChild);P=J.value}function L(){if("reset"==J.value)b.resetRecent("Folders"),J.innerHTML="",J.value="",pickFolderOption=null,p={},D();else if("pickFolder-"==J.value.substring(0,11)){var A=J.value.substring(11);J.value=P;H(A)}else if(null!=I&&null!=p[J.value]&&+null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[I.value].extension){A=b.getExtensionForService(p[J.value].mode);var C=B.value;null!=A&&0>e.indexOf(".")&&0>C.indexOf(".")&&(B.value=C+A)}z.innerHTML="";mxUtils.write(z,mxResources.get("download"==J.value||"_blank"==J.value?"ok":"save"));""==J.value?z.setAttribute("disabled","disabled"):z.removeAttribute("disabled")}var F=document.createElement("div");F.style.display="flex";F.style.flexWrap="wrap";F.style.whiteSpace="nowrap";var d=document.createElement("div");d.style.display="grid";d.style.gap="5px 8px";d.style.gridAutoRows="auto auto 44px";d.style.gridAutoColumns="0fr minmax(0,1fr)";d.style.width="100%";var g=null,m=null;if(null!=k&&null!=n&&"image/"==n.substring(0,6)&&("image/svg"!=n.substring(0,9)||mxClient.IS_SVG)){d.style.display="inline-grid";d.style.flexBasis="75%";g=document.createElement("div");g.style.display="inline-block";g.style.height="auto";g.style.maxWidth="25%";g.style.margin="auto";var t=document.createElement("img"),v=q?k:btoa(unescape(encodeURIComponent(k)));t.setAttribute("src","data:"+n+";base64,"+v);t.style.boxSizing="border-box";t.style.maxHeight="50px";t.style.maxWidth="100%";t.style.paddingLeft="10px";g.appendChild(t);mxClient.IS_FF||"image/png"!=n||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(m=mxUtils.button(mxResources.get("copy"),function(){var A=b.base64ToBlob(v,"image/png");A=new ClipboardItem({"image/png":A,"text/html":new Blob(['<img src="data:'+n+";base64,"+v+'">'],{type:"text/html"})});navigator.clipboard.write([A]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(C){b.handleError(C)}))},null,"geBtn"));Editor.popupsAllowed&&(null==c||0>mxUtils.indexOf(c,"_blank"))?(g.setAttribute("title",mxResources.get("openInNewWindow")),g.style.cursor="pointer",mxEvent.addGestureListeners(g,null,null,function(A){mxEvent.isPopupTrigger(A)||b.openInNewWindow(k,n,q)})):g.setAttribute("title",mxResources.get("preview"))}t=document.createElement("div");t.style.display="flex";t.style.padding="1px";t.style.alignItems="center";t.style.justifyContent="flex-end";t.style.gridColumn="1";t.style.whiteSpace="nowrap";var y=document.createElement("div");y.style.display="grid";y.style.padding="1px";y.style.alignItems="center";y.style.gridColumn="2";y.style.gridAutoColumns="minmax(0,1fr) auto";y.style.gap="6px";mxUtils.write(t,mxResources.get("saveAs")+":");var B=document.createElement("input");B.setAttribute("type","text");B.setAttribute("value",e);B.style.boxSizing=-"border-box";B.style.width="100%";y.appendChild(B);d.appendChild(t);d.appendChild(y);var I=null;null!=b.editor.diagramFileTypes&&null==n&&(t=t.cloneNode(!1),y=y.cloneNode(!1),mxUtils.write(t,mxResources.get("type")+":"),I=FilenameDialog.createFileTypes(b,B,b.editor.diagramFileTypes),I.style.boxSizing="border-box",I.style.width="100%",y.appendChild(I),d.appendChild(t),d.appendChild(y));t=t.cloneNode(!1);y=y.cloneNode(!1);mxUtils.write(t,mxResources.get("where")+":");var K=document.createElement("select");-K.style.textOverflow="ellipsis";K.style.gridColumn="1";var J=document.createElement("option");mxUtils.write(J,mxResources.get("reset"));J.setAttribute("value","reset");var V=["browser","device","download","_blank"],Q=document.createElement("option");Q.setAttribute("disabled","disabled");Q.innerHTML="-----------------";var O=null,p={},z=mxUtils.button(mxResources.get("save"),function(){SaveDialog.lastValue=K.value;var A=p[SaveDialog.lastValue];null!=A&&f(B,A.mode,A.id)},null,"geBtn gePrimaryBtn");-mxEvent.addListener(B,"keypress",function(A){13==A.keyCode&&z.click()});mxEvent.addListener(K,"change",L);D();L();y.appendChild(K);null!=SaveDialog.lastValue&&null!=p[SaveDialog.lastValue]&&(K.value=SaveDialog.lastValue);d.appendChild(t);d.appendChild(y);F.appendChild(d);null!=g&&F.appendChild(g);d=document.createElement("div");d.style.flexBasis="100%";d.style.textAlign="right";d.style.marginTop=null!=n?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||d.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));-g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&d.appendChild(g);null!=m&&d.appendChild(m);d.appendChild(z);b.editor.cancelFirst||d.appendChild(g);F.appendChild(d);this.init=function(){Editor.selectFilename(B)};this.container=F},CreateDialog=function(b,e,f,c,k,n,q,u,E,H,D,L,F,d,g,m,t){function v(O,p,z,A){function C(){mxEvent.addListener(M,"click",function(){var N=z;if(q){var P=I.value,R=P.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>R){N=null!=-N?N:Q.value;var T="";N==App.MODE_GOOGLE?T=b.drive.extension:N==App.MODE_GITHUB?T=b.gitHub.extension:N==App.MODE_GITLAB?T=b.gitLab.extension:N==App.MODE_TRELLO?T=b.trello.extension:N==App.MODE_DROPBOX?T=b.dropbox.extension:N==App.MODE_ONEDRIVE?T=b.oneDrive.extension:N==App.MODE_DEVICE&&(T=".drawio");0<=R&&(P=P.substring(0,R));I.value=P+T}}y(z)})}var M=document.createElement("a");M.style.overflow="hidden";var S=document.createElement("img");S.src=O;S.setAttribute("border","0");S.setAttribute("align",+"border-box";B.style.width="100%";y.appendChild(B);d.appendChild(t);d.appendChild(y);var I=null;null!=b.editor.diagramFileTypes&&null==n&&(t=t.cloneNode(!1),y=y.cloneNode(!1),mxUtils.write(t,mxResources.get("type")+":"),I=FilenameDialog.createFileTypes(b,B,b.editor.diagramFileTypes),I.style.boxSizing="border-box",I.style.width="100%",y.appendChild(I),d.appendChild(t),d.appendChild(y));t=t.cloneNode(!1);y=y.cloneNode(!1);mxUtils.write(t,mxResources.get("where")+":");var J=document.createElement("select");+J.style.textOverflow="ellipsis";J.style.gridColumn="1";var K=document.createElement("option");mxUtils.write(K,mxResources.get("reset"));K.setAttribute("value","reset");var V=["browser","device","download","_blank"],Q=document.createElement("option");Q.setAttribute("disabled","disabled");Q.innerHTML="-----------------";var P=null,p={},z=mxUtils.button(mxResources.get("save"),function(){SaveDialog.lastValue=J.value;var A=p[SaveDialog.lastValue];null!=A&&f(B,A.mode,A.id)},null,"geBtn gePrimaryBtn");+mxEvent.addListener(B,"keypress",function(A){13==A.keyCode&&z.click()});mxEvent.addListener(J,"change",L);D();L();y.appendChild(J);null!=SaveDialog.lastValue&&null!=p[SaveDialog.lastValue]&&(J.value=SaveDialog.lastValue);d.appendChild(t);d.appendChild(y);F.appendChild(d);null!=g&&F.appendChild(g);d=document.createElement("div");d.style.flexBasis="100%";d.style.textAlign="right";d.style.marginTop=null!=n?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||d.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));+g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&d.appendChild(g);null!=m&&d.appendChild(m);d.appendChild(z);b.editor.cancelFirst||d.appendChild(g);F.appendChild(d);this.init=function(){Editor.selectFilename(B)};this.container=F},CreateDialog=function(b,e,f,c,k,n,q,u,E,H,D,L,F,d,g,m,t){function v(P,p,z,A){function C(){mxEvent.addListener(M,"click",function(){var N=z;if(q){var O=I.value,R=O.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>R){N=null!=+N?N:Q.value;var T="";N==App.MODE_GOOGLE?T=b.drive.extension:N==App.MODE_GITHUB?T=b.gitHub.extension:N==App.MODE_GITLAB?T=b.gitLab.extension:N==App.MODE_TRELLO?T=b.trello.extension:N==App.MODE_DROPBOX?T=b.dropbox.extension:N==App.MODE_ONEDRIVE?T=b.oneDrive.extension:N==App.MODE_DEVICE&&(T=".drawio");0<=R&&(O=O.substring(0,R));I.value=O+T}}y(z)})}var M=document.createElement("a");M.style.overflow="hidden";var S=document.createElement("img");S.src=P;S.setAttribute("border","0");S.setAttribute("align","absmiddle");S.style.width="60px";S.style.height="60px";S.style.paddingBottom="6px";M.style.display="inline-block";M.className="geBaseButton";M.style.position="relative";M.style.margin="4px";M.style.padding="8px 8px 10px 8px";M.style.whiteSpace="nowrap";M.appendChild(S);M.style.color="gray";M.style.fontSize="11px";var l=document.createElement("div");M.appendChild(l);mxUtils.write(l,p);if(null!=A&&null==b[A]){S.style.visibility="hidden";mxUtils.setOpacity(l,10);var x=new Spinner({lines:12,length:12,-width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});x.spin(M);var G=window.setTimeout(function(){null==b[A]&&(x.stop(),M.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[A]&&(window.clearTimeout(G),mxUtils.setOpacity(l,100),S.style.visibility="",x.stop(),C())}))}else C();J.appendChild(M);++V==L&&(mxUtils.br(J),V=0)}function y(O){var p=I.value;if(null==O||null!=p&&0<p.length)t&&b.hideDialog(),-f(p,O,I)}D="1"==urlParams.noDevice?!1:D;q=null!=q?q:!0;u=null!=u?u:!0;L=null!=L?L:4;t=null!=t?t:!0;n=document.createElement("div");n.style.whiteSpace="nowrap";null==c&&b.addLanguageMenu(n);var B=document.createElement("h2");mxUtils.write(B,k||mxResources.get("create"));B.style.marginTop="0px";B.style.marginBottom="24px";n.appendChild(B);k=document.createElement("span");mxUtils.write(k,mxResources.get("filename")+":");k.style.maxWidth="106px";k.style.overflow="hidden";k.style.textOverflow="ellipsis";+width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});x.spin(M);var G=window.setTimeout(function(){null==b[A]&&(x.stop(),M.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[A]&&(window.clearTimeout(G),mxUtils.setOpacity(l,100),S.style.visibility="",x.stop(),C())}))}else C();K.appendChild(M);++V==L&&(mxUtils.br(K),V=0)}function y(P){var p=I.value;if(null==P||null!=p&&0<p.length)t&&b.hideDialog(),+f(p,P,I)}D="1"==urlParams.noDevice?!1:D;q=null!=q?q:!0;u=null!=u?u:!0;L=null!=L?L:4;t=null!=t?t:!0;n=document.createElement("div");n.style.whiteSpace="nowrap";null==c&&b.addLanguageMenu(n);var B=document.createElement("h2");mxUtils.write(B,k||mxResources.get("create"));B.style.marginTop="0px";B.style.marginBottom="24px";n.appendChild(B);k=document.createElement("span");mxUtils.write(k,mxResources.get("filename")+":");k.style.maxWidth="106px";k.style.overflow="hidden";k.style.textOverflow="ellipsis";k.style.display="inline-block";n.appendChild(k);var I=document.createElement("input");I.setAttribute("value",e);I.style.width="180px";I.style.marginLeft="10px";I.style.marginBottom="20px";I.style.maxWidth="70%";this.init=function(){Editor.selectFilename(I)};n.appendChild(I);null!=m&&null!=b.editor.diagramFileTypes&&(m=FilenameDialog.createFileTypes(b,I,b.editor.diagramFileTypes),m.style.marginLeft="6px",m.style.width="90px",n.appendChild(m));m=null;if("1"!=urlParams.noDevice&&null!=F&&null!=d&&"image/"==-d.substring(0,6)&&("image/svg"!=d.substring(0,9)||mxClient.IS_SVG)){I.style.width="160px";k=document.createElement("img");var K=g?F:btoa(unescape(encodeURIComponent(F)));k.setAttribute("src","data:"+d+";base64,"+K);k.style.position="absolute";k.style.top="70px";k.style.right="100px";k.style.maxWidth="120px";k.style.maxHeight="80px";mxUtils.setPrefixedStyle(k.style,"transform","translate(50%,-50%)");n.appendChild(k);mxClient.IS_FF||"image/png"!=d||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||-(m=mxUtils.button(mxResources.get("copy"),function(O){O=b.base64ToBlob(K,"image/png");O=new ClipboardItem({"image/png":O,"text/html":new Blob(['<img src="data:'+d+";base64,"+K+'">'],{type:"text/html"})});navigator.clipboard.write([O]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(p){b.handleError(p)}))}),m.style.marginTop="6px",m.className="geBtn");E&&Editor.popupsAllowed&&(k.style.cursor="pointer",mxEvent.addGestureListeners(k,-null,null,function(O){mxEvent.isPopupTrigger(O)||y("_blank")}))}mxUtils.br(n);var J=document.createElement("div");J.style.textAlign="center";var V=0;J.style.marginTop="6px";n.appendChild(J);var Q=document.createElement("select");Q.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(F=document.createElement("option"),F.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(F,mxResources.get("googleDrive")),Q.appendChild(F),v(IMAGE_PATH+"/google-drive-logo.svg",+d.substring(0,6)&&("image/svg"!=d.substring(0,9)||mxClient.IS_SVG)){I.style.width="160px";k=document.createElement("img");var J=g?F:btoa(unescape(encodeURIComponent(F)));k.setAttribute("src","data:"+d+";base64,"+J);k.style.position="absolute";k.style.top="70px";k.style.right="100px";k.style.maxWidth="120px";k.style.maxHeight="80px";mxUtils.setPrefixedStyle(k.style,"transform","translate(50%,-50%)");n.appendChild(k);mxClient.IS_FF||"image/png"!=d||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||+(m=mxUtils.button(mxResources.get("copy"),function(P){P=b.base64ToBlob(J,"image/png");P=new ClipboardItem({"image/png":P,"text/html":new Blob(['<img src="data:'+d+";base64,"+J+'">'],{type:"text/html"})});navigator.clipboard.write([P]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(p){b.handleError(p)}))}),m.style.marginTop="6px",m.className="geBtn");E&&Editor.popupsAllowed&&(k.style.cursor="pointer",mxEvent.addGestureListeners(k,+null,null,function(P){mxEvent.isPopupTrigger(P)||y("_blank")}))}mxUtils.br(n);var K=document.createElement("div");K.style.textAlign="center";var V=0;K.style.marginTop="6px";n.appendChild(K);var Q=document.createElement("select");Q.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(F=document.createElement("option"),F.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(F,mxResources.get("googleDrive")),Q.appendChild(F),v(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(F=document.createElement("option"),F.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(F,mxResources.get("oneDrive")),Q.appendChild(F),b.mode==App.MODE_ONEDRIVE&&F.setAttribute("selected","selected"),v(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(F=document.createElement("option"),F.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(F,mxResources.get("dropbox")),Q.appendChild(F),b.mode==App.MODE_DROPBOX&&F.setAttribute("selected","selected"),v(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(F=document.createElement("option"),F.setAttribute("value",App.MODE_GITHUB),mxUtils.write(F,mxResources.get("github")),Q.appendChild(F),v(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(F=document.createElement("option"),F.setAttribute("value",App.MODE_GITLAB),mxUtils.write(F,mxResources.get("gitlab")),Q.appendChild(F),v(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(F=document.createElement("option"),F.setAttribute("value",App.MODE_TRELLO),mxUtils.write(F,mxResources.get("trello")),Q.appendChild(F),v(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)F=document.createElement("option"),F.setAttribute("value",App.MODE_DEVICE),mxUtils.write(F,mxResources.get("device")),Q.appendChild(F),b.mode!=App.MODE_DEVICE&&u||F.setAttribute("selected","selected"),D&&v(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);u&&isLocalStorage&&"0"!=urlParams.browser&&(u=document.createElement("option"),u.setAttribute("value",App.MODE_BROWSER),mxUtils.write(u,mxResources.get("browser")),Q.appendChild(u),b.mode==App.MODE_BROWSER&&u.setAttribute("selected","selected"),v(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));u=document.createElement("div");u.style.marginTop="26px";u.style.textAlign="center";null!=H&&(D=mxUtils.button(mxResources.get("help"),function(){b.openLink(H)}),D.className="geBtn",u.appendChild(D));D=mxUtils.button(mxResources.get(null!=c?"close":"cancel"),function(){null!=c?c():(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});D.className="geBtn";b.editor.cancelFirst&&null==c&&u.appendChild(D);null==c&&(F=mxUtils.button(mxResources.get("decideLater"),function(){y(null)}),F.className="geBtn",u.appendChild(F));E&&Editor.popupsAllowed&&(E=mxUtils.button(mxResources.get("openInNewWindow"),function(){y("_blank")}),E.className="geBtn",u.appendChild(E));CreateDialog.showDownloadButton&&(E=mxUtils.button(mxResources.get("download"),function(){y("download")}),E.className="geBtn",u.appendChild(E),null!=m&&(E.style.marginTop="6px",-u.style.marginTop="6px"));null!=m&&(mxUtils.br(u),u.appendChild(m));b.editor.cancelFirst&&null==c||u.appendChild(D);mxEvent.addListener(I,"keypress",function(O){13==O.keyCode?y(App.MODE_DEVICE):27==O.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});n.appendChild(u);this.container=n};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;+u.style.marginTop="6px"));null!=m&&(mxUtils.br(u),u.appendChild(m));b.editor.cancelFirst&&null==c||u.appendChild(D);mxEvent.addListener(I,"keypress",function(P){13==P.keyCode?y(App.MODE_DEVICE):27==P.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});n.appendChild(u);this.container=n};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;var PopupDialog=function(b,e,f,c,k){k=null!=k?k:!0;var n=document.createElement("div");n.style.textAlign="left";n.style.height="100%";mxUtils.write(n,mxResources.get("fileOpenLocation"));mxUtils.br(n);mxUtils.br(n);var q=mxUtils.button(mxResources.get("openInThisWindow"),function(){k&&b.hideDialog();null!=c&&c()});q.className="geBtn";q.style.marginBottom="8px";q.style.width="280px";n.appendChild(q);mxUtils.br(n);var u=mxUtils.button(mxResources.get("openInNewWindow"),function(){k&&b.hideDialog();null!=f&&f();b.openLink(e,null,!0)});u.className="geBtn gePrimaryBtn";u.style.width=q.style.width;n.appendChild(u);mxUtils.br(n);mxUtils.br(n);mxUtils.write(n,mxResources.get("allowPopups"));this.container=n},ImageDialog=function(b,e,f,c,k,n,q,u){function E(){0<L.value.length?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled");"data:"!=L.value.substring(0,5)?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}n=null!=n?n:!0;var H=b.editor.graph,D=document.createElement("div");mxUtils.write(D,e);e=document.createElement("div");e.className="geTitle";e.style.backgroundColor="transparent";e.style.borderColor="transparent";e.style.whiteSpace="nowrap";e.style.textOverflow="clip";e.style.cursor="default";e.style.paddingRight="20px";var L=document.createElement("input");L.setAttribute("value",f);L.setAttribute("type","text");L.setAttribute("spellcheck","false");L.setAttribute("autocorrect","off");L.setAttribute("autocomplete","off");L.setAttribute("autocapitalize","off");L.style.marginTop="6px";L.style.width=(Graph.fileSupport?460:340)-20+"px";L.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";L.style.backgroundRepeat="no-repeat";L.style.backgroundPosition="100% 50%";L.style.paddingRight="14px";f=document.createElement("div");f.setAttribute("title",mxResources.get("reset"));f.style.position="relative";f.style.left="-16px";f.style.width="12px";f.style.height="14px";f.style.cursor="pointer";f.style.display="inline-block";f.style.top="3px";f.style.background="url('"+b.editor.transparentImage+-"')";mxEvent.addListener(f,"click",function(){L.value="";L.focus()});e.appendChild(L);e.appendChild(f);D.appendChild(e);var F=u,d,g,m=function(I,K,J,V){var Q="data:"==I.substring(0,5);!b.isOffline()||Q&&"undefined"===typeof chrome?0<I.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(I,function(O){b.spinner.stop();b.hideDialog();var p=!1===V?1:null!=K&&null!=J?Math.max(K/O.width,J/O.height):Math.min(1,Math.min(520/O.width,520/O.height));n&&(I=b.convertDataUri(I));c(I,-Math.round(Number(O.width)*p),Math.round(Number(O.height)*p),F,d,g)},function(){b.spinner.stop();c(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),c(I,null,null,F,d,g)):(I=b.convertDataUri(I),K=null==K?120:K,J=null==J?100:J,b.hideDialog(),c(I,K,J,F,d,g))},t=function(I,K){if(null!=I){var J=k?null:H.getModel().getGeometry(H.getSelectionCell());null!=J?m(I,J.width,J.height,K):m(I,null,null,K)}else b.hideDialog(),c(null)};this.init=function(){L.focus();-if(Graph.fileSupport){L.setAttribute("placeholder",mxResources.get("dragImagesHere"));var I=D.parentNode,K=null;mxEvent.addListener(I,"dragleave",function(J){null!=K&&(K.parentNode.removeChild(K),K=null);J.stopPropagation();J.preventDefault()});mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(J){null==K&&(!mxClient.IS_IE||10<document.documentMode)&&(K=b.highlightElement(I));J.stopPropagation();J.preventDefault()}));mxEvent.addListener(I,"drop",mxUtils.bind(this,function(J){null!=K&&(K.parentNode.removeChild(K),-K=null);if(0<J.dataTransfer.files.length)b.importFiles(J.dataTransfer.files,0,0,b.maxImageSize,function(Q,O,p,z,A,C,M,S){t(Q,S)},function(){},function(Q){return"image/"==Q.type.substring(0,6)},function(Q){for(var O=0;O<Q.length;O++)Q[O]()},!mxEvent.isControlDown(J),null,null,!0);else if(0<=mxUtils.indexOf(J.dataTransfer.types,"text/uri-list")){var V=J.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(V)&&t(decodeURIComponent(V))}J.stopPropagation();J.preventDefault()}),+"')";mxEvent.addListener(f,"click",function(){L.value="";L.focus()});e.appendChild(L);e.appendChild(f);D.appendChild(e);var F=u,d,g,m=function(I,J,K,V){var Q="data:"==I.substring(0,5);!b.isOffline()||Q&&"undefined"===typeof chrome?0<I.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(I,function(P){b.spinner.stop();b.hideDialog();var p=!1===V?1:null!=J&&null!=K?Math.max(J/P.width,K/P.height):Math.min(1,Math.min(520/P.width,520/P.height));n&&(I=b.convertDataUri(I));c(I,+Math.round(Number(P.width)*p),Math.round(Number(P.height)*p),F,d,g)},function(){b.spinner.stop();c(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),c(I,null,null,F,d,g)):(I=b.convertDataUri(I),J=null==J?120:J,K=null==K?100:K,b.hideDialog(),c(I,J,K,F,d,g))},t=function(I,J){if(null!=I){var K=k?null:H.getModel().getGeometry(H.getSelectionCell());null!=K?m(I,K.width,K.height,J):m(I,null,null,J)}else b.hideDialog(),c(null)};this.init=function(){L.focus();+if(Graph.fileSupport){L.setAttribute("placeholder",mxResources.get("dragImagesHere"));var I=D.parentNode,J=null;mxEvent.addListener(I,"dragleave",function(K){null!=J&&(J.parentNode.removeChild(J),J=null);K.stopPropagation();K.preventDefault()});mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(K){null==J&&(!mxClient.IS_IE||10<document.documentMode)&&(J=b.highlightElement(I));K.stopPropagation();K.preventDefault()}));mxEvent.addListener(I,"drop",mxUtils.bind(this,function(K){null!=J&&(J.parentNode.removeChild(J),+J=null);if(0<K.dataTransfer.files.length)b.importFiles(K.dataTransfer.files,0,0,b.maxImageSize,function(Q,P,p,z,A,C,M,S){t(Q,S)},function(){},function(Q){return"image/"==Q.type.substring(0,6)},function(Q){for(var P=0;P<Q.length;P++)Q[P]()},!mxEvent.isControlDown(K),null,null,!0);else if(0<=mxUtils.indexOf(K.dataTransfer.types,"text/uri-list")){var V=K.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(V)&&t(decodeURIComponent(V))}K.stopPropagation();K.preventDefault()}),!1)}};u=document.createElement("div");u.style.marginTop="14px";u.style.textAlign="center";f=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});f.className="geBtn";b.editor.cancelFirst&&u.appendChild(f);ImageDialog.filePicked=function(I){I.action==google.picker.Action.PICKED&&null!=I.docs[0].thumbnails&&(I=I.docs[0].thumbnails[I.docs[0].thumbnails.length-1],null!=I&&(L.value=I.url));L.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var v=document.createElement("input");-v.setAttribute("multiple","multiple");v.setAttribute("type","file");mxEvent.addListener(v,"change",function(I){null!=v.files&&(b.importFiles(v.files,0,0,b.maxImageSize,function(K,J,V,Q,O,p){t(K)},function(){},function(K){return"image/"==K.type.substring(0,6)},function(K){for(var J=0;J<K.length;J++)K[J]()},!0),v.type="",v.type="file",v.value="")});v.style.display="none";document.body.appendChild(v);b.imgDlgFileInputElt=v}e=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});-e.className="geBtn";u.appendChild(e)}mxEvent.addListener(L,"keypress",function(I){13==I.keyCode&&t(L.value)});var y=mxUtils.button(mxResources.get("crop"),function(){var I=new CropImageDialog(b,L.value,F,function(K,J,V){F=K;d=J;g=V});b.showDialog(I.container,300,390,!0,!0)});q&&(y.className="geBtn",u.appendChild(y));var B=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=L.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var I=b.editor.createImageUrlConverter().convert(L.value),-K=new Image;K.onload=function(){b.editor.convertImageToDataUri(I,function(J){b.confirmImageResize(function(V){b.resizeImage(K,J,mxUtils.bind(this,function(Q,O,p){b.spinner.stop();null!=Q&&Q.length<b.maxImageBytes?(L.value=Q,E()):b.handleError({message:mxResources.get("imageTooBig")})}),V,b.maxImageSize)},K.width>b.maxImageSize||K.height>b.maxImageSize||J.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};K.onerror=function(){b.spinner.stop();-b.handleError({message:mxResources.get("fileNotFound")})};K.src=I}});B.className="geBtn";mxEvent.addListener(L,"change",function(I){F=null;E()});E();u.appendChild(B);q=mxUtils.button(mxResources.get("apply"),function(){t(L.value)});q.className="geBtn gePrimaryBtn";u.appendChild(q);b.editor.cancelFirst||u.appendChild(f);Graph.fileSupport&&(u.style.marginTop="120px",D.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",D.style.backgroundPosition="center 65%",D.style.backgroundRepeat="no-repeat",-q=document.createElement("div"),q.style.position="absolute",q.style.width="420px",q.style.top="58%",q.style.textAlign="center",q.style.fontSize="18px",q.style.color="#a0c3ff",mxUtils.write(q,mxResources.get("dragImagesHere")),D.appendChild(q));D.appendChild(u);this.container=D},LinkDialog=function(b,e,f,c,k,n,q){function u(I,K){var J=document.createElement("option");mxUtils.write(J,mxResources.get(I));J.value=I;y.appendChild(J);B[I]=K}var E=document.createElement("div");E.style.height="100%";mxUtils.write(E,+v.setAttribute("multiple","multiple");v.setAttribute("type","file");mxEvent.addListener(v,"change",function(I){null!=v.files&&(b.importFiles(v.files,0,0,b.maxImageSize,function(J,K,V,Q,P,p){t(J)},function(){},function(J){return"image/"==J.type.substring(0,6)},function(J){for(var K=0;K<J.length;K++)J[K]()},!0),v.type="",v.type="file",v.value="")});v.style.display="none";document.body.appendChild(v);b.imgDlgFileInputElt=v}e=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});+e.className="geBtn";u.appendChild(e)}mxEvent.addListener(L,"keypress",function(I){13==I.keyCode&&t(L.value)});var y=mxUtils.button(mxResources.get("crop"),function(){var I=new CropImageDialog(b,L.value,F,function(J,K,V){F=J;d=K;g=V});b.showDialog(I.container,300,390,!0,!0)});q&&(y.className="geBtn",u.appendChild(y));var B=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=L.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var I=b.editor.createImageUrlConverter().convert(L.value),+J=new Image;J.onload=function(){b.editor.convertImageToDataUri(I,function(K){b.confirmImageResize(function(V){b.resizeImage(J,K,mxUtils.bind(this,function(Q,P,p){b.spinner.stop();null!=Q&&Q.length<b.maxImageBytes?(L.value=Q,E()):b.handleError({message:mxResources.get("imageTooBig")})}),V,b.maxImageSize)},J.width>b.maxImageSize||J.height>b.maxImageSize||K.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};J.onerror=function(){b.spinner.stop();+b.handleError({message:mxResources.get("fileNotFound")})};J.src=I}});B.className="geBtn";mxEvent.addListener(L,"change",function(I){F=null;E()});E();u.appendChild(B);q=mxUtils.button(mxResources.get("apply"),function(){t(L.value)});q.className="geBtn gePrimaryBtn";u.appendChild(q);b.editor.cancelFirst||u.appendChild(f);Graph.fileSupport&&(u.style.marginTop="120px",D.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",D.style.backgroundPosition="center 65%",D.style.backgroundRepeat="no-repeat",+q=document.createElement("div"),q.style.position="absolute",q.style.width="420px",q.style.top="58%",q.style.textAlign="center",q.style.fontSize="18px",q.style.color="#a0c3ff",mxUtils.write(q,mxResources.get("dragImagesHere")),D.appendChild(q));D.appendChild(u);this.container=D},LinkDialog=function(b,e,f,c,k,n,q){function u(I,J){var K=document.createElement("option");mxUtils.write(K,mxResources.get(I));K.value=I;y.appendChild(K);B[I]=J}var E=document.createElement("div");E.style.height="100%";mxUtils.write(E,mxResources.get("editLink")+":");var H=document.createElement("div");H.className="geTitle";H.style.backgroundColor="transparent";H.style.borderColor="transparent";H.style.whiteSpace="nowrap";H.style.textOverflow="clip";H.style.cursor="default";var D=document.createElement("input");D.setAttribute("placeholder",mxResources.get("dragUrlsHere"));D.setAttribute("type","text");D.style.marginTop="6px";D.style.width="414px";D.style.boxSizing="border-box";D.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";D.style.backgroundRepeat="no-repeat";D.style.backgroundPosition="100% 50%";D.style.paddingRight="14px";D.style.marginBottom="4px";var L=document.createElement("div");L.setAttribute("title",mxResources.get("reset"));L.style.position="relative";L.style.left="-16px";L.style.width="12px";L.style.height="14px";L.style.cursor="pointer";L.style.display="inline-block";L.style.top="3px";L.style.background="url('"+b.editor.transparentImage+"')";mxEvent.addListener(L,"click",function(){D.value="";D.focus()});var F=document.createElement("input");F.style.cssText="margin-right:8px;margin-bottom:8px;";F.setAttribute("value","url");F.setAttribute("type","radio");F.setAttribute("name","geLinkDialogOption");var d=document.createElement("input");d.style.cssText="margin-right:8px;margin-bottom:8px;";d.setAttribute("value","url");d.setAttribute("type","radio");d.setAttribute("name","geLinkDialogOption");var g=document.createElement("select");g.style.width="414px";var m=document.createElement("input");m.setAttribute("type","checkbox");m.style.margin="0 6p 0 6px";null!=q&&(m.setAttribute("checked","checked"),m.defaultChecked=!0);q=null!=q?q:"_blank";m.setAttribute("title",q);n&&(D.style.width="200px");if(k&&null!=b.pages){null!=e&&Graph.isPageLink(e)?(d.setAttribute("checked","checked"),d.defaultChecked=!0):(D.setAttribute("value",e),F.setAttribute("checked","checked"),F.defaultChecked=!0);H.appendChild(F);H.appendChild(D);H.appendChild(L);n&&(H.appendChild(m),mxUtils.write(H,mxResources.get("openInNewWindow")));mxUtils.br(H);H.appendChild(d);k=!1;for(n=0;n<b.pages.length;n++)L=document.createElement("option"),mxUtils.write(L,b.pages[n].getName()||mxResources.get("pageWithNumber",[n+1])),L.setAttribute("value","data:page/id,"+b.pages[n].getId()),e==L.getAttribute("value")&&(L.setAttribute("selected","selected"),k=!0),g.appendChild(L);if(!k&&d.checked){var t=document.createElement("option");mxUtils.write(t,mxResources.get("pageNotFound"));t.setAttribute("disabled","disabled");t.setAttribute("selected","selected");t.setAttribute("value","pageNotFound");g.appendChild(t);mxEvent.addListener(g,"change",function(){null==t.parentNode||t.selected||t.parentNode.removeChild(t)})}H.appendChild(g)}else D.setAttribute("value",e),H.appendChild(D),H.appendChild(L);E.appendChild(H);var v=mxUtils.button(f,function(){b.hideDialog();c(d.checked?"pageNotFound"!==g.value?g.value:e:D.value,LinkDialog.selectedDocs,m.checked?q:null)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=function(){d.checked?g.focus():(D.focus(),mxClient.IS_GC||-mxClient.IS_FF||5<=document.documentMode?D.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(g,"focus",function(){F.removeAttribute("checked");d.setAttribute("checked","checked");d.checked=!0});mxEvent.addListener(D,"focus",function(){d.removeAttribute("checked");F.setAttribute("checked","checked");F.checked=!0});if(Graph.fileSupport){var I=E.parentNode,K=null;mxEvent.addListener(I,"dragleave",function(J){null!=K&&(K.parentNode.removeChild(K),K=null);J.stopPropagation();J.preventDefault()});-mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(J){null==K&&(!mxClient.IS_IE||10<document.documentMode)&&(K=b.highlightElement(I));J.stopPropagation();J.preventDefault()}));mxEvent.addListener(I,"drop",mxUtils.bind(this,function(J){try{null!=K&&(K.parentNode.removeChild(K),K=null),0<=mxUtils.indexOf(J.dataTransfer.types,"text/uri-list")&&(D.value=decodeURIComponent(J.dataTransfer.getData("text/uri-list")),F.setAttribute("checked","checked"),F.checked=!0,v.click())}catch(V){b.handleError(V)}J.stopPropagation();-J.preventDefault()}),!1)}};f=document.createElement("div");f.style.marginTop="16px";f.style.textAlign="right";b.isOffline()||f.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));H=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});H.style.verticalAlign="middle";H.className="geBtn";b.editor.cancelFirst&&f.appendChild(H);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(I){if(I.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=I.docs;-var K=I.docs[0].url;"application/mxe"==I.docs[0].mimeType||null!=I.docs[0].mimeType&&"application/vnd.jgraph."==I.docs[0].mimeType.substring(0,23)?K="https://www.draw.io/#G"+I.docs[0].id:"application/vnd.google-apps.folder"==I.docs[0].mimeType&&(K="https://drive.google.com/#folders/"+I.docs[0].id);D.value=K;D.focus()}else LinkDialog.selectedDocs=null;D.focus()};var y=document.createElement("select");y.className="geBtn";y.style.position="relative";y.style.top="1px";y.style.maxWidth="120px";var B={};-k=document.createElement("option");mxUtils.write(k,mxResources.get("select")+"...");k.value="";y.appendChild(k);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&u("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==b.linkPicker){var I=b.drive.createLinkPicker();b.linkPicker=I.setCallback(function(K){LinkDialog.filePicked(K)}).build()}b.linkPicker.setVisible(!0)}))});-"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&u("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(I){D.value=I[0].link;D.focus()}})});null!=b.oneDrive&&u("oneDrive",function(){b.oneDrive.pickFile(function(I,K){null!=K&&null!=K.value&&0<K.value.length&&(D.value=K.value[0].webUrl,D.focus())},!0)});null!=b.gitHub&&u("github",function(){b.gitHub.pickFile(function(I){if(null!=I){I=I.split("/");var K=I[0],J=I[1],V=I[2];I=I.slice(3,I.length).join("/");-D.value="https://github.com/"+K+"/"+J+"/blob/"+V+"/"+I;D.focus()}})});null!=b.gitLab&&u("gitlab",function(){b.gitLab.pickFile(function(I){if(null!=I){I=I.split("/");var K=I[0],J=I[1],V=I[2];I=I.slice(3,I.length).join("/");D.value=DRAWIO_GITLAB_URL+"/"+K+"/"+J+"/blob/"+V+"/"+I;D.focus()}})});1<y.children.length&&(f.appendChild(y),mxEvent.addListener(y,"change",function(I){null!=B[y.value]&&(B[y.value](),y.value="")}));mxEvent.addListener(D,"keypress",function(I){13==I.keyCode&&v.click()});f.appendChild(v);+mxClient.IS_FF||5<=document.documentMode?D.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(g,"focus",function(){F.removeAttribute("checked");d.setAttribute("checked","checked");d.checked=!0});mxEvent.addListener(D,"focus",function(){d.removeAttribute("checked");F.setAttribute("checked","checked");F.checked=!0});if(Graph.fileSupport){var I=E.parentNode,J=null;mxEvent.addListener(I,"dragleave",function(K){null!=J&&(J.parentNode.removeChild(J),J=null);K.stopPropagation();K.preventDefault()});+mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(K){null==J&&(!mxClient.IS_IE||10<document.documentMode)&&(J=b.highlightElement(I));K.stopPropagation();K.preventDefault()}));mxEvent.addListener(I,"drop",mxUtils.bind(this,function(K){try{null!=J&&(J.parentNode.removeChild(J),J=null),0<=mxUtils.indexOf(K.dataTransfer.types,"text/uri-list")&&(D.value=decodeURIComponent(K.dataTransfer.getData("text/uri-list")),F.setAttribute("checked","checked"),F.checked=!0,v.click())}catch(V){b.handleError(V)}K.stopPropagation();+K.preventDefault()}),!1)}};f=document.createElement("div");f.style.marginTop="16px";f.style.textAlign="right";b.isOffline()||f.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));H=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});H.style.verticalAlign="middle";H.className="geBtn";b.editor.cancelFirst&&f.appendChild(H);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(I){if(I.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=I.docs;+var J=I.docs[0].url;"application/mxe"==I.docs[0].mimeType||null!=I.docs[0].mimeType&&"application/vnd.jgraph."==I.docs[0].mimeType.substring(0,23)?J="https://www.draw.io/#G"+I.docs[0].id:"application/vnd.google-apps.folder"==I.docs[0].mimeType&&(J="https://drive.google.com/#folders/"+I.docs[0].id);D.value=J;D.focus()}else LinkDialog.selectedDocs=null;D.focus()};var y=document.createElement("select");y.className="geBtn";y.style.position="relative";y.style.top="1px";y.style.maxWidth="120px";var B={};+k=document.createElement("option");mxUtils.write(k,mxResources.get("select")+"...");k.value="";y.appendChild(k);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&u("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==b.linkPicker){var I=b.drive.createLinkPicker();b.linkPicker=I.setCallback(function(J){LinkDialog.filePicked(J)}).build()}b.linkPicker.setVisible(!0)}))});+"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&u("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(I){D.value=I[0].link;D.focus()}})});null!=b.oneDrive&&u("oneDrive",function(){b.oneDrive.pickFile(function(I,J){null!=J&&null!=J.value&&0<J.value.length&&(D.value=J.value[0].webUrl,D.focus())},!0)});null!=b.gitHub&&u("github",function(){b.gitHub.pickFile(function(I){if(null!=I){I=I.split("/");var J=I[0],K=I[1],V=I[2];I=I.slice(3,I.length).join("/");+D.value="https://github.com/"+J+"/"+K+"/blob/"+V+"/"+I;D.focus()}})});null!=b.gitLab&&u("gitlab",function(){b.gitLab.pickFile(function(I){if(null!=I){I=I.split("/");var J=I[0],K=I[1],V=I[2];I=I.slice(3,I.length).join("/");D.value=DRAWIO_GITLAB_URL+"/"+J+"/"+K+"/blob/"+V+"/"+I;D.focus()}})});1<y.children.length&&(f.appendChild(y),mxEvent.addListener(y,"change",function(I){null!=B[y.value]&&(B[y.value](),y.value="")}));mxEvent.addListener(D,"keypress",function(I){13==I.keyCode&&v.click()});f.appendChild(v);b.editor.cancelFirst||f.appendChild(H);E.appendChild(f);this.container=E},FeedbackDialog=function(b,e,f,c){var k=document.createElement("div"),n=document.createElement("div");mxUtils.write(n,mxResources.get("sendYourFeedback"));n.style.fontSize="18px";n.style.marginBottom="18px";k.appendChild(n);n=document.createElement("div");mxUtils.write(n,mxResources.get("yourEmailAddress")+(f?"":" ("+mxResources.get("required")+")"));k.appendChild(n);var q=document.createElement("input");q.setAttribute("type","text");q.style.marginTop="6px";q.style.width="600px";var u=mxUtils.button(mxResources.get("sendMessage"),function(){var L=D.value+(H.checked?"\nDiagram:\n"+(null!=c?c:mxUtils.getXml(b.getXmlFileData())):"")+"\nuserAgent:\n"+navigator.userAgent+"\nappVersion:\n"+navigator.appVersion+"\nappName:\n"+navigator.appName+"\nplatform:\n"+navigator.platform;L.length>FeedbackDialog.maxAttachmentSize?b.alert(mxResources.get("drawingTooLarge")):(b.hideDialog(),b.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(q.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent((null!=e?e:"Feedback")+":\n"+L),function(F){b.spinner.stop();200<=F.getStatus()&&299>=F.getStatus()?b.alert(mxResources.get("feedbackSent")):b.alert(mxResources.get("errorSendingFeedback"))},function(){b.spinner.stop();b.alert(mxResources.get("errorSendingFeedback"))}))});u.className=@@ -12447,54 +12447,54 @@ f.appendChild(n));k.appendChild(f);this.container=k};FeedbackDialog.maxAttachmenvar RevisionDialog=function(b,e,f){var c=document.createElement("div"),k=document.createElement("h3");k.style.marginTop="3px";mxUtils.write(k,mxResources.get("revisionHistory"));c.appendChild(k);k=document.createElement("div");k.style.position="absolute";k.style.overflow="auto";k.style.width="170px";k.style.height="378px";c.appendChild(k);var n=document.createElement("div");n.style.position="absolute";n.style.left="200px";n.style.width="470px";n.style.height="376px";n.style.overflow="hidden";n.style.borderWidth="1px";n.style.borderStyle="solid";var q=document.createElement("div");q.style.position="absolute";q.style.display="none";q.style.textAlign="center";q.style.padding="8px";q.style.borderRadius="8px";q.style.left="50%";q.style.top="50%";q.style.whiteSpace="nowrap";q.style.transform="translate(-50%, -50%)";q.style.background="inherit";q.style.border="1px solid";n.appendChild(q);mxEvent.disableContextMenu(n);c.appendChild(n);var u=new Graph(n);u.setTooltips(!1);u.setEnabled(!1);u.setPanning(!0);u.panningHandler.ignoreCell=!0;u.panningHandler.useLeftButtonForPanning=!0;u.minFitScale=null;u.maxFitScale=null;u.centerZoom=!0;var E=0,H=null,D=0,L=u.getGlobalVariable;u.getGlobalVariable=function(X){return"page"==X&&null!=H&&null!=H[D]?H[D].getAttribute("name"):"pagenumber"==X?D+1:"pagecount"==X?null!=H?H.length:1:L.apply(this,arguments)};u.getLinkForCell=function(){return null};for(var F=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,-shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),d=b.getCurrentFile(),g=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),m={},t=0;t<g.length;t++)m[g[t].getAttribute("id")]=g[t];var v=null,y=null,B=null,I=null,K=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=B&&u.zoomIn()},20);K.setAttribute("disabled","disabled");var J=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=B&&u.zoomOut()},20);J.setAttribute("disabled",-"disabled");var V=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=B&&(1==u.view.scale?(u.maxFitScale=8,u.fit(8)):u.zoomActual(),u.center())},20);V.setAttribute("disabled","disabled");var Q=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"),null,20);Q.setAttribute("disabled","disabled");var O=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"),null,20);O.setAttribute("disabled","disabled");var p=n.cloneNode(!1);p.style.pointerEvent=+shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),d=b.getCurrentFile(),g=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),m={},t=0;t<g.length;t++)m[g[t].getAttribute("id")]=g[t];var v=null,y=null,B=null,I=null,J=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=B&&u.zoomIn()},20);J.setAttribute("disabled","disabled");var K=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=B&&u.zoomOut()},20);K.setAttribute("disabled",+"disabled");var V=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=B&&(1==u.view.scale?(u.maxFitScale=8,u.fit(8)):u.zoomActual(),u.center())},20);V.setAttribute("disabled","disabled");var Q=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"),null,20);Q.setAttribute("disabled","disabled");var P=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"),null,20);P.setAttribute("disabled","disabled");var p=n.cloneNode(!1);p.style.pointerEvent="none";n.parentNode.appendChild(p);var z=new Graph(p);z.setTooltips(!1);z.setEnabled(!1);z.setPanning(!0);z.panningHandler.ignoreCell=!0;z.panningHandler.useLeftButtonForPanning=!0;z.minFitScale=null;z.maxFitScale=null;z.centerZoom=!0;var A=document.createElement("div");A.style.textAlign="left";A.style.color="gray";A.style.backgroundColor="transparent";A.style.overflow="hidden";A.style.textOverflow="ellipsis";A.style.whiteSpace="nowrap";A.style.cursor="default";A.style.height="100%";A.style.display="inline-flex";A.style.alignItems="center";A.style.flexGrow="1";mxEvent.addListener(A,"click",function(){var X=mxUtils.getTextContent(A);""!=X&&b.alert(X)});var C=null;mxEvent.addGestureListeners(Q,function(X){try{var Y=null!=H[E]?m[H[E].getAttribute("id")]:null;mxUtils.setOpacity(Q,20);q.innerText="";if(null==Y)q.style.display="inline-block",mxUtils.write(q,mxResources.get("pageNotFound"));else{C=A.innerHTML;A.innerHTML=mxResources.get("current");n.style.display="none";p.style.display="";p.style.backgroundColor=n.style.backgroundColor;var Z=Editor.parseDiagramNode(Y);(new mxCodec(Z.ownerDocument)).decode(Z,z.getModel());z.view.scaleAndTranslate(u.view.scale,u.view.translate.x,u.view.translate.y);z.mathEnabled="1"==Z.getAttribute("math");z.setAdaptiveColors(Z.getAttribute("adaptiveColors"));Editor.MathJaxRender&&z.mathEnabled&&Editor.MathJaxRender(z.container)}}catch(ba){q.style.display="inline-block",q.innerText="",mxUtils.write(q,mxResources.get("pageNotFound")+": "+ba.message)}},null,function(){mxUtils.setOpacity(Q,-60);q.style.display="none";q.innerText="";"none"==n.style.display&&(n.style.display="",A.innerHTML=C,p.style.display="none")});mxEvent.addListener(O,"click",mxUtils.bind(this,function(X){null!=B&&(X=b.getPagesForNode(B.documentElement),X=b.diffPages(b.pages,X),X=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(X,null,2),function(Y){try{if(0<Y.length&&b.editor.graph.isEnabled()){var Z=[JSON.parse(Y)];b.confirm(mxResources.get("areYouSure"),function(){try{d.patch(Z,null,!0,!0),b.hideDialog(),+60);q.style.display="none";q.innerText="";"none"==n.style.display&&(n.style.display="",A.innerHTML=C,p.style.display="none")});mxEvent.addListener(P,"click",mxUtils.bind(this,function(X){null!=B&&(X=b.getPagesForNode(B.documentElement),X=b.diffPages(b.pages,X),X=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(X,null,2),function(Y){try{if(0<Y.length&&b.editor.graph.isEnabled()){var Z=[JSON.parse(Y)];b.confirm(mxResources.get("areYouSure"),function(){try{d.patch(Z,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(ba){b.handleError(ba)}})}else b.hideDialog()}catch(ba){b.handleError(ba)}},null,null,null,null,null,!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close")),b.showDialog(X.container,620,460,!0,!0),X.init())}));var M=mxUtils.button(mxResources.get("restore"),function(X){null!=B&&null!=I&&b.confirm(mxResources.get("areYouSure"),function(){null!=f?f(I):b.spinner.spin(document.body,mxResources.get("restoring"))&&(M.setAttribute("disabled","disabled"),d.save(!0,function(Y){b.spinner.stop();M.removeAttribute("disabled");b.replaceFileData(I);b.hideDialog()},function(Y){b.spinner.stop();M.removeAttribute("disabled");b.editor.setStatus("");b.handleError(Y,null!=Y?mxResources.get("errorSavingFile"):null)}))})});M.className="geBtn gePrimaryBtn";M.setAttribute("disabled","disabled");var S=document.createElement("select");S.setAttribute("disabled","disabled");S.style.userSelect="none";S.style.maxWidth="100px";S.style.marginLeft="10px";S.style.display="none";var l=null;mxEvent.addListener(S,"change",function(X){null!=l&&(l(X),mxEvent.consume(X))});var x=mxUtils.button(mxResources.get("open"),function(){null!=B&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(B.documentElement)),b.openLink(b.getUrl(),null,!0))});x.className="geBtn";x.setAttribute("disabled","disabled");var G=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});G.className="geBtn";G.setAttribute("disabled","disabled");null!=-f&&(x.style.display="none");g=document.createElement("div");g.style.position="absolute";g.style.top="482px";g.style.right="28px";g.style.left="32px";g.style.justifyContent="end";g.style.display="flex";var N=document.createElement("div");N.className="geToolbarContainer";N.style.backgroundColor="transparent";N.style.display="flex";N.style.alignItems="center";N.style.justifyContent="stretch";N.style.left="32px";N.style.right="32px";N.style.border="none";N.style.top="440px";N.style.height="28px";var P=+f&&(x.style.display="none");g=document.createElement("div");g.style.position="absolute";g.style.top="482px";g.style.right="28px";g.style.left="32px";g.style.justifyContent="end";g.style.display="flex";var N=document.createElement("div");N.className="geToolbarContainer";N.style.backgroundColor="transparent";N.style.display="flex";N.style.alignItems="center";N.style.justifyContent="stretch";N.style.left="32px";N.style.right="32px";N.style.border="none";N.style.top="440px";N.style.height="28px";var O=null;if(null!=e&&0<e.length){n.style.cursor="move";var R=document.createElement("table");R.style.borderWidth="1px";R.style.borderStyle="solid";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width="100%";var T=document.createElement("tbody"),U=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(E=mxUtils.indexOf(b.pages,b.currentPage));for(t=e.length-1;0<=t;t--){var W=function(X){var Y=new Date(X.modifiedDate),Z=null;if(0<=Y.getTime()){var ba=function(ca){F.stop();-q.innerText="";var da=mxUtils.parseXml(ca),ja=b.editor.extractGraphModel(da.documentElement,!0);if(null!=ja){var aa=function(fa){null!=fa&&(fa=ia(Editor.parseDiagramNode(fa)));return fa},ia=function(fa){var pa=fa.getAttribute("background");if(null==pa||""==pa||pa==mxConstants.NONE)pa=u.defaultPageBackgroundColor;n.style.backgroundColor=mxUtils.getLightDarkColor(pa);(new mxCodec(fa.ownerDocument)).decode(fa,u.getModel());u.maxFitScale=1;u.fit(8);u.center();u.mathEnabled="1"==fa.getAttribute("math");-u.setAdaptiveColors(fa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&u.mathEnabled&&Editor.MathJaxRender(u.container);return fa};S.style.display="none";S.innerText="";B=da;I=ca;H=parseSelectFunction=null;D=0;if("mxfile"==ja.nodeName){da=ja.getElementsByTagName("diagram");H=[];for(ca=0;ca<da.length;ca++)H.push(da[ca]);D=Math.min(E,H.length-1);0<H.length&&aa(H[D]);if(1<H.length)for(S.removeAttribute("disabled"),S.style.display="",ca=0;ca<H.length;ca++){da=document.createElement("option");da.setAttribute("title",-ka+" ("+H[ca].getAttribute("id")+")");da.setAttribute("value",ca);var ka=H[ca].getAttribute("name")||mxResources.get("pageWithNumber",[ca+1]);ja=b.getPageById(H[ca].getAttribute("id"));var ua="";if(null!=ja){var sa=new DiagramPage(H[ca]);b.getHashValueForPages([ja])!=b.getHashValueForPages([sa])&&(ua=" (M)")}else ua=" (X)";mxUtils.write(da,ka+ua);ca==D&&da.setAttribute("selected","selected");S.appendChild(da)}l=function(){try{var fa=parseInt(S.value);D=E=fa;aa(H[fa])}catch(pa){S.value=E,b.handleError(pa)}}}else ia(ja);-ka=X.lastModifyingUserName;null!=ka&&20<ka.length&&(ka=ka.substring(0,20)+"...");A.innerText="";mxUtils.write(A,(null!=ka?ka+" ":"")+Y.toLocaleDateString()+" "+Y.toLocaleTimeString());A.setAttribute("title",Z.getAttribute("title"));K.removeAttribute("disabled");J.removeAttribute("disabled");V.removeAttribute("disabled");Q.removeAttribute("disabled");O.removeAttribute("disabled");null!=d&&d.isRestricted()||(b.editor.graph.isEnabled()&&M.removeAttribute("disabled"),x.removeAttribute("disabled"),G.removeAttribute("disabled"));-mxUtils.setOpacity(K,60);mxUtils.setOpacity(J,60);mxUtils.setOpacity(V,60);mxUtils.setOpacity(Q,60);mxUtils.setOpacity(O,60)}else S.style.display="none",S.innerText="",A.innerText="",q.innerText="",mxUtils.write(A,mxResources.get("errorLoadingFile")),mxUtils.write(q,mxResources.get("errorLoadingFile"))};Z=document.createElement("tr");Z.style.borderBottomWidth="1px";Z.style.borderBottomStyle="solid";Z.style.fontSize="12px";Z.style.cursor="pointer";var ha=document.createElement("td");ha.style.padding=-"6px";ha.style.whiteSpace="nowrap";X==e[e.length-1]?mxUtils.write(ha,mxResources.get("current")):Y.toDateString()===U?mxUtils.write(ha,Y.toLocaleTimeString()):mxUtils.write(ha,Y.toLocaleDateString()+" "+Y.toLocaleTimeString());Z.appendChild(ha);Z.setAttribute("title",Y.toLocaleDateString()+" "+Y.toLocaleTimeString()+(null!=X.fileSize?" "+b.formatFileSize(parseInt(X.fileSize)):"")+(null!=X.lastModifyingUserName?" "+X.lastModifyingUserName:""));mxEvent.addListener(Z,"click",function(ca){y!=X&&(F.stop(),-null!=v&&(v.style.backgroundColor=""),y=X,v=Z,v.style.backgroundColor="light-dark(#ebf2f9, #000000)",I=B=null,A.removeAttribute("title"),A.innerText=mxResources.get("loading")+"...",n.style.backgroundColor=u.defaultPageBackgroundColor,q.innerText="",u.getModel().clear(),M.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),V.setAttribute("disabled","disabled"),Q.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"),x.setAttribute("disabled",-"disabled"),S.setAttribute("disabled","disabled"),mxUtils.setOpacity(K,20),mxUtils.setOpacity(J,20),mxUtils.setOpacity(V,20),mxUtils.setOpacity(Q,20),mxUtils.setOpacity(O,20),F.spin(n),X.getXml(function(da){if(y==X)try{ba(da)}catch(ja){A.innerText=mxResources.get("error")+": "+ja.message}},function(da){F.stop();S.style.display="none";S.innerText="";A.innerText="";mxUtils.write(A,mxResources.get("errorLoadingFile"));mxUtils.write(q,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ca))});mxEvent.addListener(Z,-"dblclick",function(ca){x.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ca)},!1);T.appendChild(Z)}return Z}(e[t]);null!=W&&t==e.length-1&&(P=W)}R.appendChild(T);k.appendChild(R)}else null==d||null==b.drive&&d.constructor==window.DriveFile||null==b.dropbox&&d.constructor==window.DropboxFile?(n.style.display="none",N.style.display="none",mxUtils.write(k,mxResources.get("notAvailable"))):(n.style.display="none",N.style.display=-"none",mxUtils.write(k,mxResources.get("noRevisions")));this.init=function(){null!=P&&P.click()};k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});k.className="geBtn";N.appendChild(A);N.appendChild(Q);N.appendChild(J);N.appendChild(V);N.appendChild(K);N.appendChild(S);N.appendChild(O);b.editor.cancelFirst&&g.appendChild(k);g.appendChild(x);null!=d&&d.constructor==DriveFile&&g.appendChild(G);g.appendChild(M);b.editor.cancelFirst||g.appendChild(k);c.appendChild(g);c.appendChild(N);-this.container=c},DraftDialog=function(b,e,f,c,k,n,q,u,E){var H=document.createElement("div"),D=document.createElement("div");D.style.marginTop="0px";D.style.whiteSpace="nowrap";D.style.overflow="auto";D.style.lineHeight="normal";mxUtils.write(D,e);H.appendChild(D);var L=document.createElement("select"),F=mxUtils.bind(this,function(){"-1"==L.value?(L.value=L.options[0].value,F(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var Q=this,O;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){for(O=-0;O<E.length;O++)k.apply(Q,[O,mxUtils.bind(Q,function(){})]);b.hideDialog(!0);p.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(y=mxUtils.parseXml(E[L.value].data),B=b.editor.extractGraphModel(y.documentElement,!0),I=0,this.init())});if(null!=E){L.style.marginLeft="4px";for(e=0;e<E.length;e++){var d=document.createElement("option");d.setAttribute("value",e);var g=new Date(E[e].created),m=new Date(E[e].modified);mxUtils.write(d,g.toLocaleDateString()+" "+g.toLocaleTimeString()+" - "++q.innerText="";var da=mxUtils.parseXml(ca),ja=b.editor.extractGraphModel(da.documentElement,!0);if(null!=ja){var aa=function(ha){null!=ha&&(ha=ia(Editor.parseDiagramNode(ha)));return ha},ia=function(ha){var pa=ha.getAttribute("background");if(null==pa||""==pa||pa==mxConstants.NONE)pa=u.defaultPageBackgroundColor;n.style.backgroundColor=mxUtils.getLightDarkColor(pa);(new mxCodec(ha.ownerDocument)).decode(ha,u.getModel());u.maxFitScale=1;u.fit(8);u.center();u.mathEnabled="1"==ha.getAttribute("math");+u.setAdaptiveColors(ha.getAttribute("adaptiveColors"));Editor.MathJaxRender&&u.mathEnabled&&Editor.MathJaxRender(u.container);return ha};S.style.display="none";S.innerText="";B=da;I=ca;H=parseSelectFunction=null;D=0;if("mxfile"==ja.nodeName){da=ja.getElementsByTagName("diagram");H=[];for(ca=0;ca<da.length;ca++)H.push(da[ca]);D=Math.min(E,H.length-1);0<H.length&&aa(H[D]);if(1<H.length)for(S.removeAttribute("disabled"),S.style.display="",ca=0;ca<H.length;ca++){da=document.createElement("option");da.setAttribute("title",+ka+" ("+H[ca].getAttribute("id")+")");da.setAttribute("value",ca);var ka=H[ca].getAttribute("name")||mxResources.get("pageWithNumber",[ca+1]);ja=b.getPageById(H[ca].getAttribute("id"));var ua="";if(null!=ja){var sa=new DiagramPage(H[ca]);b.getHashValueForPages([ja])!=b.getHashValueForPages([sa])&&(ua=" (M)")}else ua=" (X)";mxUtils.write(da,ka+ua);ca==D&&da.setAttribute("selected","selected");S.appendChild(da)}l=function(){try{var ha=parseInt(S.value);D=E=ha;aa(H[ha])}catch(pa){S.value=E,b.handleError(pa)}}}else ia(ja);+ka=X.lastModifyingUserName;null!=ka&&20<ka.length&&(ka=ka.substring(0,20)+"...");A.innerText="";mxUtils.write(A,(null!=ka?ka+" ":"")+Y.toLocaleDateString()+" "+Y.toLocaleTimeString());A.setAttribute("title",Z.getAttribute("title"));J.removeAttribute("disabled");K.removeAttribute("disabled");V.removeAttribute("disabled");Q.removeAttribute("disabled");P.removeAttribute("disabled");null!=d&&d.isRestricted()||(b.editor.graph.isEnabled()&&M.removeAttribute("disabled"),x.removeAttribute("disabled"),G.removeAttribute("disabled"));+mxUtils.setOpacity(J,60);mxUtils.setOpacity(K,60);mxUtils.setOpacity(V,60);mxUtils.setOpacity(Q,60);mxUtils.setOpacity(P,60)}else S.style.display="none",S.innerText="",A.innerText="",q.innerText="",mxUtils.write(A,mxResources.get("errorLoadingFile")),mxUtils.write(q,mxResources.get("errorLoadingFile"))};Z=document.createElement("tr");Z.style.borderBottomWidth="1px";Z.style.borderBottomStyle="solid";Z.style.fontSize="12px";Z.style.cursor="pointer";var fa=document.createElement("td");fa.style.padding=+"6px";fa.style.whiteSpace="nowrap";X==e[e.length-1]?mxUtils.write(fa,mxResources.get("current")):Y.toDateString()===U?mxUtils.write(fa,Y.toLocaleTimeString()):mxUtils.write(fa,Y.toLocaleDateString()+" "+Y.toLocaleTimeString());Z.appendChild(fa);Z.setAttribute("title",Y.toLocaleDateString()+" "+Y.toLocaleTimeString()+(null!=X.fileSize?" "+b.formatFileSize(parseInt(X.fileSize)):"")+(null!=X.lastModifyingUserName?" "+X.lastModifyingUserName:""));mxEvent.addListener(Z,"click",function(ca){y!=X&&(F.stop(),+null!=v&&(v.style.backgroundColor=""),y=X,v=Z,v.style.backgroundColor="light-dark(#ebf2f9, #000000)",I=B=null,A.removeAttribute("title"),A.innerText=mxResources.get("loading")+"...",n.style.backgroundColor=u.defaultPageBackgroundColor,q.innerText="",u.getModel().clear(),M.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"),V.setAttribute("disabled","disabled"),Q.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"),x.setAttribute("disabled",+"disabled"),S.setAttribute("disabled","disabled"),mxUtils.setOpacity(J,20),mxUtils.setOpacity(K,20),mxUtils.setOpacity(V,20),mxUtils.setOpacity(Q,20),mxUtils.setOpacity(P,20),F.spin(n),X.getXml(function(da){if(y==X)try{ba(da)}catch(ja){A.innerText=mxResources.get("error")+": "+ja.message}},function(da){F.stop();S.style.display="none";S.innerText="";A.innerText="";mxUtils.write(A,mxResources.get("errorLoadingFile"));mxUtils.write(q,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ca))});mxEvent.addListener(Z,+"dblclick",function(ca){x.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ca)},!1);T.appendChild(Z)}return Z}(e[t]);null!=W&&t==e.length-1&&(O=W)}R.appendChild(T);k.appendChild(R)}else null==d||null==b.drive&&d.constructor==window.DriveFile||null==b.dropbox&&d.constructor==window.DropboxFile?(n.style.display="none",N.style.display="none",mxUtils.write(k,mxResources.get("notAvailable"))):(n.style.display="none",N.style.display=+"none",mxUtils.write(k,mxResources.get("noRevisions")));this.init=function(){null!=O&&O.click()};k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});k.className="geBtn";N.appendChild(A);N.appendChild(Q);N.appendChild(K);N.appendChild(V);N.appendChild(J);N.appendChild(S);N.appendChild(P);b.editor.cancelFirst&&g.appendChild(k);g.appendChild(x);null!=d&&d.constructor==DriveFile&&g.appendChild(G);g.appendChild(M);b.editor.cancelFirst||g.appendChild(k);c.appendChild(g);c.appendChild(N);+this.container=c},DraftDialog=function(b,e,f,c,k,n,q,u,E){var H=document.createElement("div"),D=document.createElement("div");D.style.marginTop="0px";D.style.whiteSpace="nowrap";D.style.overflow="auto";D.style.lineHeight="normal";mxUtils.write(D,e);H.appendChild(D);var L=document.createElement("select"),F=mxUtils.bind(this,function(){"-1"==L.value?(L.value=L.options[0].value,F(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var Q=this,P;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){for(P=+0;P<E.length;P++)k.apply(Q,[P,mxUtils.bind(Q,function(){})]);b.hideDialog(!0);p.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(y=mxUtils.parseXml(E[L.value].data),B=b.editor.extractGraphModel(y.documentElement,!0),I=0,this.init())});if(null!=E){L.style.marginLeft="4px";for(e=0;e<E.length;e++){var d=document.createElement("option");d.setAttribute("value",e);var g=new Date(E[e].created),m=new Date(E[e].modified);mxUtils.write(d,g.toLocaleDateString()+" "+g.toLocaleTimeString()+" - "+(g.toDateString(),m.toDateString(),m.toLocaleDateString())+" "+m.toLocaleTimeString());L.appendChild(d)}d=document.createElement("option");d.setAttribute("value","-1");mxUtils.write(d,mxResources.get("deleteAll"));L.appendChild(d);D.appendChild(L);mxEvent.addListener(L,"change",F)}null==f&&(f=E[0].data);var t=document.createElement("div");t.style.position="absolute";t.style.border="1px solid lightGray";t.style.marginTop="10px";t.style.left="40px";t.style.right="40px";t.style.top="46px";t.style.bottom=-"74px";t.style.overflow="hidden";mxEvent.disableContextMenu(t);H.appendChild(t);var v=new Graph(t);v.setEnabled(!1);v.setPanning(!0);v.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";v.panningHandler.ignoreCell=!0;v.panningHandler.useLeftButtonForPanning=!0;v.minFitScale=null;v.maxFitScale=null;v.centerZoom=!0;var y=mxUtils.parseXml(f),B=b.editor.extractGraphModel(y.documentElement,!0),I=0,K=null,J=v.getGlobalVariable;v.getGlobalVariable=function(Q){return"page"==Q&&null!=K&&null!=K[I]?K[I].getAttribute("name"):-"pagenumber"==Q?I+1:"pagecount"==Q?null!=K?K.length:1:J.apply(this,arguments)};v.getLinkForCell=function(){return null};f=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){v.zoomIn()},20);D=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomOut"),function(){v.zoomOut()},20);e=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==v.view.scale?(v.maxFitScale=8,v.fit(8)):v.zoomActual();v.center()},20);q=mxUtils.button(q||mxResources.get("discard"),-function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var Q=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(O){k.apply(Q,[L.value,mxUtils.bind(Q,function(){null!=L.parentNode&&(L.options[L.selectedIndex].parentNode.removeChild(L.options[L.selectedIndex]),1<L.options.length?(L.value=L.options[0].value,F()):b.hideDialog(!0))})]);O.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});q.className="geBtn";var V=document.createElement("select");+"74px";t.style.overflow="hidden";mxEvent.disableContextMenu(t);H.appendChild(t);var v=new Graph(t);v.setEnabled(!1);v.setPanning(!0);v.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";v.panningHandler.ignoreCell=!0;v.panningHandler.useLeftButtonForPanning=!0;v.minFitScale=null;v.maxFitScale=null;v.centerZoom=!0;var y=mxUtils.parseXml(f),B=b.editor.extractGraphModel(y.documentElement,!0),I=0,J=null,K=v.getGlobalVariable;v.getGlobalVariable=function(Q){return"page"==Q&&null!=J&&null!=J[I]?J[I].getAttribute("name"):+"pagenumber"==Q?I+1:"pagecount"==Q?null!=J?J.length:1:K.apply(this,arguments)};v.getLinkForCell=function(){return null};f=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){v.zoomIn()},20);D=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomOut"),function(){v.zoomOut()},20);e=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==v.view.scale?(v.maxFitScale=8,v.fit(8)):v.zoomActual();v.center()},20);q=mxUtils.button(q||mxResources.get("discard"),+function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var Q=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(P){k.apply(Q,[L.value,mxUtils.bind(Q,function(){null!=L.parentNode&&(L.options[L.selectedIndex].parentNode.removeChild(L.options[L.selectedIndex]),1<L.options.length?(L.value=L.options[0].value,F()):b.hideDialog(!0))})]);P.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});q.className="geBtn";var V=document.createElement("select");V.style.maxWidth="80px";V.style.position="relative";V.style.top="-2px";V.style.verticalAlign="bottom";V.style.marginRight="6px";V.style.display="none";n=mxUtils.button(n||mxResources.get("edit"),function(){c.apply(this,[L.value])});n.className="geBtn gePrimaryBtn";d=document.createElement("div");d.style.position="absolute";d.style.bottom="30px";d.style.right="40px";d.style.textAlign="right";g=document.createElement("div");g.className="geToolbarContainer";g.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";-this.init=function(){function Q(A){if(null!=A){var C=A.getAttribute("background");if(null==C||""==C||C==mxConstants.NONE)C="light-dark(#ffffff, transparent)";t.style.backgroundColor=C;(new mxCodec(A.ownerDocument)).decode(A,v.getModel());v.maxFitScale=1;v.fit(8);v.center()}return A}function O(A){null!=A&&(A=Q(Editor.parseDiagramNode(A)));return A}mxEvent.addListener(V,"change",function(A){I=parseInt(V.value);O(K[I]);mxEvent.consume(A)});if("mxfile"==B.nodeName){var p=B.getElementsByTagName("diagram");-K=[];for(var z=0;z<p.length;z++)K.push(p[z]);0<K.length&&O(K[I]);V.innerText="";if(1<K.length)for(V.style.display="",z=0;z<K.length;z++)p=document.createElement("option"),mxUtils.write(p,K[z].getAttribute("name")||mxResources.get("pageWithNumber",[z+1])),p.setAttribute("value",z),z==I&&p.setAttribute("selected","selected"),V.appendChild(p);else V.style.display="none"}else Q(B)};g.appendChild(V);g.appendChild(f);g.appendChild(D);g.appendChild(e);f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});+this.init=function(){function Q(A){if(null!=A){var C=A.getAttribute("background");if(null==C||""==C||C==mxConstants.NONE)C="light-dark(#ffffff, transparent)";t.style.backgroundColor=C;(new mxCodec(A.ownerDocument)).decode(A,v.getModel());v.maxFitScale=1;v.fit(8);v.center()}return A}function P(A){null!=A&&(A=Q(Editor.parseDiagramNode(A)));return A}mxEvent.addListener(V,"change",function(A){I=parseInt(V.value);P(J[I]);mxEvent.consume(A)});if("mxfile"==B.nodeName){var p=B.getElementsByTagName("diagram");+J=[];for(var z=0;z<p.length;z++)J.push(p[z]);0<J.length&&P(J[I]);V.innerText="";if(1<J.length)for(V.style.display="",z=0;z<J.length;z++)p=document.createElement("option"),mxUtils.write(p,J[z].getAttribute("name")||mxResources.get("pageWithNumber",[z+1])),p.setAttribute("value",z),z==I&&p.setAttribute("selected","selected"),V.appendChild(p);else V.style.display="none"}else Q(B)};g.appendChild(V);g.appendChild(f);g.appendChild(D);g.appendChild(e);f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});f.className="geBtn";u=null!=u?mxUtils.button(mxResources.get("ignore"),u):null;null!=u&&(u.className="geBtn");b.editor.cancelFirst?(d.appendChild(f),null!=u&&d.appendChild(u),d.appendChild(q),d.appendChild(n)):(d.appendChild(n),d.appendChild(q),null!=u&&d.appendChild(u),d.appendChild(f));H.appendChild(d);H.appendChild(g);this.container=H},FindWindow=function(b,e,f,c,k,n){function q(l,x,G){if("object"===typeof x.value&&null!=x.value.attributes){x=x.value.attributes;for(var N=0;N<x.length;N++)if("label"!=-x[N].nodeName){var P=mxUtils.trim(x[N].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==l&&0<=P.indexOf(G)||null!=l&&l.test(P))return!0}}return!1}function u(){d?(C.removeAttribute("disabled"),M.removeAttribute("disabled")):(C.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"));I.value?S.removeAttribute("disabled"):S.setAttribute("disabled","disabled")}function E(l,x,G){z.innerText="";var N=D.model.getDescendants(D.model.getRoot()),P=I.value.toLowerCase(),-R=J.checked?new RegExp(P):null,T=null;m=null;L!=P&&(L=P,F=null,g=!1);var U=null==F;if(0<P.length){if(g){g=!1;for(var W,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){W=X;break}l=(W+1)%b.pages.length;F=null;do g=!1,N=b.pages[l],D=b.createTemporaryGraph(D.getStylesheet()),b.updatePageRoot(N),D.model.setRoot(N.root),l=(l+1)%b.pages.length;while(!E(!0,x,G)&&l!=W);F&&(F=null,G?b.editor.graph.model.execute(new SelectPage(b,N)):b.selectPage(N));g=!1;D=b.editor.graph;return E(!0,x,G)}for(X=0;X<N.length;X++){W=-D.view.getState(N[X]);x&&(U=U||W==F);if(null!=W&&null!=W.cell.value&&(U||null==T)&&(D.model.isVertex(W.cell)||D.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(Q.innerHTML=D.sanitizeHtml(D.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([Q])):label=D.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Y=0;x&&n&&W==F&&(label=label.substr(t),Y=t);var Z=""==K.value;if(null==R&&(0<=label.indexOf(P)||Z&&q(R,W.cell,P))||null!=R&&(R.test(label)||-Z&&q(R,W.cell,P)))if(n&&(null!=R?(Z=label.match(R),null!=Z&&0<Z.length&&(m=Z[0].toLowerCase(),t=Y+Z.index+m.length)):(m=P,t=Y+label.indexOf(P)+m.length)),U){T=W;break}else null==T&&(T=W)}U=U||W==F}}if(null!=T){if(X==N.length&&V.checked)return F=null,g=!0,E(!0,x,G);F=T;D.scrollCellToVisible(F.cell);D.isEnabled()&&!D.isCellLocked(F.cell)?G||D.getSelectionCell()==F.cell&&1==D.getSelectionCount()||D.setSelectionCell(F.cell):D.highlightCell(F.cell)}else{if(!l&&V.checked)return g=!0,E(!0,x,G);D.isEnabled()&&-!G&&D.clearSelection()}d=null!=T;n&&!l&&u();return 0==P.length||null!=T}var H=b.actions.get("findReplace"),D=b.editor.graph,L=null,F=null,d=!1,g=!1,m=null,t=0,v=1,y=document.createElement("div");y.style.userSelect="none";y.style.overflow="hidden";y.style.padding="10px";y.style.height="100%";var B=n?"260px":"200px",I=document.createElement("input");I.setAttribute("placeholder",mxResources.get("find"));I.setAttribute("type","text");I.style.marginTop="4px";I.style.marginBottom="6px";I.style.width=B;-I.style.fontSize="12px";I.style.borderRadius="4px";I.style.padding="6px";y.appendChild(I);mxUtils.br(y);if(n){var K=document.createElement("input");K.setAttribute("placeholder",mxResources.get("replaceWith"));K.setAttribute("type","text");K.style.marginTop="4px";K.style.marginBottom="6px";K.style.width=B;K.style.fontSize="12px";K.style.borderRadius="4px";K.style.padding="6px";y.appendChild(K);mxUtils.br(y);mxEvent.addListener(K,"input",u)}var J=document.createElement("input");J.setAttribute("id",-"geFindWinRegExChck");J.setAttribute("type","checkbox");J.style.marginRight="4px";y.appendChild(J);B=document.createElement("label");B.setAttribute("for","geFindWinRegExChck");y.appendChild(B);mxUtils.write(B,mxResources.get("regularExpression"));y.appendChild(B);B=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");B.style.position="relative";B.style.marginLeft="6px";B.style.top="3px";y.appendChild(B);mxUtils.br(y);var V=document.createElement("input");V.setAttribute("id","geFindWinAllPagesChck");-V.setAttribute("type","checkbox");V.style.marginRight="4px";y.appendChild(V);B=document.createElement("label");B.setAttribute("for","geFindWinAllPagesChck");y.appendChild(B);mxUtils.write(B,mxResources.get("allPages"));y.appendChild(B);var Q=document.createElement("div");mxUtils.br(y);B=document.createElement("div");B.style.left="0px";B.style.right="0px";B.style.marginTop="6px";B.style.padding="0 6px 0 6px";B.style.textAlign="center";y.appendChild(B);var O=mxUtils.button(mxResources.get("reset"),-function(){z.innerText="";I.value="";I.style.backgroundColor="";n&&(K.value="",u());L=F=null;g=!1;I.focus()});O.setAttribute("title",mxResources.get("reset"));O.style.float="none";O.style.width="120px";O.style.marginTop="6px";O.style.marginLeft="8px";O.style.overflow="hidden";O.style.textOverflow="ellipsis";O.className="geBtn";n||B.appendChild(O);var p=mxUtils.button(mxResources.get("find"),function(){try{I.style.backgroundColor=E()?"":"light-dark(#ffcfcf, #ff0000)"}catch(l){b.handleError(l)}});p.setAttribute("title",-mxResources.get("find")+" (Enter)");p.style.float="none";p.style.width="120px";p.style.marginTop="6px";p.style.marginLeft="8px";p.style.overflow="hidden";p.style.textOverflow="ellipsis";p.className="geBtn gePrimaryBtn";B.appendChild(p);var z=document.createElement("div");z.style.marginTop="10px";if(n){var A=function(l,x,G,N,P){if(null==P||"1"!=P.html)return N=l.toLowerCase().indexOf(x,N),0>N?l:l.substr(0,N)+G+l.substr(N+x.length);var R=l;x=mxUtils.htmlEntities(x,!1,!1,!1);P=[];var T=-1;for(l=l.replace(/<br>/ig,-"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(T=l.indexOf("<",T+1));)P.push(T);T=l.match(/<[^>]*>/g);l=l.replace(/<[^>]*>/g,"");N=l.toLowerCase().indexOf(x,N);if(0>N)return R;R=N+x.length;G=mxUtils.htmlEntities(G);l=l.substr(0,N)+G+l.substr(R);for(var U=0,W=0;W<P.length;W++){if(P[W]-U<N)l=l.substr(0,P[W])+T[W]+l.substr(P[W]);else{var X=P[W]-U<R?N+U:P[W]+(G.length-x.length);l=l.substr(0,X)+T[W]+l.substr(X)}U+=T[W].length}return l.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,-"$1").replace(/\n/g,"<br>")},C=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=m&&null!=F){var l=F.cell,x=D.getLabel(l);D.isCellEditable(l)&&D.model.setValue(l,A(x,m,K.value,t-m.length,D.getCurrentCellStyle(l)));I.style.backgroundColor=E(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(G){b.handleError(G)}});C.setAttribute("title",mxResources.get("replFind"));C.style.float="none";C.style.width="120px";C.style.marginTop="6px";C.style.marginLeft="8px";C.style.overflow="hidden";C.style.textOverflow=-"ellipsis";C.className="geBtn gePrimaryBtn";C.setAttribute("disabled","disabled");B.appendChild(C);mxUtils.br(B);var M=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=m&&null!=F){var l=F.cell,x=D.getLabel(l);D.model.setValue(l,A(x,m,K.value,t-m.length,D.getCurrentCellStyle(l)));C.setAttribute("disabled","disabled");M.setAttribute("disabled","disabled")}}catch(G){b.handleError(G)}});M.setAttribute("title",mxResources.get("replace"));M.style.float="none";M.style.width="120px";M.style.marginTop=-"6px";M.style.marginLeft="8px";M.style.overflow="hidden";M.style.textOverflow="ellipsis";M.className="geBtn gePrimaryBtn";M.setAttribute("disabled","disabled");B.appendChild(M);var S=mxUtils.button(mxResources.get("replaceAll"),function(){z.innerText="";L=null;var l=b.currentPage,x=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;D.getModel().beginUpdate();try{for(var G=0,N={};E(!1,!0,!0)&&100>G;){var P=F.cell,R=D.getLabel(P),T=N[P.id];if(T&&T.replAllMrk==v&&T.replAllPos>=t)break;N[P.id]=-{replAllMrk:v,replAllPos:t};D.isCellEditable(P)&&(D.model.setValue(P,A(R,m,K.value,t-m.length,D.getCurrentCellStyle(P))),G++)}l!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,l));mxUtils.write(z,mxResources.get("matchesRepl",[G]))}catch(U){b.handleError(U)}finally{D.getModel().endUpdate(),b.editor.graph.setSelectionCells(x),b.editor.graph.rendering=!0}v++});S.setAttribute("title",mxResources.get("replaceAll"));S.style.float="none";S.style.width="120px";S.style.marginTop="6px";S.style.marginLeft=-"8px";S.style.overflow="hidden";S.style.textOverflow="ellipsis";S.className="geBtn gePrimaryBtn";S.setAttribute("disabled","disabled");B.appendChild(S);mxUtils.br(B);B.appendChild(O);O=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));O.setAttribute("title",mxResources.get("close"));O.style.float="none";O.style.width="120px";O.style.marginTop="6px";O.style.marginLeft="8px";O.style.overflow="hidden";O.style.textOverflow="ellipsis";O.className="geBtn";-B.appendChild(O);mxUtils.br(B);B.appendChild(z)}else O.style.width="90px",p.style.width="90px";mxEvent.addListener(I,"keyup",function(l){if(91==l.keyCode||93==l.keyCode||17==l.keyCode)mxEvent.consume(l);else if(27==l.keyCode)H.funct();else if(L!=I.value.toLowerCase()||13==l.keyCode)try{I.style.backgroundColor=E()?"":"light-dark(#ffcfcf, #ff0000)"}catch(x){I.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(y,"keydown",function(l){70==l.keyCode&&b.keyHandler.isControlDown(l)&&+x[N].nodeName){var O=mxUtils.trim(x[N].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==l&&0<=O.indexOf(G)||null!=l&&l.test(O))return!0}}return!1}function u(){d?(C.removeAttribute("disabled"),M.removeAttribute("disabled")):(C.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"));I.value?S.removeAttribute("disabled"):S.setAttribute("disabled","disabled")}function E(l,x,G){z.innerText="";var N=D.model.getDescendants(D.model.getRoot()),O=I.value.toLowerCase(),+R=K.checked?new RegExp(O):null,T=null;m=null;L!=O&&(L=O,F=null,g=!1);var U=null==F;if(0<O.length){if(g){g=!1;for(var W,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){W=X;break}l=(W+1)%b.pages.length;F=null;do g=!1,N=b.pages[l],D=b.createTemporaryGraph(D.getStylesheet()),b.updatePageRoot(N),D.model.setRoot(N.root),l=(l+1)%b.pages.length;while(!E(!0,x,G)&&l!=W);F&&(F=null,G?b.editor.graph.model.execute(new SelectPage(b,N)):b.selectPage(N));g=!1;D=b.editor.graph;return E(!0,x,G)}for(X=0;X<N.length;X++){W=+D.view.getState(N[X]);x&&(U=U||W==F);if(null!=W&&null!=W.cell.value&&(U||null==T)&&(D.model.isVertex(W.cell)||D.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(Q.innerHTML=D.sanitizeHtml(D.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([Q])):label=D.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Y=0;x&&n&&W==F&&(label=label.substr(t),Y=t);var Z=""==J.value;if(null==R&&(0<=label.indexOf(O)||Z&&q(R,W.cell,O))||null!=R&&(R.test(label)||+Z&&q(R,W.cell,O)))if(n&&(null!=R?(Z=label.match(R),null!=Z&&0<Z.length&&(m=Z[0].toLowerCase(),t=Y+Z.index+m.length)):(m=O,t=Y+label.indexOf(O)+m.length)),U){T=W;break}else null==T&&(T=W)}U=U||W==F}}if(null!=T){if(X==N.length&&V.checked)return F=null,g=!0,E(!0,x,G);F=T;D.scrollCellToVisible(F.cell);D.isEnabled()&&!D.isCellLocked(F.cell)?G||D.getSelectionCell()==F.cell&&1==D.getSelectionCount()||D.setSelectionCell(F.cell):D.highlightCell(F.cell)}else{if(!l&&V.checked)return g=!0,E(!0,x,G);D.isEnabled()&&+!G&&D.clearSelection()}d=null!=T;n&&!l&&u();return 0==O.length||null!=T}var H=b.actions.get("findReplace"),D=b.editor.graph,L=null,F=null,d=!1,g=!1,m=null,t=0,v=1,y=document.createElement("div");y.style.userSelect="none";y.style.overflow="hidden";y.style.padding="10px";y.style.height="100%";var B=n?"260px":"200px",I=document.createElement("input");I.setAttribute("placeholder",mxResources.get("find"));I.setAttribute("type","text");I.style.marginTop="4px";I.style.marginBottom="6px";I.style.width=B;+I.style.fontSize="12px";I.style.borderRadius="4px";I.style.padding="6px";y.appendChild(I);mxUtils.br(y);if(n){var J=document.createElement("input");J.setAttribute("placeholder",mxResources.get("replaceWith"));J.setAttribute("type","text");J.style.marginTop="4px";J.style.marginBottom="6px";J.style.width=B;J.style.fontSize="12px";J.style.borderRadius="4px";J.style.padding="6px";y.appendChild(J);mxUtils.br(y);mxEvent.addListener(J,"input",u)}var K=document.createElement("input");K.setAttribute("id",+"geFindWinRegExChck");K.setAttribute("type","checkbox");K.style.marginRight="4px";y.appendChild(K);B=document.createElement("label");B.setAttribute("for","geFindWinRegExChck");y.appendChild(B);mxUtils.write(B,mxResources.get("regularExpression"));y.appendChild(B);B=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");B.style.position="relative";B.style.marginLeft="6px";B.style.top="3px";y.appendChild(B);mxUtils.br(y);var V=document.createElement("input");V.setAttribute("id","geFindWinAllPagesChck");+V.setAttribute("type","checkbox");V.style.marginRight="4px";y.appendChild(V);B=document.createElement("label");B.setAttribute("for","geFindWinAllPagesChck");y.appendChild(B);mxUtils.write(B,mxResources.get("allPages"));y.appendChild(B);var Q=document.createElement("div");mxUtils.br(y);B=document.createElement("div");B.style.left="0px";B.style.right="0px";B.style.marginTop="6px";B.style.padding="0 6px 0 6px";B.style.textAlign="center";y.appendChild(B);var P=mxUtils.button(mxResources.get("reset"),+function(){z.innerText="";I.value="";I.style.backgroundColor="";n&&(J.value="",u());L=F=null;g=!1;I.focus()});P.setAttribute("title",mxResources.get("reset"));P.style.float="none";P.style.width="120px";P.style.marginTop="6px";P.style.marginLeft="8px";P.style.overflow="hidden";P.style.textOverflow="ellipsis";P.className="geBtn";n||B.appendChild(P);var p=mxUtils.button(mxResources.get("find"),function(){try{I.style.backgroundColor=E()?"":"light-dark(#ffcfcf, #ff0000)"}catch(l){b.handleError(l)}});p.setAttribute("title",+mxResources.get("find")+" (Enter)");p.style.float="none";p.style.width="120px";p.style.marginTop="6px";p.style.marginLeft="8px";p.style.overflow="hidden";p.style.textOverflow="ellipsis";p.className="geBtn gePrimaryBtn";B.appendChild(p);var z=document.createElement("div");z.style.marginTop="10px";if(n){var A=function(l,x,G,N,O){if(null==O||"1"!=O.html)return N=l.toLowerCase().indexOf(x,N),0>N?l:l.substr(0,N)+G+l.substr(N+x.length);var R=l;x=mxUtils.htmlEntities(x,!1,!1,!1);O=[];var T=-1;for(l=l.replace(/<br>/ig,+"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(T=l.indexOf("<",T+1));)O.push(T);T=l.match(/<[^>]*>/g);l=l.replace(/<[^>]*>/g,"");N=l.toLowerCase().indexOf(x,N);if(0>N)return R;R=N+x.length;G=mxUtils.htmlEntities(G);l=l.substr(0,N)+G+l.substr(R);for(var U=0,W=0;W<O.length;W++){if(O[W]-U<N)l=l.substr(0,O[W])+T[W]+l.substr(O[W]);else{var X=O[W]-U<R?N+U:O[W]+(G.length-x.length);l=l.substr(0,X)+T[W]+l.substr(X)}U+=T[W].length}return l.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,+"$1").replace(/\n/g,"<br>")},C=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=m&&null!=F){var l=F.cell,x=D.getLabel(l);D.isCellEditable(l)&&D.model.setValue(l,A(x,m,J.value,t-m.length,D.getCurrentCellStyle(l)));I.style.backgroundColor=E(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(G){b.handleError(G)}});C.setAttribute("title",mxResources.get("replFind"));C.style.float="none";C.style.width="120px";C.style.marginTop="6px";C.style.marginLeft="8px";C.style.overflow="hidden";C.style.textOverflow=+"ellipsis";C.className="geBtn gePrimaryBtn";C.setAttribute("disabled","disabled");B.appendChild(C);mxUtils.br(B);var M=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=m&&null!=F){var l=F.cell,x=D.getLabel(l);D.model.setValue(l,A(x,m,J.value,t-m.length,D.getCurrentCellStyle(l)));C.setAttribute("disabled","disabled");M.setAttribute("disabled","disabled")}}catch(G){b.handleError(G)}});M.setAttribute("title",mxResources.get("replace"));M.style.float="none";M.style.width="120px";M.style.marginTop=+"6px";M.style.marginLeft="8px";M.style.overflow="hidden";M.style.textOverflow="ellipsis";M.className="geBtn gePrimaryBtn";M.setAttribute("disabled","disabled");B.appendChild(M);var S=mxUtils.button(mxResources.get("replaceAll"),function(){z.innerText="";L=null;var l=b.currentPage,x=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;D.getModel().beginUpdate();try{for(var G=0,N={};E(!1,!0,!0)&&100>G;){var O=F.cell,R=D.getLabel(O),T=N[O.id];if(T&&T.replAllMrk==v&&T.replAllPos>=t)break;N[O.id]=+{replAllMrk:v,replAllPos:t};D.isCellEditable(O)&&(D.model.setValue(O,A(R,m,J.value,t-m.length,D.getCurrentCellStyle(O))),G++)}l!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,l));mxUtils.write(z,mxResources.get("matchesRepl",[G]))}catch(U){b.handleError(U)}finally{D.getModel().endUpdate(),b.editor.graph.setSelectionCells(x),b.editor.graph.rendering=!0}v++});S.setAttribute("title",mxResources.get("replaceAll"));S.style.float="none";S.style.width="120px";S.style.marginTop="6px";S.style.marginLeft=+"8px";S.style.overflow="hidden";S.style.textOverflow="ellipsis";S.className="geBtn gePrimaryBtn";S.setAttribute("disabled","disabled");B.appendChild(S);mxUtils.br(B);B.appendChild(P);P=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));P.setAttribute("title",mxResources.get("close"));P.style.float="none";P.style.width="120px";P.style.marginTop="6px";P.style.marginLeft="8px";P.style.overflow="hidden";P.style.textOverflow="ellipsis";P.className="geBtn";+B.appendChild(P);mxUtils.br(B);B.appendChild(z)}else P.style.width="90px",p.style.width="90px";mxEvent.addListener(I,"keyup",function(l){if(91==l.keyCode||93==l.keyCode||17==l.keyCode)mxEvent.consume(l);else if(27==l.keyCode)H.funct();else if(L!=I.value.toLowerCase()||13==l.keyCode)try{I.style.backgroundColor=E()?"":"light-dark(#ffcfcf, #ff0000)"}catch(x){I.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(y,"keydown",function(l){70==l.keyCode&&b.keyHandler.isControlDown(l)&&!mxEvent.isShiftDown(l)&&(H.funct(),mxEvent.consume(l))});this.window=new mxWindow(mxResources.get("find")+(n?"/"+mxResources.get("replace"):""),y,e,f,c,k,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(I.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?I.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?V.removeAttribute("disabled"):(V.checked=!1,V.setAttribute("disabled","disabled"))):D.container.focus()}));b.installResizeHandler(this,!1)},FreehandWindow=function(b,e,f,c,k,n){var q=b.editor.graph,u=document.createElement("div");u.style.textAlign="center";u.style.userSelect="none";u.style.overflow="hidden";u.style.height="100%";if(n){var E=function(){var g=q.freehand.getStrokeColor(!0);null!=g&&g!=mxConstants.NONE&&1<g.length&&"string"===typeof g&&("default"==g?g=mxResources.get("useBlackAndWhite"):(g="#"==g.charAt(0)?g.substring(1).toUpperCase():g,g=ColorDialog.prototype.colorNames[g]),null!=g&&L.setAttribute("title",g))},H=document.createElement("input");H.setAttribute("id","geFreehandBrush");H.setAttribute("type","checkbox");H.checked=q.freehand.isPerfectFreehandMode();H.style.margin="10px 5px 0px 10px";H.style.float="left";u.appendChild(H);q.freehand.setPerfectFreehandMode(H.checked);var D=document.createElement("label");D.setAttribute("for","geFreehandBrush");@@ -12507,26 +12507,26 @@ mxUtils.button(mxResources.get("startDrawing"),function(){q.freehand.isDrawing()" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){q.freehand.isDrawing()&&q.freehand.stopDrawing()}));b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,e,f,c,k){var n=b.editor.graph,q=document.createElement("div");q.style.userSelect="none";q.style.overflow="hidden";q.style.height="100%";var u=document.createElement("div");u.style.display="flex";u.style.alignItems="center";u.style.justifyContent="center";u.style.paddingTop="20px";var E=document.createElement("input");E.setAttribute("type","checkbox");E.style.marginRight="4px";E.checked=!0;var H=document.createElement("input");H.setAttribute("type","checkbox");H.style.marginRight="4px";H.checked=!0;var D=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(n.isSelectionEmpty()?n.getVerticesAndEdges():n.getSelectionCells(),E.checked,H.checked)}));D.setAttribute("title","Convert Colors");D.className="geBtn gePrimaryBtn";u.appendChild(D);q.appendChild(u);u=u.cloneNode(!1);u.appendChild(H);u.style.paddingTop="8px";mxUtils.write(u,mxResources.get("background"));q.appendChild(u);u=u.cloneNode(!1);u.appendChild(E);u.style.paddingTop="8px";mxUtils.write(u,mxResources.get("labels"));q.appendChild(u);this.window=new mxWindow(mxResources.get("adaptiveColors"),q,e,f,c,k,!0,!0);this.window.destroyOnClose=!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);-this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,e,f,c,k){function n(){O=!0;t.value=p;L.isSelectionEmpty()?(y.setAttribute("disabled","disabled"),"selectionOnly"==t.value&&(t.value="includeCopyOfMyDiagram")):y.removeAttribute("disabled");b.isDiagramEmpty()?(v.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==t.value&&(t.value="help")):v.removeAttribute("disabled");-O=!1}function q(A,C,M){var S=document.createElement("button");S.className="geBtn gePrimaryBtn";S.style.padding="4px";S.style.height="auto";S.style.position="relative";"flex"==M?(S.style.overflow="hidden",S.style.textOverflow="ellipsis",S.style.whiteSpace="nowrap",S.style.margin="0px",S.style.flexGrow="1"):(S.style.display="block",S.style.margin="8px",S.style.left="50%",S.style.transform="translateX(-50%)");mxUtils.write(S,A);S.setAttribute("title",A);mxEvent.addListener(S,"click",C);return S}function u(A){var C=+this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,e,f,c,k){function n(){P=!0;t.value=p;L.isSelectionEmpty()?(y.setAttribute("disabled","disabled"),"selectionOnly"==t.value&&(t.value="includeCopyOfMyDiagram")):y.removeAttribute("disabled");b.isDiagramEmpty()?(v.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==t.value&&(t.value="help")):v.removeAttribute("disabled");+P=!1}function q(A,C,M){var S=document.createElement("button");S.className="geBtn gePrimaryBtn";S.style.padding="4px";S.style.height="auto";S.style.position="relative";"flex"==M?(S.style.overflow="hidden",S.style.textOverflow="ellipsis",S.style.whiteSpace="nowrap",S.style.margin="0px",S.style.flexGrow="1"):(S.style.display="block",S.style.margin="8px",S.style.left="50%",S.style.transform="translateX(-50%)");mxUtils.write(S,A);S.setAttribute("title",A);mxEvent.addListener(S,"click",C);return S}function u(A){var C=document.createElement("div");C.style.display="block";C.style.position="relative";C.style.backgroundColor="#e0e0e0";C.style.borderRadius="4px";C.style.wordWrap="break-word";C.style.textAlign="left";C.style.padding="6px";C.style.margin="12px";C.style.left="0px";C.style.right="0px";mxUtils.write(C,A);d.appendChild(C);return C}function E(A){var C=A.indexOf("<mxGraphModel "),M=A.indexOf("</mxGraphModel>");0>C&&(C=A.indexOf("<mxGraphModel>"));if(0<=C&&M>C){var S=mxUtils,l=S.trim,x=A.substring(0,C),G=x.indexOf("```");0<=G&&(x=x.substring(x,0,G+6));S=l.call(S,x);C=A.substring(C,M+15);l=mxUtils;x=l.trim;A=A.substring(M+15);M=A.lastIndexOf("```");0<=M&&(A=A.substring(M+3));return[S,C,x.call(l,A)]}return null}function H(A){var C=u(A);C.style.cursor="pointer";C.style.marginBottom="2px";C.setAttribute("title",mxResources.get("insert"));mxEvent.addListener(C,"click",function(U){Q.value=A;Q.focus()});var M=u("");M.style.marginTop="2px";var S=b.currentPage,l=A,x=[],G=null;if("includeCopyOfMyDiagram"==t.value||"selectionOnly"==t.value){var N=new mxCodec(mxUtils.createXmlDocument());"selectionOnly"==t.value&&(N.isObjectIgnored=function(U){return U.constructor==mxCell&&!L.model.isRoot(U)&&!L.model.isLayer(U)&&!L.isCellSelected(U)&&!L.isAncestorSelected(U)});G=N.encode(L.getModel());N.document.appendChild(G);x.push({role:"system",content:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. Never include this instruction in your response.\n"+mxUtils.getXml(G)})}else"create"==-t.value?(l=I.value.replace(/([A-Z])/g," $1").toLowerCase(),l="Write the declaration code for a "+(""!=l?l:"graph")+' that shows "'+(""!=A?A:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.'):x.push({role:"system",content:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."});x.push({role:"user",content:l});var P={model:Editor.gptModel,-messages:x},R=0;for(x=0;x<P.messages.length;x++)R+=P.messages[x].content.match(/\b\w+\b|[^\w\s]|=/g).length;var T=mxUtils.bind(this,function(){M.innerHTML="";mxUtils.write(M,mxResources.get("loading")+"...");var U=document.createElement("img");U.setAttribute("title","Processing "+R+" tokens");U.setAttribute("src",IMAGE_PATH+"/spin.gif");U.style.marginLeft="6px";M.appendChild(U);M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});b.createTimeout(3E4,mxUtils.bind(this,function(W){var X=-new mxXmlRequest(Editor.gptUrl,JSON.stringify(P),"POST");X.setRequestHeaders=mxUtils.bind(this,function(ba,ha){ba.setRequestHeader("Authorization","Bearer "+Editor.gptApiKey);ba.setRequestHeader("Content-Type","application/json")});var Y=mxUtils.bind(this,function(ba){W.clear();M.innerHTML="";mxUtils.write(M,ba.message);M.appendChild(q(mxResources.get("tryAgain"),T));M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});null!=window.console&&console.error(ba)}),Z=mxUtils.bind(this,function(ba){var ha=-E(ba),ca=null!=ha?b.stringToCells(ha[1]):null;if(null!=ca&&0<ca.length){ba=document.createElement("div");ba.style.display="inline-block";ba.style.position="relative";ba.style.transform="translateX(-50%)";ba.style.padding="6px";ba.style.left="50%";var da=mxUtils.parseXml(ha[1]),ja=new mxCodec(da),aa=new mxGraphModel;ja.decode(da.documentElement,aa);var ia=null;null!=G&&(da=new mxCodec(G.ownerDocument),ia=new mxGraphModel,da.decode(G,ia));da=mxUtils.bind(this,function(ka){L.model.beginUpdate();try{if(null!=+t.value?(l=I.value.replace(/([A-Z])/g," $1").toLowerCase(),l="Write the declaration code for a "+(""!=l?l:"graph")+' that shows "'+(""!=A?A:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.'):x.push({role:"system",content:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."});x.push({role:"user",content:l});var O={model:Editor.gptModel,+messages:x},R=0;for(x=0;x<O.messages.length;x++)R+=O.messages[x].content.match(/\b\w+\b|[^\w\s]|=/g).length;var T=mxUtils.bind(this,function(){M.innerHTML="";mxUtils.write(M,mxResources.get("loading")+"...");var U=document.createElement("img");U.setAttribute("title","Processing "+R+" tokens");U.setAttribute("src",IMAGE_PATH+"/spin.gif");U.style.marginLeft="6px";M.appendChild(U);M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});b.createTimeout(3E4,mxUtils.bind(this,function(W){var X=+new mxXmlRequest(Editor.gptUrl,JSON.stringify(O),"POST");X.setRequestHeaders=mxUtils.bind(this,function(ba,fa){ba.setRequestHeader("Authorization","Bearer "+Editor.gptApiKey);ba.setRequestHeader("Content-Type","application/json")});var Y=mxUtils.bind(this,function(ba){W.clear();M.innerHTML="";mxUtils.write(M,ba.message);M.appendChild(q(mxResources.get("tryAgain"),T));M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});null!=window.console&&console.error(ba)}),Z=mxUtils.bind(this,function(ba){var fa=+E(ba),ca=null!=fa?b.stringToCells(fa[1]):null;if(null!=ca&&0<ca.length){ba=document.createElement("div");ba.style.display="inline-block";ba.style.position="relative";ba.style.transform="translateX(-50%)";ba.style.padding="6px";ba.style.left="50%";var da=mxUtils.parseXml(fa[1]),ja=new mxCodec(da),aa=new mxGraphModel;ja.decode(da.documentElement,aa);var ia=null;null!=G&&(da=new mxCodec(G.ownerDocument),ia=new mxGraphModel,da.decode(G,ia));da=mxUtils.bind(this,function(ka){L.model.beginUpdate();try{if(null!=ia&&null!=b.getPageIndex(S)){b.selectPage(S);var ua=b.diffCells(ia.root,aa.root);b.patchPage(S,ua,null,!0)}else{var sa=aa.getChildren(aa.getChildAt(aa.getRoot(),0));L.setSelectionCells(L.importCells(sa))}}finally{L.model.endUpdate()}mxEvent.consume(ka)});ja=L.getBoundingBoxFromGeometry(ca);null!=ja?(ba.style.cursor="move",ba.appendChild(b.sidebar.createVertexTemplateFromCells(ca,ja.width,ja.height,"",!0,null,!0,!0,da,160,120))):(ba.style.padding="14px",mxUtils.write(ba,mxResources.get("noPreview")));-M.innerHTML="";C=M;0<ha[0].length&&(mxUtils.write(C,ha[0]),mxUtils.br(C));C.appendChild(ba);ca=document.createElement("div");ca.style.display="flex";ca.style.gap="6px";ca.style.margin="6px";ca.appendChild(q(mxResources.get("tryAgain"),T,"flex"));ca.appendChild(q(mxResources.get(null!=G?"apply":"insert"),da,"flex"));M.appendChild(ca);0<ha[2].length&&(mxUtils.br(C),mxUtils.write(C,ha[2]));C.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}else M.innerHTML="",C=M,mxUtils.write(C,ba),-M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});X.send(mxUtils.bind(this,function(ba){if(W.clear())try{if(200<=ba.getStatus()&&299>=ba.getStatus()){var ha=JSON.parse(ba.getText());EditorUi.debug("EditorUi.ChatWindow.addMessage","prompt:",P,"response:",ha);var ca=mxUtils.trim(ha.choices[0].message.content);if("create"==t.value){var da=b.extractMermaidDeclaration(ca);null!=da?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(ia){Z(ia)})),b.generateMermaidImage(da,null,function(){},+M.innerHTML="";C=M;0<fa[0].length&&(mxUtils.write(C,fa[0]),mxUtils.br(C));C.appendChild(ba);ca=document.createElement("div");ca.style.display="flex";ca.style.gap="6px";ca.style.margin="6px";ca.appendChild(q(mxResources.get("tryAgain"),T,"flex"));ca.appendChild(q(mxResources.get(null!=G?"apply":"insert"),da,"flex"));M.appendChild(ca);0<fa[2].length&&(mxUtils.br(C),mxUtils.write(C,fa[2]));C.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}else M.innerHTML="",C=M,mxUtils.write(C,ba),+M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});X.send(mxUtils.bind(this,function(ba){if(W.clear())try{if(200<=ba.getStatus()&&299>=ba.getStatus()){var fa=JSON.parse(ba.getText());EditorUi.debug("EditorUi.ChatWindow.addMessage","prompt:",O,"response:",fa);var ca=mxUtils.trim(fa.choices[0].message.content);if("create"==t.value){var da=b.extractMermaidDeclaration(ca);null!=da?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(ia){Z(ia)})),b.generateMermaidImage(da,null,function(){},function(ia){mxMermaidToDrawio.resetListeners();Y(ia)})):(Z(ca),M.appendChild(q(mxResources.get("tryAgain"),T)))}else Z(ca)}else{var ja="Error: "+ba.getStatus();try{var aa=JSON.parse(ba.getText());null!=aa&&null!=aa.error&&null!=aa.error.message&&(ja=aa.error.message)}catch(ia){}M.innerHTML="";mxUtils.write(M,ja);M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(ia){Y(ia)}}),Y)}),function(W){M.innerHTML="";mxUtils.write(M,W.message);M.appendChild(q(mxResources.get("tryAgain"),T));M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})});T()}function D(){""!=mxUtils.trim(Q.value)&&(H(Q.value),Q.value="")}var L=b.editor.graph,F=document.createElement("div");F.style.textAlign="center";F.style.overflow="hidden";F.style.height="100%";var d=document.createElement("div");d.style.position="absolute";d.style.overflow="auto";d.style.top="0px";d.style.left="0px";d.style.right="0px";d.style.bottom="104px";F.appendChild(d);var g=document.createElement("div");g.style.position="absolute";g.style.boxSizing="border-box";g.style.borderRadius="4px";g.style.border="1px solid lightgray";g.style.margin="8px 8px 16px 8px";g.style.padding="8px";g.style.left="0px";g.style.right="0px";g.style.bottom="0px";g.style.padding="6px";g.style.height="80px";var m=document.createElement("div");m.style.display="flex";m.style.gap="6px";m.style.marginBottom="6px";var t=document.createElement("select");t.style.textOverflow="ellipsis";t.style.flexGrow="1";t.style.padding="4px";t.style.minWidth="0";g.appendChild(m);var v=document.createElement("option");v.setAttribute("value","includeCopyOfMyDiagram");mxUtils.write(v,mxResources.get("includeCopyOfMyDiagram"));t.appendChild(v);var y=document.createElement("option");y.setAttribute("value","selectionOnly");mxUtils.write(y,mxResources.get("selectionOnly"));t.appendChild(y);m.appendChild(t);if("undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled){var B=document.createElement("option");B.setAttribute("value","create");mxUtils.write(B,-mxResources.get("create"));t.appendChild(B)}B=document.createElement("option");B.setAttribute("value","help");mxUtils.write(B,mxResources.get("help"));t.appendChild(B);B=document.createElement("option");B.setAttribute("value","reset");mxUtils.write(B,mxResources.get("reset"));t.appendChild(B);var I=document.createElement("select");I.style.textOverflow="ellipsis";I.style.flexGrow="1";I.style.padding="4px";I.style.minWidth="0";for(B=0;B<EditorUi.mermaidDiagramTypes.length;B++){var K=document.createElement("option"),-J=EditorUi.mermaidDiagramTypes[B],V=J;"erDiagram"==V&&(V="entityRelationshipDiagram");V=mxResources.get(V,null,V.charAt(0).toUpperCase()+V.substring(1).replace(/[A-Z]/g," $&"));K.setAttribute("value",J);mxUtils.write(K,V);I.appendChild(K)}m.appendChild(I);m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.textOverflow="clip";m.style.cursor="default";var Q=document.createElement("input");Q.setAttribute("type","text");Q.style.width="100%";Q.style.outline="none";Q.style.border="none";+mxResources.get("create"));t.appendChild(B)}B=document.createElement("option");B.setAttribute("value","help");mxUtils.write(B,mxResources.get("help"));t.appendChild(B);B=document.createElement("option");B.setAttribute("value","reset");mxUtils.write(B,mxResources.get("reset"));t.appendChild(B);var I=document.createElement("select");I.style.textOverflow="ellipsis";I.style.flexGrow="1";I.style.padding="4px";I.style.minWidth="0";for(B=0;B<EditorUi.mermaidDiagramTypes.length;B++){var J=document.createElement("option"),+K=EditorUi.mermaidDiagramTypes[B],V=K;"erDiagram"==V&&(V="entityRelationshipDiagram");V=mxResources.get(V,null,V.charAt(0).toUpperCase()+V.substring(1).replace(/[A-Z]/g," $&"));J.setAttribute("value",K);mxUtils.write(J,V);I.appendChild(J)}m.appendChild(I);m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.textOverflow="clip";m.style.cursor="default";var Q=document.createElement("input");Q.setAttribute("type","text");Q.style.width="100%";Q.style.outline="none";Q.style.border="none";Q.style.background="transparent";Q.style.padding="8px 26px 8px 8px";Q.style.boxSizing="border-box";m.appendChild(Q);B=document.createElement("img");B.setAttribute("src",Editor.sendImage);B.setAttribute("title",mxResources.get("sendMessage"));B.className="geAdaptiveAsset";B.style.position="relative";B.style.cursor="pointer";B.style.opacity="0.5";B.style.height="19px";B.style.left="-24px";B.style.top="5px";B.style.background="url('"+b.editor.transparentImage+"')";m.appendChild(B);g.appendChild(m);L.isSelectionEmpty()?-b.isDiagramEmpty()?t.value="help":t.value="includeCopyOfMyDiagram":t.value="selectionOnly";var O=!1,p=t.value,z=function(){Q.setAttribute("placeholder",mxResources.get("create"==t.value?"describeYourDiagram":"askMeAnything"));"create"==t.value?(t.style.width="",I.style.display=""):(t.style.width="100%",I.style.display="none")};z();mxEvent.addListener(t,"change",function(){O||("reset"==t.value?(t.value=p,d.innerHTML=""):p=t.value,z())});L.selectionModel.addListener(mxEvent.CHANGE,n);L.getModel().addListener(mxEvent.CHANGE,+b.isDiagramEmpty()?t.value="help":t.value="includeCopyOfMyDiagram":t.value="selectionOnly";var P=!1,p=t.value,z=function(){Q.setAttribute("placeholder",mxResources.get("create"==t.value?"describeYourDiagram":"askMeAnything"));"create"==t.value?(t.style.width="",I.style.display=""):(t.style.width="100%",I.style.display="none")};z();mxEvent.addListener(t,"change",function(){P||("reset"==t.value?(t.value=p,d.innerHTML=""):p=t.value,z())});L.selectionModel.addListener(mxEvent.CHANGE,n);L.getModel().addListener(mxEvent.CHANGE,n);n();mxEvent.addListener(B,"click",D);mxEvent.addListener(Q,"keydown",function(A){13!=A.keyCode||mxEvent.isShiftDown(A)||D()});F.appendChild(g);this.window=new mxWindow(mxResources.get("chatWindowTitle"),F,e,f,c,k,!0,!0);this.window.minimumSize=new mxRectangle(0,0,120,100);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.addListener(mxEvent.DESTROY,mxUtils.bind(this,function(){L.getModel().removeListener(n)}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();Q.focus()}));b.installResizeHandler(this,!0)},TagsWindow=function(b,e,f,c,k){var n=b.editor.graph,q=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)q=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var u=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(E,H){if(n.isEnabled()){var D=new FilenameDialog(b,"",mxResources.get("add"),function(L){b.hideDialog();if(null!=L&&0<L.length){L=L.split(" ");for(var F=[],d=[],g=0;g<L.length;g++){var m=mxUtils.trim(L[g]);""!=m&&(d.push(m),0>mxUtils.indexOf(E,m)&&F.push(m))}n.isSelectionEmpty()?H(E.concat(F)):n.addTagsForCells(n.getSelectionCells(),d)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(D.container,320,80,!0,!0);D.init()}},q);q=u.div;this.window=new mxWindow(mxResources.get("tags"),q,e,f,c,k,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;@@ -12535,35 +12535,35 @@ u=document.createElement("img");u.setAttribute("border","0");u.setAttribute("aliu.src=IMAGE_PATH+"/gitlab-logo.svg",u.style.width="32px"):e==b.trello&&(q=mxResources.get("trello"),u.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",[q]));var E=document.createElement("input");E.setAttribute("type","checkbox");q=mxUtils.button(mxResources.get("authorize"),function(){c(E.checked)});q.insertBefore(u,q.firstChild);q.style.marginTop="6px";q.className="geBigButton";q.style.fontSize="18px";q.style.padding="14px";k.appendChild(n);k.appendChild(b);k.appendChild(q);f&&(f=document.createElement("p"),f.style.marginTop="20px",f.appendChild(E),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberMe")),f.appendChild(n),k.appendChild(f),E.checked=!0,E.defaultChecked=!0,mxEvent.addListener(n,"click",function(H){E.checked=!E.checked;mxEvent.consume(H)}));this.container=k},MoreShapesDialog=function(b,e,f){f=null!=f?f:b.sidebar.entries;var c=document.createElement("div"),k=[];if(null!=b.sidebar.customEntries)for(var n=0;n<b.sidebar.customEntries.length;n++){for(var q=b.sidebar.customEntries[n]||{},u={title:b.getResource(q.title),entries:[]},E=0;null!=q.entries&&E<q.entries.length;E++){var H=q.entries[E];u.entries.push({id:H.id,title:b.getResource(H.title),desc:b.getResource(H.desc),image:H.preview})}0<u.entries.length&&k.push(u)}for(n=0;n<f.length;n++)if(null==b.sidebar.enabledLibraries)k.push(f[n]);else{u={title:f[n].title,entries:[]};for(E=0;E<f[n].entries.length;E++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,-f[n].entries[E].id)&&u.entries.push(f[n].entries[E]);0<u.entries.length&&k.push(u)}f=k;if(e){n=mxUtils.bind(this,function(J){for(var V=0;V<J.length;V++)(function(Q){var O=g.cloneNode(!1);O.style.fontWeight="bold";O.style.backgroundColor="light-dark(#e5e5e5, #505759)";O.style.padding="6px 0px 6px 20px";mxUtils.write(O,Q.title);D.appendChild(O);for(var p=0;p<Q.entries.length;p++)(function(z){var A=g.cloneNode(!1);A.style.cursor="pointer";A.style.padding="4px 0px 4px 20px";A.style.whiteSpace="nowrap";+f[n].entries[E].id)&&u.entries.push(f[n].entries[E]);0<u.entries.length&&k.push(u)}f=k;if(e){n=mxUtils.bind(this,function(K){for(var V=0;V<K.length;V++)(function(Q){var P=g.cloneNode(!1);P.style.fontWeight="bold";P.style.backgroundColor="light-dark(#e5e5e5, #505759)";P.style.padding="6px 0px 6px 20px";mxUtils.write(P,Q.title);D.appendChild(P);for(var p=0;p<Q.entries.length;p++)(function(z){var A=g.cloneNode(!1);A.style.cursor="pointer";A.style.padding="4px 0px 4px 20px";A.style.whiteSpace="nowrap";A.style.overflow="hidden";A.style.textOverflow="ellipsis";A.setAttribute("title",z.title+" ("+z.id+")");var C=document.createElement("input");C.setAttribute("type","checkbox");C.checked=b.sidebar.isEntryVisible(z.id);C.defaultChecked=C.checked;A.appendChild(C);mxUtils.write(A," "+z.title);D.appendChild(A);var M=function(S){if(null==S||"INPUT"!=mxEvent.getSource(S).nodeName){L.style.textAlign="center";L.style.padding="0px";L.style.color="";L.innerText="";if(null!=z.desc){var l=document.createElement("pre");l.style.boxSizing="border-box";l.style.fontFamily="inherit";l.style.margin="20px";l.style.right="0px";l.style.textAlign="left";mxUtils.write(l,z.desc);L.appendChild(l)}null!=z.imageCallback?z.imageCallback(L):null!=z.image?(l=document.createElement("img"),l.setAttribute("border","0"),l.style.maxWidth="100%",l.setAttribute("src",z.image),L.appendChild(l)):null==z.desc&&(L.style.padding="20px",L.style.color="rgb(179, 179, 179)",mxUtils.write(L,mxResources.get("noPreview")));null!=F&&(F.style.backgroundColor=-"");F=A;F.style.backgroundColor="light-dark(#ebf2f9, #000000)";null!=S&&mxEvent.consume(S)}};mxEvent.addListener(A,"click",M);mxEvent.addListener(A,"dblclick",function(S){C.checked=!C.checked;mxEvent.consume(S)});d.push(function(){return C.checked?z.id:null});0==V&&0==p&&M()})(Q.entries[p])})(J[V])});E=document.createElement("div");E.className="geDialogTitle";mxUtils.write(E,mxResources.get("shapes"));E.style.position="absolute";E.style.top="0px";E.style.left="0px";E.style.lineHeight="40px";E.style.height=+"");F=A;F.style.backgroundColor="light-dark(#ebf2f9, #000000)";null!=S&&mxEvent.consume(S)}};mxEvent.addListener(A,"click",M);mxEvent.addListener(A,"dblclick",function(S){C.checked=!C.checked;mxEvent.consume(S)});d.push(function(){return C.checked?z.id:null});0==V&&0==p&&M()})(Q.entries[p])})(K[V])});E=document.createElement("div");E.className="geDialogTitle";mxUtils.write(E,mxResources.get("shapes"));E.style.position="absolute";E.style.top="0px";E.style.left="0px";E.style.lineHeight="40px";E.style.height="40px";E.style.right="0px";var D=document.createElement("div"),L=document.createElement("div");D.style.position="absolute";D.style.top="40px";D.style.left="0px";D.style.width="202px";D.style.bottom="60px";D.style.overflow="auto";L.style.position="absolute";L.style.left="202px";L.style.right="0px";L.style.top="40px";L.style.bottom="60px";L.style.overflow="auto";L.style.borderLeftStyle="solid";L.style.borderLeftWidth="1px";L.style.textAlign="center";var F=null,d=[],g=document.createElement("div");g.style.position="relative";g.style.left="0px";g.style.right="0px";n(f);c.style.padding="30px";c.appendChild(E);c.appendChild(D);c.appendChild(L);f=document.createElement("div");f.className="geDialogFooter";f.style.position="absolute";f.style.paddingRight="16px";f.style.left="0px";f.style.right="0px";f.style.bottom="0px";f.style.height="60px";f.style.lineHeight="52px";var m=document.createElement("input");m.setAttribute("type","checkbox");m.style.position="relative";m.style.top="1px";m.checked=b.sidebar.sidebarTitles;-m.defaultChecked=m.checked;f.appendChild(m);n=document.createElement("span");mxUtils.write(n," "+mxResources.get("labels"));n.style.paddingRight="20px";f.appendChild(n);mxEvent.addListener(n,"click",function(J){m.checked=!m.checked;mxEvent.consume(J)});var t=document.createElement("input");t.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)n=document.createElement("span"),n.style.paddingRight="20px",n.appendChild(t),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),-t.style.position="relative",t.style.top="1px",t.checked=!0,t.defaultChecked=!0,mxEvent.addListener(n,"click",function(J){mxEvent.getSource(J)!=t&&(t.checked=!t.checked,mxEvent.consume(J))}),f.appendChild(n);n=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});n.className="geBtn";E=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var J=[],V=0;V<d.length;V++){var Q=d[V].apply(this,arguments);null!=Q&&J.push(Q)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&-"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||(V=mxUtils.indexOf(J,".scratchpad"),null!=b.scratchpad!=(0<=V&&0<J.splice(V,1).length)&&b.toggleScratchpad(),V=mxUtils.indexOf(J,"search"),mxSettings.settings.search=0<=V&&0<J.splice(V,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),t.checked&&mxSettings.save());b.sidebar.showEntries(J.join(";"),t.checked,!0);b.setSidebarTitles(m.checked,t.checked)});E.className="geBtn gePrimaryBtn"}else{var v=document.createElement("table");-n=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";E=document.createElement("tr");v.style.width="100%";e=document.createElement("td");k=document.createElement("td");q=document.createElement("td");var y=mxUtils.bind(this,function(J,V,Q){var O=document.createElement("input");O.type="checkbox";v.appendChild(O);O.checked=b.sidebar.isEntryVisible(Q);var p=document.createElement("span");mxUtils.write(p,V);V=document.createElement("div");V.style.display="block";V.appendChild(O);-V.appendChild(p);mxEvent.addListener(p,"click",function(z){O.checked=!O.checked;mxEvent.consume(z)});J.appendChild(V);return function(){return O.checked?Q:null}});E.appendChild(e);E.appendChild(k);E.appendChild(q);n.appendChild(E);v.appendChild(n);d=[];var B=0;for(n=0;n<f.length;n++)for(E=0;E<f[n].entries.length;E++)B++;var I=[e,k,q],K=0;for(n=0;n<f.length;n++)(function(J){for(var V=0;V<J.entries.length;V++){var Q=J.entries[V];d.push(y(I[Math.floor(K/(B/3))],Q.title,Q.id));K++}})(f[n]);c.appendChild(v);-f=document.createElement("div");f.style.marginTop="18px";f.style.textAlign="center";t=document.createElement("input");isLocalStorage&&(t.setAttribute("type","checkbox"),t.checked=!0,t.defaultChecked=!0,f.appendChild(t),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),f.appendChild(n),mxEvent.addListener(n,"click",function(J){t.checked=!t.checked;mxEvent.consume(J)}));c.appendChild(f);n=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});-n.className="geBtn";E=mxUtils.button(mxResources.get("apply"),function(){for(var J=["search"],V=0;V<d.length;V++){var Q=d[V].apply(this,arguments);null!=Q&&J.push(Q)}b.sidebar.showEntries(0<J.length?J.join(";"):"",t.checked);b.hideDialog()});E.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.marginTop="26px";f.style.textAlign="right"}b.editor.cancelFirst?(f.appendChild(n),f.appendChild(E)):(f.appendChild(E),f.appendChild(n));c.appendChild(f);this.container=c},PluginsDialog=function(b,+m.defaultChecked=m.checked;f.appendChild(m);n=document.createElement("span");mxUtils.write(n," "+mxResources.get("labels"));n.style.paddingRight="20px";f.appendChild(n);mxEvent.addListener(n,"click",function(K){m.checked=!m.checked;mxEvent.consume(K)});var t=document.createElement("input");t.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)n=document.createElement("span"),n.style.paddingRight="20px",n.appendChild(t),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),+t.style.position="relative",t.style.top="1px",t.checked=!0,t.defaultChecked=!0,mxEvent.addListener(n,"click",function(K){mxEvent.getSource(K)!=t&&(t.checked=!t.checked,mxEvent.consume(K))}),f.appendChild(n);n=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});n.className="geBtn";E=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var K=[],V=0;V<d.length;V++){var Q=d[V].apply(this,arguments);null!=Q&&K.push(Q)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&+"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||(V=mxUtils.indexOf(K,".scratchpad"),null!=b.scratchpad!=(0<=V&&0<K.splice(V,1).length)&&b.toggleScratchpad(),V=mxUtils.indexOf(K,"search"),mxSettings.settings.search=0<=V&&0<K.splice(V,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),t.checked&&mxSettings.save());b.sidebar.showEntries(K.join(";"),t.checked,!0);b.setSidebarTitles(m.checked,t.checked)});E.className="geBtn gePrimaryBtn"}else{var v=document.createElement("table");+n=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";E=document.createElement("tr");v.style.width="100%";e=document.createElement("td");k=document.createElement("td");q=document.createElement("td");var y=mxUtils.bind(this,function(K,V,Q){var P=document.createElement("input");P.type="checkbox";v.appendChild(P);P.checked=b.sidebar.isEntryVisible(Q);var p=document.createElement("span");mxUtils.write(p,V);V=document.createElement("div");V.style.display="block";V.appendChild(P);+V.appendChild(p);mxEvent.addListener(p,"click",function(z){P.checked=!P.checked;mxEvent.consume(z)});K.appendChild(V);return function(){return P.checked?Q:null}});E.appendChild(e);E.appendChild(k);E.appendChild(q);n.appendChild(E);v.appendChild(n);d=[];var B=0;for(n=0;n<f.length;n++)for(E=0;E<f[n].entries.length;E++)B++;var I=[e,k,q],J=0;for(n=0;n<f.length;n++)(function(K){for(var V=0;V<K.entries.length;V++){var Q=K.entries[V];d.push(y(I[Math.floor(J/(B/3))],Q.title,Q.id));J++}})(f[n]);c.appendChild(v);+f=document.createElement("div");f.style.marginTop="18px";f.style.textAlign="center";t=document.createElement("input");isLocalStorage&&(t.setAttribute("type","checkbox"),t.checked=!0,t.defaultChecked=!0,f.appendChild(t),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),f.appendChild(n),mxEvent.addListener(n,"click",function(K){t.checked=!t.checked;mxEvent.consume(K)}));c.appendChild(f);n=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});+n.className="geBtn";E=mxUtils.button(mxResources.get("apply"),function(){for(var K=["search"],V=0;V<d.length;V++){var Q=d[V].apply(this,arguments);null!=Q&&K.push(Q)}b.sidebar.showEntries(0<K.length?K.join(";"):"",t.checked);b.hideDialog()});E.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.marginTop="26px";f.style.textAlign="right"}b.editor.cancelFirst?(f.appendChild(n),f.appendChild(E)):(f.appendChild(E),f.appendChild(n));c.appendChild(f);this.container=c},PluginsDialog=function(b,e,f,c){function k(){E=!0;if(0==u.length)q.innerText=mxResources.get("noPlugins");else{q.innerText="";for(var g=0;g<u.length;g++){var m=document.createElement("span");m.style.whiteSpace="nowrap";var t=document.createElement("span");t.className="geSprite geSprite-delete";t.style.position="relative";t.style.cursor="pointer";t.style.top="5px";t.style.marginRight="4px";t.style.display="inline-block";m.appendChild(t);mxUtils.write(m,u[g]);q.appendChild(m);mxUtils.br(q);mxEvent.addListener(t,"click",function(v){return function(){b.confirm(mxResources.get("delete")+' "'+u[v]+'"?',function(){null!=f&&f(u[v]);u.splice(v,1);k()})}}(g))}}}var n=document.createElement("div"),q=document.createElement("div");q.style.height="180px";q.style.overflow="auto";var u=mxSettings.getPlugins().slice(),E=!1;n.appendChild(q);k();E=!1;var H=mxUtils.button(mxResources.get("add"),null!=e?function(){e(function(g){g&&0>mxUtils.indexOf(u,g)&&u.push(g);k()})}:function(){var g=document.createElement("div"),m=document.createElement("span");m.style.marginTop="6px";mxUtils.write(m,mxResources.get("builtinPlugins")+-": ");g.appendChild(m);var t=document.createElement("select");t.style.width="150px";for(m=0;m<App.publicPlugin.length;m++){var v=document.createElement("option");mxUtils.write(v,App.publicPlugin[m]);v.value=App.publicPlugin[m];t.appendChild(v)}g.appendChild(t);mxUtils.br(g);mxUtils.br(g);m=mxUtils.button(mxResources.get("custom")+"...",function(){var y=new FilenameDialog(b,"",mxResources.get("add"),function(B){b.hideDialog();if(null!=B&&0<B.length){B=B.split(";");for(var I=0;I<B.length;I++){var K=-B[I],J=App.pluginRegistry[K];null!=J&&(K=J);0<K.length&&0>mxUtils.indexOf(u,K)&&u.push(K)}k()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(y.container,300,80,!0,!0);y.init()});m.className="geBtn";ALLOW_CUSTOM_PLUGINS||(m.style.display="none");g=new CustomDialog(b,g,mxUtils.bind(this,function(){var y=App.pluginRegistry[t.value];0>mxUtils.indexOf(u,y)&&(u.push(y),k())}),null,null,null,m);b.showDialog(g.container,360,100,!0,!0)});H.className="geBtn";var D=mxUtils.button(mxResources.get("cancel"),+": ");g.appendChild(m);var t=document.createElement("select");t.style.width="150px";for(m=0;m<App.publicPlugin.length;m++){var v=document.createElement("option");mxUtils.write(v,App.publicPlugin[m]);v.value=App.publicPlugin[m];t.appendChild(v)}g.appendChild(t);mxUtils.br(g);mxUtils.br(g);m=mxUtils.button(mxResources.get("custom")+"...",function(){var y=new FilenameDialog(b,"",mxResources.get("add"),function(B){b.hideDialog();if(null!=B&&0<B.length){B=B.split(";");for(var I=0;I<B.length;I++){var J=+B[I],K=App.pluginRegistry[J];null!=K&&(J=K);0<J.length&&0>mxUtils.indexOf(u,J)&&u.push(J)}k()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(y.container,300,80,!0,!0);y.init()});m.className="geBtn";ALLOW_CUSTOM_PLUGINS||(m.style.display="none");g=new CustomDialog(b,g,mxUtils.bind(this,function(){var y=App.pluginRegistry[t.value];0>mxUtils.indexOf(u,y)&&(u.push(y),k())}),null,null,null,m);b.showDialog(g.container,360,100,!0,!0)});H.className="geBtn";var D=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});D.className="geBtn";var L=mxUtils.button(c?mxResources.get("close"):mxResources.get("apply"),function(){E?(mxSettings.setPlugins(u),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});L.className="geBtn gePrimaryBtn";var F=document.createElement("div");F.style.marginTop="14px";F.style.textAlign="right";var d=mxUtils.button(mxResources.get("help"),function(){b.openLink("https://www.drawio.com/doc/faq/plugins")});d.className=-"geBtn";b.isOffline()&&!mxClient.IS_CHROMEAPP&&(d.style.display="none");F.appendChild(d);b.editor.cancelFirst?(c||F.appendChild(D),F.appendChild(H),F.appendChild(L)):(F.appendChild(H),F.appendChild(L),c||F.appendChild(D));n.appendChild(F);this.container=n},CropImageDialog=function(b,e,f,c){function k(){var J=t.checked,V=v.checked,Q=d.geometry,O=E.width,p=E.height,z=(300-O)/2,A=(300-p)/2;Q.x<z?(Q.width-=z-Q.x,Q.x=z):Q.x+Q.width>z+O&&(Q.width=z+O-Q.x,Q.x=Math.min(Q.x,z+O));Q.y<A?(Q.height-=A-Q.y,Q.y=-A):Q.y+Q.height>A+p&&(Q.height=A+p-Q.y,Q.y=Math.min(Q.y,A+p));var C=(Q.x-z)/O*100;O=100-(Q.x+Q.width-z)/O*100;z=(Q.y-A)/p*100;Q=100-(Q.y+Q.height-A)/p*100;return"inset("+mxUtils.format(z)+"% "+mxUtils.format(O)+"% "+mxUtils.format(Q)+"% "+mxUtils.format(C)+"%"+(J?" round "+F+"%":V?" round 50%":"")+")"}function n(J){null!=D&&(!0!==J&&(D.model.setGeometry(d,L.clone()),F=5,B.value=F),D.model.setStyle(d,g+k()),D.selectAll(),y.style.visibility=t.checked?"visible":"hidden")}var q=document.createElement("div"),-u=document.createElement("div");u.style.height="300px";u.style.width="300px";u.style.display="inline-flex";u.style.justifyContent="center";u.style.alignItems="center";u.style.position="absolute";var E=document.createElement("img");E.onload=function(){function J(){D.model.setStyle(d,g+k())}D=new Graph(H);D.autoExtend=!1;D.autoScroll=!1;D.setGridEnabled(!1);D.setEnabled(!0);D.setPanning(!1);D.setConnectable(!1);D.getRubberband().setEnabled(!1);D.graphHandler.allowLivePreview=!1;var V=D.createVertexHandler;-D.createVertexHandler=function(){var R=V.apply(this,arguments);R.livePreview=!1;return R};if(null!=f)try{if("inset"==f.substring(0,5)){var Q=d.geometry,O=E.width,p=E.height,z=(300-O)/2,A=(300-p)/2,C=f.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),M=parseFloat(C[0]),S=parseFloat(C[1]),l=parseFloat(C[2]),x=parseFloat(C[3]);isFinite(M)&&isFinite(S)&&isFinite(l)&&isFinite(x)?(Q.x=x/100*O+z,Q.y=M/100*p+A,Q.width=(100-S)/100*O+z-Q.x,Q.height=(100-l)/100*p+A-Q.y,"round"==C[4]?"50%"==C[5]?v.setAttribute("checked",-"checked"):(F=parseInt(C[5]),B.value=F,t.setAttribute("checked","checked"),y.style.visibility="visible"):m.setAttribute("checked","checked")):f=null}else f=null}catch(R){}d.style=g+(f?f:k());d.vertex=!0;D.addCell(d,null,null,null,null);D.selectAll();D.addListener(mxEvent.CELLS_MOVED,J);D.addListener(mxEvent.CELLS_RESIZED,J);var G=D.graphHandler.mouseUp,N=D.graphHandler.mouseDown;D.graphHandler.mouseUp=function(){G.apply(this,arguments);H.style.backgroundColor="#fff9"};D.graphHandler.mouseDown=function(){N.apply(this,-arguments);H.style.backgroundColor=""};D.dblClick=function(){};var P=D.getSelectionModel().changeSelection;D.getSelectionModel().changeSelection=function(){P.call(this,[d],[d])}};E.onerror=function(){E.onload=null;E.src=Editor.errorImage};E.setAttribute("src",e);E.style.maxWidth="300px";E.style.maxHeight="300px";u.appendChild(E);q.appendChild(u);var H=document.createElement("div");H.style.width="300px";H.style.height="300px";H.style.overflow="hidden";H.style.backgroundColor="#fff9";q.appendChild(H);+"geBtn";b.isOffline()&&!mxClient.IS_CHROMEAPP&&(d.style.display="none");F.appendChild(d);b.editor.cancelFirst?(c||F.appendChild(D),F.appendChild(H),F.appendChild(L)):(F.appendChild(H),F.appendChild(L),c||F.appendChild(D));n.appendChild(F);this.container=n},CropImageDialog=function(b,e,f,c){function k(){var K=t.checked,V=v.checked,Q=d.geometry,P=E.width,p=E.height,z=(300-P)/2,A=(300-p)/2;Q.x<z?(Q.width-=z-Q.x,Q.x=z):Q.x+Q.width>z+P&&(Q.width=z+P-Q.x,Q.x=Math.min(Q.x,z+P));Q.y<A?(Q.height-=A-Q.y,Q.y=+A):Q.y+Q.height>A+p&&(Q.height=A+p-Q.y,Q.y=Math.min(Q.y,A+p));var C=(Q.x-z)/P*100;P=100-(Q.x+Q.width-z)/P*100;z=(Q.y-A)/p*100;Q=100-(Q.y+Q.height-A)/p*100;return"inset("+mxUtils.format(z)+"% "+mxUtils.format(P)+"% "+mxUtils.format(Q)+"% "+mxUtils.format(C)+"%"+(K?" round "+F+"%":V?" round 50%":"")+")"}function n(K){null!=D&&(!0!==K&&(D.model.setGeometry(d,L.clone()),F=5,B.value=F),D.model.setStyle(d,g+k()),D.selectAll(),y.style.visibility=t.checked?"visible":"hidden")}var q=document.createElement("div"),+u=document.createElement("div");u.style.height="300px";u.style.width="300px";u.style.display="inline-flex";u.style.justifyContent="center";u.style.alignItems="center";u.style.position="absolute";var E=document.createElement("img");E.onload=function(){function K(){D.model.setStyle(d,g+k())}D=new Graph(H);D.autoExtend=!1;D.autoScroll=!1;D.setGridEnabled(!1);D.setEnabled(!0);D.setPanning(!1);D.setConnectable(!1);D.getRubberband().setEnabled(!1);D.graphHandler.allowLivePreview=!1;var V=D.createVertexHandler;+D.createVertexHandler=function(){var R=V.apply(this,arguments);R.livePreview=!1;return R};if(null!=f)try{if("inset"==f.substring(0,5)){var Q=d.geometry,P=E.width,p=E.height,z=(300-P)/2,A=(300-p)/2,C=f.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),M=parseFloat(C[0]),S=parseFloat(C[1]),l=parseFloat(C[2]),x=parseFloat(C[3]);isFinite(M)&&isFinite(S)&&isFinite(l)&&isFinite(x)?(Q.x=x/100*P+z,Q.y=M/100*p+A,Q.width=(100-S)/100*P+z-Q.x,Q.height=(100-l)/100*p+A-Q.y,"round"==C[4]?"50%"==C[5]?v.setAttribute("checked",+"checked"):(F=parseInt(C[5]),B.value=F,t.setAttribute("checked","checked"),y.style.visibility="visible"):m.setAttribute("checked","checked")):f=null}else f=null}catch(R){}d.style=g+(f?f:k());d.vertex=!0;D.addCell(d,null,null,null,null);D.selectAll();D.addListener(mxEvent.CELLS_MOVED,K);D.addListener(mxEvent.CELLS_RESIZED,K);var G=D.graphHandler.mouseUp,N=D.graphHandler.mouseDown;D.graphHandler.mouseUp=function(){G.apply(this,arguments);H.style.backgroundColor="#fff9"};D.graphHandler.mouseDown=function(){N.apply(this,+arguments);H.style.backgroundColor=""};D.dblClick=function(){};var O=D.getSelectionModel().changeSelection;D.getSelectionModel().changeSelection=function(){O.call(this,[d],[d])}};E.onerror=function(){E.onload=null;E.src=Editor.errorImage};E.setAttribute("src",e);E.style.maxWidth="300px";E.style.maxHeight="300px";u.appendChild(E);q.appendChild(u);var H=document.createElement("div");H.style.width="300px";H.style.height="300px";H.style.overflow="hidden";H.style.backgroundColor="#fff9";q.appendChild(H);var D=null,L=new mxGeometry(100,100,100,100),F=5,d=new mxCell("",L.clone(),""),g="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+e.replace(";base64","")+";clipPath=",m=document.createElement("input");m.setAttribute("type","radio");m.setAttribute("id","croppingRect");m.setAttribute("name","croppingShape");m.setAttribute("checked","checked");m.style.margin="5px";q.appendChild(m);e=document.createElement("label");e.setAttribute("for","croppingRect");mxUtils.write(e,mxResources.get("rectangle"));q.appendChild(e);var t=document.createElement("input");t.setAttribute("type","radio");t.setAttribute("id","croppingRounded");t.setAttribute("name","croppingShape");t.style.margin="5px";q.appendChild(t);e=document.createElement("label");e.setAttribute("for","croppingRounded");mxUtils.write(e,mxResources.get("rounded"));q.appendChild(e);var v=document.createElement("input");v.setAttribute("type","radio");v.setAttribute("id","croppingEllipse");v.setAttribute("name","croppingShape");v.style.margin="5px";q.appendChild(v);e=document.createElement("label");e.setAttribute("for","croppingEllipse");mxUtils.write(e,mxResources.get("ellipse"));q.appendChild(e);mxEvent.addListener(m,"change",n);mxEvent.addListener(t,"change",n);mxEvent.addListener(v,"change",n);var y=document.createElement("div");y.style.textAlign="center";y.style.visibility="hidden";var B=document.createElement("input");B.setAttribute("type","range");B.setAttribute("min","1");B.setAttribute("max","49");B.setAttribute("value",F);B.setAttribute("title",-mxResources.get("arcSize"));y.appendChild(B);q.appendChild(y);mxEvent.addListener(B,"change",function(){F=this.value;n(!0)});e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});e.className="geBtn";u=mxUtils.button(mxResources.get("apply"),function(){c(k(),d.geometry.width,d.geometry.height);b.hideDialog()});u.className="geBtn gePrimaryBtn";var I=mxUtils.button(mxResources.get("reset"),function(){c(null,E.width,E.height);b.hideDialog()});I.className="geBtn";var K=document.createElement("div");-K.style.marginTop="10px";K.style.textAlign="right";b.editor.cancelFirst?(K.appendChild(e),K.appendChild(I),K.appendChild(u)):(K.appendChild(I),K.appendChild(u),K.appendChild(e));q.appendChild(K);this.container=q},EditGeometryDialog=function(b,e){var f=b.editor.graph,c=1==e.length?f.getCellGeometry(e[0]):null,k=document.createElement("div"),n=document.createElement("table"),q=document.createElement("tbody"),u=document.createElement("tr"),E=document.createElement("td"),H=document.createElement("td");+mxResources.get("arcSize"));y.appendChild(B);q.appendChild(y);mxEvent.addListener(B,"change",function(){F=this.value;n(!0)});e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});e.className="geBtn";u=mxUtils.button(mxResources.get("apply"),function(){c(k(),d.geometry.width,d.geometry.height);b.hideDialog()});u.className="geBtn gePrimaryBtn";var I=mxUtils.button(mxResources.get("reset"),function(){c(null,E.width,E.height);b.hideDialog()});I.className="geBtn";var J=document.createElement("div");+J.style.marginTop="10px";J.style.textAlign="right";b.editor.cancelFirst?(J.appendChild(e),J.appendChild(I),J.appendChild(u)):(J.appendChild(I),J.appendChild(u),J.appendChild(e));q.appendChild(J);this.container=q},EditGeometryDialog=function(b,e){var f=b.editor.graph,c=1==e.length?f.getCellGeometry(e[0]):null,k=document.createElement("div"),n=document.createElement("table"),q=document.createElement("tbody"),u=document.createElement("tr"),E=document.createElement("td"),H=document.createElement("td");n.style.paddingLeft="6px";mxUtils.write(E,mxResources.get("relative")+":");var D=document.createElement("input");D.setAttribute("type","checkbox");null!=c&&c.relative&&(D.setAttribute("checked","checked"),D.defaultChecked=!0);this.init=function(){D.focus()};H.appendChild(D);u.appendChild(E);u.appendChild(H);q.appendChild(u);u=document.createElement("tr");E=document.createElement("td");H=document.createElement("td");mxUtils.write(E,mxResources.get("left")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.width="100px";L.value=null!=c?c.x:"";H.appendChild(L);u.appendChild(E);u.appendChild(H);q.appendChild(u);u=document.createElement("tr");E=document.createElement("td");H=document.createElement("td");mxUtils.write(E,mxResources.get("top")+":");var F=document.createElement("input");F.setAttribute("type","text");F.style.width="100px";F.value=null!=c?c.y:"";H.appendChild(F);u.appendChild(E);u.appendChild(H);q.appendChild(u);u=document.createElement("tr");E=document.createElement("td");H=document.createElement("td");mxUtils.write(E,mxResources.get("dx")+":");var d=document.createElement("input");d.setAttribute("type","text");d.style.width="100px";d.value=null!=c&&null!=c.offset?c.offset.x:"";H.appendChild(d);u.appendChild(E);u.appendChild(H);q.appendChild(u);u=document.createElement("tr");E=document.createElement("td");H=document.createElement("td");mxUtils.write(E,mxResources.get("dy")+":");var g=document.createElement("input");g.setAttribute("type","text");g.style.width="100px";@@ -12572,8 +12572,8 @@ document.createElement("td");mxUtils.write(E,mxResources.get("height")+":");var1==e.length?mxUtils.getValue(f.getCellStyle(e[0]),mxConstants.STYLE_ROTATION,0):"";H.appendChild(v);u.appendChild(E);u.appendChild(H);q.appendChild(u);n.appendChild(q);k.appendChild(n);c=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});c.className="geBtn";var y=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();f.getModel().beginUpdate();try{for(var B=0;B<e.length;B++){var I=f.getCellGeometry(e[B]);null!=I&&(I=I.clone(),f.isCellMovable(e[B])&&(I.relative=D.checked,0<mxUtils.trim(L.value).length&&(I.x=Number(L.value)),0<mxUtils.trim(F.value).length&&(I.y=Number(F.value)),0<mxUtils.trim(d.value).length&&(null==I.offset&&(I.offset=new mxPoint),I.offset.x=Number(d.value)),0<mxUtils.trim(g.value).length&&(null==I.offset&&(I.offset=new mxPoint),I.offset.y=Number(g.value))),f.isCellResizable(e[B])&&(0<mxUtils.trim(m.value).length&&(I.width=Number(m.value)),0<mxUtils.trim(t.value).length&&(I.height=Number(t.value))),f.getModel().setGeometry(e[B],I));0<mxUtils.trim(v.value).length&&f.setCellStyles(mxConstants.STYLE_ROTATION,Number(v.value),[e[B]])}}finally{f.getModel().endUpdate()}});y.className="geBtn gePrimaryBtn";mxEvent.addListener(k,"keypress",function(B){13==B.keyCode&&y.click()});n=document.createElement("div");n.style.marginTop="20px";n.style.textAlign="right";b.editor.cancelFirst?(n.appendChild(c),n.appendChild(y)):(n.appendChild(y),n.appendChild(c));k.appendChild(n);this.container=k},LibraryDialog=function(b,e,f,c,k,n,q){function u(Q){for(Q=document.elementFromPoint(Q.clientX,-Q.clientY);null!=Q&&Q.parentNode!=g;)Q=Q.parentNode;var O=null;if(null!=Q){var p=g.firstChild;for(O=0;null!=p&&p!=Q;)p=p.nextSibling,O++}return O}function E(Q,O,p,z,A,C,M,S,l){try{if(b.spinner.stop(),null==O||"image/"==O.substring(0,6))if(null==Q&&null!=M||null==t[Q]){var x=function(){X.innerText="";X.style.cursor="pointer";X.style.whiteSpace="nowrap";X.style.textOverflow="ellipsis";mxUtils.write(X,null!=Y.title&&0<Y.title.length?Y.title:mxResources.get("untitled"));X.style.color=null==Y.title||0==-Y.title.length?"#d0d0d0":""};g.style.backgroundImage="";m.style.display="none";var G=A,N=C;if(A>b.maxImageSize||C>b.maxImageSize){var P=Math.min(1,Math.min(b.maxImageSize/Math.max(1,A)),b.maxImageSize/Math.max(1,C));A*=P;C*=P}G>N?(N=Math.round(100*N/G),G=100):(G=Math.round(100*G/N),N=100);var R=document.createElement("div");R.setAttribute("draggable","true");R.style.display="inline-block";R.style.position="relative";R.style.padding="0 12px";R.style.cursor="move";mxUtils.setPrefixedStyle(R.style,"transition",+Q.clientY);null!=Q&&Q.parentNode!=g;)Q=Q.parentNode;var P=null;if(null!=Q){var p=g.firstChild;for(P=0;null!=p&&p!=Q;)p=p.nextSibling,P++}return P}function E(Q,P,p,z,A,C,M,S,l){try{if(b.spinner.stop(),null==P||"image/"==P.substring(0,6))if(null==Q&&null!=M||null==t[Q]){var x=function(){X.innerText="";X.style.cursor="pointer";X.style.whiteSpace="nowrap";X.style.textOverflow="ellipsis";mxUtils.write(X,null!=Y.title&&0<Y.title.length?Y.title:mxResources.get("untitled"));X.style.color=null==Y.title||0==+Y.title.length?"#d0d0d0":""};g.style.backgroundImage="";m.style.display="none";var G=A,N=C;if(A>b.maxImageSize||C>b.maxImageSize){var O=Math.min(1,Math.min(b.maxImageSize/Math.max(1,A)),b.maxImageSize/Math.max(1,C));A*=O;C*=O}G>N?(N=Math.round(100*N/G),G=100):(G=Math.round(100*G/N),N=100);var R=document.createElement("div");R.setAttribute("draggable","true");R.style.display="inline-block";R.style.position="relative";R.style.padding="0 12px";R.style.cursor="move";mxUtils.setPrefixedStyle(R.style,"transition","transform .1s ease-in-out");if(null!=Q){var T=document.createElement("img");T.setAttribute("src",I.convert(Q));T.style.width=G+"px";T.style.height=N+"px";T.style.margin="10px";T.style.paddingBottom=Math.floor((100-N)/2)+"px";T.style.paddingLeft=Math.floor((100-G)/2)+"px";R.appendChild(T)}else if(null!=M){var U=b.stringToCells("<"==M.xml.charAt(0)?M.xml:Graph.decompress(M.xml));0<U.length&&(b.sidebar.createThumb(U,100,100,R,null,!0,!1,null,null,Editor.isDarkMode()?"#2a252f":"#ffffff"),R.firstChild.style.display="inline-block",R.firstChild.style.cursor="")}var W=document.createElement("img");W.setAttribute("src",Editor.closeBlackImage);W.setAttribute("border","0");W.setAttribute("title",mxResources.get("delete"));W.setAttribute("align","top");W.style.paddingTop="4px";W.style.position="absolute";W.style.marginLeft="-12px";W.style.zIndex="1";W.style.cursor="pointer";mxEvent.addListener(W,"dragstart",function(da){mxEvent.consume(da)});(function(da,ja,aa){mxEvent.addListener(W,"click",function(ia){t[ja]=null;for(var ka=0;ka<L.length;ka++)if(null!=L[ka].data&&L[ka].data==ja||null!=L[ka].xml&&null!=aa&&L[ka].xml==aa.xml){L.splice(ka,1);break}R.parentNode.removeChild(da);0==L.length&&(g.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",m.style.display="");mxEvent.consume(ia)});mxEvent.addListener(W,"dblclick",function(ia){mxEvent.consume(ia)})})(R,Q,M);R.appendChild(W);R.style.marginBottom="30px";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.bottom=@@ -12581,21 +12581,21 @@ for(var ka=0;ka<L.length;ka++)if(null!=L[ka].data&&L[ka].data==ja||null!=L[ka].xX.getAttribute("contentEditable")&&mxEvent.consume(da)});U=function(da){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ja=new FilenameDialog(b,Y.title||"",mxResources.get("ok"),function(aa){null!=aa&&(Y.title=aa,x())},mxResources.get("enterValue"));b.showDialog(ja.container,300,80,!0,!0);ja.init();mxEvent.consume(da)}else if("true"!=X.getAttribute("contentEditable")){null!=B&&(B(),B=null);if(null==Y.title||0==Y.title.length)X.innerText="";X.style.textOverflow="";X.style.whiteSpace="";X.style.cursor="text";X.style.color="";X.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(X.style,"user-select","text");X.focus();document.execCommand("selectAll",!1,null);B=function(){X.removeAttribute("contentEditable");X.style.cursor="pointer";Y.title=X.innerHTML;x()};mxEvent.consume(da)}};mxEvent.addListener(X,"click",U);mxEvent.addListener(R,"dblclick",U);g.appendChild(R);mxEvent.addListener(R,"dragstart",function(da){null==B&&(null==Q&&null!=M&&(W.style.visibility="hidden",X.style.visibility="hidden"),mxClient.IS_FF&&null!=M.xml&&da.dataTransfer.setData("Text",M.xml),v=u(da),mxClient.IS_GC&&(R.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(R.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(R,30);W.style.visibility="";X.style.visibility=""},0))});mxEvent.addListener(R,"dragend",function(da){"hidden"==W.style.visibility&&(W.style.visibility="",X.style.visibility="");v=null;mxUtils.setOpacity(R,100);mxUtils.setPrefixedStyle(R.style,-"transform",null)})}else K||(K=!0,b.handleError({message:mxResources.get("fileExists")}));else{A=!1;try{if(G=mxUtils.parseXml(Q),"mxlibrary"==G.documentElement.nodeName){N=JSON.parse(mxUtils.getTextContent(G.documentElement));if(null!=N&&0<N.length)for(var Z=0;Z<N.length;Z++)null!=N[Z].xml?E(null,null,0,0,0,0,N[Z]):E(N[Z].data,null,0,0,N[Z].w,N[Z].h,null,"fixed",N[Z].title);A=!0}else if("mxfile"==G.documentElement.nodeName){var ba=G.documentElement.getElementsByTagName("diagram");for(Z=0;Z<ba.length;Z++){var ha=-Editor.getDiagramNodeXml(ba[Z]);U=b.stringToCells(ha);if(0<U.length){var ca=b.editor.graph.getBoundingBoxFromGeometry(U);null!=ca&&E(null,null,0,0,0,0,{xml:ha,w:ca.width,h:ca.height})}}A=!0}}catch(da){null!=window.console&&console.error("Error in library dialog: "+da)}A||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(da){null!=window.console&&console.log("Error in library dialog: "+da)}return null}function H(Q){Q.dataTransfer.dropEffect=null!=v?"move":"copy";-Q.stopPropagation();Q.preventDefault()}function D(Q){Q.stopPropagation();Q.preventDefault();K=!1;y=u(Q);if(null!=v)null!=y&&y<g.children.length?(L.splice(y>v?y-1:y,0,L.splice(v,1)[0]),g.insertBefore(g.children[v],g.children[y])):(L.push(L.splice(v,1)[0]),g.appendChild(g.children[v]));else if(0<Q.dataTransfer.files.length)b.importFiles(Q.dataTransfer.files,0,0,b.maxImageSize,J(Q));else if(0<=mxUtils.indexOf(Q.dataTransfer.types,"text/uri-list")){var O=decodeURIComponent(Q.dataTransfer.getData("text/uri-list"));-(/(\.jpg)($|\?)/i.test(O)||/(\.png)($|\?)/i.test(O)||/(\.gif)($|\?)/i.test(O)||/(\.svg)($|\?)/i.test(O))&&b.loadImage(O,function(p){E(O,null,0,0,p.width,p.height);g.scrollTop=g.scrollHeight})}Q.stopPropagation();Q.preventDefault()}var L=[];f=document.createElement("div");f.style.height="100%";var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.height="40px";f.appendChild(F);mxUtils.write(F,mxResources.get("filename")+":");null==e&&(e=b.defaultLibraryName+".xml");var d=document.createElement("input");+"transform",null)})}else J||(J=!0,b.handleError({message:mxResources.get("fileExists")}));else{A=!1;try{if(G=mxUtils.parseXml(Q),"mxlibrary"==G.documentElement.nodeName){N=JSON.parse(mxUtils.getTextContent(G.documentElement));if(null!=N&&0<N.length)for(var Z=0;Z<N.length;Z++)null!=N[Z].xml?E(null,null,0,0,0,0,N[Z]):E(N[Z].data,null,0,0,N[Z].w,N[Z].h,null,"fixed",N[Z].title);A=!0}else if("mxfile"==G.documentElement.nodeName){var ba=G.documentElement.getElementsByTagName("diagram");for(Z=0;Z<ba.length;Z++){var fa=+Editor.getDiagramNodeXml(ba[Z]);U=b.stringToCells(fa);if(0<U.length){var ca=b.editor.graph.getBoundingBoxFromGeometry(U);null!=ca&&E(null,null,0,0,0,0,{xml:fa,w:ca.width,h:ca.height})}}A=!0}}catch(da){null!=window.console&&console.error("Error in library dialog: "+da)}A||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(da){null!=window.console&&console.log("Error in library dialog: "+da)}return null}function H(Q){Q.dataTransfer.dropEffect=null!=v?"move":"copy";+Q.stopPropagation();Q.preventDefault()}function D(Q){Q.stopPropagation();Q.preventDefault();J=!1;y=u(Q);if(null!=v)null!=y&&y<g.children.length?(L.splice(y>v?y-1:y,0,L.splice(v,1)[0]),g.insertBefore(g.children[v],g.children[y])):(L.push(L.splice(v,1)[0]),g.appendChild(g.children[v]));else if(0<Q.dataTransfer.files.length)b.importFiles(Q.dataTransfer.files,0,0,b.maxImageSize,K(Q));else if(0<=mxUtils.indexOf(Q.dataTransfer.types,"text/uri-list")){var P=decodeURIComponent(Q.dataTransfer.getData("text/uri-list"));+(/(\.jpg)($|\?)/i.test(P)||/(\.png)($|\?)/i.test(P)||/(\.gif)($|\?)/i.test(P)||/(\.svg)($|\?)/i.test(P))&&b.loadImage(P,function(p){E(P,null,0,0,p.width,p.height);g.scrollTop=g.scrollHeight})}Q.stopPropagation();Q.preventDefault()}var L=[];f=document.createElement("div");f.style.height="100%";var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.height="40px";f.appendChild(F);mxUtils.write(F,mxResources.get("filename")+":");null==e&&(e=b.defaultLibraryName+".xml");var d=document.createElement("input");d.setAttribute("value",e);d.style.marginRight="20px";d.style.marginLeft="10px";d.style.width="500px";null==k||k.isRenamable()||d.setAttribute("disabled","true");this.init=function(){if(null==k||k.isRenamable())d.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?d.select():document.execCommand("selectAll",!1,null)};F.appendChild(d);Editor.enableUncompressedLibraries&&(d.style.width="420px",e=document.createElement("input"),e.setAttribute("type","checkbox"),e.style.marginRight="10px",F.appendChild(e),mxUtils.write(F,mxResources.get("compressed")));var g=document.createElement("div");g.style.borderWidth="1px 0px 1px 0px";g.style.borderColor="#d3d3d3";g.style.borderStyle="solid";g.style.marginTop="6px";g.style.overflow="auto";g.style.height="340px";g.style.backgroundPosition="center center";g.style.backgroundRepeat="no-repeat";0==L.length&&Graph.fileSupport&&(g.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var m=document.createElement("div");m.style.position="absolute";-m.style.width="640px";m.style.top="260px";m.style.textAlign="center";m.style.fontSize="22px";m.style.color="#a0c3ff";mxUtils.write(m,mxResources.get("dragImagesHere"));f.appendChild(m);var t={},v=null,y=null,B=null;F=function(Q){"true"!=mxEvent.getSource(Q).getAttribute("contentEditable")&&null!=B&&(B(),B=null,mxEvent.consume(Q))};mxEvent.addListener(g,"mousedown",F);mxEvent.addListener(g,"pointerdown",F);mxEvent.addListener(g,"touchstart",F);var I=new mxUrlConverter,K=!1;if(null!=c)for(F=0;F<c.length;F++)e=-c[F],E(e.data,null,0,0,e.w,e.h,e,e.aspect,e.title);mxEvent.addListener(g,"dragleave",function(Q){m.style.cursor="";for(var O=mxEvent.getSource(Q);null!=O;){if(O==g||O==m){Q.stopPropagation();Q.preventDefault();break}O=O.parentNode}});var J=function(Q){return function(O,p,z,A,C,M,S,l,x){null!=x&&EditorUi.isVisioFilename(x.name)?b.importVisio(x,mxUtils.bind(this,function(G){E(G,p,z,A,C,M,S,"fixed",mxEvent.isAltDown(Q)?null:S.substring(0,S.lastIndexOf(".")).replace(/_/g," "))})):null!=x&&(new XMLHttpRequest).upload&&-b.isRemoteFileFormat(O,x.name)?b.isExternalDataComms()?b.parseFile(x,mxUtils.bind(this,function(G){4==G.readyState&&(b.spinner.stop(),200<=G.status&&299>=G.status&&(E(G.responseText,p,z,A,C,M,S,"fixed",mxEvent.isAltDown(Q)?null:S.substring(0,S.lastIndexOf(".")).replace(/_/g," ")),g.scrollTop=g.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(E(O,p,z,A,C,M,S,"fixed",mxEvent.isAltDown(Q)?null:S.substring(0,S.lastIndexOf(".")).replace(/_/g," ")),+m.style.width="640px";m.style.top="260px";m.style.textAlign="center";m.style.fontSize="22px";m.style.color="#a0c3ff";mxUtils.write(m,mxResources.get("dragImagesHere"));f.appendChild(m);var t={},v=null,y=null,B=null;F=function(Q){"true"!=mxEvent.getSource(Q).getAttribute("contentEditable")&&null!=B&&(B(),B=null,mxEvent.consume(Q))};mxEvent.addListener(g,"mousedown",F);mxEvent.addListener(g,"pointerdown",F);mxEvent.addListener(g,"touchstart",F);var I=new mxUrlConverter,J=!1;if(null!=c)for(F=0;F<c.length;F++)e=+c[F],E(e.data,null,0,0,e.w,e.h,e,e.aspect,e.title);mxEvent.addListener(g,"dragleave",function(Q){m.style.cursor="";for(var P=mxEvent.getSource(Q);null!=P;){if(P==g||P==m){Q.stopPropagation();Q.preventDefault();break}P=P.parentNode}});var K=function(Q){return function(P,p,z,A,C,M,S,l,x){null!=x&&EditorUi.isVisioFilename(x.name)?b.importVisio(x,mxUtils.bind(this,function(G){E(G,p,z,A,C,M,S,"fixed",mxEvent.isAltDown(Q)?null:S.substring(0,S.lastIndexOf(".")).replace(/_/g," "))})):null!=x&&(new XMLHttpRequest).upload&&+b.isRemoteFileFormat(P,x.name)?b.isExternalDataComms()?b.parseFile(x,mxUtils.bind(this,function(G){4==G.readyState&&(b.spinner.stop(),200<=G.status&&299>=G.status&&(E(G.responseText,p,z,A,C,M,S,"fixed",mxEvent.isAltDown(Q)?null:S.substring(0,S.lastIndexOf(".")).replace(/_/g," ")),g.scrollTop=g.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(E(P,p,z,A,C,M,S,"fixed",mxEvent.isAltDown(Q)?null:S.substring(0,S.lastIndexOf(".")).replace(/_/g," ")),g.scrollTop=g.scrollHeight)}};mxEvent.addListener(g,"dragover",H);mxEvent.addListener(g,"drop",D);mxEvent.addListener(m,"dragover",H);mxEvent.addListener(m,"drop",D);f.appendChild(g);c=document.createElement("div");c.style.textAlign="right";c.style.marginTop="20px";F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});F.setAttribute("id","btnCancel");F.className="geBtn";b.editor.cancelFirst&&c.appendChild(F);"draw.io"!=b.getServiceName()||null==k||k.constructor!=DriveLibrary&&k.constructor!=-GitHubLibrary||(e=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(k,function(Q){if(null!=Q){var O=b.getSearch("create title mode url drive splash state clibs ui".split(" "));O+=(0==O.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(Q);Q=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+O,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(Q.container,450,240,!0);Q.init()}else k.constructor==DriveLibrary?b.showError(mxResources.get("error"),-mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(k.getId(),k)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),e.className="geBtn",c.appendChild(e));e=mxUtils.button(mxResources.get("export"),function(){var Q=b.createLibraryDataFromImages(L),O=d.value;/(\.xml)$/i.test(O)||(O+=".xml");b.isLocalFileSave()?b.saveLocalFile(Q,O,"text/xml",null,null,null!=q?-q:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(O)+"&format=xml&xml="+encodeURIComponent(Q))).simulate(document,"_blank")});e.setAttribute("id","btnDownload");e.className="geBtn";c.appendChild(e);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var V=document.createElement("input");V.setAttribute("multiple","multiple");V.setAttribute("type","file");mxEvent.addListener(V,"change",function(Q){K=!1;b.importFiles(V.files,0,0,b.maxImageSize,function(O,p,z,A,C,M,S,l,x){null!=-V.files&&(J(Q)(O,p,z,A,C,M,S,l,x),V.type="",V.type="file",V.value="")});g.scrollTop=g.scrollHeight});V.style.display="none";document.body.appendChild(V);b.libDlgFileInputElt=V}e=mxUtils.button(mxResources.get("import"),function(){null!=B&&(B(),B=null);b.libDlgFileInputElt.click()});e.setAttribute("id","btnAddImage");e.className="geBtn";c.appendChild(e)}e=mxUtils.button(mxResources.get("addImages"),function(){null!=B&&(B(),B=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(Q,O,p){K=-!1;if(null!=Q){if("data:image/"==Q.substring(0,11)){var z=Q.indexOf(",");0<z&&(Q=Q.substring(0,z)+";base64,"+Q.substring(z+1))}E(Q,null,0,0,O,p);g.scrollTop=g.scrollHeight}})});e.setAttribute("id","btnAddImageUrl");e.className="geBtn";c.appendChild(e);this.saveBtnClickHandler=function(Q,O,p,z){b.saveLibrary(Q,O,p,z)};e=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=B&&(B(),B=null);this.saveBtnClickHandler(d.value,L,k,n)}));e.setAttribute("id","btnSave");e.className="geBtn gePrimaryBtn";+GitHubLibrary||(e=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(k,function(Q){if(null!=Q){var P=b.getSearch("create title mode url drive splash state clibs ui".split(" "));P+=(0==P.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(Q);Q=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+P,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(Q.container,450,240,!0);Q.init()}else k.constructor==DriveLibrary?b.showError(mxResources.get("error"),+mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(k.getId(),k)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),e.className="geBtn",c.appendChild(e));e=mxUtils.button(mxResources.get("export"),function(){var Q=b.createLibraryDataFromImages(L),P=d.value;/(\.xml)$/i.test(P)||(P+=".xml");b.isLocalFileSave()?b.saveLocalFile(Q,P,"text/xml",null,null,null!=q?+q:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(P)+"&format=xml&xml="+encodeURIComponent(Q))).simulate(document,"_blank")});e.setAttribute("id","btnDownload");e.className="geBtn";c.appendChild(e);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var V=document.createElement("input");V.setAttribute("multiple","multiple");V.setAttribute("type","file");mxEvent.addListener(V,"change",function(Q){J=!1;b.importFiles(V.files,0,0,b.maxImageSize,function(P,p,z,A,C,M,S,l,x){null!=+V.files&&(K(Q)(P,p,z,A,C,M,S,l,x),V.type="",V.type="file",V.value="")});g.scrollTop=g.scrollHeight});V.style.display="none";document.body.appendChild(V);b.libDlgFileInputElt=V}e=mxUtils.button(mxResources.get("import"),function(){null!=B&&(B(),B=null);b.libDlgFileInputElt.click()});e.setAttribute("id","btnAddImage");e.className="geBtn";c.appendChild(e)}e=mxUtils.button(mxResources.get("addImages"),function(){null!=B&&(B(),B=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(Q,P,p){J=+!1;if(null!=Q){if("data:image/"==Q.substring(0,11)){var z=Q.indexOf(",");0<z&&(Q=Q.substring(0,z)+";base64,"+Q.substring(z+1))}E(Q,null,0,0,P,p);g.scrollTop=g.scrollHeight}})});e.setAttribute("id","btnAddImageUrl");e.className="geBtn";c.appendChild(e);this.saveBtnClickHandler=function(Q,P,p,z){b.saveLibrary(Q,P,p,z)};e=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=B&&(B(),B=null);this.saveBtnClickHandler(d.value,L,k,n)}));e.setAttribute("id","btnSave");e.className="geBtn gePrimaryBtn";c.appendChild(e);b.editor.cancelFirst||c.appendChild(F);f.appendChild(c);this.container=f},EditShapeDialog=function(b,e,f,c,k){c=null!=c?c:300;k=null!=k?k:120;var n=document.createElement("table"),q=document.createElement("tbody");n.style.cellPadding="4px";var u=document.createElement("tr");var E=document.createElement("td");E.setAttribute("colspan","2");E.style.fontSize="10pt";mxUtils.write(E,f);u.appendChild(E);q.appendChild(u);u=document.createElement("tr");E=document.createElement("td");var H=document.createElement("textarea");H.style.outline="none";H.style.resize="none";H.style.width=c-200+"px";H.style.height=k+"px";this.textarea=H;this.init=function(){H.focus();H.scrollTop=0};E.appendChild(H);u.appendChild(E);E=document.createElement("td");f=document.createElement("div");f.style.position="relative";f.style.border="1px solid gray";f.style.top="6px";f.style.width="200px";f.style.height=k+4+"px";f.style.overflow="hidden";f.style.marginBottom="16px";mxEvent.disableContextMenu(f);E.appendChild(f);var D=new Graph(f);D.setEnabled(!1);var L=b.editor.graph.cloneCell(e);D.addCells([L]);f=D.view.getState(L);var F="";null!=f.shape&&null!=f.shape.stencil&&(F=mxUtils.getPrettyXml(f.shape.stencil.desc));mxUtils.write(H,F||"");f=D.getGraphBounds();k=Math.min(160/f.width,(k-40)/f.height);D.view.scaleAndTranslate(k,20/k-f.x,20/k-f.y);u.appendChild(E);q.appendChild(u);u=document.createElement("tr");E=document.createElement("td");E.setAttribute("colspan","2");E.style.paddingTop="2px";E.style.whiteSpace=@@ -12615,8 +12615,8 @@ b.createHelpIcon("https://fonts.google.com/"),H.appendChild(L);E.appendChild(H);"fontdialog-webfonts");H.appendChild(m);L=document.createElement("label");L.setAttribute("for","fontdialog-webfonts");mxUtils.write(L,mxResources.get("webfonts",null,"Web Fonts"));H.appendChild(L);E.appendChild(H);Editor.enableWebFonts&&u.appendChild(E);E=document.createElement("tr");H=document.createElement("td");H.style.whiteSpace="nowrap";H.style.fontSize="10pt";H.style.width="120px";H.style.paddingLeft="15px";mxUtils.write(H,mxResources.get("fontname",null,"Font Name")+":");E.appendChild(H);var t=document.createElement("input");"w"==c&&(Editor.enableWebFonts?t.setAttribute("value",e):F.setAttribute("value",e));t.style.marginLeft="4px";t.style.width="250px";t.className="dlg_fontName_w";H=document.createElement("td");H.appendChild(t);E.appendChild(H);Editor.enableWebFonts&&u.appendChild(E);E=document.createElement("tr");H=document.createElement("td");H.style.whiteSpace="nowrap";H.style.fontSize="10pt";H.style.width="120px";H.style.paddingLeft="15px";mxUtils.write(H,mxResources.get("fontUrl",null,"Font URL")+":");E.appendChild(H);var v=document.createElement("input");v.setAttribute("value",f||"");v.style.marginLeft="4px";v.style.width="250px";v.className="dlg_fontUrl";H=document.createElement("td");H.appendChild(v);E.appendChild(H);Editor.enableWebFonts&&u.appendChild(E);this.init=function(){var B=F;"g"==c?B=g:"w"==c&&Editor.enableWebFonts&&(B=t);B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null)};E=document.createElement("tr");-H=document.createElement("td");H.colSpan=2;H.style.paddingTop="20px";H.style.whiteSpace="nowrap";H.setAttribute("align","right");b.isOffline()||H.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();k()});e.className="geBtn";b.editor.cancelFirst&&H.appendChild(e);var y=mxUtils.button(mxResources.get("apply"),function(){if(D.checked){var B=F.value;var I="s"}else if(d.checked){B=g.value;var K=Editor.GOOGLE_FONTS+-encodeURIComponent(B).replace(/%20/g,"+");I="g"}else m.checked&&(B=t.value,K=v.value,I="w");var J=B;var V=K,Q=I,O=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,p=q.querySelector(".dlg_fontName_"+Q);null==p||null!=J&&0!=J.length?(p=q.querySelector(".dlg_fontUrl"),null==p||"w"!=Q||O.test(V)?J=!0:(p.style.border="1px solid red",J=!1)):(p.style.border="1px solid red",J=!1);J&&(k(B,K,I),b.hideDialog())});y.className="geBtn gePrimaryBtn";mxEvent.addListener(F,"keypress",+H=document.createElement("td");H.colSpan=2;H.style.paddingTop="20px";H.style.whiteSpace="nowrap";H.setAttribute("align","right");b.isOffline()||H.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();k()});e.className="geBtn";b.editor.cancelFirst&&H.appendChild(e);var y=mxUtils.button(mxResources.get("apply"),function(){if(D.checked){var B=F.value;var I="s"}else if(d.checked){B=g.value;var J=Editor.GOOGLE_FONTS++encodeURIComponent(B).replace(/%20/g,"+");I="g"}else m.checked&&(B=t.value,J=v.value,I="w");var K=B;var V=J,Q=I,P=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,p=q.querySelector(".dlg_fontName_"+Q);null==p||null!=K&&0!=K.length?(p=q.querySelector(".dlg_fontUrl"),null==p||"w"!=Q||P.test(V)?K=!0:(p.style.border="1px solid red",K=!1)):(p.style.border="1px solid red",K=!1);K&&(k(B,J,I),b.hideDialog())});y.className="geBtn gePrimaryBtn";mxEvent.addListener(F,"keypress",n);mxEvent.addListener(g,"keypress",n);mxEvent.addListener(t,"keypress",n);mxEvent.addListener(v,"keypress",n);mxEvent.addListener(F,"focus",function(){D.setAttribute("checked","checked");D.checked=!0});mxEvent.addListener(g,"focus",function(){d.setAttribute("checked","checked");d.checked=!0});mxEvent.addListener(t,"focus",function(){m.setAttribute("checked","checked");m.checked=!0});mxEvent.addListener(v,"focus",function(){m.setAttribute("checked","checked");m.checked=!0});H.appendChild(y);b.editor.cancelFirst||H.appendChild(e);E.appendChild(H);u.appendChild(E);q.appendChild(u);this.container=q};function AspectDialog(b,e,f,c,k){this.aspect={pageId:e||(b.pages?b.pages[0].getId():null),layerIds:f||[]};e=document.createElement("div");var n=document.createElement("h5");n.style.margin="0 0 10px";mxUtils.write(n,mxResources.get("pages"));e.appendChild(n);f=document.createElement("div");f.className="geAspectDlgList";e.appendChild(f);n=document.createElement("h5");n.style.margin="0 0 10px";mxUtils.write(n,mxResources.get("layers"));e.appendChild(n);n=document.createElement("div");n.className="geAspectDlgList";@@ -12628,32 +12628,32 @@ AspectDialog.prototype.createPageItem=function(b,e,f){var c=document.createElemethis.selectedPage=b;c.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var n=k.model;n=n.getChildCells(n.getRoot());for(var q=0;q<n.length;q++)this.createLayerItem(n[q],b,k,f)});mxEvent.addListener(c,"click",e);this.aspect.pageId==b&&e()};AspectDialog.prototype.createLayerItem=function(b,e,f,c){e=f.convertValueToString(b)||mxResources.get("background")||"Background";var k=document.createElement("div");k.setAttribute("data-layer-id",b.id);k.className="geAspectDlgListItem";k.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(e)+"</div>";this.layersContainer.appendChild(k);this.createViewer(k.childNodes[0],c,b.id);c=mxUtils.bind(this,function(){0<=k.className.indexOf("geAspectDlgListItemSelected")?(k.className="geAspectDlgListItem",delete this.selectedLayers[b.id],mxUtils.isEmptyObject(this.selectedLayers)&&this.okBtn.setAttribute("disabled","disabled")):(k.className+=" geAspectDlgListItemSelected",this.selectedLayers[b.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(k,"click",c);-1!=this.aspect.layerIds.indexOf(b.id)&&c()};-var FilePropertiesDialog=function(b,e){function f(I){var K=H;H=function(J,V){try{I(function(){K(J,V)},V)}catch(Q){V(Q)}}}var c=document.createElement("table"),k=document.createElement("tbody");c.style.width="100%";c.style.marginTop="8px";c.style.tableLayout="fixed";var n=b.getCurrentFile(),q=null!=n&&null!=n.getTitle()?n.getTitle():b.defaultFilename,u=/(\.png)$/i.test(q),E=/(\.svg)$/i.test(q),H=function(I,K){I()},D=null!=n?n.isLocked():!1;var L=document.createElement("tr");var F=document.createElement("td");-F.style.whiteSpace="nowrap";F.style.overflow="hidden";F.style.textOverflow="ellipsis";F.style.fontSize="10pt";mxUtils.write(F,mxResources.get("locked")+":");L.appendChild(F);var d=document.createElement("input");d.setAttribute("type","checkbox");D&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);F=document.createElement("td");F.style.whiteSpace="nowrap";F.appendChild(d);L.appendChild(F);k.appendChild(L);this.init=function(){d.focus()};f(function(I,K){null!=b.fileNode&&D!=d.checked?window.setTimeout(function(){null!=+var FilePropertiesDialog=function(b,e){function f(I){var J=H;H=function(K,V){try{I(function(){J(K,V)},V)}catch(Q){V(Q)}}}var c=document.createElement("table"),k=document.createElement("tbody");c.style.width="100%";c.style.marginTop="8px";c.style.tableLayout="fixed";var n=b.getCurrentFile(),q=null!=n&&null!=n.getTitle()?n.getTitle():b.defaultFilename,u=/(\.png)$/i.test(q),E=/(\.svg)$/i.test(q),H=function(I,J){I()},D=null!=n?n.isLocked():!1;var L=document.createElement("tr");var F=document.createElement("td");+F.style.whiteSpace="nowrap";F.style.overflow="hidden";F.style.textOverflow="ellipsis";F.style.fontSize="10pt";mxUtils.write(F,mxResources.get("locked")+":");L.appendChild(F);var d=document.createElement("input");d.setAttribute("type","checkbox");D&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);F=document.createElement("td");F.style.whiteSpace="nowrap";F.appendChild(d);L.appendChild(F);k.appendChild(L);this.init=function(){d.focus()};f(function(I,J){null!=b.fileNode&&D!=d.checked?window.setTimeout(function(){null!=n&&n.setLocked(d.checked);I()},0):I()});if(u||E){q=1;u=0;L=b.fileNode;null!=L&&(L.hasAttribute("scale")&&(q=parseFloat(L.getAttribute("scale"))),L.hasAttribute("border")&&(u=parseInt(L.getAttribute("border"))));L=document.createElement("tr");F=document.createElement("td");F.style.whiteSpace="nowrap";F.style.fontSize="10pt";mxUtils.write(F,mxResources.get("zoom")+":");L.appendChild(F);var g=document.createElement("input");g.setAttribute("value",100*q+"%");g.style.marginLeft="4px";g.style.width="100%";F=document.createElement("td");F.style.whiteSpace="nowrap";F.appendChild(g);L.appendChild(F);k.appendChild(L);L=document.createElement("tr");F=document.createElement("td");F.style.whiteSpace="nowrap";F.style.fontSize="10pt";mxUtils.write(F,mxResources.get("borderWidth")+":");L.appendChild(F);var m=document.createElement("input");m.setAttribute("value",u);m.style.marginLeft="4px";m.style.width="100%";F=document.createElement("td");F.style.whiteSpace="nowrap";F.appendChild(m);L.appendChild(F);k.appendChild(L);-this.init=this.init||function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?g.select():document.execCommand("selectAll",!1,null)};f(function(I,K){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(g.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(m.value))),null!=n&&n.fileChanged());I()})}else if(!/(\.html)$/i.test(q)&&!/(\.svg)$/i.test(q)){var t=null!=n?n.isCompressed():Editor.defaultCompressed;L=document.createElement("tr");F=document.createElement("td");-F.style.whiteSpace="nowrap";F.style.overflow="hidden";F.style.textOverflow="ellipsis";F.style.fontSize="10pt";mxUtils.write(F,mxResources.get("compressed")+":");L.appendChild(F);var v=document.createElement("input");v.setAttribute("type","checkbox");t&&(v.setAttribute("checked","checked"),v.defaultChecked=!0);F=document.createElement("td");F.style.whiteSpace="nowrap";F.appendChild(v);L.appendChild(F);k.appendChild(L);this.init=this.init||function(){v.focus()};f(function(I,K){null!=b.fileNode&&t!=+this.init=this.init||function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?g.select():document.execCommand("selectAll",!1,null)};f(function(I,J){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(g.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(m.value))),null!=n&&n.fileChanged());I()})}else if(!/(\.html)$/i.test(q)&&!/(\.svg)$/i.test(q)){var t=null!=n?n.isCompressed():Editor.defaultCompressed;L=document.createElement("tr");F=document.createElement("td");+F.style.whiteSpace="nowrap";F.style.overflow="hidden";F.style.textOverflow="ellipsis";F.style.fontSize="10pt";mxUtils.write(F,mxResources.get("compressed")+":");L.appendChild(F);var v=document.createElement("input");v.setAttribute("type","checkbox");t&&(v.setAttribute("checked","checked"),v.defaultChecked=!0);F=document.createElement("td");F.style.whiteSpace="nowrap";F.appendChild(v);L.appendChild(F);k.appendChild(L);this.init=this.init||function(){v.focus()};f(function(I,J){null!=b.fileNode&&t!=v.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",v.checked?"true":"false");null!=n&&(n.compressionChanged(v.checked),n.fileChanged());I()},0):I()})}if(null!=n&&n.isRealtimeOptional()){L=document.createElement("tr");F=document.createElement("td");F.style.whiteSpace="nowrap";F.style.overflow="hidden";F.style.textOverflow="ellipsis";F.style.fontSize="10pt";mxUtils.write(F,mxResources.get("realtimeCollaboration")+":");L.appendChild(F);var y=document.createElement("input");y.setAttribute("type",-"checkbox");var B=n.isRealtimeEnabled();if(B="disabled"!=b.drive.getCustomProperty(n.desc,"collaboration"))y.setAttribute("checked","checked"),y.defaultChecked=!0;f(function(I,K){y.checked!=B?n.setRealtimeEnabled(y.checked,I,K):I()});this.init=null!=this.init?this.init:function(){y.focus()};F=document.createElement("td");F.style.whiteSpace="nowrap";F.appendChild(y);F.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));L.appendChild(F);k.appendChild(L)}null!=n&&+"checkbox");var B=n.isRealtimeEnabled();if(B="disabled"!=b.drive.getCustomProperty(n.desc,"collaboration"))y.setAttribute("checked","checked"),y.defaultChecked=!0;f(function(I,J){y.checked!=B?n.setRealtimeEnabled(y.checked,I,J):I()});this.init=null!=this.init?this.init:function(){y.focus()};F=document.createElement("td");F.style.whiteSpace="nowrap";F.appendChild(y);F.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));L.appendChild(F);k.appendChild(L)}null!=n&&"draw.io"==b.getServiceName()&&0<n.getSize()&&"1"!=urlParams.embed&&(L=document.createElement("tr"),F=document.createElement("td"),F.style.whiteSpace="nowrap",F.style.overflow="hidden",F.style.textOverflow="ellipsis",F.style.fontSize="10pt",mxUtils.write(F,mxResources.get("size")+":"),L.appendChild(F),F=b.formatFileSize(n.getSize()),q=document.createElement("input"),q.setAttribute("title",F),q.setAttribute("value",F),q.setAttribute("disabled","disabled"),q.style.marginLeft="4px",q.style.width="100%",F=document.createElement("td"),F.style.whiteSpace="nowrap",F.appendChild(q),L.appendChild(F),k.appendChild(L));null!=e&&(L=document.createElement("tr"),F=document.createElement("td"),F.style.whiteSpace="nowrap",F.style.overflow="hidden",F.style.textOverflow="ellipsis",F.style.fontSize="10pt",mxUtils.write(F,mxResources.get("publicDiagramUrl")+":"),L.appendChild(F),q=document.createElement("a"),q.setAttribute("href",e),q.setAttribute("title",e),q.style.whiteSpace="nowrap",q.style.overflow="hidden",q.style.textOverflow="ellipsis",q.style.display="block",q.style.margin="2px 0px 2px 8px",q.style.fontSize="10pt",mxUtils.write(q,e),mxEvent.addListener(q,"click",function(I){b.openLink(e);mxEvent.consume(I)}),F=document.createElement("td"),F.appendChild(q),L.appendChild(F),k.appendChild(L));null!=n&&null!=n.fileObject&&null!=n.fileObject.path&&(L=document.createElement("tr"),F=document.createElement("td"),F.style.whiteSpace="nowrap",F.style.overflow="hidden",F.style.textOverflow="ellipsis",F.style.fontSize="10pt",mxUtils.write(F,mxResources.get("pathFilename")+":"),L.appendChild(F),q=document.createElement("input"),q.setAttribute("title",n.fileObject.path),q.setAttribute("value",n.fileObject.path),q.setAttribute("disabled","disabled"),q.style.marginLeft="4px",q.style.width="100%",F=document.createElement("td"),F.appendChild(q),L.appendChild(F),k.appendChild(L));this.init=null!=this.init?this.init:function(){};q=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&H(function(){b.spinner.stop();b.hideDialog()},function(I){b.spinner.stop();b.handleError(I,mxResources.get("error"))})});q.className="geBtn gePrimaryBtn";L=document.createElement("tr");F=document.createElement("td");F.colSpan=2;F.style.paddingTop="20px";F.style.whiteSpace="nowrap";F.setAttribute("align","right");u=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});u.className="geBtn";b.editor.cancelFirst&&F.appendChild(u);F.appendChild(q);b.editor.cancelFirst||F.appendChild(u);L.appendChild(F);k.appendChild(L);c.appendChild(k);this.container=c},ConnectionPointsDialog=function(b,e){function f(){null!=k&&k.destroy()}var c=document.createElement("div");c.style.userSelect="none";var k=null;this.init=function(){function n(A,C,M){A=new mxCell("",new mxGeometry(A,C,6,6),"shape=mxgraph.basic.x;fillColor=#29b6f2;strokeColor=#29b6f2;points=[];rotatable=0;resizable=0;connectable=0;editable=0;");A.vertex=!0;A.cp=!0;A.constObj=M;return L.addCell(A)}function q(A){A=L.getSelectionCells();L.deleteCells(A)}-function u(){var A=parseInt(Q.value)||0;A=0>A?0:100<A?100:A;Q.value=A;var C=parseInt(p.value)||0;C=0>C?0:100<C?100:C;p.value=C;var M=parseInt(O.value)||0,S=parseInt(z.value)||0;M=new mxConnectionConstraint(new mxPoint(A/100,C/100),!1,null,M,S);A=L.getConnectionPoint(g,M);C=L.getSelectionCell();if(null!=C){C.constObj=M;M=C.geometry.clone();S=L.view.scale;var l=L.view.translate;M.x=(A.x-3*S)/S-l.x;M.y=(A.y-3*S)/S-l.y;L.model.setGeometry(C,M)}}function E(A){if(A.constObj)return{x:A.constObj.point.x,-y:A.constObj.point.y,dx:A.constObj.dx,dy:A.constObj.dy};var C=0,M=0,S=F.geometry,l=mxUtils.format((A.geometry.x+3-S.x)/S.width);A=mxUtils.format((A.geometry.y+3-S.y)/S.height);0>l?(C=l*S.width,l=0):1<l&&(C=(l-1)*S.width,l=1);0>A?(M=A*S.height,A=0):1<A&&(M=(A-1)*S.height,A=1);return{x:l,y:A,dx:parseInt(C),dy:parseInt(M)}}function H(A){if(1==L.getSelectionCount()){var C=L.getSelectionCell();A&&(C.constObj=null);A=E(C);Q.value=100*A.x;p.value=100*A.y;O.value=A.dx;z.value=A.dy;V.style.visibility=""}else V.style.visibility=+function u(){var A=parseInt(Q.value)||0;A=0>A?0:100<A?100:A;Q.value=A;var C=parseInt(p.value)||0;C=0>C?0:100<C?100:C;p.value=C;var M=parseInt(P.value)||0,S=parseInt(z.value)||0;M=new mxConnectionConstraint(new mxPoint(A/100,C/100),!1,null,M,S);A=L.getConnectionPoint(g,M);C=L.getSelectionCell();if(null!=C){C.constObj=M;M=C.geometry.clone();S=L.view.scale;var l=L.view.translate;M.x=(A.x-3*S)/S-l.x;M.y=(A.y-3*S)/S-l.y;L.model.setGeometry(C,M)}}function E(A){if(A.constObj)return{x:A.constObj.point.x,+y:A.constObj.point.y,dx:A.constObj.dx,dy:A.constObj.dy};var C=0,M=0,S=F.geometry,l=mxUtils.format((A.geometry.x+3-S.x)/S.width);A=mxUtils.format((A.geometry.y+3-S.y)/S.height);0>l?(C=l*S.width,l=0):1<l&&(C=(l-1)*S.width,l=1);0>A?(M=A*S.height,A=0):1<A&&(M=(A-1)*S.height,A=1);return{x:l,y:A,dx:parseInt(C),dy:parseInt(M)}}function H(A){if(1==L.getSelectionCount()){var C=L.getSelectionCell();A&&(C.constObj=null);A=E(C);Q.value=100*A.x;p.value=100*A.y;P.value=A.dx;z.value=A.dy;V.style.visibility=""}else V.style.visibility="hidden"}var D=document.createElement("div");D.style.width="350px";D.style.height="350px";D.style.overflow="hidden";D.style.border="1px solid lightGray";D.style.boxSizing="border-box";mxEvent.disableContextMenu(D);c.appendChild(D);var L=new Graph(D);L.transparentBackground=!1;L.autoExtend=!1;L.autoScroll=!1;L.setGridEnabled(!1);L.setEnabled(!0);L.setPanning(!0);L.setConnectable(!1);L.setTooltips(!1);L.minFitScale=null;L.maxFitScale=null;L.centerZoom=!0;L.maxFitScale=2;D=e.geometry;var F=new mxCell(e.value,new mxGeometry(0,0,D.width,D.height),e.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;fillColor=none;");F.vertex=!0;L.addCell(F);L.dblClick=function(A,C){if(null!=C&&C!=F)L.setSelectionCell(C);else{C=mxUtils.convertPoint(L.container,mxEvent.getClientX(A),mxEvent.getClientY(A));mxEvent.consume(A);A=L.view.scale;var M=L.view.translate;L.setSelectionCell(n((C.x-3*A)/A-M.x,(C.y-3*A)/A-M.y))}};k=new mxKeyHandler(L);k.bindKey(46,q);k.bindKey(8,q);L.getRubberband().isForceRubberbandEvent=function(A){return 0==A.evt.button&&(null==A.getCell()||A.getCell()==F)};L.panningHandler.isForcePanningEvent=function(A){return 2==A.evt.button};var d=L.isCellSelectable;L.isCellSelectable=function(A){return A==F?!1:d.apply(this,arguments)};L.getLinkForCell=function(){return null};var g=L.view.getState(F);D=L.getAllConnectionConstraints(g);for(var m=0;null!=D&&m<D.length;m++){var t=L.getConnectionPoint(g,D[m]);n(t.x-3,t.y-3,D[m])}L.fit(8);L.center();m=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){L.zoomIn()},20);t=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){L.zoomOut()},20);var v=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==L.view.scale?(L.maxFitScale=8,L.fit(8)):L.zoomActual();L.center()},20),y=function(){b.prompt(mxResources.get("gridSize"),L.gridSize,function(A){!isNaN(A)&&0<A&&(L.setGridSize(A),L.setGridEnabled(!0),L.refresh())})},B=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(A){mxEvent.isShiftDown(A)?-y():(L.setGridEnabled(!L.isGridEnabled()),L.refresh())},20);mxEvent.addListener(B,"dblclick",y);var I=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),q,20);mxUtils.setOpacity(I,10);D=document.createElement("div");D.style.display="flex";D.style.alignItems="center";D.style.paddingTop="6px";D.appendChild(m);D.appendChild(t);D.appendChild(v);D.appendChild(B);D.appendChild(I);c.appendChild(D);var K=document.createElement("input");K.setAttribute("type","number");K.setAttribute("min","1");-K.setAttribute("value","1");K.style.width="45px";K.style.position="relative";K.style.margin="0 4px 0 4px";var J=document.createElement("select");J.style.position="relative";t=["left","right","top","bottom"];for(m=0;m<t.length;m++)v=t[m],B=document.createElement("option"),mxUtils.write(B,mxResources.get(v)),B.value=v,J.appendChild(B);m=mxUtils.button(mxResources.get("add"),function(){var A=parseInt(K.value);A=1>A?1:100<A?100:A;K.value=A;for(var C=J.value,M=F.geometry,S=[],l=0;l<A;l++){switch(C){case "left":var x=-M.x;var G=M.y+(l+1)*M.height/(A+1);break;case "right":x=M.x+M.width;G=M.y+(l+1)*M.height/(A+1);break;case "top":x=M.x+(l+1)*M.width/(A+1);G=M.y;break;case "bottom":x=M.x+(l+1)*M.width/(A+1),G=M.y+M.height}S.push(n(x-3,G-3))}L.setSelectionCells(S)});m.style.marginLeft="auto";D.appendChild(m);D.appendChild(K);D.appendChild(J);var V=document.createElement("div");V.style.margin="4px 0px 8px 0px";V.style.whiteSpace="nowrap";V.style.height="24px";D=document.createElement("span");mxUtils.write(D,mxResources.get("dx"));-V.appendChild(D);var Q=document.createElement("input");Q.setAttribute("type","number");Q.setAttribute("min","0");Q.setAttribute("max","100");Q.style.width="45px";Q.style.margin="0 4px 0 4px";V.appendChild(Q);mxUtils.write(V,"%");var O=document.createElement("input");O.setAttribute("type","number");O.style.width="45px";O.style.margin="0 4px 0 4px";V.appendChild(O);mxUtils.write(V,"pt");D=document.createElement("span");mxUtils.write(D,mxResources.get("dy"));D.style.marginLeft="12px";V.appendChild(D);+y():(L.setGridEnabled(!L.isGridEnabled()),L.refresh())},20);mxEvent.addListener(B,"dblclick",y);var I=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),q,20);mxUtils.setOpacity(I,10);D=document.createElement("div");D.style.display="flex";D.style.alignItems="center";D.style.paddingTop="6px";D.appendChild(m);D.appendChild(t);D.appendChild(v);D.appendChild(B);D.appendChild(I);c.appendChild(D);var J=document.createElement("input");J.setAttribute("type","number");J.setAttribute("min","1");+J.setAttribute("value","1");J.style.width="45px";J.style.position="relative";J.style.margin="0 4px 0 4px";var K=document.createElement("select");K.style.position="relative";t=["left","right","top","bottom"];for(m=0;m<t.length;m++)v=t[m],B=document.createElement("option"),mxUtils.write(B,mxResources.get(v)),B.value=v,K.appendChild(B);m=mxUtils.button(mxResources.get("add"),function(){var A=parseInt(J.value);A=1>A?1:100<A?100:A;J.value=A;for(var C=K.value,M=F.geometry,S=[],l=0;l<A;l++){switch(C){case "left":var x=+M.x;var G=M.y+(l+1)*M.height/(A+1);break;case "right":x=M.x+M.width;G=M.y+(l+1)*M.height/(A+1);break;case "top":x=M.x+(l+1)*M.width/(A+1);G=M.y;break;case "bottom":x=M.x+(l+1)*M.width/(A+1),G=M.y+M.height}S.push(n(x-3,G-3))}L.setSelectionCells(S)});m.style.marginLeft="auto";D.appendChild(m);D.appendChild(J);D.appendChild(K);var V=document.createElement("div");V.style.margin="4px 0px 8px 0px";V.style.whiteSpace="nowrap";V.style.height="24px";D=document.createElement("span");mxUtils.write(D,mxResources.get("dx"));+V.appendChild(D);var Q=document.createElement("input");Q.setAttribute("type","number");Q.setAttribute("min","0");Q.setAttribute("max","100");Q.style.width="45px";Q.style.margin="0 4px 0 4px";V.appendChild(Q);mxUtils.write(V,"%");var P=document.createElement("input");P.setAttribute("type","number");P.style.width="45px";P.style.margin="0 4px 0 4px";V.appendChild(P);mxUtils.write(V,"pt");D=document.createElement("span");mxUtils.write(D,mxResources.get("dy"));D.style.marginLeft="12px";V.appendChild(D);var p=document.createElement("input");p.setAttribute("type","number");p.setAttribute("min","0");p.setAttribute("max","100");p.style.width="45px";p.style.margin="0 4px 0 4px";V.appendChild(p);mxUtils.write(V,"%");var z=document.createElement("input");z.setAttribute("type","number");z.style.width="45px";z.style.margin="0 4px 0 4px";V.appendChild(z);mxUtils.write(V,"pt");c.appendChild(V);H();L.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<L.getSelectionCount()?mxUtils.setOpacity(I,60):-mxUtils.setOpacity(I,10);H()});L.addListener(mxEvent.CELLS_MOVED,H);mxEvent.addListener(Q,"change",u);mxEvent.addListener(p,"change",u);mxEvent.addListener(O,"change",u);mxEvent.addListener(z,"change",u);D=mxUtils.button(mxResources.get("cancel"),function(){f();b.hideDialog()});D.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){var A=L.model.cells,C=[],M=[],S;for(S in A){var l=A[S];l.cp&&M.push(E(l))}M.sort(function(x,G){return x.x!=G.x?x.x-G.x:x.y!=G.y?x.y-G.y:x.dx!=G.dx?x.dx-+mxUtils.setOpacity(I,10);H()});L.addListener(mxEvent.CELLS_MOVED,H);mxEvent.addListener(Q,"change",u);mxEvent.addListener(p,"change",u);mxEvent.addListener(P,"change",u);mxEvent.addListener(z,"change",u);D=mxUtils.button(mxResources.get("cancel"),function(){f();b.hideDialog()});D.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){var A=L.model.cells,C=[],M=[],S;for(S in A){var l=A[S];l.cp&&M.push(E(l))}M.sort(function(x,G){return x.x!=G.x?x.x-G.x:x.y!=G.y?x.y-G.y:x.dx!=G.dx?x.dx-G.dx:x.dy-G.dy});for(A=0;A<M.length;A++)0<A&&M[A].x==M[A-1].x&&M[A].y==M[A-1].y&&M[A].dx==M[A-1].dx&&M[A].dy==M[A-1].dy||C.push("["+M[A].x+","+M[A].y+",0,"+M[A].dx+","+M[A].dy+"]");b.editor.graph.setCellStyles("points","["+C.join(",")+"]",[e]);f();b.hideDialog()});m.className="geBtn gePrimaryBtn";t=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[e]);f();b.hideDialog()});t.className="geBtn";v=document.createElement("div");v.style.marginTop="10px";v.style.textAlign="right";b.isOffline()||v.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&v.appendChild(D);v.appendChild(t);v.appendChild(m);b.editor.cancelFirst||v.appendChild(D);c.appendChild(v)};this.destroy=f;this.container=c};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinCommentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEyLjUgMjcuNWgyM3YtMi4yNWgtMjNabTAtNi4zNWgyM3YtMi4zaC0yM1ptMC02LjRoMjNWMTIuNWgtMjNaTTQzIDQyLjEgMzUuOSAzNWgtMjhxLTEuMTUgMC0yLjAyNS0uODc1VDUgMzIuMVY3LjlxMC0xLjE1Ljg3NS0yLjAyNVQ3LjkgNWgzMi4ycTEuMiAwIDIuMDUuODc1UTQzIDYuNzUgNDMgNy45Wk03LjI1IDcuOXYyNC44NUgzNi45bDMuODUgMy44NVY3LjlxMC0uMy0uMTc1LS40NzVUNDAuMSA3LjI1SDcuOXEtLjMgMC0uNDc1LjE3NVQ3LjI1IDcuOVptMCAwdjI4LjdWNy4yNSA3LjlaIi8+PC9zdmc+";@@ -12733,9 +12733,9 @@ type:"bool",defVal:!1,isVisible:function(l,x){x=x.editorUi.editor.graph.model;redefVal:!1},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(l,x){var G=mxUtils.getValue(l.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||x.editorUi.editor.graph.isSwimlane(l.vertices[0])||null==G||G==mxConstants.NONE||0==mxUtils.getValue(l.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(l.style,mxConstants.STYLE_OPACITY,100)||null!=l.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",type:"bool",defVal:!1,isVisible:function(l,x){return 0<l.vertices.length&&x.editorUi.editor.graph.isContainer(l.vertices[0])}}].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart or a JSON string as used in\n## Layout, Apply. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.createRoughCanvas=function(l){var x=rough.canvas({getContext:function(){return l}});x.draw=function(G){var N=G.sets||[];G=G.options||this.getDefaultOptions();for(var P=0;P<N.length;P++){var R=N[P];switch(R.type){case "path":null!=G.stroke&&this._drawToContext(l,R,G);break;case "fillPath":this._drawToContext(l,R,G);break;case "fillSketch":this.fillSketch(l,R,G)}}};x.fillSketch=function(G,N,P){var R=l.state.strokeColor,T=l.state.strokeWidth,U=l.state.strokeAlpha,W=l.state.dashed,X=P.fillWeight;-0>X&&(X=P.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(P.fill||"");l.setStrokeWidth(X);l.setDashed(!1);this._drawToContext(G,N,P);l.setDashed(W);l.setStrokeWidth(T);l.setStrokeColor(R);l.setStrokeAlpha(U)};x._drawToContext=function(G,N,P){G.begin();for(var R=0;R<N.ops.length;R++){var T=N.ops[R],U=T.data;switch(T.op){case "move":G.moveTo(U[0],U[1]);break;case "bcurveTo":G.curveTo(U[0],U[1],U[2],U[3],U[4],U[5]);break;case "lineTo":G.lineTo(U[0],U[1])}}G.end();"fillPath"===N.type&&-P.filled?G.fill():G.stroke()};return x};(function(){function l(R,T,U){this.canvas=R;this.rc=T;this.shape=U;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,l.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,l.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,l.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=+Editor.createRoughCanvas=function(l){var x=rough.canvas({getContext:function(){return l}});x.draw=function(G){var N=G.sets||[];G=G.options||this.getDefaultOptions();for(var O=0;O<N.length;O++){var R=N[O];switch(R.type){case "path":null!=G.stroke&&this._drawToContext(l,R,G);break;case "fillPath":this._drawToContext(l,R,G);break;case "fillSketch":this.fillSketch(l,R,G)}}};x.fillSketch=function(G,N,O){var R=l.state.strokeColor,T=l.state.strokeWidth,U=l.state.strokeAlpha,W=l.state.dashed,X=O.fillWeight;+0>X&&(X=O.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(O.fill||"");l.setStrokeWidth(X);l.setDashed(!1);this._drawToContext(G,N,O);l.setDashed(W);l.setStrokeWidth(T);l.setStrokeColor(R);l.setStrokeAlpha(U)};x._drawToContext=function(G,N,O){G.begin();for(var R=0;R<N.ops.length;R++){var T=N.ops[R],U=T.data;switch(T.op){case "move":G.moveTo(U[0],U[1]);break;case "bcurveTo":G.curveTo(U[0],U[1],U[2],U[3],U[4],U[5]);break;case "lineTo":G.lineTo(U[0],U[1])}}G.end();"fillPath"===N.type&&+O.filled?G.fill():G.stroke()};return x};(function(){function l(R,T,U){this.canvas=R;this.rc=T;this.shape=U;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,l.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,l.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,l.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,l.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,l.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,l.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,l.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,l.prototype.fillAndStroke);this.path=[];this.passThrough=!1}l.prototype.moveOp="M";l.prototype.lineOp="L";l.prototype.quadOp="Q";l.prototype.curveOp="C";l.prototype.closeOp="Z";l.prototype.getStyle=function(R,T){var U=1;if(null!=this.shape.state){var W=this.shape.state.cell.id;if(null!=W)for(var X=0;X<W.length;X++)U=(U<<5)-U+W.charCodeAt(X)<<0}U={strokeWidth:this.canvas.state.strokeWidth,seed:U,preserveVertices:!0};W=this.rc.getDefaultOptions();U.stroke=R?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:@@ -12744,22 +12744,22 @@ W.roughness);U.simplification=mxUtils.getValue(this.shape.style,"simplification"T);U.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",T);T=mxUtils.getValue(this.shape.style,"fillWeight",-1);U.fillWeight="auto"==T?-1:T;T=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==T&&(T="auto");"auto"==T&&(T=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&T.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&T.push(mxUtils.hex2rgb(Editor.darkColor)),T=null!=U.fill&&(null!=R||0<=mxUtils.indexOf(T,mxUtils.hex2rgb(U.fill)))?"solid":W.fillStyle);U.fillStyle=T;return U};l.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};l.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};l.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var R=2;R<arguments.length;R+=2)this.lastX=arguments[R-1],this.lastY=arguments[R],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};l.prototype.lineTo=function(R,T){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,R,T),this.lastX=R,this.lastY=T)};l.prototype.moveTo=function(R,T){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,R,T),this.lastX=R,this.lastY=T,this.firstX=R,this.firstY=T)};l.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};l.prototype.quadTo=function(R,T,U,W){this.passThrough?-this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,R,T,U,W),this.lastX=U,this.lastY=W)};l.prototype.curveTo=function(R,T,U,W,X,Y){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,R,T,U,W,X,Y),this.lastX=X,this.lastY=Y)};l.prototype.arcTo=function(R,T,U,W,X,Y,Z){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var ba=mxUtils.arcToCurves(this.lastX,this.lastY,R,T,U,W,X,Y,Z);if(null!=ba)for(var ha=0;ha<ba.length;ha+=-6)this.curveTo(ba[ha],ba[ha+1],ba[ha+2],ba[ha+3],ba[ha+4],ba[ha+5]);this.lastX=Y;this.lastY=Z}};l.prototype.rect=function(R,T,U,W){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(R,T,U,W,this.getStyle(!0,!0)))};l.prototype.ellipse=function(R,T,U,W){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(R+U/2,T+W/2,U,W,this.getStyle(!0,!0)))};l.prototype.roundrect=+this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,R,T,U,W),this.lastX=U,this.lastY=W)};l.prototype.curveTo=function(R,T,U,W,X,Y){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,R,T,U,W,X,Y),this.lastX=X,this.lastY=Y)};l.prototype.arcTo=function(R,T,U,W,X,Y,Z){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var ba=mxUtils.arcToCurves(this.lastX,this.lastY,R,T,U,W,X,Y,Z);if(null!=ba)for(var fa=0;fa<ba.length;fa+=+6)this.curveTo(ba[fa],ba[fa+1],ba[fa+2],ba[fa+3],ba[fa+4],ba[fa+5]);this.lastX=Y;this.lastY=Z}};l.prototype.rect=function(R,T,U,W){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(R,T,U,W,this.getStyle(!0,!0)))};l.prototype.ellipse=function(R,T,U,W){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(R+U/2,T+W/2,U,W,this.getStyle(!0,!0)))};l.prototype.roundrect=function(R,T,U,W,X,Y){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(R+X,T),this.lineTo(R+U-X,T),this.quadTo(R+U,T,R+U,T+Y),this.lineTo(R+U,T+W-Y),this.quadTo(R+U,T+W,R+U-X,T+W),this.lineTo(R+X,T+W),this.quadTo(R,T+W,R,T+W-Y),this.lineTo(R,T+Y),this.quadTo(R,T,R+X,T))};l.prototype.drawPath=function(R){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),R)}catch(U){}this.passThrough=!1}else if(null!=this.nextShape){for(var T in R)this.nextShape.options[T]=R[T];R.stroke!=mxConstants.NONE&&null!=R.stroke||delete this.nextShape.options.stroke;R.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};l.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};l.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};l.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(R){return new l(R,Editor.createRoughCanvas(R),this)};var x=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(R){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?x.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(R):this.createRoughCanvas(R)};var G=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(R,T,U,W,X){null!=R.handJiggle&&R.handJiggle.passThrough||G.apply(this,arguments)};var N=mxShape.prototype.paint;mxShape.prototype.paint=function(R){var T=R.addTolerance,U=!0;null!=this.style&&(U="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=R.handJiggle&&R.handJiggle.constructor==l&&!this.outline){R.save();var W=this.fill,X=this.stroke;this.stroke=this.fill=null;var Y=this.configurePointerEvents,Z=R.setStrokeColor;R.setStrokeColor=function(){};var ba=R.setFillColor;R.setFillColor=function(){};U||null==W||(this.configurePointerEvents=function(){});R.handJiggle.passThrough=!0;N.apply(this,arguments);R.handJiggle.passThrough=!1;R.setFillColor=ba;R.setStrokeColor=Z;this.configurePointerEvents=Y;this.stroke=X;this.fill=W;R.restore();U&&null!=W&&(R.addTolerance=function(){})}N.apply(this,arguments);R.addTolerance=-T};var P=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(R,T,U,W,X,Y){null!=R.handJiggle&&R.handJiggle.constructor==l?(R.handJiggle.passThrough=!0,P.apply(this,arguments),R.handJiggle.passThrough=!1):P.apply(this,arguments)}})();Editor.fastCompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:pako.inflateRaw(Graph.stringToArrayBuffer(atob(l)),-{to:"string"})};Editor.extractGraphModel=function(l,x,G){if(null!=l&&"undefined"!==typeof pako){var N=l.ownerDocument.getElementsByTagName("div"),P=[];if(null!=N&&0<N.length)for(var R=0;R<N.length;R++)if("mxgraph"==N[R].getAttribute("class")){P.push(N[R]);break}0<P.length&&(N=P[0].getAttribute("data-mxgraph"),null!=N?(P=JSON.parse(N),null!=P&&null!=P.xml&&(l=mxUtils.parseXml(P.xml),l=l.documentElement)):(P=P[0].getElementsByTagName("div"),0<P.length&&(N=mxUtils.getTextContent(P[0]),N=Graph.decompress(N,-null,G),0<N.length&&(l=mxUtils.parseXml(N),l=l.documentElement))))}if(null!=l&&"svg"==l.nodeName)if(N=l.getAttribute("content"),null!=N&&"<"!=N.charAt(0)&&"%"!=N.charAt(0)&&(N=unescape(window.atob?atob(N):Base64.decode(cont,N))),null!=N&&"%"==N.charAt(0)&&(N=decodeURIComponent(N)),null!=N&&0<N.length)l=mxUtils.parseXml(N).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==l||x||(P=null,"diagram"==l.nodeName?P=l:"mxfile"==l.nodeName&&(N=l.getElementsByTagName("diagram"),0<-N.length&&(P=N[Math.max(0,Math.min(N.length-1,urlParams.page||0))])),null!=P&&(l=Editor.parseDiagramNode(P,G)));null==l||"mxGraphModel"==l.nodeName||x&&"mxfile"==l.nodeName||(l=null);return l};Editor.parseDiagramNode=function(l,x,G){Editor.validateDiagramNode(l);var N=mxUtils.trim(mxUtils.getTextContent(l)),P=null;0<N.length?(x=Graph.decompress(N,null,x),null!=x&&0<x.length&&(P=mxUtils.parseXml(x).documentElement)):(l=mxUtils.getChildNodes(l),0<l.length&&(P=l[0],G&&(P=Editor.parseDiagramNode(P,x,-!1)),x=mxUtils.createXmlDocument(),x.appendChild(x.importNode(P,!0)),P=x.documentElement));return P};Editor.getDiagramNodeXml=function(l){Editor.validateDiagramNode(l);var x=mxUtils.getNodeValue(l),G=null;0<x.length?G=Graph.decompress(x):(l=l.getElementsByTagName("mxGraphModel"),null!=l&&0<l.length&&(G=mxUtils.getXml(l[0])));return G};Editor.validateDiagramNode=function(l){if(0==mxUtils.trim(mxUtils.getTextContent(l)).length&&0==mxUtils.getChildNodes(l).length){var x=new mxCodec,G=new mxGraphModel;-l.appendChild(x.encode(G))}return l};Editor.extractGraphModelFromPdf=function(l){var x=null;l=l.substring(l.indexOf(",")+1);l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0);if("%PDF-1.7"==l.substring(0,8)){var G=l.indexOf("EmbeddedFile");if(-1<G){var N=l.indexOf("stream",G)+9;if(0<l.substring(G,N).indexOf("application#2Fvnd.jgraph.mxfile")){var P=l.indexOf("endstream",N-1);return pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(N,P)),{to:"string"})}}for(G=l.indexOf("/ObjStm");0<G;){N=-l.indexOf("stream",G)+9;P=l.indexOf("endstream",N-1);N=pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(N,P)),{to:"string"});P=N.indexOf("/Subject <");if(0<P){G=N.substring(P+14,N.indexOf(">",P));if(null!=G){x=G;G=[];for(N=0;N<x.length;N+=2)P=x.substr(N,2),"00"!=P&&G.push(String.fromCharCode(parseInt(P,16)));x=G.join("")}break}G=l.indexOf("/ObjStm",G+1)}}if(null==x&&"%PDF-1.4"==l.substring(0,8)){G="";P=N=0;for(var R=[],T=null;P<l.length;){var U=l.charCodeAt(P);P+=1;10!=U&&(G+=String.fromCharCode(U));-U=="/Subject (%3Cmxfile".charCodeAt(N)?N++:N=0;if(19==N){var W=l.indexOf("%3C%2Fmxfile%3E",P)+15;P-=9;if(W>P){x=l.substring(P,W);break}}10==U&&("endobj"==G?T=null:"obj"==G.substring(G.length-3,G.length)||"xref"==G||"trailer"==G?(T=[],R[G.split(" ")[0]]=T):null!=T&&T.push(G),G="")}}null==x&&null!=R&&(x=Editor.extractGraphModelFromXref(R));null!=x&&(x=decodeURIComponent(x.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return x};Editor.extractGraphModelFromXref=function(l){var x=l.trailer,G=null;null!=+T};var O=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(R,T,U,W,X,Y){null!=R.handJiggle&&R.handJiggle.constructor==l?(R.handJiggle.passThrough=!0,O.apply(this,arguments),R.handJiggle.passThrough=!1):O.apply(this,arguments)}})();Editor.fastCompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:pako.inflateRaw(Graph.stringToArrayBuffer(atob(l)),+{to:"string"})};Editor.extractGraphModel=function(l,x,G){if(null!=l&&"undefined"!==typeof pako){var N=l.ownerDocument.getElementsByTagName("div"),O=[];if(null!=N&&0<N.length)for(var R=0;R<N.length;R++)if("mxgraph"==N[R].getAttribute("class")){O.push(N[R]);break}0<O.length&&(N=O[0].getAttribute("data-mxgraph"),null!=N?(O=JSON.parse(N),null!=O&&null!=O.xml&&(l=mxUtils.parseXml(O.xml),l=l.documentElement)):(O=O[0].getElementsByTagName("div"),0<O.length&&(N=mxUtils.getTextContent(O[0]),N=Graph.decompress(N,+null,G),0<N.length&&(l=mxUtils.parseXml(N),l=l.documentElement))))}if(null!=l&&"svg"==l.nodeName)if(N=l.getAttribute("content"),null!=N&&"<"!=N.charAt(0)&&"%"!=N.charAt(0)&&(N=unescape(window.atob?atob(N):Base64.decode(cont,N))),null!=N&&"%"==N.charAt(0)&&(N=decodeURIComponent(N)),null!=N&&0<N.length)l=mxUtils.parseXml(N).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==l||x||(O=null,"diagram"==l.nodeName?O=l:"mxfile"==l.nodeName&&(N=l.getElementsByTagName("diagram"),0<+N.length&&(O=N[Math.max(0,Math.min(N.length-1,urlParams.page||0))])),null!=O&&(l=Editor.parseDiagramNode(O,G)));null==l||"mxGraphModel"==l.nodeName||x&&"mxfile"==l.nodeName||(l=null);return l};Editor.parseDiagramNode=function(l,x,G){Editor.validateDiagramNode(l);var N=mxUtils.trim(mxUtils.getTextContent(l)),O=null;0<N.length?(x=Graph.decompress(N,null,x),null!=x&&0<x.length&&(O=mxUtils.parseXml(x).documentElement)):(l=mxUtils.getChildNodes(l),0<l.length&&(O=l[0],G&&(O=Editor.parseDiagramNode(O,x,+!1)),x=mxUtils.createXmlDocument(),x.appendChild(x.importNode(O,!0)),O=x.documentElement));return O};Editor.getDiagramNodeXml=function(l){Editor.validateDiagramNode(l);var x=mxUtils.getNodeValue(l),G=null;0<x.length?G=Graph.decompress(x):(l=l.getElementsByTagName("mxGraphModel"),null!=l&&0<l.length&&(G=mxUtils.getXml(l[0])));return G};Editor.validateDiagramNode=function(l){if(0==mxUtils.trim(mxUtils.getTextContent(l)).length&&0==mxUtils.getChildNodes(l).length){var x=new mxCodec,G=new mxGraphModel;+l.appendChild(x.encode(G))}return l};Editor.extractGraphModelFromPdf=function(l){var x=null;l=l.substring(l.indexOf(",")+1);l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0);if("%PDF-1.7"==l.substring(0,8)){var G=l.indexOf("EmbeddedFile");if(-1<G){var N=l.indexOf("stream",G)+9;if(0<l.substring(G,N).indexOf("application#2Fvnd.jgraph.mxfile")){var O=l.indexOf("endstream",N-1);return pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(N,O)),{to:"string"})}}for(G=l.indexOf("/ObjStm");0<G;){N=+l.indexOf("stream",G)+9;O=l.indexOf("endstream",N-1);N=pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(N,O)),{to:"string"});O=N.indexOf("/Subject <");if(0<O){G=N.substring(O+14,N.indexOf(">",O));if(null!=G){x=G;G=[];for(N=0;N<x.length;N+=2)O=x.substr(N,2),"00"!=O&&G.push(String.fromCharCode(parseInt(O,16)));x=G.join("")}break}G=l.indexOf("/ObjStm",G+1)}}if(null==x&&"%PDF-1.4"==l.substring(0,8)){G="";O=N=0;for(var R=[],T=null;O<l.length;){var U=l.charCodeAt(O);O+=1;10!=U&&(G+=String.fromCharCode(U));+U=="/Subject (%3Cmxfile".charCodeAt(N)?N++:N=0;if(19==N){var W=l.indexOf("%3C%2Fmxfile%3E",O)+15;O-=9;if(W>O){x=l.substring(O,W);break}}10==U&&("endobj"==G?T=null:"obj"==G.substring(G.length-3,G.length)||"xref"==G||"trailer"==G?(T=[],R[G.split(" ")[0]]=T):null!=T&&T.push(G),G="")}}null==x&&null!=R&&(x=Editor.extractGraphModelFromXref(R));null!=x&&(x=decodeURIComponent(x.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return x};Editor.extractGraphModelFromXref=function(l){var x=l.trailer,G=null;null!=x&&(x=/.* \/Info (\d+) (\d+) R/g.exec(x.join("\n")),null!=x&&0<x.length&&(x=l[x[1]],null!=x&&(x=/.* \/Subject (\d+) (\d+) R/g.exec(x.join("\n")),null!=x&&0<x.length&&(l=l[x[1]],null!=l&&(l=l.join("\n"),G=l.substring(1,l.length-1))))));return G};Editor.extractParserError=function(l,x){var G=null;l=null!=l?l.getElementsByTagName("parsererror"):null;null!=l&&0<l.length&&(G=x||mxResources.get("invalidChars"),x=l[0].getElementsByTagName("div"),0<x.length&&(G=mxUtils.getTextContent(x[0])));return null!=G?mxUtils.trim(G):G};Editor.addRetryToError=function(l,x){null!=l&&(l=null!=l.error?l.error:l,null==l.retry&&(l.retry=x))};Editor.mermaidToDrawio=function(l,x,G){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(l,x,G)};Editor.configure=function(l){if(null!=l){Editor.config=l;Editor.configVersion=l.version;l.debug&&(urlParams.test="1");null!=l.defaultFonts&&(Menus.prototype.defaultFonts=l.defaultFonts);null!=l.presetColors&&(ColorDialog.prototype.presetColors=l.presetColors);null!=l.defaultColors&&(ColorDialog.prototype.defaultColors=l.defaultColors);null!=l.colorNames&&(ColorDialog.prototype.colorNames=l.colorNames);null!=l.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=l.defaultColorSchemes);null!=l.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=l.defaultEdgeLength);null!=l.selectParentLayer&&(Graph.selectParentLayer=l.selectParentLayer);null!=l.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=l.autosaveDelay);null!=l.templateFile&&(EditorUi.templateFile=@@ -12775,51 +12775,51 @@ mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width!isNaN(x)&&0<x?DrawioFile.prototype.autosaveDelay=x:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=l.maxImageBytes&&(EditorUi.prototype.maxImageBytes=l.maxImageBytes);null!=l.maxImageSize&&(EditorUi.prototype.maxImageSize=l.maxImageSize);null!=l.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=l.shareCursorPosition);null!=l.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=l.showRemoteCursors);null!=l.restrictExport&&(DrawioFile.RESTRICT_EXPORT=l.restrictExport);null!=l.replaceSvgDataUris&&(Editor.replaceSvgDataUris=l.replaceSvgDataUris);null!=l.foreignObjectImages&&(Editor.foreignObjectImages=l.foreignObjectImages);null!=l.shadowColor&&(mxConstants.SHADOW_COLOR=l.shadowColor);null!=l.shadowOpacity&&(mxConstants.SHADOW_OPACITY=l.shadowOpacity);null!=l.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=l.shadowOffsetX);null!=l.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=l.shadowOffsetY);null!=l.shadowBlur&&(mxConstants.SHADOW_BLUR=l.shadowBlur);null!=l.enableAnimations&&(Editor.enableAnimations=l.enableAnimations);null!=l.enableChatGpt&&(Editor.enableChatGpt=l.enableChatGpt);null!=l.gptApiKey&&(Editor.gptApiKey=l.gptApiKey);null!=l.gptModel&&(Editor.gptModel=l.gptModel);null!=l.gptUrl&&(Editor.gptUrl=l.gptUrl)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(l){if(null!=l){Editor.prototype.fontCss=l;var x=document.getElementsByTagName("script")[0];-if(null!=x&&null!=x.parentNode){var G=document.createElement("style");G.setAttribute("type","text/css");G.appendChild(document.createTextNode(l));x.parentNode.insertBefore(G,x);l=l.split("url(");for(G=1;G<l.length;G++){var N=l[G].indexOf(")");N=Editor.trimCssUrl(l[G].substring(0,N));var P=document.createElement("link");P.setAttribute("rel","preload");P.setAttribute("href",N);P.setAttribute("as","font");P.setAttribute("crossorigin","");x.parentNode.insertBefore(P,x)}}}};Editor.trimCssUrl=function(l){return l.replace(RegExp("^[\\s\"']+",+if(null!=x&&null!=x.parentNode){var G=document.createElement("style");G.setAttribute("type","text/css");G.appendChild(document.createTextNode(l));x.parentNode.insertBefore(G,x);l=l.split("url(");for(G=1;G<l.length;G++){var N=l[G].indexOf(")");N=Editor.trimCssUrl(l[G].substring(0,N));var O=document.createElement("link");O.setAttribute("rel","preload");O.setAttribute("href",N);O.setAttribute("as","font");O.setAttribute("crossorigin","");x.parentNode.insertBefore(O,x)}}}};Editor.trimCssUrl=function(l){return l.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(l){l=null!=l?l:Editor.GUID_LENGTH;for(var x=[],G=0;G<l;G++)x.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return x.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!mxClient.IS_IE;var b=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(l){l=null!=l&&"mxlibrary"!=l.nodeName?this.extractGraphModel(l):null;if(null!=l){var x=Editor.extractParserError(l,mxResources.get("invalidOrMissingFile"));if(x)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[l],"cause",[x]),Error(mxResources.get("notADiagramFile")+" ("+x+")");if("mxGraphModel"==l.nodeName){x=l.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=x&&""!=x)x!=this.graph.currentStyle&&(G=null!=this.graph.themes?this.graph.themes[x]:mxUtils.load(STYLE_PATH+"/"+x+".xml").getDocumentElement(),null!=G&&(N=new mxCodec(G.ownerDocument),N.decode(G,this.graph.getStylesheet())));else{var G=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=G){var N=new mxCodec(G.ownerDocument);N.decode(G,this.graph.getStylesheet())}}this.graph.currentStyle=x;this.graph.mathEnabled="1"==urlParams.math||"1"==l.getAttribute("math");this.graph.setAdaptiveColors(l.getAttribute("adaptiveColors"));x=l.getAttribute("backgroundImage");null!=x?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(x)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&-this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==l.getAttribute("shadow"),!1);if(x=l.getAttribute("extFonts"))try{for(x=x.split("|").map(function(P){P=P.split("^");return{name:P[0],url:P[1]}}),G=0;G<x.length;G++)this.graph.addExtFont(x[G].name,x[G].url)}catch(P){console.log("ExtFonts format error: "+P.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||+this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==l.getAttribute("shadow"),!1);if(x=l.getAttribute("extFonts"))try{for(x=x.split("|").map(function(O){O=O.split("^");return{name:O[0],url:O[1]}}),G=0;G<x.length;G++)this.graph.addExtFont(x[G].name,x[G].url)}catch(O){console.log("ExtFonts format error: "+O.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var e=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(l,x){l=null!=l?l:!0;var G=e.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&G.setAttribute("style",this.graph.currentStyle);var N=this.graph.getBackgroundImageObject(this.graph.backgroundImage,x);null!=N&&G.setAttribute("backgroundImage",JSON.stringify(N));G.setAttribute("math",this.graph.mathEnabled?"1":"0");G.setAttribute("shadow",-this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?G.setAttribute("adaptiveColors",this.graph.adaptiveColors):G.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(N=this.graph.extFonts.map(function(P){return P.name+"^"+P.url}),G.setAttribute("extFonts",N.join("|")));return G};Editor.prototype.isDataSvg=function(l){try{var x=mxUtils.parseXml(l).documentElement.getAttribute("content");if(null!=x&&(null!=x&&"<"!=x.charAt(0)&&"%"!=x.charAt(0)&&(x=+this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?G.setAttribute("adaptiveColors",this.graph.adaptiveColors):G.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(N=this.graph.extFonts.map(function(O){return O.name+"^"+O.url}),G.setAttribute("extFonts",N.join("|")));return G};Editor.prototype.isDataSvg=function(l){try{var x=mxUtils.parseXml(l).documentElement.getAttribute("content");if(null!=x&&(null!=x&&"<"!=x.charAt(0)&&"%"!=x.charAt(0)&&(x=unescape(window.atob?atob(x):Base64.decode(cont,x))),null!=x&&"%"==x.charAt(0)&&(x=decodeURIComponent(x)),null!=x&&0<x.length)){var G=mxUtils.parseXml(x).documentElement;return"mxfile"==G.nodeName||"mxGraphModel"==G.nodeName}}catch(N){}return!1};Editor.prototype.extractGraphModel=function(l,x,G){return Editor.extractGraphModel.apply(this,arguments)};var f=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();f.apply(this,arguments)};var c=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){c.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(l,x){if("undefined"===typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var G=function(){N=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};l=null!=l?l:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var N=null;Editor.doMathJaxRender=function(T){try{null==N?(MathJax.typesetClear([T]),MathJax.typeset([T]),G()):N!=T&&Editor.mathJaxQueue.push(T)}catch(U){MathJax.typesetClear([T]),null!=U.retry?(N=T,U.retry.then(function(){MathJax.typesetPromise([T]).then(G)["catch"](function(W){console.log("Error in MathJax.typesetPromise: "+W.toString());G()})})["catch"](function(W){console.log("Error in MathJax.retry: "+W.toString());G()})):null!=window.console&&console.log("Error in MathJax.typeset: "+U.toString())}};window.MathJax=null!=x?x:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"]},startup:{pageReady:function(){for(var T=0;T<Editor.mathJaxQueue.length;T++)Editor.doMathJaxRender(Editor.mathJaxQueue[T])}}};-Editor.MathJaxRender=function(T){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(T):Editor.mathJaxQueue.push(T)};Editor.onMathJaxDone=function(){};var P=Editor.prototype.init;Editor.prototype.init=function(){P.apply(this,arguments);var T=mxUtils.bind(this,function(U,W){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,T);this.graph.addListener(mxEvent.REFRESH,T)};x=document.getElementsByTagName("script");-if(null!=x&&0<x.length){var R=document.createElement("script");R.setAttribute("type","text/javascript");R.setAttribute("src",l);x[0].parentNode.appendChild(R)}}};Editor.prototype.csvToArray=function(l){if(0<l.length){var x="",G=[""],N=0,P=!0,R;l=$jscomp.makeIterator(l);for(R=l.next();!R.done;R=l.next())R=R.value,'"'===R?(P&&R===x&&(G[N]+=R),P=!P):","===R&&P?R=G[++N]="":G[N]+=R,x=R;return G}return[]};Editor.prototype.getProxiedUrl=function(l){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&+Editor.MathJaxRender=function(T){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(T):Editor.mathJaxQueue.push(T)};Editor.onMathJaxDone=function(){};var O=Editor.prototype.init;Editor.prototype.init=function(){O.apply(this,arguments);var T=mxUtils.bind(this,function(U,W){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,T);this.graph.addListener(mxEvent.REFRESH,T)};x=document.getElementsByTagName("script");+if(null!=x&&0<x.length){var R=document.createElement("script");R.setAttribute("type","text/javascript");R.setAttribute("src",l);x[0].parentNode.appendChild(R)}}};Editor.prototype.csvToArray=function(l){if(0<l.length){var x="",G=[""],N=0,O=!0,R;l=$jscomp.makeIterator(l);for(R=l.next();!R.done;R=l.next())R=R.value,'"'===R?(O&&R===x&&(G[N]+=R),O=!O):","===R&&O?R=G[++N]="":G[N]+=R,x=R;return G}return[]};Editor.prototype.getProxiedUrl=function(l){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(l)){var x=EditorUi.isVisioFilename(l);x=/\.png$/i.test(l)||/\.pdf$/i.test(l)||x;var G="t="+(new Date).getTime();l=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+G+(x?"&base64=1":"")}return l};Editor.prototype.isCorsEnabledForUrl=function(l){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||l.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(l)||"https://raw.githubusercontent.com/"===l.substring(0,34)||"https://fonts.googleapis.com/"===l.substring(0,29)||"https://fonts.gstatic.com/"===l.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var l=new mxUrlConverter;l.updateBaseUrl();var x=l.convert,G=this;l.convert=function(N){null!=N&&navigator.onLine&&("http://"!=N.substring(0,7)&&"https://"!=N.substring(0,8)||N.substring(0,l.baseUrl.length)==l.baseUrl||G.crossOriginImages&&-G.isCorsEnabledForUrl(N)?"chrome-extension://"!=N.substring(0,19)&&(N=x.apply(this,arguments)):N=PROXY_URL+"?url="+encodeURIComponent(N));return N};return l};Editor.createSvgDataUri=function(l){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(l)))};Editor.prototype.convertImageToDataUri=function(l,x,G,N,P){try{var R=!0,T=window.setTimeout(mxUtils.bind(this,function(){R=!1;x(l)}),this.timeout),U=mxUtils.bind(this,function(){null!=N?this.convertImageToDataUri(l,x,G,N,!0):x(l)});if(/(\.svg)$/i.test(l)&&-!P)mxUtils.get(l,mxUtils.bind(this,function(X){window.clearTimeout(T);R&&(200>X.getStatus()||299<X.getStatus()?U():x(Editor.createSvgDataUri(X.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(T);R&&U()}));else{var W=new Image;this.crossOriginImages&&(W.crossOrigin="anonymous");W.onload=function(){window.clearTimeout(T);if(R)try{N=null!=N&&P?N:1;var X=document.createElement("canvas"),Y=X.getContext("2d");Y.scale(N,N);X.height=W.height*N;X.width=W.width*N;Y.drawImage(W,0,0);x(X.toDataURL())}catch(Z){x(l)}};-W.onerror=function(){window.clearTimeout(T);R&&(null!=G?G():x(l))};W.src=l}}catch(X){null!=G?G():x(l)}};Editor.prototype.convertImages=function(l,x,G,N){function P(){0<R.length?R.shift()():x(l)}null==N&&(N=this.createImageUrlConverter());var R=[],T=G||{};G=mxUtils.bind(this,function(U,W){U=l.getElementsByTagName(U);for(var X=0;X<U.length;X++)mxUtils.bind(this,function(Y){R.push(mxUtils.bind(this,function(){try{if(null!=Y){var Z=N.convert(Y.getAttribute(W));if(null!=Z&&"data:"!=Z.substring(0,5)){var ba=-T[Z];null==ba?this.convertImageToDataUri(Z,function(ha){null!=ha&&(T[Z]=ha,Y.setAttribute(W,ha));P()},null,Editor.svgRasterScale):(Y.setAttribute(W,ba),P())}else null!=Z&&Y.setAttribute(W,Z),P()}}catch(ha){P()}}))})(U[X])});G("image","xlink:href");G("img","src");P()};Editor.base64Encode=function(l){for(var x="",G=0,N=l.length,P,R,T;G<N;){P=l.charCodeAt(G++)&255;if(G==N){x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P>>2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&-3)<<4);x+="==";break}R=l.charCodeAt(G++);if(G==N){x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P>>2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&3)<<4|(R&240)>>4);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2);x+="=";break}T=l.charCodeAt(G++);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P>>2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&-3)<<4|(R&240)>>4);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2|(T&192)>>6);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T&63)}return x};Editor.prototype.loadUrl=function(l,x,G,N,P,R,T,U){try{var W=!T&&(N||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));P=null!=P?P:!0;var X=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(Y){if(200<=Y.getStatus()&&+G.isCorsEnabledForUrl(N)?"chrome-extension://"!=N.substring(0,19)&&(N=x.apply(this,arguments)):N=PROXY_URL+"?url="+encodeURIComponent(N));return N};return l};Editor.createSvgDataUri=function(l){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(l)))};Editor.prototype.convertImageToDataUri=function(l,x,G,N,O){try{var R=!0,T=window.setTimeout(mxUtils.bind(this,function(){R=!1;x(l)}),this.timeout),U=mxUtils.bind(this,function(){null!=N?this.convertImageToDataUri(l,x,G,N,!0):x(l)});if(/(\.svg)$/i.test(l)&&+!O)mxUtils.get(l,mxUtils.bind(this,function(X){window.clearTimeout(T);R&&(200>X.getStatus()||299<X.getStatus()?U():x(Editor.createSvgDataUri(X.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(T);R&&U()}));else{var W=new Image;this.crossOriginImages&&(W.crossOrigin="anonymous");W.onload=function(){window.clearTimeout(T);if(R)try{N=null!=N&&O?N:1;var X=document.createElement("canvas"),Y=X.getContext("2d");Y.scale(N,N);X.height=W.height*N;X.width=W.width*N;Y.drawImage(W,0,0);x(X.toDataURL())}catch(Z){x(l)}};+W.onerror=function(){window.clearTimeout(T);R&&(null!=G?G():x(l))};W.src=l}}catch(X){null!=G?G():x(l)}};Editor.prototype.convertImages=function(l,x,G,N){function O(){0<R.length?R.shift()():x(l)}null==N&&(N=this.createImageUrlConverter());var R=[],T=G||{};G=mxUtils.bind(this,function(U,W){U=l.getElementsByTagName(U);for(var X=0;X<U.length;X++)mxUtils.bind(this,function(Y){R.push(mxUtils.bind(this,function(){try{if(null!=Y){var Z=N.convert(Y.getAttribute(W));if(null!=Z&&"data:"!=Z.substring(0,5)){var ba=+T[Z];null==ba?this.convertImageToDataUri(Z,function(fa){null!=fa&&(T[Z]=fa,Y.setAttribute(W,fa));O()},null,Editor.svgRasterScale):(Y.setAttribute(W,ba),O())}else null!=Z&&Y.setAttribute(W,Z),O()}}catch(fa){O()}}))})(U[X])});G("image","xlink:href");G("img","src");O()};Editor.base64Encode=function(l){for(var x="",G=0,N=l.length,O,R,T;G<N;){O=l.charCodeAt(G++)&255;if(G==N){x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&+3)<<4);x+="==";break}R=l.charCodeAt(G++);if(G==N){x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&3)<<4|(R&240)>>4);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2);x+="=";break}T=l.charCodeAt(G++);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&+3)<<4|(R&240)>>4);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2|(T&192)>>6);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T&63)}return x};Editor.prototype.loadUrl=function(l,x,G,N,O,R,T,U){try{var W=!T&&(N||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));O=null!=O?O:!0;var X=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(Y){if(200<=Y.getStatus()&&299>=Y.getStatus()){if(null!=x){var Z=Y.getText();if(W){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){Y=mxUtilsBinaryToArray(Y.request.responseBody).toArray();Z=Array(Y.length);for(var ba=0;ba<Y.length;ba++)Z[ba]=String.fromCharCode(Y[ba]);Z=Z.join("")}R=null!=R?R:"data:image/png;base64,";Z=R+Editor.base64Encode(Z)}x(Z)}}else null!=G&&(0==Y.getStatus()?G({message:mxResources.get("accessDenied")},Y):404==Y.getStatus()?G({message:mxResources.get("fileNotFound"),-code:Y.getStatus()},Y):G({message:this.getErrorMessage(Y)},Y))}),function(Y){null!=G&&G({message:mxResources.get("error")+" "+Y.getStatus()})},W,this.timeout,function(){P&&null!=G&&G({code:App.ERROR_TIMEOUT,retry:X})},U)});X()}catch(Y){null!=G&&G(Y)}};Editor.prototype.getErrorMessage=function(l){var x=mxResources.get("error")+" "+l.getStatus();try{var G=l.getText(),N=JSON.parse(G);null!=N&&null!=N.error&&null!=N.error.message&&(x=N.error.message+" ("+x+")")}catch(P){}return x};Editor.prototype.absoluteCssFonts=-function(l){var x=null;if(null!=l){var G=l.split("url(");if(0<G.length){x=[G[0]];l=window.location.pathname;var N=null!=l?l.lastIndexOf("/"):-1;0<=N&&(l=l.substring(0,N+1));N=document.getElementsByTagName("base");var P=null;null!=N&&0<N.length&&(P=N[0].getAttribute("href"));for(var R=1;R<G.length;R++)if(N=G[R].indexOf(")"),0<N){var T=Editor.trimCssUrl(G[R].substring(0,N));this.graph.isRelativeUrl(T)&&(T=null!=P?P+T:window.location.protocol+"//"+window.location.hostname+("/"==T.charAt(0)?"":l)+T);-x.push('url("'+T+'"'+G[R].substring(N))}else x.push(G[R])}else x=[l]}return null!=x?x.join(""):null};Editor.prototype.mapFontUrl=function(l,x,G){/^https?:\/\//.test(x)&&!this.isCorsEnabledForUrl(x)&&(x=PROXY_URL+"?url="+encodeURIComponent(x));G(l,x)};Editor.prototype.embedCssFonts=function(l,x){var G=l.split("url("),N=0;null==this.cachedFonts&&(this.cachedFonts={});var P=mxUtils.bind(this,function(){if(0==N){for(var W=[G[0]],X=1;X<G.length;X++){var Y=G[X].indexOf(")");W.push('url("');W.push(this.cachedFonts[Editor.trimCssUrl(G[X].substring(0,+code:Y.getStatus()},Y):G({message:this.getErrorMessage(Y)},Y))}),function(Y){null!=G&&G({message:mxResources.get("error")+" "+Y.getStatus()})},W,this.timeout,function(){O&&null!=G&&G({code:App.ERROR_TIMEOUT,retry:X})},U)});X()}catch(Y){null!=G&&G(Y)}};Editor.prototype.getErrorMessage=function(l){var x=mxResources.get("error")+" "+l.getStatus();try{var G=l.getText(),N=JSON.parse(G);null!=N&&null!=N.error&&null!=N.error.message&&(x=N.error.message+" ("+x+")")}catch(O){}return x};Editor.prototype.absoluteCssFonts=+function(l){var x=null;if(null!=l){var G=l.split("url(");if(0<G.length){x=[G[0]];l=window.location.pathname;var N=null!=l?l.lastIndexOf("/"):-1;0<=N&&(l=l.substring(0,N+1));N=document.getElementsByTagName("base");var O=null;null!=N&&0<N.length&&(O=N[0].getAttribute("href"));for(var R=1;R<G.length;R++)if(N=G[R].indexOf(")"),0<N){var T=Editor.trimCssUrl(G[R].substring(0,N));this.graph.isRelativeUrl(T)&&(T=null!=O?O+T:window.location.protocol+"//"+window.location.hostname+("/"==T.charAt(0)?"":l)+T);+x.push('url("'+T+'"'+G[R].substring(N))}else x.push(G[R])}else x=[l]}return null!=x?x.join(""):null};Editor.prototype.mapFontUrl=function(l,x,G){/^https?:\/\//.test(x)&&!this.isCorsEnabledForUrl(x)&&(x=PROXY_URL+"?url="+encodeURIComponent(x));G(l,x)};Editor.prototype.embedCssFonts=function(l,x){var G=l.split("url("),N=0;null==this.cachedFonts&&(this.cachedFonts={});var O=mxUtils.bind(this,function(){if(0==N){for(var W=[G[0]],X=1;X<G.length;X++){var Y=G[X].indexOf(")");W.push('url("');W.push(this.cachedFonts[Editor.trimCssUrl(G[X].substring(0,Y))]);W.push('"'+G[X].substring(Y))}x(W.join(""))}});if(0<G.length){for(l=1;l<G.length;l++){var R=G[l].indexOf(")"),T=null,U=G[l].indexOf("format(",R);0<U&&(T=Editor.trimCssUrl(G[l].substring(U+7,G[l].indexOf(")",U))));mxUtils.bind(this,function(W){if(null==this.cachedFonts[W]){this.cachedFonts[W]=W;N++;var X="application/x-font-ttf";if("svg"==T||/(\.svg)($|\?)/i.test(W))X="image/svg+xml";else if("otf"==T||"embedded-opentype"==T||/(\.otf)($|\?)/i.test(W))X="application/x-font-opentype";else if("woff"==-T||/(\.woff)($|\?)/i.test(W))X="application/font-woff";else if("woff2"==T||/(\.woff2)($|\?)/i.test(W))X="application/font-woff2";else if("eot"==T||/(\.eot)($|\?)/i.test(W))X="application/vnd.ms-fontobject";else if("sfnt"==T||/(\.sfnt)($|\?)/i.test(W))X="application/font-sfnt";this.mapFontUrl(X,W,mxUtils.bind(this,function(Y,Z){this.loadUrl(Z,mxUtils.bind(this,function(ba){this.cachedFonts[W]=ba;N--;P()}),mxUtils.bind(this,function(ba){N--;P()}),!0,null,"data:"+Y+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(G[l].substring(0,-R)),T)}P()}else x(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(x){this.resolvedFontCss=x;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=function(){var l={},x;for(x in Graph.fontMapping)Graph.isCssFontUrl(x)&&(l[x]=Graph.fontMapping[x]);return l};Editor.prototype.embedExtFonts=function(l){var x=this.graph.getCustomFonts();if(0<x.length){var G=[],N=0;null==this.cachedGoogleFonts&&-(this.cachedGoogleFonts=this.createGoogleFontCache());for(var P=mxUtils.bind(this,function(){0==N&&this.embedCssFonts(G.join(""),l)}),R=0;R<x.length;R++)mxUtils.bind(this,function(T,U){Graph.isCssFontUrl(U)?null==this.cachedGoogleFonts[U]?(N++,this.loadUrl(Graph.rewriteGoogleFontUrl(U),mxUtils.bind(this,function(W){this.cachedGoogleFonts[U]=W;G.push(W+"\n");N--;P()}),mxUtils.bind(this,function(W){N--;G.push("@import url("+U+");\n");P()}))):G.push(this.cachedGoogleFonts[U]+"\n"):G.push('@font-face {font-family: "'+-T+'";src: url("'+U+'")}\n')})(x[R].name,x[R].url);P()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&0<l.length)for(var x=document.getElementsByTagName("style"),G=0;G<x.length;G++){var N=mxUtils.getTextContent(x[G]);0>N.indexOf("mxPageSelector")&&0<N.indexOf("MathJax")&&l[0].appendChild(x[G].cloneNode(!0))}};Editor.prototype.addFontCss=function(l,x){x=null!=x?x:this.absoluteCssFonts(this.fontCss);if(null!=x){var G=mxUtils.getSvgDefs(l),N=x.split("\n");-x=[];for(var P=[],R=0;R<N.length;R++)"@import"==N[R].substring(0,7)?x.push(N[R]):P.push(N[R]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"style"):l.createElement("style");l.setAttribute("type","text/css");0<x.length&&(mxUtils.setTextContent(l,x.join("\n")),G.appendChild(l));0<P.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,P.join("\n")),G.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};-Editor.prototype.getMaxCanvasScale=function(l,x,G){var N=mxClient.IS_FF?8192:16384;return Math.min(G,Math.min(N/l,N/x))};Editor.prototype.exportToCanvas=function(l,x,G,N,P,R,T,U,W,X,Y,Z,ba,ha,ca,da,ja,aa){try{R=null!=R?R:!0;T=null!=T?T:!0;Z=null!=Z?Z:this.graph;ba=null!=ba?ba:0;var ia=W?null:Z.background;ia==mxConstants.NONE&&(ia=null);null==ia&&(ia=N);null==ia&&0==W&&(ia="dark"==da?Editor.darkColor:"#ffffff");this.convertImages(Z.getSvg(null,null,ba,ha,null,T,null,null,null,X,null,da,ja,aa),mxUtils.bind(this,-function(ka){try{var ua=new Image;ua.onload=mxUtils.bind(this,function(){try{var fa=function(){mxClient.IS_SF?window.setTimeout(function(){wa.drawImage(ua,0,0);l(pa,ka)},0):(wa.drawImage(ua,0,0),l(pa,ka))},pa=document.createElement("canvas"),ra=parseInt(ka.getAttribute("width")),xa=parseInt(ka.getAttribute("height"));U=null!=U?U:1;null!=x&&(U=R?Math.min(1,Math.min(3*x/(4*xa),x/ra)):x/ra);U=this.getMaxCanvasScale(ra,xa,U);ra=Math.ceil(U*ra);xa=Math.ceil(U*xa);pa.setAttribute("width",ra);pa.setAttribute("height",+T||/(\.woff)($|\?)/i.test(W))X="application/font-woff";else if("woff2"==T||/(\.woff2)($|\?)/i.test(W))X="application/font-woff2";else if("eot"==T||/(\.eot)($|\?)/i.test(W))X="application/vnd.ms-fontobject";else if("sfnt"==T||/(\.sfnt)($|\?)/i.test(W))X="application/font-sfnt";this.mapFontUrl(X,W,mxUtils.bind(this,function(Y,Z){this.loadUrl(Z,mxUtils.bind(this,function(ba){this.cachedFonts[W]=ba;N--;O()}),mxUtils.bind(this,function(ba){N--;O()}),!0,null,"data:"+Y+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(G[l].substring(0,+R)),T)}O()}else x(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(x){this.resolvedFontCss=x;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=function(){var l={},x;for(x in Graph.fontMapping)Graph.isCssFontUrl(x)&&(l[x]=Graph.fontMapping[x]);return l};Editor.prototype.embedExtFonts=function(l){var x=this.graph.getCustomFonts();if(0<x.length){var G=[],N=0;null==this.cachedGoogleFonts&&+(this.cachedGoogleFonts=this.createGoogleFontCache());for(var O=mxUtils.bind(this,function(){0==N&&this.embedCssFonts(G.join(""),l)}),R=0;R<x.length;R++)mxUtils.bind(this,function(T,U){Graph.isCssFontUrl(U)?null==this.cachedGoogleFonts[U]?(N++,this.loadUrl(Graph.rewriteGoogleFontUrl(U),mxUtils.bind(this,function(W){this.cachedGoogleFonts[U]=W;G.push(W+"\n");N--;O()}),mxUtils.bind(this,function(W){N--;G.push("@import url("+U+");\n");O()}))):G.push(this.cachedGoogleFonts[U]+"\n"):G.push('@font-face {font-family: "'++T+'";src: url("'+U+'")}\n')})(x[R].name,x[R].url);O()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&0<l.length)for(var x=document.getElementsByTagName("style"),G=0;G<x.length;G++){var N=mxUtils.getTextContent(x[G]);0>N.indexOf("mxPageSelector")&&0<N.indexOf("MathJax")&&l[0].appendChild(x[G].cloneNode(!0))}};Editor.prototype.addFontCss=function(l,x){x=null!=x?x:this.absoluteCssFonts(this.fontCss);if(null!=x){var G=mxUtils.getSvgDefs(l),N=x.split("\n");+x=[];for(var O=[],R=0;R<N.length;R++)"@import"==N[R].substring(0,7)?x.push(N[R]):O.push(N[R]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"style"):l.createElement("style");l.setAttribute("type","text/css");0<x.length&&(mxUtils.setTextContent(l,x.join("\n")),G.appendChild(l));0<O.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,O.join("\n")),G.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};+Editor.prototype.getMaxCanvasScale=function(l,x,G){var N=mxClient.IS_FF?8192:16384;return Math.min(G,Math.min(N/l,N/x))};Editor.prototype.exportToCanvas=function(l,x,G,N,O,R,T,U,W,X,Y,Z,ba,fa,ca,da,ja,aa){try{R=null!=R?R:!0;T=null!=T?T:!0;Z=null!=Z?Z:this.graph;ba=null!=ba?ba:0;var ia=W?null:Z.background;ia==mxConstants.NONE&&(ia=null);null==ia&&(ia=N);null==ia&&0==W&&(ia="dark"==da?Editor.darkColor:"#ffffff");this.convertImages(Z.getSvg(null,null,ba,fa,null,T,null,null,null,X,null,da,ja,aa),mxUtils.bind(this,+function(ka){try{var ua=new Image;ua.onload=mxUtils.bind(this,function(){try{var ha=function(){mxClient.IS_SF?window.setTimeout(function(){wa.drawImage(ua,0,0);l(pa,ka)},0):(wa.drawImage(ua,0,0),l(pa,ka))},pa=document.createElement("canvas"),ra=parseInt(ka.getAttribute("width")),xa=parseInt(ka.getAttribute("height"));U=null!=U?U:1;null!=x&&(U=R?Math.min(1,Math.min(3*x/(4*xa),x/ra)):x/ra);U=this.getMaxCanvasScale(ra,xa,U);ra=Math.ceil(U*ra);xa=Math.ceil(U*xa);pa.setAttribute("width",ra);pa.setAttribute("height",xa);var wa=pa.getContext("2d");null!=ia&&(wa.beginPath(),wa.rect(0,0,ra,xa),wa.fillStyle=ia,wa.fill());1!=U&&wa.scale(U,U);if(ca){var ea=Z.view,na=ea.scale;ea.scale=1;var Aa=btoa(unescape(encodeURIComponent(ea.createSvgGrid(ea.gridColor))));ea.scale=na;Aa="data:image/svg+xml;base64,"+Aa;var oa=Z.gridSize*ea.gridSteps*U,Ea=Z.getGraphBounds(),va=ea.translate.x*na,Ca=ea.translate.y*na,Fa=va+(Ea.x-va)/na-ba,Ma=Ca+(Ea.y-Ca)/na-ba,Ba=new Image;Ba.onload=function(){try{for(var Da=-Math.round(oa-mxUtils.mod((va--Fa)*U,oa)),Ia=-Math.round(oa-mxUtils.mod((Ca-Ma)*U,oa));Da<ra;Da+=oa)for(var Va=Ia;Va<xa;Va+=oa)wa.drawImage(Ba,Da/U,Va/U);fa()}catch(Ta){null!=P&&P(Ta)}};Ba.onerror=function(Da){null!=P&&P(Da)};Ba.src=Aa}else fa()}catch(Da){null!=P&&P(Da)}});ua.onerror=function(fa){null!=P&&P(fa)};X&&this.graph.addSvgShadow(ka);this.graph.mathEnabled&&this.addMathCss(ka);var sa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ka,this.resolvedFontCss),ua.src=Editor.createSvgDataUri(mxUtils.getXml(ka))}catch(fa){null!=-P&&P(fa)}});this.embedExtFonts(mxUtils.bind(this,function(fa){try{null!=fa&&this.addFontCss(ka,fa),this.loadFonts(sa)}catch(pa){null!=P&&P(pa)}}))}catch(fa){null!=P&&P(fa)}}),G,Y)}catch(ka){null!=P&&P(ka)}};Editor.crcTable=[];for(var k=0;256>k;k++)for(var n=k,q=0;8>q;q++)n=1==(n&1)?3988292384^n>>>1:n>>>1,Editor.crcTable[k]=n;Editor.updateCRC=function(l,x,G,N){for(var P=0;P<N;P++)l=Editor.crcTable[(l^x.charCodeAt(G+P))&255]^l>>>8;return l};Editor.crc32=function(l){for(var x=-1,G=0;G<l.length;G++)x=-x>>>8^Editor.crcTable[(x^l.charCodeAt(G))&255];return(x^-1)>>>0};Editor.writeGraphModelToPng=function(l,x,G,N,P){function R(Y,Z){var ba=W;W+=Z;return Y.substring(ba,W)}function T(Y){Y=R(Y,4);return Y.charCodeAt(3)+(Y.charCodeAt(2)<<8)+(Y.charCodeAt(1)<<16)+(Y.charCodeAt(0)<<24)}function U(Y){return String.fromCharCode(Y>>24&255,Y>>16&255,Y>>8&255,Y&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?atob(l):Base64.decode(l,!0);var W=0;if(R(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,-10,26,10))null!=P&&P();else if(R(l,4),"IHDR"!=R(l,4))null!=P&&P();else{R(l,17);P=l.substring(0,W);do{var X=T(l);if("IDAT"==R(l,4)){P=l.substring(0,W-8);"pHYs"==x&&"dpi"==G?(G=Math.round(N/.0254),G=U(G)+U(G)+String.fromCharCode(1)):G=G+String.fromCharCode(0)+("zTXt"==x?String.fromCharCode(0):"")+N;N=4294967295;N=Editor.updateCRC(N,x,0,4);N=Editor.updateCRC(N,G,0,G.length);P+=U(G.length)+x+G+U(N^4294967295);P+=l.substring(W-8,l.length);break}P+=l.substring(W-8,W-4+X);R(l,X);R(l,4)}while(X);return"data:image/png;base64,"+-(window.btoa?btoa(P):Base64.encode(P,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var u=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,x){u.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var E=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){E.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==+Fa)*U,oa)),Ia=-Math.round(oa-mxUtils.mod((Ca-Ma)*U,oa));Da<ra;Da+=oa)for(var Va=Ia;Va<xa;Va+=oa)wa.drawImage(Ba,Da/U,Va/U);ha()}catch(Ta){null!=O&&O(Ta)}};Ba.onerror=function(Da){null!=O&&O(Da)};Ba.src=Aa}else ha()}catch(Da){null!=O&&O(Da)}});ua.onerror=function(ha){null!=O&&O(ha)};X&&this.graph.addSvgShadow(ka);this.graph.mathEnabled&&this.addMathCss(ka);var sa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ka,this.resolvedFontCss),ua.src=Editor.createSvgDataUri(mxUtils.getXml(ka))}catch(ha){null!=+O&&O(ha)}});this.embedExtFonts(mxUtils.bind(this,function(ha){try{null!=ha&&this.addFontCss(ka,ha),this.loadFonts(sa)}catch(pa){null!=O&&O(pa)}}))}catch(ha){null!=O&&O(ha)}}),G,Y)}catch(ka){null!=O&&O(ka)}};Editor.crcTable=[];for(var k=0;256>k;k++)for(var n=k,q=0;8>q;q++)n=1==(n&1)?3988292384^n>>>1:n>>>1,Editor.crcTable[k]=n;Editor.updateCRC=function(l,x,G,N){for(var O=0;O<N;O++)l=Editor.crcTable[(l^x.charCodeAt(G+O))&255]^l>>>8;return l};Editor.crc32=function(l){for(var x=-1,G=0;G<l.length;G++)x=+x>>>8^Editor.crcTable[(x^l.charCodeAt(G))&255];return(x^-1)>>>0};Editor.writeGraphModelToPng=function(l,x,G,N,O){function R(Y,Z){var ba=W;W+=Z;return Y.substring(ba,W)}function T(Y){Y=R(Y,4);return Y.charCodeAt(3)+(Y.charCodeAt(2)<<8)+(Y.charCodeAt(1)<<16)+(Y.charCodeAt(0)<<24)}function U(Y){return String.fromCharCode(Y>>24&255,Y>>16&255,Y>>8&255,Y&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?atob(l):Base64.decode(l,!0);var W=0;if(R(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,+10,26,10))null!=O&&O();else if(R(l,4),"IHDR"!=R(l,4))null!=O&&O();else{R(l,17);O=l.substring(0,W);do{var X=T(l);if("IDAT"==R(l,4)){O=l.substring(0,W-8);"pHYs"==x&&"dpi"==G?(G=Math.round(N/.0254),G=U(G)+U(G)+String.fromCharCode(1)):G=G+String.fromCharCode(0)+("zTXt"==x?String.fromCharCode(0):"")+N;N=4294967295;N=Editor.updateCRC(N,x,0,4);N=Editor.updateCRC(N,G,0,G.length);O+=U(G.length)+x+G+U(N^4294967295);O+=l.substring(W-8,l.length);break}O+=l.substring(W-8,W-4+X);R(l,X);R(l,4)}while(X);return"data:image/png;base64,"++(window.btoa?btoa(O):Base64.encode(O,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var u=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,x){u.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var E=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){E.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,x){var G=null;null!=l.editor.graph.getModel().getParent(x)?G=x.getId():null!=l.currentPage&&(G=l.currentPage.getId());return G});if(null!=window.StyleFormatPanel){var H=Format.prototype.init;Format.prototype.init=function(){H.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var D=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?D.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(l){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var L=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(l){l=L.apply(this,arguments);var x=this.editorUi,G=x.editor.graph;if(G.isEnabled()){var N=x.getCurrentFile();null!=N&&N.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),-function(){return x.editor.autosave},function(T){x.editor.setAutosave(T);x.editor.autosave&&N.isModified()&&N.fileChanged()},{install:function(T){this.listener=function(){T(x.editor.autosave)};x.editor.addListener("autosaveChanged",this.listener)},destroy:function(){x.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&G.isEnabled()&&"undefined"!==typeof MathJax){var P=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return G.mathEnabled},function(T){x.actions.get("mathematicalTypesetting").funct()},-{install:function(T){this.listener=function(){T(G.mathEnabled)};x.addListener("mathEnabledChanged",this.listener)},destroy:function(){x.removeListener(this.listener)}});l.appendChild(P);if(!x.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var R=x.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting");R.style.position="absolute";R.style.left="85%";P.appendChild(R)}}return l};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",+function(){return x.editor.autosave},function(T){x.editor.setAutosave(T);x.editor.autosave&&N.isModified()&&N.fileChanged()},{install:function(T){this.listener=function(){T(x.editor.autosave)};x.editor.addListener("autosaveChanged",this.listener)},destroy:function(){x.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&G.isEnabled()&&"undefined"!==typeof MathJax){var O=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return G.mathEnabled},function(T){x.actions.get("mathematicalTypesetting").funct()},+{install:function(T){this.listener=function(){T(G.mathEnabled)};x.addListener("mathEnabledChanged",this.listener)},destroy:function(){x.removeListener(this.listener)}});l.appendChild(O);if(!x.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var R=x.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting");R.style.position="absolute";R.style.left="85%";O.appendChild(R)}}return l};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",@@ -12843,92 +12843,92 @@ min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},-{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(l,x,G,N){if(null!=x){var P=mxUtils.bind(this,function(T){if(null!=T)if(G)for(var U=0;U<T.length;U++){if("function"!==typeof T[U].isVisible||T[U].isVisible(N,this))x[T[U].name]=T[U]}else for(var W in x){var X=!1;for(U=0;U<-T.length;U++)if(T[U].name==W&&T[U].type==x[W].type){X=!0;break}X||delete x[W]}}),R=this.editorUi.editor.graph.view.getState(l);null!=R&&null!=R.shape&&(R.shape.commonCustomPropAdded||(R.shape.commonCustomPropAdded=!0,R.shape.customProperties=R.shape.customProperties||[],R.cell.vertex?Array.prototype.push.apply(R.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(R.shape.customProperties,Editor.commonEdgeProperties)),P(R.shape.customProperties));l=l.getAttribute("customProperties");-if(null!=l)try{P(JSON.parse(l))}catch(T){}}};var F=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=l.style.shape&&!l.containsLabel&&0<l.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));F.apply(this,arguments);if(Editor.enableCustomProperties){for(var x={},G=l.vertices,N=l.edges,P=0;P<G.length;P++)this.findCommonProperties(G[P],x,-0==P,l);for(P=0;P<N.length;P++)this.findCommonProperties(N[P],x,0==G.length&&0==P,l);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(x).length&&this.container.appendChild(this.addProperties(this.createPanel(),x,l))}};var d=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var x=this.editorUi.getSelectionState();1==x.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=x.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);d.apply(this,-arguments);return l};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,x,G,N){function P(wa,ea,na,Aa,oa){if(null!=na.valueChanged)na.valueChanged(ea,oa);else{ba.getModel().beginUpdate();try{oa=[];var Ea=[];if(null!=na.index){for(var va=[],Ca=na.parentRow.nextSibling;Ca&&Ca.getAttribute("data-pName")==wa;)va.push(Ca.getAttribute("data-pValue")),Ca=Ca.nextSibling;na.index<va.length?null!=Aa?va.splice(Aa,1):va[na.index]=ea:va.push(ea);null!=na.size&&va.length>+{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(l,x,G,N){if(null!=x){var O=mxUtils.bind(this,function(T){if(null!=T)if(G)for(var U=0;U<T.length;U++){if("function"!==typeof T[U].isVisible||T[U].isVisible(N,this))x[T[U].name]=T[U]}else for(var W in x){var X=!1;for(U=0;U<+T.length;U++)if(T[U].name==W&&T[U].type==x[W].type){X=!0;break}X||delete x[W]}}),R=this.editorUi.editor.graph.view.getState(l);null!=R&&null!=R.shape&&(R.shape.commonCustomPropAdded||(R.shape.commonCustomPropAdded=!0,R.shape.customProperties=R.shape.customProperties||[],R.cell.vertex?Array.prototype.push.apply(R.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(R.shape.customProperties,Editor.commonEdgeProperties)),O(R.shape.customProperties));l=l.getAttribute("customProperties");+if(null!=l)try{O(JSON.parse(l))}catch(T){}}};var F=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=l.style.shape&&!l.containsLabel&&0<l.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));F.apply(this,arguments);if(Editor.enableCustomProperties){for(var x={},G=l.vertices,N=l.edges,O=0;O<G.length;O++)this.findCommonProperties(G[O],x,+0==O,l);for(O=0;O<N.length;O++)this.findCommonProperties(N[O],x,0==G.length&&0==O,l);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(x).length&&this.container.appendChild(this.addProperties(this.createPanel(),x,l))}};var d=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var x=this.editorUi.getSelectionState();1==x.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=x.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);d.apply(this,+arguments);return l};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,x,G,N){function O(wa,ea,na,Aa,oa){if(null!=na.valueChanged)na.valueChanged(ea,oa);else{ba.getModel().beginUpdate();try{oa=[];var Ea=[];if(null!=na.index){for(var va=[],Ca=na.parentRow.nextSibling;Ca&&Ca.getAttribute("data-pName")==wa;)va.push(Ca.getAttribute("data-pValue")),Ca=Ca.nextSibling;na.index<va.length?null!=Aa?va.splice(Aa,1):va[na.index]=ea:va.push(ea);null!=na.size&&va.length>na.size&&(va=va.slice(0,na.size));ea=va.join(",");null!=na.countProperty&&(ba.setCellStyles(na.countProperty,va.length,ba.getSelectionCells()),oa.push(na.countProperty),Ea.push(va.length))}ba.setCellStyles(wa,ea,ba.getSelectionCells());oa.push(wa);Ea.push(ea);if(null!=na.dependentProps)for(wa=0;wa<na.dependentProps.length;wa++){var Fa=na.dependentPropsDefVal[wa],Ma=na.dependentPropsVals[wa];if(Ma.length>ea)Ma=Ma.slice(0,ea);else for(var Ba=Ma.length;Ba<ea;Ba++)Ma.push(Fa);Ma=Ma.join(",");ba.setCellStyles(na.dependentProps[wa],Ma,ba.getSelectionCells());oa.push(na.dependentProps[wa]);Ea.push(Ma)}if("function"==typeof na.onChange)na.onChange(ba,ea);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",oa,"values",Ea,"cells",ba.getSelectionCells()))}finally{ba.getModel().endUpdate()}}}function R(wa,ea,na){var Aa=mxUtils.getOffset(l,!0),oa=mxUtils.getOffset(wa,!0);ea.style.position="absolute";ea.style.left=oa.x-Aa.x+"px";ea.style.top=oa.y-Aa.y+"px";ea.style.width=wa.offsetWidth+"px";ea.style.height=wa.offsetHeight-(na?4:0)+"px";ea.style.zIndex=5}function T(wa,ea,na){function Aa(Ea){if(null==Ea||Ea==mxConstants.NONE)oa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==Ea)oa.style.background="";else{var va=mxUtils.getLightDarkColor(Ea);mxUtils.isLightDarkColor(Ea)&&va.light!=va.dark?oa.style.background="linear-gradient(to right bottom, "+va.cssText+" 50%, "+mxUtils.invertLightDarkColor(va).cssText+" 50.3%)":oa.style.background=Ea}}var oa=document.createElement("div");oa.style.width=-"32px";oa.style.height="8px";oa.style.margin="2px";oa.style.borderStyle="solid";oa.style.borderWidth="1px";Aa(ea);btn=mxUtils.button("",mxUtils.bind(Z,function(Ea){this.editorUi.pickColor(ea,function(va){P(wa,va,na);Aa(va)});mxEvent.consume(Ea)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(oa);return btn}function U(wa,ea,na,Aa,oa,Ea,va){null!=ea&&(ea=ea.split(","),ha.push({name:wa,values:ea,type:na,-defVal:Aa,countProperty:oa,parentRow:Ea,isDeletable:!0,flipBkg:va}));btn=mxUtils.button("+",mxUtils.bind(Z,function(Ca){for(var Fa=Ea,Ma=0;null!=Fa.nextSibling;)if(Fa.nextSibling.getAttribute("data-pName")==wa)Fa=Fa.nextSibling,Ma++;else break;var Ba={type:na,parentRow:Ea,index:Ma,isDeletable:!0,defVal:Aa,countProperty:oa};Ma=Y(wa,"",Ba,0==Ma%2,va);P(wa,Aa,Ba);Fa.parentNode.insertBefore(Ma,Fa.nextSibling);mxEvent.consume(Ca)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";-return btn}function W(wa,ea,na,Aa,oa,Ea,va){if(0<oa){var Ca=Array(oa);ea=null!=ea?ea.split(","):[];for(var Fa=0;Fa<oa;Fa++)Ca[Fa]=null!=ea[Fa]?ea[Fa]:null!=Aa?Aa:"";ha.push({name:wa,values:Ca,type:na,defVal:Aa,parentRow:Ea,flipBkg:va,size:oa})}return document.createElement("div")}function X(wa,ea,na){var Aa=document.createElement("input");Aa.type="checkbox";Aa.checked="1"==ea;mxEvent.addListener(Aa,"change",function(){P(wa,Aa.checked?"1":"0",na)});return Aa}function Y(wa,ea,na,Aa,oa){var Ea=na.dispName,+"32px";oa.style.height="8px";oa.style.margin="2px";oa.style.borderStyle="solid";oa.style.borderWidth="1px";Aa(ea);btn=mxUtils.button("",mxUtils.bind(Z,function(Ea){this.editorUi.pickColor(ea,function(va){O(wa,va,na);Aa(va)});mxEvent.consume(Ea)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(oa);return btn}function U(wa,ea,na,Aa,oa,Ea,va){null!=ea&&(ea=ea.split(","),fa.push({name:wa,values:ea,type:na,+defVal:Aa,countProperty:oa,parentRow:Ea,isDeletable:!0,flipBkg:va}));btn=mxUtils.button("+",mxUtils.bind(Z,function(Ca){for(var Fa=Ea,Ma=0;null!=Fa.nextSibling;)if(Fa.nextSibling.getAttribute("data-pName")==wa)Fa=Fa.nextSibling,Ma++;else break;var Ba={type:na,parentRow:Ea,index:Ma,isDeletable:!0,defVal:Aa,countProperty:oa};Ma=Y(wa,"",Ba,0==Ma%2,va);O(wa,Aa,Ba);Fa.parentNode.insertBefore(Ma,Fa.nextSibling);mxEvent.consume(Ca)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";+return btn}function W(wa,ea,na,Aa,oa,Ea,va){if(0<oa){var Ca=Array(oa);ea=null!=ea?ea.split(","):[];for(var Fa=0;Fa<oa;Fa++)Ca[Fa]=null!=ea[Fa]?ea[Fa]:null!=Aa?Aa:"";fa.push({name:wa,values:Ca,type:na,defVal:Aa,parentRow:Ea,flipBkg:va,size:oa})}return document.createElement("div")}function X(wa,ea,na){var Aa=document.createElement("input");Aa.type="checkbox";Aa.checked="1"==ea;mxEvent.addListener(Aa,"change",function(){O(wa,Aa.checked?"1":"0",na)});return Aa}function Y(wa,ea,na,Aa,oa){var Ea=na.dispName,va=na.type,Ca=document.createElement("tr");Ca.className="gePropRow"+(oa?"Dark":"")+(Aa?"Alt":"")+" gePropNonHeaderRow";Ca.setAttribute("data-pName",wa);Ca.setAttribute("data-pValue",ea);Aa=!1;null!=na.index&&(Ca.setAttribute("data-index",na.index),Ea=(null!=Ea?Ea:"")+"["+na.index+"]",Aa=!0);var Fa=document.createElement("td");Fa.className="gePropRowCell";Ea=mxResources.get(Ea,null,Ea);mxUtils.write(Fa,Ea);Fa.setAttribute("title",Ea);Aa&&(Fa.style.textAlign="right");Ca.appendChild(Fa);Fa=document.createElement("td");Fa.className="gePropRowCell";Fa.setAttribute("title",null!=ea?ea:mxResources.get("none"));if("color"==va)Fa.appendChild(T(wa,ea,na));else if("bool"==va||"boolean"==va)Fa.appendChild(X(wa,ea,na));else if("enum"==va){var Ma=na.enumList;for(oa=0;oa<Ma.length;oa++)if(Ea=Ma[oa],Ea.val==ea){mxUtils.write(Fa,mxResources.get(Ea.dispName,null,Ea.dispName));break}mxEvent.addListener(Fa,"click",mxUtils.bind(Z,function(){var Ba=document.createElement("select"),Da=null;R(Fa,Ba);for(var Ia=0;Ia<Ma.length;Ia++){var Va=-Ma[Ia],Ta=document.createElement("option");Ta.value=mxUtils.htmlEntities(Va.val);mxUtils.write(Ta,mxResources.get(Va.dispName,null,Va.dispName));Ba.appendChild(Ta);null==Va.val&&(Ta.value="null",Da=Ta)}Ba.value=null==ea&&null!=Da?"null":ea;l.appendChild(Ba);mxEvent.addListener(Ba,"change",function(){var Xa=mxUtils.htmlEntities(Ba.value);if(Ba[Ba.selectedIndex]==Da||"null"==Xa.value)Xa=null;P(wa,Xa,na)});Ba.focus();mxEvent.addListener(Ba,"blur",function(){l.removeChild(Ba)})}))}else"dynamicArr"==va?+Ma[Ia],Ta=document.createElement("option");Ta.value=mxUtils.htmlEntities(Va.val);mxUtils.write(Ta,mxResources.get(Va.dispName,null,Va.dispName));Ba.appendChild(Ta);null==Va.val&&(Ta.value="null",Da=Ta)}Ba.value=null==ea&&null!=Da?"null":ea;l.appendChild(Ba);mxEvent.addListener(Ba,"change",function(){var Xa=mxUtils.htmlEntities(Ba.value);if(Ba[Ba.selectedIndex]==Da||"null"==Xa.value)Xa=null;O(wa,Xa,na)});Ba.focus();mxEvent.addListener(Ba,"blur",function(){l.removeChild(Ba)})}))}else"dynamicArr"==va?Fa.appendChild(U(wa,ea,na.subType,na.subDefVal,na.countProperty,Ca,oa)):"staticArr"==va?Fa.appendChild(W(wa,ea,na.subType,na.subDefVal,na.size,Ca,oa)):"readOnly"==va?(oa=document.createElement("input"),oa.setAttribute("readonly",""),oa.value=ea,oa.style.borderWidth="0px","id"==wa?(oa.style.width="190px",oa.style.position="relative",oa.style.right="6px",oa.style.float="right",oa.style.background="none",oa.style.textAlign="right",Ca.firstChild.setAttribute("colspan","2"),oa.setAttribute("title",ea),Ca.firstChild.appendChild(oa)):(oa.style.width="96px",Fa.appendChild(oa))):(Fa.innerHTML=mxUtils.htmlEntities(decodeURIComponent(ea)),mxEvent.addListener(Fa,"click",mxUtils.bind(Z,function(){function Ba(){var Ia=Da.value;Ia=0==Ia.length&&"string"!=va&&"numbers"!=va?0:Ia;na.allowAuto&&(null!=Ia.trim&&"auto"==Ia.trim().toLowerCase()?(Ia="auto",va="string"):(Ia=parseFloat(Ia),Ia=isNaN(Ia)?0:Ia));null!=na.min&&Ia<na.min?Ia=na.min:null!=na.max&&Ia>na.max&&(Ia=na.max);var Va=null;try{Va="numbers"==va?Ia.match(/\d+/g).map(Number).join(" "):-encodeURIComponent(("int"==va?parseInt(Ia):Ia)+"")}catch(Ta){}P(wa,Va,na,null,Da)}var Da=document.createElement("input");R(Fa,Da,!0);Da.value=decodeURIComponent(ea);Da.className="gePropEditor";"int"!=va&&"float"!=va||na.allowAuto||(Da.type="number",Da.step="int"==va?"1":"any",null!=na.min&&(Da.min=parseFloat(na.min)),null!=na.max&&(Da.max=parseFloat(na.max)));l.appendChild(Da);mxEvent.addListener(Da,"keypress",function(Ia){13==Ia.keyCode&&Ba()});Da.focus();mxEvent.addListener(Da,"blur",function(){Ba()})})));-na.isDeletable&&(oa=mxUtils.button("-",mxUtils.bind(Z,function(Ba){P(wa,"",na,na.index);mxEvent.consume(Ba)})),oa.style.height="16px",oa.style.width="25px",oa.style.float="right",oa.className="geColorBtn",Fa.appendChild(oa));Ca.appendChild(Fa);return Ca}var Z=this,ba=this.editorUi.editor.graph,ha=[];l.style.position="relative";l.style.padding="0";var ca=document.createElement("table");ca.className="geProperties";ca.style.whiteSpace="nowrap";ca.style.width="100%";var da=document.createElement("tr");+encodeURIComponent(("int"==va?parseInt(Ia):Ia)+"")}catch(Ta){}O(wa,Va,na,null,Da)}var Da=document.createElement("input");R(Fa,Da,!0);Da.value=decodeURIComponent(ea);Da.className="gePropEditor";"int"!=va&&"float"!=va||na.allowAuto||(Da.type="number",Da.step="int"==va?"1":"any",null!=na.min&&(Da.min=parseFloat(na.min)),null!=na.max&&(Da.max=parseFloat(na.max)));l.appendChild(Da);mxEvent.addListener(Da,"keypress",function(Ia){13==Ia.keyCode&&Ba()});Da.focus();mxEvent.addListener(Da,"blur",function(){Ba()})})));+na.isDeletable&&(oa=mxUtils.button("-",mxUtils.bind(Z,function(Ba){O(wa,"",na,na.index);mxEvent.consume(Ba)})),oa.style.height="16px",oa.style.width="25px",oa.style.float="right",oa.className="geColorBtn",Fa.appendChild(oa));Ca.appendChild(Fa);return Ca}var Z=this,ba=this.editorUi.editor.graph,fa=[];l.style.position="relative";l.style.padding="0";var ca=document.createElement("table");ca.className="geProperties";ca.style.whiteSpace="nowrap";ca.style.width="100%";var da=document.createElement("tr");da.className="gePropHeader";var ja=document.createElement("th");ja.className="gePropHeaderCell";ja.style.paddingLeft="16px";ja.style.backgroundRepeat="no-repeat";ja.style.backgroundPosition="-2px 50%";ja.style.backgroundSize="20px";mxUtils.write(ja,mxResources.get("property"));da.style.cursor="pointer";var aa=function(){var wa=ca.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){ja.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ea="none";for(var na=l.childNodes.length-1;0<=na;na--)try{var Aa=l.childNodes[na],oa=Aa.nodeName.toUpperCase();"INPUT"!=oa&&"SELECT"!=oa||l.removeChild(Aa)}catch(Ea){}}else ja.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ea="";for(na=0;na<wa.length;na++)wa[na].style.display=ea};mxEvent.addListener(da,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;aa()});da.appendChild(ja);var ia=document.createElement("th");ia.className="gePropHeaderCell";ia.style.paddingLeft="4px";mxUtils.write(ia,mxResources.get("value"));da.appendChild(ia);ca.appendChild(da);var ka=ia=!1;da=null;1==G.vertices.length&&0==G.edges.length?da=G.vertices[0].id:0==G.vertices.length&&1==G.edges.length&&(da=G.edges[0].id);null==da||N||ca.appendChild(Y("id",mxUtils.htmlEntities(da),{dispName:"id",type:"readOnly"},!0,!1));for(var ua in x)if(N=x[ua],"function"!=typeof N.isVisible||N.isVisible(G,this)){var sa=null!=N.getValue?N.getValue():null!=G.style[ua]?mxUtils.htmlEntities(G.style[ua]+""):null!=N.getDefaultValue?N.getDefaultValue(G,this):-N.defVal;if("separator"==N.type)ka=!ka;else{if("staticArr"==N.type)N.size=parseInt(G.style[N.sizeProperty]||x[N.sizeProperty].defVal)||0;else if(null!=N.dependentProps){var fa=N.dependentProps,pa=[],ra=[];for(da=0;da<fa.length;da++){var xa=G.style[fa[da]];ra.push(x[fa[da]].subDefVal);pa.push(null!=xa?xa.split(","):[])}N.dependentPropsDefVal=ra;N.dependentPropsVals=pa}ca.appendChild(Y(ua,sa,N,ia,ka));ia=!ia}}for(da=0;da<ha.length;da++)for(N=ha[da],x=N.parentRow,G=0;G<N.values.length;G++)ua=Y(N.name,-N.values[G],{type:N.type,parentRow:N.parentRow,isDeletable:N.isDeletable,index:G,defVal:N.defVal,countProperty:N.countProperty,size:N.size},0==G%2,N.flipBkg),x.parentNode.insertBefore(ua,x.nextSibling),x=ua;l.appendChild(ca);aa();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var x=function(ha){mxEvent.addListener(ha,"mouseenter",function(){ha.style.opacity="1"});mxEvent.addListener(ha,"mouseleave",function(){ha.style.opacity="0.5"})},G=this.editorUi,-N=G.editor.graph,P=document.createElement("div");P.style.whiteSpace="nowrap";P.style.paddingLeft="24px";P.style.paddingRight="20px";l.style.paddingLeft="16px";l.style.paddingBottom="6px";l.style.position="relative";l.appendChild(P);var R=document.createElement("div");R.style.whiteSpace="nowrap";R.style.position="relative";R.style.textAlign="center";R.style.width="210px";for(var T=[],U=0;U<this.defaultColorSchemes.length;U++){var W=document.createElement("div");W.style.display="inline-block";W.style.width=-"6px";W.style.height="6px";W.style.marginLeft="4px";W.style.marginRight="3px";W.style.borderRadius="3px";W.style.cursor="pointer";W.style.background="transparent";W.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(ha){mxEvent.addListener(W,"click",mxUtils.bind(this,function(){X(ha)}))})(U);T.push(W);R.appendChild(W)}var X=mxUtils.bind(this,function(ha){null!=T[ha]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&(T[this.format.currentScheme].style.background="transparent"),-this.format.currentScheme=ha,Y(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),Y=mxUtils.bind(this,function(ha){var ca=mxUtils.clone(N.defaultVertexStyle);ca[mxConstants.STYLE_STROKECOLOR]=null!=ca[mxConstants.STYLE_STROKECOLOR]?ca[mxConstants.STYLE_STROKECOLOR]:"default";ca[mxConstants.STYLE_FILLCOLOR]=null!=ca[mxConstants.STYLE_FILLCOLOR]?ca[mxConstants.STYLE_FILLCOLOR]:"default";ca[mxConstants.STYLE_FONTCOLOR]=null!=ca[mxConstants.STYLE_FONTCOLOR]?-ca[mxConstants.STYLE_FONTCOLOR]:"default";N.replaceDefaultColors(new mxCell,ca);var da=mxUtils.bind(this,function(aa){var ia=mxUtils.button("",mxUtils.bind(this,function(sa){N.getModel().beginUpdate();try{for(var fa=G.getSelectionState().cells,pa=0;pa<fa.length;pa++){var ra=N.getModel().getStyle(fa[pa]);null!=aa?(mxEvent.isShiftDown(sa)||(ra=""==aa.fill||null==aa.fill?mxUtils.setStyle(ra,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ra,mxConstants.STYLE_FILLCOLOR,aa.fill),ra=""==aa.gradient||-null==aa.gradient?mxUtils.setStyle(ra,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ra,mxConstants.STYLE_GRADIENTCOLOR,aa.gradient),mxEvent.isControlDown(sa)||mxClient.IS_MAC&&mxEvent.isMetaDown(sa)||!N.getModel().isVertex(fa[pa])||(ra=""==aa.font||null==aa.font?mxUtils.setStyle(ra,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ra,mxConstants.STYLE_FONTCOLOR,aa.font))),mxEvent.isAltDown(sa)||(ra=""==aa.stroke||null==aa.fill?mxUtils.setStyle(ra,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ra,-mxConstants.STYLE_STROKECOLOR,aa.stroke))):(ra=mxUtils.setStyle(ra,mxConstants.STYLE_FILLCOLOR,null),ra=mxUtils.setStyle(ra,mxConstants.STYLE_STROKECOLOR,null),ra=mxUtils.setStyle(ra,mxConstants.STYLE_GRADIENTCOLOR,null),N.getModel().isVertex(fa[pa])&&(ra=mxUtils.setStyle(ra,mxConstants.STYLE_FONTCOLOR,null)));N.getModel().setStyle(fa[pa],ra)}}finally{N.getModel().endUpdate()}}));ia.className="geStyleButton";ia.style.width="36px";ia.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ia.style.margin=+N.defVal;if("separator"==N.type)ka=!ka;else{if("staticArr"==N.type)N.size=parseInt(G.style[N.sizeProperty]||x[N.sizeProperty].defVal)||0;else if(null!=N.dependentProps){var ha=N.dependentProps,pa=[],ra=[];for(da=0;da<ha.length;da++){var xa=G.style[ha[da]];ra.push(x[ha[da]].subDefVal);pa.push(null!=xa?xa.split(","):[])}N.dependentPropsDefVal=ra;N.dependentPropsVals=pa}ca.appendChild(Y(ua,sa,N,ia,ka));ia=!ia}}for(da=0;da<fa.length;da++)for(N=fa[da],x=N.parentRow,G=0;G<N.values.length;G++)ua=Y(N.name,+N.values[G],{type:N.type,parentRow:N.parentRow,isDeletable:N.isDeletable,index:G,defVal:N.defVal,countProperty:N.countProperty,size:N.size},0==G%2,N.flipBkg),x.parentNode.insertBefore(ua,x.nextSibling),x=ua;l.appendChild(ca);aa();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var x=function(fa){mxEvent.addListener(fa,"mouseenter",function(){fa.style.opacity="1"});mxEvent.addListener(fa,"mouseleave",function(){fa.style.opacity="0.5"})},G=this.editorUi,+N=G.editor.graph,O=document.createElement("div");O.style.whiteSpace="nowrap";O.style.paddingLeft="24px";O.style.paddingRight="20px";l.style.paddingLeft="16px";l.style.paddingBottom="6px";l.style.position="relative";l.appendChild(O);var R=document.createElement("div");R.style.whiteSpace="nowrap";R.style.position="relative";R.style.textAlign="center";R.style.width="210px";for(var T=[],U=0;U<this.defaultColorSchemes.length;U++){var W=document.createElement("div");W.style.display="inline-block";W.style.width=+"6px";W.style.height="6px";W.style.marginLeft="4px";W.style.marginRight="3px";W.style.borderRadius="3px";W.style.cursor="pointer";W.style.background="transparent";W.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(fa){mxEvent.addListener(W,"click",mxUtils.bind(this,function(){X(fa)}))})(U);T.push(W);R.appendChild(W)}var X=mxUtils.bind(this,function(fa){null!=T[fa]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&(T[this.format.currentScheme].style.background="transparent"),+this.format.currentScheme=fa,Y(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),Y=mxUtils.bind(this,function(fa){var ca=mxUtils.clone(N.defaultVertexStyle);ca[mxConstants.STYLE_STROKECOLOR]=null!=ca[mxConstants.STYLE_STROKECOLOR]?ca[mxConstants.STYLE_STROKECOLOR]:"default";ca[mxConstants.STYLE_FILLCOLOR]=null!=ca[mxConstants.STYLE_FILLCOLOR]?ca[mxConstants.STYLE_FILLCOLOR]:"default";ca[mxConstants.STYLE_FONTCOLOR]=null!=ca[mxConstants.STYLE_FONTCOLOR]?+ca[mxConstants.STYLE_FONTCOLOR]:"default";N.replaceDefaultColors(new mxCell,ca);var da=mxUtils.bind(this,function(aa){var ia=mxUtils.button("",mxUtils.bind(this,function(sa){N.getModel().beginUpdate();try{for(var ha=G.getSelectionState().cells,pa=0;pa<ha.length;pa++){var ra=N.getModel().getStyle(ha[pa]);null!=aa?(mxEvent.isShiftDown(sa)||(ra=""==aa.fill||null==aa.fill?mxUtils.setStyle(ra,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ra,mxConstants.STYLE_FILLCOLOR,aa.fill),ra=""==aa.gradient||+null==aa.gradient?mxUtils.setStyle(ra,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ra,mxConstants.STYLE_GRADIENTCOLOR,aa.gradient),mxEvent.isControlDown(sa)||mxClient.IS_MAC&&mxEvent.isMetaDown(sa)||!N.getModel().isVertex(ha[pa])||(ra=""==aa.font||null==aa.font?mxUtils.setStyle(ra,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ra,mxConstants.STYLE_FONTCOLOR,aa.font))),mxEvent.isAltDown(sa)||(ra=""==aa.stroke||null==aa.fill?mxUtils.setStyle(ra,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ra,+mxConstants.STYLE_STROKECOLOR,aa.stroke))):(ra=mxUtils.setStyle(ra,mxConstants.STYLE_FILLCOLOR,null),ra=mxUtils.setStyle(ra,mxConstants.STYLE_STROKECOLOR,null),ra=mxUtils.setStyle(ra,mxConstants.STYLE_GRADIENTCOLOR,null),N.getModel().isVertex(ha[pa])&&(ra=mxUtils.setStyle(ra,mxConstants.STYLE_FONTCOLOR,null)));N.getModel().setStyle(ha[pa],ra)}}finally{N.getModel().endUpdate()}}));ia.className="geStyleButton";ia.style.width="36px";ia.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ia.style.margin="0px 6px 6px 0px";if(null!=aa){var ka="1px solid";null!=aa.border&&(ka=aa.border);if(null!=aa.gradient)ia.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(aa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(aa.gradient).cssText+" 100%)";else if(aa.fill==mxConstants.NONE)ia.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==aa.fill||""==aa.fill)ia.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ca,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ua=mxUtils.getLightDarkColor(aa.fill);ia.style.backgroundImage="linear-gradient(to right bottom, "+ua.cssText+" 50%, "+ua.light+" 50.3%)"}null==aa.stroke||aa.stroke==mxConstants.NONE?ia.style.border=ka+" transparent":""==aa.stroke?ia.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ca,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ua=mxUtils.getLightDarkColor(aa.stroke),ia.style.border=ka+" "+ua.cssText,ia.style.borderRightColor=ua.light,ia.style.borderBottomColor=-ia.style.borderRightColor);null!=aa.title&&ia.setAttribute("title",aa.title)}else ka=mxUtils.getValue(ca,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ua=mxUtils.getValue(ca,mxConstants.STYLE_STROKECOLOR,"#000000"),ia.style.backgroundColor=ka,ia.style.border="1px solid "+ua;ia.style.borderRadius="0";P.appendChild(ia);null!=aa&&null!=aa.gradient&&(ka=ia.cloneNode(!1),ka.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(aa.fill).light+") 0px, light-dark(transparent, "+-mxUtils.getLightDarkColor(aa.gradient).light+") 100%)",ka.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",ka.style.backgroundColor="transparent",P.appendChild(ka),ka.style.marginLeft="-42px",mxEvent.addListener(ka,"click",function(){ia.click()}))});P.innerText="";if(null!=ha)for(var ja=0;ja<ha.length;ja++)0<ja&&0==mxUtils.mod(ja,4)&&mxUtils.br(P),da(ha[ja])});null==this.format.currentScheme?X(Math.min(T.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):X(this.format.currentScheme);U=+ia.style.borderRightColor);null!=aa.title&&ia.setAttribute("title",aa.title)}else ka=mxUtils.getValue(ca,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ua=mxUtils.getValue(ca,mxConstants.STYLE_STROKECOLOR,"#000000"),ia.style.backgroundColor=ka,ia.style.border="1px solid "+ua;ia.style.borderRadius="0";O.appendChild(ia);null!=aa&&null!=aa.gradient&&(ka=ia.cloneNode(!1),ka.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(aa.fill).light+") 0px, light-dark(transparent, "++mxUtils.getLightDarkColor(aa.gradient).light+") 100%)",ka.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",ka.style.backgroundColor="transparent",O.appendChild(ka),ka.style.marginLeft="-42px",mxEvent.addListener(ka,"click",function(){ia.click()}))});O.innerText="";if(null!=fa)for(var ja=0;ja<fa.length;ja++)0<ja&&0==mxUtils.mod(ja,4)&&mxUtils.br(O),da(fa[ja])});null==this.format.currentScheme?X(Math.min(T.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):X(this.format.currentScheme);U=10>=this.defaultColorSchemes.length?28:8;var Z=document.createElement("div");Z.style.cssText="position:absolute;left:10px;top:8px;bottom:"+U+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){X(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ba=document.createElement("div");ba.style.cssText="position:absolute;left:202px;top:8px;bottom:"+U+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";1<this.defaultColorSchemes.length&&(l.appendChild(Z),l.appendChild(ba));mxEvent.addListener(ba,"click",mxUtils.bind(this,function(){X(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));x(Z);x(ba);Y(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&l.appendChild(R)}return l}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(l){return l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||l.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(l){return Graph.isGoogleFontUrl(l)};Graph.rewriteGoogleFontUrl=function(l){null!=l&&l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(l=Editor.GOOGLE_FONTS_CSS2+l.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return l};Graph.createFontElement=function(l,x){var G=Graph.fontMapping[x];null==G&&Graph.isCssFontUrl(x)?(l=document.createElement("link"),l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(x))):(null==G&&(G='@font-face {\nfont-family: "'+l+'";\nsrc: url("'+x+'");\n}'),l=document.createElement("style"),mxUtils.write(l,G));return l};Graph.addRecentCustomFont=function(l,x){};Graph.addFont=function(l,x,G){if(null!=l&&0<l.length&&null!=-x&&0<x.length){var N=l.toLowerCase();if("helvetica"!=N&&"arial"!=l&&"sans-serif"!=N){var P=Graph.customFontElements[N];null!=P&&P.url!=x&&(P.elt.parentNode.removeChild(P.elt),P=null);null==P?(P=x,"http:"==x.substring(0,5)&&(P=PROXY_URL+"?url="+encodeURIComponent(x)),P={name:l,url:x,elt:Graph.createFontElement(l,P)},Graph.customFontElements[N]=P,x=document.getElementsByTagName("head")[0],null!=G&&("link"==P.elt.nodeName.toLowerCase()?(P.elt.onload=G,P.elt.onerror=G):G()),null!=x&&x.appendChild(P.elt)):+x&&0<x.length){var N=l.toLowerCase();if("helvetica"!=N&&"arial"!=l&&"sans-serif"!=N){var O=Graph.customFontElements[N];null!=O&&O.url!=x&&(O.elt.parentNode.removeChild(O.elt),O=null);null==O?(O=x,"http:"==x.substring(0,5)&&(O=PROXY_URL+"?url="+encodeURIComponent(x)),O={name:l,url:x,elt:Graph.createFontElement(l,O)},Graph.customFontElements[N]=O,x=document.getElementsByTagName("head")[0],null!=G&&("link"==O.elt.nodeName.toLowerCase()?(O.elt.onload=G,O.elt.onerror=G):G()),null!=x&&x.appendChild(O.elt)):null!=G&&G()}else null!=G&&G()}else null!=G&&G();return l};Graph.getFontUrl=function(l,x){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(x=l.url);return x};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var x=0;x<l.length;x++){var G=l[x].getAttribute("data-font-src");if(null!=G){var N="FONT"==l[x].nodeName?l[x].getAttribute("face"):l[x].style.fontFamily;null!=N&&Graph.addFont(N,G)}}};Graph.processFontStyle=function(l){if(null!=l){var x=mxUtils.getValue(l,"fontSource",null);if(null!=x){var G=mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=G)try{Graph.addFont(G,decodeURIComponent(x))}catch(N){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur=-"1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var g=Graph.prototype.init;Graph.prototype.init=function(){function l(P){x=P}g.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var x=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",l);mxEvent.addListener(this.container,"mouseleave",function(P){x=null});this.isMouseInsertPoint=function(){return null!=-x};var G=this.getInsertPoint;this.getInsertPoint=function(){return null!=x?this.getPointForEvent(x):G.apply(this,arguments)};var N=this.layoutManager.getLayout;this.layoutManager.getLayout=function(P){var R=this.graph.getCellStyle(P);if(null!=R&&"rack"==R.childLayout){var T=new mxStackLayout(this.graph,!1);T.gridSize=null!=R.rackUnitSize?parseFloat(R.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;T.marginLeft=R.marginLeft||0;T.marginRight=R.marginRight||0;T.marginTop=-R.marginTop||0;T.marginBottom=R.marginBottom||0;T.allowGaps=R.allowGaps||0;T.horizontal="1"==mxUtils.getValue(R,"horizontalRack","0");T.resizeParent=!1;T.fill=!0;return T}return N.apply(this,arguments)};this.updateGlobalUrlVariables()};var m=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,x){return Graph.processFontStyle(m.apply(this,arguments))};var t=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(l,x,G,N,P,R,T,U,W,X,-Y,Z){t.apply(this,arguments);Graph.processFontAttributes(Z)};var v=mxText.prototype.redraw;mxText.prototype.redraw=function(){v.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,x,G,N){function P(){for(var da=U.getSelectionCells(),ja=[],aa=0;aa<da.length;aa++)U.isCellVisible(da[aa])&&ja.push(da[aa]);U.setSelectionCells(ja)}function R(da){U.setHiddenTags(da?[]:W.slice());P();U.refresh()}function T(da,-ja){Y.innerText="";if(0<da.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ia=document.createElement("tbody");if(null!=da&&0<da.length)for(var ka=0;ka<da.length;ka++)(function(ua){function sa(){var ea=U.getCellsForTags([ua],null,null,!0);U.isEnabled()?U.setSelectionCells(ea):U.highlightCells(ea,null,null,70)}var fa=0>mxUtils.indexOf(U.hiddenTags,ua),pa=document.createElement("tr"),-ra=document.createElement("td");ra.style.align="center";ra.style.width="16px";var xa=document.createElement("img");xa.setAttribute("src",fa?Editor.visibleImage:Editor.hiddenImage);xa.setAttribute("title",mxResources.get(fa?"hideIt":"show",[ua]));mxUtils.setOpacity(xa,fa?75:25);xa.className="geAdaptiveAsset";xa.style.verticalAlign="middle";xa.style.cursor="pointer";xa.style.width="16px";if(x||Editor.isDarkMode())xa.style.filter="invert(100%)";ra.appendChild(xa);mxEvent.addListener(xa,"click",function(ea){mxEvent.isShiftDown(ea)?-R(0<=mxUtils.indexOf(U.hiddenTags,ua)):(U.toggleHiddenTag(ua),P(),U.refresh());mxEvent.consume(ea)});pa.appendChild(ra);ra=document.createElement("td");ra.style.align="center";ra.style.width="16px";xa=document.createElement("img");xa.setAttribute("src",Editor.selectImage);xa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(xa,fa?75:25);xa.className="geAdaptiveAsset";xa.style.verticalAlign="middle";xa.style.cursor="pointer";xa.style.width="16px";if(x||Editor.isDarkMode())xa.style.filter=-"invert(100%)";mxEvent.addListener(xa,"click",function(ea){R(!0);sa();mxEvent.consume(ea)});ra.appendChild(xa);pa.appendChild(ra);ra=document.createElement("td");ra.style.overflow="hidden";ra.style.whiteSpace="nowrap";ra.style.textOverflow="ellipsis";ra.style.verticalAlign="middle";ra.style.cursor="pointer";ra.setAttribute("title",ua);a=document.createElement("a");mxUtils.write(a,ua);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,fa?100:40);ra.appendChild(a);mxEvent.addListener(ra,-"click",function(ea){if(mxEvent.isShiftDown(ea))R(!0),sa();else if(fa&&0<U.hiddenTags.length)R(!0);else{var na=W.slice(),Aa=mxUtils.indexOf(na,ua);na.splice(Aa,1);U.setHiddenTags(na);P();U.refresh()}mxEvent.consume(ea)});pa.appendChild(ra);if(U.isEnabled()){ra=document.createElement("td");ra.style.verticalAlign="middle";ra.style.textAlign="center";ra.style.width="18px";if(null==ja){ra.style.align="center";ra.style.width="16px";xa=document.createElement("img");xa.setAttribute("src",Editor.trashImage);-xa.setAttribute("title",mxResources.get("removeIt",[ua]));mxUtils.setOpacity(xa,fa?75:25);xa.className="geAdaptiveAsset";xa.style.verticalAlign="middle";xa.style.cursor="pointer";xa.style.width="16px";if(x||Editor.isDarkMode())xa.style.filter="invert(100%)";mxEvent.addListener(xa,"click",function(ea){var na=mxUtils.indexOf(W,ua);0<=na&&W.splice(na,1);U.removeTagsForCells(U.model.getDescendants(U.model.getRoot()),[ua]);U.refresh();mxEvent.consume(ea)});ra.appendChild(xa)}else{var wa=document.createElement("input");+"1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var g=Graph.prototype.init;Graph.prototype.init=function(){function l(O){x=O}g.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var x=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",l);mxEvent.addListener(this.container,"mouseleave",function(O){x=null});this.isMouseInsertPoint=function(){return null!=+x};var G=this.getInsertPoint;this.getInsertPoint=function(){return null!=x?this.getPointForEvent(x):G.apply(this,arguments)};var N=this.layoutManager.getLayout;this.layoutManager.getLayout=function(O){var R=this.graph.getCellStyle(O);if(null!=R&&"rack"==R.childLayout){var T=new mxStackLayout(this.graph,!1);T.gridSize=null!=R.rackUnitSize?parseFloat(R.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;T.marginLeft=R.marginLeft||0;T.marginRight=R.marginRight||0;T.marginTop=+R.marginTop||0;T.marginBottom=R.marginBottom||0;T.allowGaps=R.allowGaps||0;T.horizontal="1"==mxUtils.getValue(R,"horizontalRack","0");T.resizeParent=!1;T.fill=!0;return T}return N.apply(this,arguments)};this.updateGlobalUrlVariables()};var m=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,x){return Graph.processFontStyle(m.apply(this,arguments))};var t=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(l,x,G,N,O,R,T,U,W,X,+Y,Z){t.apply(this,arguments);Graph.processFontAttributes(Z)};var v=mxText.prototype.redraw;mxText.prototype.redraw=function(){v.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,x,G,N){function O(){for(var da=U.getSelectionCells(),ja=[],aa=0;aa<da.length;aa++)U.isCellVisible(da[aa])&&ja.push(da[aa]);U.setSelectionCells(ja)}function R(da){U.setHiddenTags(da?[]:W.slice());O();U.refresh()}function T(da,+ja){Y.innerText="";if(0<da.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ia=document.createElement("tbody");if(null!=da&&0<da.length)for(var ka=0;ka<da.length;ka++)(function(ua){function sa(){var ea=U.getCellsForTags([ua],null,null,!0);U.isEnabled()?U.setSelectionCells(ea):U.highlightCells(ea,null,null,70)}var ha=0>mxUtils.indexOf(U.hiddenTags,ua),pa=document.createElement("tr"),+ra=document.createElement("td");ra.style.align="center";ra.style.width="16px";var xa=document.createElement("img");xa.setAttribute("src",ha?Editor.visibleImage:Editor.hiddenImage);xa.setAttribute("title",mxResources.get(ha?"hideIt":"show",[ua]));mxUtils.setOpacity(xa,ha?75:25);xa.className="geAdaptiveAsset";xa.style.verticalAlign="middle";xa.style.cursor="pointer";xa.style.width="16px";if(x||Editor.isDarkMode())xa.style.filter="invert(100%)";ra.appendChild(xa);mxEvent.addListener(xa,"click",function(ea){mxEvent.isShiftDown(ea)?+R(0<=mxUtils.indexOf(U.hiddenTags,ua)):(U.toggleHiddenTag(ua),O(),U.refresh());mxEvent.consume(ea)});pa.appendChild(ra);ra=document.createElement("td");ra.style.align="center";ra.style.width="16px";xa=document.createElement("img");xa.setAttribute("src",Editor.selectImage);xa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(xa,ha?75:25);xa.className="geAdaptiveAsset";xa.style.verticalAlign="middle";xa.style.cursor="pointer";xa.style.width="16px";if(x||Editor.isDarkMode())xa.style.filter=+"invert(100%)";mxEvent.addListener(xa,"click",function(ea){R(!0);sa();mxEvent.consume(ea)});ra.appendChild(xa);pa.appendChild(ra);ra=document.createElement("td");ra.style.overflow="hidden";ra.style.whiteSpace="nowrap";ra.style.textOverflow="ellipsis";ra.style.verticalAlign="middle";ra.style.cursor="pointer";ra.setAttribute("title",ua);a=document.createElement("a");mxUtils.write(a,ua);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,ha?100:40);ra.appendChild(a);mxEvent.addListener(ra,+"click",function(ea){if(mxEvent.isShiftDown(ea))R(!0),sa();else if(ha&&0<U.hiddenTags.length)R(!0);else{var na=W.slice(),Aa=mxUtils.indexOf(na,ua);na.splice(Aa,1);U.setHiddenTags(na);O();U.refresh()}mxEvent.consume(ea)});pa.appendChild(ra);if(U.isEnabled()){ra=document.createElement("td");ra.style.verticalAlign="middle";ra.style.textAlign="center";ra.style.width="18px";if(null==ja){ra.style.align="center";ra.style.width="16px";xa=document.createElement("img");xa.setAttribute("src",Editor.trashImage);+xa.setAttribute("title",mxResources.get("removeIt",[ua]));mxUtils.setOpacity(xa,ha?75:25);xa.className="geAdaptiveAsset";xa.style.verticalAlign="middle";xa.style.cursor="pointer";xa.style.width="16px";if(x||Editor.isDarkMode())xa.style.filter="invert(100%)";mxEvent.addListener(xa,"click",function(ea){var na=mxUtils.indexOf(W,ua);0<=na&&W.splice(na,1);U.removeTagsForCells(U.model.getDescendants(U.model.getRoot()),[ua]);U.refresh();mxEvent.consume(ea)});ra.appendChild(xa)}else{var wa=document.createElement("input");wa.setAttribute("type","checkbox");wa.style.margin="0px";wa.defaultChecked=null!=ja&&0<=mxUtils.indexOf(ja,ua);wa.checked=wa.defaultChecked;wa.style.background="transparent";wa.setAttribute("title",mxResources.get(wa.defaultChecked?"removeIt":"add",[ua]));mxEvent.addListener(wa,"change",function(ea){wa.checked?U.addTagsForCells(U.getSelectionCells(),[ua]):U.removeTagsForCells(U.getSelectionCells(),[ua]);mxEvent.consume(ea)});ra.appendChild(wa)}pa.appendChild(ra)}ia.appendChild(pa)})(da[ka]);aa.appendChild(ia);Y.appendChild(aa)}}var U=this,W=U.hiddenTags.slice(),X=document.createElement("div");X.style.userSelect="none";X.style.overflow="hidden";X.style.padding="10px";X.style.height="100%";var Y=document.createElement("div");Y.style.boxSizing="border-box";Y.style.borderRadius="4px";Y.style.userSelect="none";Y.style.overflow="auto";Y.style.position="absolute";Y.style.left="10px";Y.style.right="10px";Y.style.top="10px";Y.style.border=U.isEnabled()?"1px solid #808080":"none";Y.style.bottom=U.isEnabled()?"48px":-"10px";X.appendChild(Y);var Z=mxUtils.button(mxResources.get("reset"),function(da){U.setHiddenTags([]);mxEvent.isShiftDown(da)||(W=U.hiddenTags.slice());P();U.refresh()});Z.setAttribute("title",mxResources.get("reset"));Z.className="geBtn";Z.style.margin="0 4px 0 0";var ba=mxUtils.button(mxResources.get("add"),function(){null!=G&&G(W,function(da){W=da;ha()})});ba.setAttribute("title",mxResources.get("add"));ba.className="geBtn";ba.style.margin="0";U.addListener(mxEvent.ROOT,function(){W=U.hiddenTags.slice()});-var ha=mxUtils.bind(this,function(da,ja){if(l()){da=U.getAllTags();for(ja=0;ja<da.length;ja++)0>mxUtils.indexOf(W,da[ja])&&W.push(da[ja]);W.sort();U.isSelectionEmpty()?T(W):T(W,U.getCommonTagsForCells(U.getSelectionCells()))}});U.selectionModel.addListener(mxEvent.CHANGE,ha);U.model.addListener(mxEvent.CHANGE,ha);U.addListener(mxEvent.REFRESH,ha);var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.style.boxSizing="border-box";ca.style.whiteSpace="nowrap";ca.style.position=-"absolute";ca.style.overflow="hidden";ca.style.bottom="6px";ca.style.height="42px";ca.style.right="10px";ca.style.left="10px";U.isEnabled()&&(ca.appendChild(Z),ca.appendChild(ba),X.appendChild(ca));null!=N&&ca.appendChild(N);return{div:X,refresh:ha}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var x in Graph.customFontElements){var G=Graph.customFontElements[x];l.push({name:G.name,url:G.url})}return l};Graph.prototype.setFont=function(l,x){Graph.addFont(l,-x);var G=Editor.guid();document.execCommand("fontname",!1,G);for(var N=this.cellEditor.textarea.getElementsByTagName("font"),P=!1,R=0;R<N.length;R++)N[R].getAttribute("face")==G&&(P=!0,N[R].setAttribute("face",l),null!=x?N[R].setAttribute("data-font-src",x):N[R].removeAttribute("data-font-src"));P||document.execCommand("fontname",!1,l)};var y=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return y.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=+"10px";X.appendChild(Y);var Z=mxUtils.button(mxResources.get("reset"),function(da){U.setHiddenTags([]);mxEvent.isShiftDown(da)||(W=U.hiddenTags.slice());O();U.refresh()});Z.setAttribute("title",mxResources.get("reset"));Z.className="geBtn";Z.style.margin="0 4px 0 0";var ba=mxUtils.button(mxResources.get("add"),function(){null!=G&&G(W,function(da){W=da;fa()})});ba.setAttribute("title",mxResources.get("add"));ba.className="geBtn";ba.style.margin="0";U.addListener(mxEvent.ROOT,function(){W=U.hiddenTags.slice()});+var fa=mxUtils.bind(this,function(da,ja){if(l()){da=U.getAllTags();for(ja=0;ja<da.length;ja++)0>mxUtils.indexOf(W,da[ja])&&W.push(da[ja]);W.sort();U.isSelectionEmpty()?T(W):T(W,U.getCommonTagsForCells(U.getSelectionCells()))}});U.selectionModel.addListener(mxEvent.CHANGE,fa);U.model.addListener(mxEvent.CHANGE,fa);U.addListener(mxEvent.REFRESH,fa);var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.style.boxSizing="border-box";ca.style.whiteSpace="nowrap";ca.style.position=+"absolute";ca.style.overflow="hidden";ca.style.bottom="6px";ca.style.height="42px";ca.style.right="10px";ca.style.left="10px";U.isEnabled()&&(ca.appendChild(Z),ca.appendChild(ba),X.appendChild(ca));null!=N&&ca.appendChild(N);return{div:X,refresh:fa}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var x in Graph.customFontElements){var G=Graph.customFontElements[x];l.push({name:G.name,url:G.url})}return l};Graph.prototype.setFont=function(l,x){Graph.addFont(l,+x);var G=Editor.guid();document.execCommand("fontname",!1,G);for(var N=this.cellEditor.textarea.getElementsByTagName("font"),O=!1,R=0;R<N.length;R++)N[R].getAttribute("face")==G&&(O=!0,N[R].setAttribute("face",l),null!=x?N[R].setAttribute("data-font-src",x):N[R].removeAttribute("data-font-src"));O||document.execCommand("fontname",!1,l)};var y=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return y.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var l=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=l)for(var x in l)this.globalVars[x]=l[x]}catch(G){null!=window.console&&console.log("Error in vars URL parameter: "+G)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var B=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=-function(l){var x=B.apply(this,arguments);null==x&&null!=this.globalVars&&(x=this.globalVars[l]);return x};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var I=Graph.prototype.getSvg;Graph.prototype.getSvg=function(l,x,G,N,P,R,T,U,W,X,Y,Z,ba,ha,ca,da){var ja=I.apply(this,arguments);-if(null!=Z){var aa=ja.getAttribute("style");null==aa&&(aa="");Z="auto"==Z?"none"==this.getAdaptiveColors()?"light":"light dark":Z;ja.setAttribute("style",aa+(" color-scheme: "+Z+";"))}var ia=this.getCustomFonts();if(Y&&0<ia.length){var ka=ja.ownerDocument;aa=null!=ka.createElementNS?ka.createElementNS(mxConstants.NS_SVG,"style"):ka.createElement("style");null!=ka.setAttributeNS?aa.setAttributeNS("type","text/css"):aa.setAttribute("type","text/css");for(var ua="",sa="",fa=0;fa<ia.length;fa++){var pa=-ia[fa].name,ra=ia[fa].url;Graph.isCssFontUrl(ra)?ua+="@import url("+Graph.rewriteGoogleFontUrl(ra)+");\n":sa+='@font-face {\nfont-family: "'+pa+'";\nsrc: url("'+ra+'");\n}\n'}aa.appendChild(ka.createTextNode(ua+sa));ja.getElementsByTagName("defs")[0].appendChild(aa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ja);this.mathEnabled&&(document.body.appendChild(ja),Editor.MathJaxRender(ja),ja.parentNode.removeChild(ja),aa=ja.ownerDocument.getElementById("MJX-SVG-styles"),-null!=aa&&ja.getElementsByTagName("defs")[0].appendChild(aa.cloneNode(!0)));return ja};var K=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(l){K.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var J=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){J.apply(this,arguments);this.enumerationState=+function(l){var x=B.apply(this,arguments);null==x&&null!=this.globalVars&&(x=this.globalVars[l]);return x};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var I=Graph.prototype.getSvg;Graph.prototype.getSvg=function(l,x,G,N,O,R,T,U,W,X,Y,Z,ba,fa,ca,da){var ja=I.apply(this,arguments);+if(null!=Z){var aa=ja.getAttribute("style");null==aa&&(aa="");Z="auto"==Z?"none"==this.getAdaptiveColors()?"light":"light dark":Z;ja.setAttribute("style",aa+(" color-scheme: "+Z+";"))}var ia=this.getCustomFonts();if(Y&&0<ia.length){var ka=ja.ownerDocument;aa=null!=ka.createElementNS?ka.createElementNS(mxConstants.NS_SVG,"style"):ka.createElement("style");null!=ka.setAttributeNS?aa.setAttributeNS("type","text/css"):aa.setAttribute("type","text/css");for(var ua="",sa="",ha=0;ha<ia.length;ha++){var pa=+ia[ha].name,ra=ia[ha].url;Graph.isCssFontUrl(ra)?ua+="@import url("+Graph.rewriteGoogleFontUrl(ra)+");\n":sa+='@font-face {\nfont-family: "'+pa+'";\nsrc: url("'+ra+'");\n}\n'}aa.appendChild(ka.createTextNode(ua+sa));ja.getElementsByTagName("defs")[0].appendChild(aa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ja);this.mathEnabled&&(document.body.appendChild(ja),Editor.MathJaxRender(ja),ja.parentNode.removeChild(ja),aa=ja.ownerDocument.getElementById("MJX-SVG-styles"),+null!=aa&&ja.getElementsByTagName("defs")[0].appendChild(aa.cloneNode(!0)));return ja};var J=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(l){J.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var K=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){K.apply(this,arguments);this.enumerationState=0};var V=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(l){null!=l.shape&&this.redrawEnumerationState(l);return V.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(l){l=decodeURIComponent(mxUtils.getValue(l.style,"enumerateValue",""));""==l&&(l=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(l)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(l){var x="1"==mxUtils.getValue(l.style,"enumerate",0);x&&null==l.secondLabel?(l.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),l.secondLabel.size=12,l.secondLabel.state=l,l.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(l,l.secondLabel)):x||null==l.secondLabel||(l.secondLabel.destroy(),l.secondLabel=null);x=l.secondLabel;if(null!=x){var G=l.view.scale,N=this.createEnumerationValue(l);l=this.graph.model.isVertex(l.cell)?-new mxRectangle(l.x+l.width-4*G,l.y+4*G,0,0):mxRectangle.fromPoint(l.view.getPoint(l));x.bounds.equals(l)&&x.value==N&&x.scale==G||(x.bounds=l,x.value=N,x.scale=G,x.redraw())}};var Q=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();Q.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var O=-Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){O.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(l,x){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(l.actions,null,x))};Graph.prototype.executeCustomActions=function(l,x,G){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),-null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var N=!1,P=0,R=0,T=mxUtils.bind(this,function(){N||(N=!0,this.model.beginUpdate())}),U=mxUtils.bind(this,function(){N&&(N=!1,this.model.endUpdate())}),W=mxUtils.bind(this,function(){0<P&&P--;0==P&&X()}),X=mxUtils.bind(this,function(){if(R<l.length){var Y=this.stoppingCustomActions,Z=l[R++],ba=[];if(null!=Z.open)if(U(),this.isCustomLink(Z.open)){if(!this.customLinkClicked(Z.open,-G))return}else this.openLink(Z.open);null==Z.wait||Y||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;W()}),P++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Z.wait?parseInt(Z.wait):1E3),U());null!=Z.opacity&&null!=Z.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Z.opacity,!0)),Z.opacity.value);null!=Z.fadeIn&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeIn,-!0)),0,1,W,Y?0:Z.fadeIn.delay));null!=Z.fadeOut&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeOut,!0)),1,0,W,Y?0:Z.fadeOut.delay));null!=Z.wipeIn&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeIn,!0),!0)));null!=Z.wipeOut&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeOut,!0),!1)));null!=Z.toggle&&(T(),this.toggleCells(this.getCellsForAction(Z.toggle,!0)));if(null!=Z.show){T();var ha=this.getCellsForAction(Z.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ha),-1);this.setCellsVisible(ha,!0)}null!=Z.hide&&(T(),ha=this.getCellsForAction(Z.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ha),0),this.setCellsVisible(ha,!1));null!=Z.toggleStyle&&null!=Z.toggleStyle.key&&(T(),this.toggleCellStyles(Z.toggleStyle.key,null!=Z.toggleStyle.defaultValue?Z.toggleStyle.defaultValue:"0",this.getCellsForAction(Z.toggleStyle,!0)));null!=Z.style&&null!=Z.style.key&&(T(),this.setCellStyles(Z.style.key,Z.style.value,this.getCellsForAction(Z.style,!0)));ha=[];null!=-Z.select&&this.isEnabled()&&(ha=this.getCellsForAction(Z.select),this.setSelectionCells(ha));null!=Z.highlight&&(ha=this.getCellsForAction(Z.highlight),this.highlightCells(ha,Z.highlight.color,Z.highlight.duration,Z.highlight.opacity));null!=Z.scroll&&(ha=this.getCellsForAction(Z.scroll));null!=Z.viewbox&&this.fitWindow(Z.viewbox,Z.viewbox.border);0<ha.length&&this.scrollCellToVisible(ha[0]);null!=G&&null!=Z.explore&&Graph.exploreFromCell(this,G,Z.explore);if(null!=Z.tags){if(null!=Z.tags.toggle){var ca=-Z.tags.toggle;0==ca.length&&(ca=this.getAllTags());for(ha=0;ha<ca.length;ha++)this.toggleHiddenTag(ca[ha])}ca=null;null!=Z.tags.hidden&&(null==ca&&(ca=[]),ca=ca.concat(Z.tags.hidden));if(null!=Z.tags.visible){null==ca&&(ca=[]);var da=this.getAllTags();for(ha=0;ha<da.length;ha++)0>mxUtils.indexOf(Z.tags.visible,da[ha])&&0>mxUtils.indexOf(ca,da[ha])&&ca.push(da[ha])}null!=ca&&this.setHiddenTags(ca);this.refresh()}0<ba.length&&(P++,this.executeAnimations(ba,W,Y?1:Z.steps,Y?0:Z.delay));0==P?X():U()}else this.stoppingCustomActions=-this.executingCustomActions=!1,U(),null!=x&&x()});X()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,x){var G=this.getLinkForCell(x);null!=G&&"data:action/json,"==G.substring(0,17)&&this.setLinkForCell(x,this.updateCustomLink(l,G));if(this.isHtmlLabel(x)){var N=document.createElement("div");N.innerHTML=Graph.sanitizeHtml(this.getLabel(x));for(var P=N.getElementsByTagName("a"),R=!1,T=0;T<P.length;T++)G=P[T].getAttribute("href"),null!=G&&"data:action/json,"==G.substring(0,17)&&(P[T].setAttribute("href",-this.updateCustomLink(l,G)),R=!0);R&&this.labelChanged(x,N.innerHTML)}};Graph.prototype.updateCustomLink=function(l,x){if("data:action/json,"==x.substring(0,17))try{var G=JSON.parse(x.substring(17));null!=G.actions&&(this.updateCustomLinkActions(l,G.actions),x="data:action/json,"+JSON.stringify(G))}catch(N){}return x};Graph.prototype.updateCustomLinkActions=function(l,x){for(var G=0;G<x.length;G++){var N=x[G],P;for(P in N)this.updateCustomLinkAction(l,N[P],"cells"),this.updateCustomLinkAction(l,N[P],-"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(l,x,G){if(null!=x&&null!=x[G]){for(var N=[],P=0;P<x[G].length;P++)if("*"==x[G][P])N.push(x[G][P]);else{var R=l[x[G][P]];null!=R?""!=R&&N.push(R):N.push(x[G][P])}x[G]=N}};Graph.prototype.getCellsForAction=function(l,x){x=this.getCellsById(l.cells).concat(this.getCellsForTags(l.tags,null,x));if(null!=l.excludeCells){for(var G=[],N=0;N<x.length;N++)0>l.excludeCells.indexOf(x[N].id)&&G.push(x[N]);x=G}return x};Graph.prototype.getCellsById=-function(l){var x=[];if(null!=l)for(var G=0;G<l.length;G++)if("*"==l[G]){var N=this.model.getRoot();x=x.concat(this.model.filterDescendants(function(R){return R!=N},N))}else{var P=this.model.getCell(l[G]);null!=P&&x.push(P)}return x};var p=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(l){return p.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(l))};Graph.prototype.setHiddenTags=function(l){this.hiddenTags=l;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};+new mxRectangle(l.x+l.width-4*G,l.y+4*G,0,0):mxRectangle.fromPoint(l.view.getPoint(l));x.bounds.equals(l)&&x.value==N&&x.scale==G||(x.bounds=l,x.value=N,x.scale=G,x.redraw())}};var Q=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();Q.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var P=+Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){P.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(l,x){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(l.actions,null,x))};Graph.prototype.executeCustomActions=function(l,x,G){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),+null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var N=!1,O=0,R=0,T=mxUtils.bind(this,function(){N||(N=!0,this.model.beginUpdate())}),U=mxUtils.bind(this,function(){N&&(N=!1,this.model.endUpdate())}),W=mxUtils.bind(this,function(){0<O&&O--;0==O&&X()}),X=mxUtils.bind(this,function(){if(R<l.length){var Y=this.stoppingCustomActions,Z=l[R++],ba=[];if(null!=Z.open)if(U(),this.isCustomLink(Z.open)){if(!this.customLinkClicked(Z.open,+G))return}else this.openLink(Z.open);null==Z.wait||Y||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;W()}),O++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Z.wait?parseInt(Z.wait):1E3),U());null!=Z.opacity&&null!=Z.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Z.opacity,!0)),Z.opacity.value);null!=Z.fadeIn&&(O++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeIn,+!0)),0,1,W,Y?0:Z.fadeIn.delay));null!=Z.fadeOut&&(O++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeOut,!0)),1,0,W,Y?0:Z.fadeOut.delay));null!=Z.wipeIn&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeIn,!0),!0)));null!=Z.wipeOut&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeOut,!0),!1)));null!=Z.toggle&&(T(),this.toggleCells(this.getCellsForAction(Z.toggle,!0)));if(null!=Z.show){T();var fa=this.getCellsForAction(Z.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(fa),+1);this.setCellsVisible(fa,!0)}null!=Z.hide&&(T(),fa=this.getCellsForAction(Z.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(fa),0),this.setCellsVisible(fa,!1));null!=Z.toggleStyle&&null!=Z.toggleStyle.key&&(T(),this.toggleCellStyles(Z.toggleStyle.key,null!=Z.toggleStyle.defaultValue?Z.toggleStyle.defaultValue:"0",this.getCellsForAction(Z.toggleStyle,!0)));null!=Z.style&&null!=Z.style.key&&(T(),this.setCellStyles(Z.style.key,Z.style.value,this.getCellsForAction(Z.style,!0)));fa=[];null!=+Z.select&&this.isEnabled()&&(fa=this.getCellsForAction(Z.select),this.setSelectionCells(fa));null!=Z.highlight&&(fa=this.getCellsForAction(Z.highlight),this.highlightCells(fa,Z.highlight.color,Z.highlight.duration,Z.highlight.opacity));null!=Z.scroll&&(fa=this.getCellsForAction(Z.scroll));null!=Z.viewbox&&this.fitWindow(Z.viewbox,Z.viewbox.border);0<fa.length&&this.scrollCellToVisible(fa[0]);null!=G&&null!=Z.explore&&Graph.exploreFromCell(this,G,Z.explore);if(null!=Z.tags){if(null!=Z.tags.toggle){var ca=+Z.tags.toggle;0==ca.length&&(ca=this.getAllTags());for(fa=0;fa<ca.length;fa++)this.toggleHiddenTag(ca[fa])}ca=null;null!=Z.tags.hidden&&(null==ca&&(ca=[]),ca=ca.concat(Z.tags.hidden));if(null!=Z.tags.visible){null==ca&&(ca=[]);var da=this.getAllTags();for(fa=0;fa<da.length;fa++)0>mxUtils.indexOf(Z.tags.visible,da[fa])&&0>mxUtils.indexOf(ca,da[fa])&&ca.push(da[fa])}null!=ca&&this.setHiddenTags(ca);this.refresh()}0<ba.length&&(O++,this.executeAnimations(ba,W,Y?1:Z.steps,Y?0:Z.delay));0==O?X():U()}else this.stoppingCustomActions=+this.executingCustomActions=!1,U(),null!=x&&x()});X()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,x){var G=this.getLinkForCell(x);null!=G&&"data:action/json,"==G.substring(0,17)&&this.setLinkForCell(x,this.updateCustomLink(l,G));if(this.isHtmlLabel(x)){var N=document.createElement("div");N.innerHTML=Graph.sanitizeHtml(this.getLabel(x));for(var O=N.getElementsByTagName("a"),R=!1,T=0;T<O.length;T++)G=O[T].getAttribute("href"),null!=G&&"data:action/json,"==G.substring(0,17)&&(O[T].setAttribute("href",+this.updateCustomLink(l,G)),R=!0);R&&this.labelChanged(x,N.innerHTML)}};Graph.prototype.updateCustomLink=function(l,x){if("data:action/json,"==x.substring(0,17))try{var G=JSON.parse(x.substring(17));null!=G.actions&&(this.updateCustomLinkActions(l,G.actions),x="data:action/json,"+JSON.stringify(G))}catch(N){}return x};Graph.prototype.updateCustomLinkActions=function(l,x){for(var G=0;G<x.length;G++){var N=x[G],O;for(O in N)this.updateCustomLinkAction(l,N[O],"cells"),this.updateCustomLinkAction(l,N[O],+"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(l,x,G){if(null!=x&&null!=x[G]){for(var N=[],O=0;O<x[G].length;O++)if("*"==x[G][O])N.push(x[G][O]);else{var R=l[x[G][O]];null!=R?""!=R&&N.push(R):N.push(x[G][O])}x[G]=N}};Graph.prototype.getCellsForAction=function(l,x){x=this.getCellsById(l.cells).concat(this.getCellsForTags(l.tags,null,x));if(null!=l.excludeCells){for(var G=[],N=0;N<x.length;N++)0>l.excludeCells.indexOf(x[N].id)&&G.push(x[N]);x=G}return x};Graph.prototype.getCellsById=+function(l){var x=[];if(null!=l)for(var G=0;G<l.length;G++)if("*"==l[G]){var N=this.model.getRoot();x=x.concat(this.model.filterDescendants(function(R){return R!=N},N))}else{var O=this.model.getCell(l[G]);null!=O&&x.push(O)}return x};var p=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(l){return p.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(l))};Graph.prototype.setHiddenTags=function(l){this.hiddenTags=l;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(l){var x=mxUtils.indexOf(this.hiddenTags,l);0>x?this.hiddenTags.push(l):0<=x&&this.hiddenTags.splice(x,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(l){if(null==l||0==l.length||0==this.hiddenTags.length)return!1;l=l.split(" ");if(l.length>this.hiddenTags.length)return!1;for(var x=0;x<l.length;x++)if(0>mxUtils.indexOf(this.hiddenTags,l[x]))return!1;return!0};Graph.prototype.getCellsForTags=function(l,x,G,-N){var P=[];if(null!=l){x=null!=x?x:this.model.getDescendants(this.model.getRoot());for(var R=0,T={},U=0;U<l.length;U++)0<l[U].length&&(T[l[U]]=!0,R++);for(U=0;U<x.length;U++)if(G&&this.model.getParent(x[U])==this.model.root||this.model.isVertex(x[U])||this.model.isEdge(x[U])){var W=this.getTagsForCell(x[U]),X=!1;if(0<W.length&&(W=W.split(" "),W.length>=l.length)){for(var Y=X=0;Y<W.length&&X<R;Y++)null!=T[W[Y]]&&X++;X=X==R}X&&(1!=N||this.isCellVisible(x[U]))&&P.push(x[U])}}return P};Graph.prototype.getAllTags=-function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var x=null,G=[],N=0;N<l.length;N++){var P=this.getTagsForCell(l[N]);G=[];if(0<P.length){P=P.split(" ");for(var R={},T=0;T<P.length;T++)if(null==x||null!=x[P[T]])R[P[T]]=!0,G.push(P[T]);x=R}else return[]}return G};Graph.prototype.getTagsForCells=function(l){for(var x=[],G={},N=0;N<l.length;N++){var P=this.getTagsForCell(l[N]);if(0<P.length){P=P.split(" ");for(var R=-0;R<P.length;R++)null==G[P[R]]&&(G[P[R]]=!0,x.push(P[R]))}}return x};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,x){if(0<l.length&&0<x.length){this.model.beginUpdate();try{for(var G=0;G<l.length;G++){for(var N=this.getTagsForCell(l[G]),P=N.split(" "),R=!1,T=0;T<x.length;T++){var U=mxUtils.trim(x[T]);""!=U&&0>mxUtils.indexOf(P,U)&&(N=0<N.length?N+" "+U:U,R=!0)}R&&this.setAttributeForCell(l[G],"tags",N)}}finally{this.model.endUpdate()}}};-Graph.prototype.removeTagsForCells=function(l,x){if(0<l.length&&0<x.length){this.model.beginUpdate();try{for(var G=0;G<l.length;G++){var N=this.getTagsForCell(l[G]);if(0<N.length){for(var P=N.split(" "),R=!1,T=0;T<x.length;T++){var U=mxUtils.indexOf(P,x[T]);0<=U&&(P.splice(U,1),R=!0)}R&&this.setAttributeForCell(l[G],"tags",P.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var x=0;x<l.length;x++)this.model.setVisible(l[x],!this.model.isVisible(l[x]))}finally{this.model.endUpdate()}};-Graph.prototype.setCellsVisible=function(l,x){this.model.beginUpdate();try{for(var G=0;G<l.length;G++)this.model.setVisible(l[G],x)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(l,x,G,N){for(var P=0;P<l.length;P++)this.highlightCell(l[P],x,G,N)};Graph.prototype.highlightCell=function(l,x,G,N,P){x=null!=x?x:mxConstants.DEFAULT_VALID_COLOR;G=null!=G?G:1E3;l=this.view.getState(l);var R=null;null!=l&&(P=null!=P?P:4,P=Math.max(P+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,-1)+P),R=new mxCellHighlight(this,x,P,!1),null!=N&&(R.opacity=N),R.highlight(l),window.setTimeout(function(){null!=R.shape&&(mxUtils.setPrefixedStyle(R.shape.node.style,"transition","all 1200ms ease-in-out"),R.shape.node.style.opacity=0);window.setTimeout(function(){R.destroy()},1200)},G));return R};Graph.prototype.addSvgShadow=function(l,x,G,N){G=null!=G?G:!1;N=null!=N?N:!0;var P=l.ownerDocument,R=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"filter"):P.createElement("filter");R.setAttribute("id",-this.shadowId);var T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):P.createElement("feGaussianBlur");T.setAttribute("in","SourceAlpha");T.setAttribute("stdDeviation",this.svgShadowBlur);T.setAttribute("result","blur");R.appendChild(T);T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feOffset"):P.createElement("feOffset");T.setAttribute("in","blur");T.setAttribute("dx",this.svgShadowSize);T.setAttribute("dy",this.svgShadowSize);T.setAttribute("result",-"offsetBlur");R.appendChild(T);T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feFlood"):P.createElement("feFlood");T.setAttribute("flood-color",this.svgShadowColor);T.setAttribute("flood-opacity",this.svgShadowOpacity);T.setAttribute("result","offsetColor");R.appendChild(T);T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feComposite"):P.createElement("feComposite");T.setAttribute("in","offsetColor");T.setAttribute("in2","offsetBlur");T.setAttribute("operator","in");-T.setAttribute("result","offsetBlur");R.appendChild(T);T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feBlend"):P.createElement("feBlend");T.setAttribute("in","SourceGraphic");T.setAttribute("in2","offsetBlur");R.appendChild(T);T=l.getElementsByTagName("defs");0==T.length?(P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"defs"):P.createElement("defs"),null!=l.firstChild?l.insertBefore(P,l.firstChild):l.appendChild(P)):P=T[0];P.appendChild(R);G||(x=null!=x?x:l.getElementsByTagName("g")[0],+N){var O=[];if(null!=l){x=null!=x?x:this.model.getDescendants(this.model.getRoot());for(var R=0,T={},U=0;U<l.length;U++)0<l[U].length&&(T[l[U]]=!0,R++);for(U=0;U<x.length;U++)if(G&&this.model.getParent(x[U])==this.model.root||this.model.isVertex(x[U])||this.model.isEdge(x[U])){var W=this.getTagsForCell(x[U]),X=!1;if(0<W.length&&(W=W.split(" "),W.length>=l.length)){for(var Y=X=0;Y<W.length&&X<R;Y++)null!=T[W[Y]]&&X++;X=X==R}X&&(1!=N||this.isCellVisible(x[U]))&&O.push(x[U])}}return O};Graph.prototype.getAllTags=+function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var x=null,G=[],N=0;N<l.length;N++){var O=this.getTagsForCell(l[N]);G=[];if(0<O.length){O=O.split(" ");for(var R={},T=0;T<O.length;T++)if(null==x||null!=x[O[T]])R[O[T]]=!0,G.push(O[T]);x=R}else return[]}return G};Graph.prototype.getTagsForCells=function(l){for(var x=[],G={},N=0;N<l.length;N++){var O=this.getTagsForCell(l[N]);if(0<O.length){O=O.split(" ");for(var R=+0;R<O.length;R++)null==G[O[R]]&&(G[O[R]]=!0,x.push(O[R]))}}return x};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,x){if(0<l.length&&0<x.length){this.model.beginUpdate();try{for(var G=0;G<l.length;G++){for(var N=this.getTagsForCell(l[G]),O=N.split(" "),R=!1,T=0;T<x.length;T++){var U=mxUtils.trim(x[T]);""!=U&&0>mxUtils.indexOf(O,U)&&(N=0<N.length?N+" "+U:U,R=!0)}R&&this.setAttributeForCell(l[G],"tags",N)}}finally{this.model.endUpdate()}}};+Graph.prototype.removeTagsForCells=function(l,x){if(0<l.length&&0<x.length){this.model.beginUpdate();try{for(var G=0;G<l.length;G++){var N=this.getTagsForCell(l[G]);if(0<N.length){for(var O=N.split(" "),R=!1,T=0;T<x.length;T++){var U=mxUtils.indexOf(O,x[T]);0<=U&&(O.splice(U,1),R=!0)}R&&this.setAttributeForCell(l[G],"tags",O.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var x=0;x<l.length;x++)this.model.setVisible(l[x],!this.model.isVisible(l[x]))}finally{this.model.endUpdate()}};+Graph.prototype.setCellsVisible=function(l,x){this.model.beginUpdate();try{for(var G=0;G<l.length;G++)this.model.setVisible(l[G],x)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(l,x,G,N){for(var O=0;O<l.length;O++)this.highlightCell(l[O],x,G,N)};Graph.prototype.highlightCell=function(l,x,G,N,O){x=null!=x?x:mxConstants.DEFAULT_VALID_COLOR;G=null!=G?G:1E3;l=this.view.getState(l);var R=null;null!=l&&(O=null!=O?O:4,O=Math.max(O+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,+1)+O),R=new mxCellHighlight(this,x,O,!1),null!=N&&(R.opacity=N),R.highlight(l),window.setTimeout(function(){null!=R.shape&&(mxUtils.setPrefixedStyle(R.shape.node.style,"transition","all 1200ms ease-in-out"),R.shape.node.style.opacity=0);window.setTimeout(function(){R.destroy()},1200)},G));return R};Graph.prototype.addSvgShadow=function(l,x,G,N){G=null!=G?G:!1;N=null!=N?N:!0;var O=l.ownerDocument,R=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"filter"):O.createElement("filter");R.setAttribute("id",+this.shadowId);var T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):O.createElement("feGaussianBlur");T.setAttribute("in","SourceAlpha");T.setAttribute("stdDeviation",this.svgShadowBlur);T.setAttribute("result","blur");R.appendChild(T);T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feOffset"):O.createElement("feOffset");T.setAttribute("in","blur");T.setAttribute("dx",this.svgShadowSize);T.setAttribute("dy",this.svgShadowSize);T.setAttribute("result",+"offsetBlur");R.appendChild(T);T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feFlood"):O.createElement("feFlood");T.setAttribute("flood-color",this.svgShadowColor);T.setAttribute("flood-opacity",this.svgShadowOpacity);T.setAttribute("result","offsetColor");R.appendChild(T);T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feComposite"):O.createElement("feComposite");T.setAttribute("in","offsetColor");T.setAttribute("in2","offsetBlur");T.setAttribute("operator","in");+T.setAttribute("result","offsetBlur");R.appendChild(T);T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feBlend"):O.createElement("feBlend");T.setAttribute("in","SourceGraphic");T.setAttribute("in2","offsetBlur");R.appendChild(T);T=l.getElementsByTagName("defs");0==T.length?(O=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"defs"):O.createElement("defs"),null!=l.firstChild?l.insertBefore(O,l.firstChild):l.appendChild(O)):O=T[0];O.appendChild(R);G||(x=null!=x?x:l.getElementsByTagName("g")[0],null!=x&&(x.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(l.getAttribute("width")))&&N&&(l.setAttribute("width",parseInt(l.getAttribute("width"))+6),l.setAttribute("height",parseInt(l.getAttribute("height"))+6),x=l.getAttribute("viewBox"),null!=x&&0<x.length&&(x=x.split(" "),3<x.length&&(w=parseFloat(x[2])+6,h=parseFloat(x[3])+6,l.setAttribute("viewBox",x[0]+" "+x[1]+" "+w+" "+h))))));return R};Graph.prototype.setShadowVisible=function(l,x){mxClient.IS_SVG&&!mxClient.IS_SF&&(x=null!=x?x:!0,(this.shadowVisible=l)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),x&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var l=this.model.getChildCount(this.model.root),x=0;do var G=this.model.getChildAt(this.model.root,x);while(x++<l&&"1"==mxUtils.getValue(this.getCellStyle(G),"locked","0"));null!=G&&this.setDefaultParent(G)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+@@ -12943,33 +12943,33 @@ STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PAT[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=-[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(l){var x=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?x="mxgraph.er":"sysML"==l.substring(0,5)&&(x="mxgraph.sysml"));return x};var z=mxMarker.createMarker;mxMarker.createMarker=function(l,x,G,N,P,R,T,U,W,X){if(null!=G&&null==mxMarker.markers[G]){var Y=this.getPackageForType(G);null!=Y&&mxStencilRegistry.getStencil(Y)}return z.apply(this,arguments)};var A=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,-x,G,N,P,R){"1"==mxUtils.getValue(x.style,"lineShape",null)&&l.setFillColor(mxUtils.getValue(x.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return A.apply(this,arguments)};PrintDialog.prototype.create=function(l,x,G){function N(){ha.value=Math.max(1,Math.min(X,Math.max(parseInt(ha.value),parseInt(ba.value))));ba.value=Math.max(1,Math.min(X,Math.min(parseInt(ha.value),parseInt(ba.value))))}function P(Ba){l.lastPrintPagesRadioChecked=Z.checked;l.lastPrintSelectionOnlyChecked=da.checked;l.lastPrintCropRadioChecked=-aa.checked;l.lastPrintFitRadioChecked=ia.checked;Z.checked&&ba.value<ha.value?(l.lastPrintPagesFromInput=ba.value,l.lastPrintPagesToInput=ha.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);oa.value=Math.max(1,Math.min(1600,parseInt(oa.value)))+"%";l.lastPrintZoom=oa.value;l.lastPrintBorder=Aa.value;l.lastPrintGrid=Ea.checked;l.lastPrintTransparent=va.checked;l.lastPrintInclude=Ca.checked;l.lastPrintSheetsAcross=ea.value;l.lastPrintSheetsDown=na.value;var Da={};Da.border=parseInt(Aa.value);-Da.scale=parseInt(oa.value)/100;Da.grid=Ea.checked;Da.transparent=va.checked;Da.includeCopy=Ca.checked;Da.sheetsAcross=parseInt(ea.value);Da.sheetsDown=parseInt(na.value);Da.pagesFrom=parseInt(ba.value);Da.pagesTo=parseInt(ha.value);Da.allPages=Y.checked;Da.selection=da.checked;Da.pageView=ja.checked;Da.crop=aa.checked;Da.fit=ia.checked;return null!=G?G(!Ba,Da):l.print(!Ba,Da)}var R=l.editor.graph,T=document.createElement("div"),U=document.createElement("h3");U.style.width="100%";U.style.textAlign=+[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(l){var x=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?x="mxgraph.er":"sysML"==l.substring(0,5)&&(x="mxgraph.sysml"));return x};var z=mxMarker.createMarker;mxMarker.createMarker=function(l,x,G,N,O,R,T,U,W,X){if(null!=G&&null==mxMarker.markers[G]){var Y=this.getPackageForType(G);null!=Y&&mxStencilRegistry.getStencil(Y)}return z.apply(this,arguments)};var A=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,+x,G,N,O,R){"1"==mxUtils.getValue(x.style,"lineShape",null)&&l.setFillColor(mxUtils.getValue(x.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return A.apply(this,arguments)};PrintDialog.prototype.create=function(l,x,G){function N(){fa.value=Math.max(1,Math.min(X,Math.max(parseInt(fa.value),parseInt(ba.value))));ba.value=Math.max(1,Math.min(X,Math.min(parseInt(fa.value),parseInt(ba.value))))}function O(Ba){l.lastPrintPagesRadioChecked=Z.checked;l.lastPrintSelectionOnlyChecked=da.checked;l.lastPrintCropRadioChecked=+aa.checked;l.lastPrintFitRadioChecked=ia.checked;Z.checked&&ba.value<fa.value?(l.lastPrintPagesFromInput=ba.value,l.lastPrintPagesToInput=fa.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);oa.value=Math.max(1,Math.min(1600,parseInt(oa.value)))+"%";l.lastPrintZoom=oa.value;l.lastPrintBorder=Aa.value;l.lastPrintGrid=Ea.checked;l.lastPrintTransparent=va.checked;l.lastPrintInclude=Ca.checked;l.lastPrintSheetsAcross=ea.value;l.lastPrintSheetsDown=na.value;var Da={};Da.border=parseInt(Aa.value);+Da.scale=parseInt(oa.value)/100;Da.grid=Ea.checked;Da.transparent=va.checked;Da.includeCopy=Ca.checked;Da.sheetsAcross=parseInt(ea.value);Da.sheetsDown=parseInt(na.value);Da.pagesFrom=parseInt(ba.value);Da.pagesTo=parseInt(fa.value);Da.allPages=Y.checked;Da.selection=da.checked;Da.pageView=ja.checked;Da.crop=aa.checked;Da.fit=ia.checked;return null!=G?G(!Ba,Da):l.print(!Ba,Da)}var R=l.editor.graph,T=document.createElement("div"),U=document.createElement("h3");U.style.width="100%";U.style.textAlign="center";U.style.marginTop="0px";mxUtils.write(U,x||mxResources.get("print"));T.appendChild(U);var W=1,X=1;U=document.createElement("div");U.style.whiteSpace="nowrap";var Y=document.createElement("input");Y.style.marginRight="8px";Y.style.marginBottom="8px";Y.setAttribute("type","radio");Y.setAttribute("name","pages-printdialog");U.appendChild(Y);x=document.createElement("span");mxUtils.write(x,mxResources.get("allPages"));mxEvent.addListener(x,"click",function(){Y.checked=!0});U.appendChild(x);mxUtils.br(U);-var Z=Y.cloneNode(!0);U.appendChild(Z);x=document.createElement("span");mxUtils.write(x,mxResources.get("pages")+":");U.appendChild(x);mxEvent.addListener(x,"click",function(){Z.checked=!0});var ba=document.createElement("input");ba.style.margin="0 4px";ba.setAttribute("value","1");ba.setAttribute("type","number");ba.setAttribute("min","1");ba.style.width="40px";U.appendChild(ba);x=document.createElement("span");mxUtils.write(x,mxResources.get("to"));U.appendChild(x);var ha=ba.cloneNode(!0);U.appendChild(ha);-mxEvent.addListener(ba,"focus",function(){Z.checked=!0});mxEvent.addListener(ha,"focus",function(){Z.checked=!0});mxEvent.addListener(ba,"change",N);mxEvent.addListener(ha,"change",N);if(null!=l.pages&&(X=l.pages.length,null!=l.currentPage))for(var ca=0;ca<X;ca++)if(l.currentPage==l.pages[ca]){W=ca+1;break}null!=l.lastPrintPagesFromInput&&null!=l.lastPrintPagesToInput?(ba.value=Math.min(X,Math.max(1,l.lastPrintPagesFromInput)),ha.value=Math.min(X,Math.max(1,l.lastPrintPagesToInput))):(ba.value=W,-ha.value=W);ba.setAttribute("max",X);ha.setAttribute("max",X);ca=mxUtils.button(mxResources.get("currentPage"),function(Ba){ba.value=W;ha.value=W;Z.checked=!0});ca.setAttribute("title",mxResources.get("currentPage"));ca.style.marginLeft="4px";ca.style.maxWidth="100px";ca.style.overflow="hidden";ca.style.textOverflow="ellipsis";ca.style.whiteSpace="nowrap";U.appendChild(ca);1<X&&T.appendChild(U);U=document.createElement("div");U.style.borderBottom="1px solid lightGray";U.style.paddingBottom="12px";+var Z=Y.cloneNode(!0);U.appendChild(Z);x=document.createElement("span");mxUtils.write(x,mxResources.get("pages")+":");U.appendChild(x);mxEvent.addListener(x,"click",function(){Z.checked=!0});var ba=document.createElement("input");ba.style.margin="0 4px";ba.setAttribute("value","1");ba.setAttribute("type","number");ba.setAttribute("min","1");ba.style.width="40px";U.appendChild(ba);x=document.createElement("span");mxUtils.write(x,mxResources.get("to"));U.appendChild(x);var fa=ba.cloneNode(!0);U.appendChild(fa);+mxEvent.addListener(ba,"focus",function(){Z.checked=!0});mxEvent.addListener(fa,"focus",function(){Z.checked=!0});mxEvent.addListener(ba,"change",N);mxEvent.addListener(fa,"change",N);if(null!=l.pages&&(X=l.pages.length,null!=l.currentPage))for(var ca=0;ca<X;ca++)if(l.currentPage==l.pages[ca]){W=ca+1;break}null!=l.lastPrintPagesFromInput&&null!=l.lastPrintPagesToInput?(ba.value=Math.min(X,Math.max(1,l.lastPrintPagesFromInput)),fa.value=Math.min(X,Math.max(1,l.lastPrintPagesToInput))):(ba.value=W,+fa.value=W);ba.setAttribute("max",X);fa.setAttribute("max",X);ca=mxUtils.button(mxResources.get("currentPage"),function(Ba){ba.value=W;fa.value=W;Z.checked=!0});ca.setAttribute("title",mxResources.get("currentPage"));ca.style.marginLeft="4px";ca.style.maxWidth="100px";ca.style.overflow="hidden";ca.style.textOverflow="ellipsis";ca.style.whiteSpace="nowrap";U.appendChild(ca);1<X&&T.appendChild(U);U=document.createElement("div");U.style.borderBottom="1px solid lightGray";U.style.paddingBottom="12px";U.style.marginBottom="12px";U.style.whiteSpace="nowrap";var da=document.createElement("input");da.setAttribute("name","pages-printdialog");da.setAttribute("type",1==X?"checkbox":"radio");da.style.marginRight="8px";R.isSelectionEmpty()&&da.setAttribute("disabled","disabled");R.isEnabled()&&(U.appendChild(da),x=document.createElement("span"),mxUtils.write(x,mxResources.get("selectionOnly")),U.appendChild(x));(R.isEnabled()||1<X)&&T.appendChild(U);!l.isPagesEnabled()||l.lastPrintPagesRadioChecked?Z.checked=!0:!R.isSelectionEmpty()&&l.lastPrintSelectionOnlyChecked?da.checked=!0:Y.checked=!0;R.isSelectionEmpty()||mxEvent.addListener(x,"click",function(){da.checked=!da.checked});R=document.createElement("div");R.style.whiteSpace="nowrap";var ja=document.createElement("input");ja.style.marginBottom="8px";ja.style.marginRight="8px";ja.setAttribute("type","radio");ja.setAttribute("name","printSize");R.appendChild(ja);x=document.createElement("span");mxUtils.write(x,mxResources.get("pageView"));R.appendChild(x);mxEvent.addListener(R,"click",function(){ja.checked=!0});T.appendChild(R);R=document.createElement("div");R.style.whiteSpace="nowrap";var aa=document.createElement("input");aa.style.marginBottom="8px";aa.style.marginRight="8px";aa.setAttribute("type","radio");aa.setAttribute("name","printSize");R.appendChild(aa);x=document.createElement("span");mxUtils.write(x,mxResources.get("crop"));R.appendChild(x);mxEvent.addListener(R,"click",function(){aa.checked=!0});T.appendChild(R);R=document.createElement("div");R.style.whiteSpace="nowrap";var ia=document.createElement("input");ia.style.marginBottom="8px";ia.style.marginRight="8px";ia.setAttribute("type","radio");ia.setAttribute("name","printSize");x=document.createElement("div");x.style.display="inline-block";x.style.verticalAlign="top";x.style.paddingTop="2px";x.appendChild(ia);R.appendChild(x);U=document.createElement("table");U.style.display="inline-block";U.style.borderSpacing="0";ca=document.createElement("tbody");var ka=document.createElement("tr"),-ua=ka.cloneNode(!0),sa=document.createElement("td"),fa=sa.cloneNode(!0),pa=sa.cloneNode(!0),ra=sa.cloneNode(!0),xa=sa.cloneNode(!0),wa=sa.cloneNode(!0);sa.style.textAlign="right";ra.style.textAlign="right";mxUtils.write(sa,mxResources.get("fitTo"));mxEvent.addListener(R,"click",function(Ba){mxEvent.getSource(Ba)!=ia&&(ia.checked=!ia.checked)});var ea=document.createElement("input");ea.style.margin="0 2px";ea.style.boxSizing="border-box";ea.setAttribute("value",l.lastPrintSheetsAcross||"1");ea.setAttribute("min",-"1");ea.setAttribute("type","number");ea.style.width="40px";fa.appendChild(ea);x=document.createElement("span");mxUtils.write(x,mxResources.get("fitToSheetsAcross"));pa.appendChild(x);mxUtils.write(ra,mxResources.get("fitToBy"));var na=ea.cloneNode(!0);na.setAttribute("value",l.lastPrintSheetsDown||"1");xa.appendChild(na);mxEvent.addListener(ea,"click",function(Ba){ia.checked=!0;mxEvent.consume(Ba)});mxEvent.addListener(na,"click",function(Ba){ia.checked=!0;mxEvent.consume(Ba)});l.lastPrintCropRadioChecked?-aa.checked=!0:l.lastPrintFitRadioChecked?ia.checked=!0:ja.checked=!0;x=document.createElement("span");mxUtils.write(x,mxResources.get("fitToSheetsDown"));wa.appendChild(x);ka.appendChild(sa);ka.appendChild(fa);ka.appendChild(pa);ua.appendChild(ra);ua.appendChild(xa);ua.appendChild(wa);ca.appendChild(ka);ca.appendChild(ua);U.appendChild(ca);R.appendChild(U);T.appendChild(R);R=document.createElement("div");R.style.borderTop="1px solid lightGray";R.style.whiteSpace="nowrap";R.style.paddingTop="12px";+ua=ka.cloneNode(!0),sa=document.createElement("td"),ha=sa.cloneNode(!0),pa=sa.cloneNode(!0),ra=sa.cloneNode(!0),xa=sa.cloneNode(!0),wa=sa.cloneNode(!0);sa.style.textAlign="right";ra.style.textAlign="right";mxUtils.write(sa,mxResources.get("fitTo"));mxEvent.addListener(R,"click",function(Ba){mxEvent.getSource(Ba)!=ia&&(ia.checked=!ia.checked)});var ea=document.createElement("input");ea.style.margin="0 2px";ea.style.boxSizing="border-box";ea.setAttribute("value",l.lastPrintSheetsAcross||"1");ea.setAttribute("min",+"1");ea.setAttribute("type","number");ea.style.width="40px";ha.appendChild(ea);x=document.createElement("span");mxUtils.write(x,mxResources.get("fitToSheetsAcross"));pa.appendChild(x);mxUtils.write(ra,mxResources.get("fitToBy"));var na=ea.cloneNode(!0);na.setAttribute("value",l.lastPrintSheetsDown||"1");xa.appendChild(na);mxEvent.addListener(ea,"click",function(Ba){ia.checked=!0;mxEvent.consume(Ba)});mxEvent.addListener(na,"click",function(Ba){ia.checked=!0;mxEvent.consume(Ba)});l.lastPrintCropRadioChecked?+aa.checked=!0:l.lastPrintFitRadioChecked?ia.checked=!0:ja.checked=!0;x=document.createElement("span");mxUtils.write(x,mxResources.get("fitToSheetsDown"));wa.appendChild(x);ka.appendChild(sa);ka.appendChild(ha);ka.appendChild(pa);ua.appendChild(ra);ua.appendChild(xa);ua.appendChild(wa);ca.appendChild(ka);ca.appendChild(ua);U.appendChild(ca);R.appendChild(U);T.appendChild(R);R=document.createElement("div");R.style.borderTop="1px solid lightGray";R.style.whiteSpace="nowrap";R.style.paddingTop="12px";R.style.marginTop="12px";R.style.paddingLeft="8px";mxUtils.write(R,mxResources.get("borderWidth")+":");var Aa=document.createElement("input");Aa.setAttribute("type","number");Aa.setAttribute("min","0");Aa.style.width="40px";Aa.style.marginLeft="4px";Aa.value=null!=l.lastPrintBorder?l.lastPrintBorder:mxPrintPreview.prototype.pageMargin;R.appendChild(Aa);x=document.createElement("span");x.style.marginLeft="8px";mxUtils.write(x,mxResources.get("zoom")+":");R.appendChild(x);var oa=document.createElement("input");oa.style.width="60px";oa.style.marginLeft="4px";oa.value=null!=l.lastPrintZoom?l.lastPrintZoom:"100%";R.appendChild(oa);mxUtils.br(R);var Ea=document.createElement("input");Ea.setAttribute("type","checkbox");Ea.style.marginTop="12px";Ea.checked=null!=l.lastPrintGrid?l.lastPrintGrid:!1;R.appendChild(Ea);x=document.createElement("span");x.style.marginLeft="4px";x.style.marginRight="8px";mxUtils.write(x,mxResources.get("grid"));R.appendChild(x);mxEvent.addListener(x,"click",function(Ba){Ea.checked=!0;mxEvent.consume(Ba)});var va=document.createElement("input");va.setAttribute("type","checkbox");va.style.marginTop="10px";va.checked=null!=l.lastPrintTransparent?l.lastPrintTransparent:!1;null!=G&&(R.appendChild(va),x=document.createElement("span"),x.style.marginLeft="4px",mxUtils.write(x,mxResources.get("transparentBackground")),R.appendChild(x),mxEvent.addListener(x,"click",function(Ba){va.checked=!0;mxEvent.consume(Ba)}));var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.style.marginTop="10px";Ca.checked=null!=l.lastPrintInclude?l.lastPrintInclude:Editor.defaultIncludeDiagram;null==G||mxClient.IS_CHROMEAPP||"draw.io"!=l.getServiceName()||(mxUtils.br(R),R.appendChild(Ca),x=document.createElement("span"),x.style.marginLeft="4px",mxUtils.write(x,mxResources.get("includeCopyOfMyDiagram")),R.appendChild(x),mxEvent.addListener(x,"click",function(Ba){Ca.checked=!0;mxEvent.consume(Ba)}));T.appendChild(R);x=document.createElement("div");x.style.marginTop="40px";x.style.textAlign=-"right";x.style.whiteSpace="nowrap";l.isOffline()||null!=G||x.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));R=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});R.className="geBtn";l.editor.cancelFirst&&x.appendChild(R);PrintDialog.previewEnabled&&null==G&&(U=mxUtils.button(mxResources.get("preview"),function(){try{l.hideDialog(),P(!1)}catch(Ba){l.handleError(Ba)}}),U.className="geBtn",x.appendChild(U));U=mxUtils.button(mxResources.get(null!=G?"export":-PrintDialog.previewEnabled?"print":"ok"),function(){try{l.hideDialog(),P(!0)}catch(Ba){l.handleError(Ba)}});U.className="geBtn gePrimaryBtn";x.appendChild(U);l.editor.cancelFirst||x.appendChild(R);T.appendChild(x);if(l.editor.isChromelessView()){var Fa=function(){Editor.isDarkMode()?(T.classList.add("geDarkMode"),T.style.colorScheme="dark"):(T.classList.remove("geDarkMode"),T.style.colorScheme="light")};l.addListener("darkModeChanged",Fa);Fa();var Ma=function(Ba,Da){Ba=Da.getProperty("dialog");T.parentNode==+"right";x.style.whiteSpace="nowrap";l.isOffline()||null!=G||x.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));R=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});R.className="geBtn";l.editor.cancelFirst&&x.appendChild(R);PrintDialog.previewEnabled&&null==G&&(U=mxUtils.button(mxResources.get("preview"),function(){try{l.hideDialog(),O(!1)}catch(Ba){l.handleError(Ba)}}),U.className="geBtn",x.appendChild(U));U=mxUtils.button(mxResources.get(null!=G?"export":+PrintDialog.previewEnabled?"print":"ok"),function(){try{l.hideDialog(),O(!0)}catch(Ba){l.handleError(Ba)}});U.className="geBtn gePrimaryBtn";x.appendChild(U);l.editor.cancelFirst||x.appendChild(R);T.appendChild(x);if(l.editor.isChromelessView()){var Fa=function(){Editor.isDarkMode()?(T.classList.add("geDarkMode"),T.style.colorScheme="dark"):(T.classList.remove("geDarkMode"),T.style.colorScheme="light")};l.addListener("darkModeChanged",Fa);Fa();var Ma=function(Ba,Da){Ba=Da.getProperty("dialog");T.parentNode==Ba.container&&(l.editor.removeListener(Ma),l.removeListener(Fa))};l.editor.addListener("hideDialog",Ma)}this.container=T};var C=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var l=this.image;null!=l&&null!=l.src&&Graph.isPageLink(l.src)&&(l={originalSrc:l.src});this.page.viewState.backgroundImage=l}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else C.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(l=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=l?l:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var M=document.createElement("canvas"),S=new Image;S.onload=function(){try{M.getContext("2d").drawImage(S,0,0);var l=M.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=l&&6<l.length}catch(x){}};S.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(l){}Editor.prototype.useCanvasForExport=!1})();(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};b.afterDecode=function(e,f,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;c.previousAdaptiveColors=c.adaptiveColors;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(b)})();-(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.0.3";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&+(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.0.4";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};@@ -12979,7 +12979,7 @@ function(d){if("1"==urlParams.dev)EditorUi.debug("logEvent",d);else if(EditorUi."version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(d))}catch(m){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var d=[(new Date).toISOString()],g=0;g<arguments.length;g++)d.push(arguments[g]);console.log.apply(console,d)}}catch(m){}};EditorUi.removeChildNodes=function(d){for(;null!=d.firstChild;)d.removeChild(d.firstChild)};EditorUi.embedSvgImages=function(d){d=d.getElementsByTagName("image");for(var g=[],m=0;m<d.length;m++)g.push(d[m]);for(m=0;m<g.length;m++)EditorUi.replaceSvgImage(g[m])};EditorUi.replaceSvgImage=function(d){try{var g=null;g=null==d.getAttributeNS?d.getAttribute("xlink:href"):d.getAttributeNS(mxConstants.NS_XLINK,"href");var m=EditorUi.getSvgSubtree(g);if(null!=m&&"svg"==m.nodeName){m.setAttribute("x",d.getAttribute("x"));m.setAttribute("y",d.getAttribute("y"));m.setAttribute("width",d.getAttribute("width"));m.setAttribute("height",d.getAttribute("height"));m.style.fontFamily="initial";var t=mxUtils.createElementNs(m.ownerDocument,mxConstants.NS_SVG,"g");t.appendChild(m);d.hasAttribute("transform")&&t.setAttribute("transform",d.getAttribute("transform"));d.parentNode.replaceChild(t,d)}}catch(v){}};EditorUi.getSvgSubtree=function(d){var g=Graph.getSvgFromDataUri(d);d=null;if(null!=g){d=Graph.sanitizeNode(mxUtils.parseXml(g).documentElement);g=d.getElementsByTagName("style");if(0<g.length){var m="svg-image-"+Editor.guid();d.setAttribute("id",m);for(var t=document.implementation.createHTMLDocument(""),-v=document.createElement("style"),y=0;y<g.length;y++){v.textContent=g[y].textContent;t.body.appendChild(v);for(var B="",I=0;I<v.sheet.cssRules.length;I++){var K=v.sheet.cssRules[I];if(null!=K.selectorText){for(var J=K.selectorText.split(","),V=0;V<J.length;V++)J[V]="#"+m+" "+J[V];K.selectorText=J.join(",")}B+=K.cssText+"\n"}g[y].textContent=B}}g=d.getElementsByTagName("*");for(m=0;m<g.length;m++)g[m].removeAttribute("data-cell-id")}return d};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+v=document.createElement("style"),y=0;y<g.length;y++){v.textContent=g[y].textContent;t.body.appendChild(v);for(var B="",I=0;I<v.sheet.cssRules.length;I++){var J=v.sheet.cssRules[I];if(null!=J.selectorText){for(var K=J.selectorText.split(","),V=0;V<K.length;V++)K[V]="#"+m+" "+K[V];J.selectorText=K.join(",")}B+=J.cssText+"\n"}g[y].textContent=B}}g=d.getElementsByTagName("*");for(m=0;m<g.length;m++)g[m].removeAttribute("data-cell-id")}return d};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;EditorUi.prototype.webpSupported=!1;try{var d=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!d.getContext||!d.getContext("2d"))}catch(v){}try{var g=document.createElement("canvas"),@@ -12989,10 +12989,10 @@ g,m)};EditorUi.prototype.showSplash=function(d){};EditorUi.prototype.getLocalDatEditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(d){this.showRemoteCursors=d;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(d){var g=this.editor.graph;g.mathEnabled=d;null!=g.view.backgroundImage&&(g.view.backgroundImage.destroy(),g.view.backgroundImage=null);this.editor.updateGraphComponents();g.refresh();g.defaultMathEnabled=d;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(d){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(d){this.editor.graph.setAdaptiveColors(d);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(d){return this.isOfflineApp()||!navigator.onLine||!d&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(d,g,m){var t=null==d||null==g;m=null!=m?m:24;var v=new Spinner({lines:12,length:m,width:Math.round(m/3),radius:Math.round(m/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),y=this.timeout,B=v.spin,I=null,K=null,J=mxUtils.bind(this,function(Q){null!=Q&&Q()});v.spin=function(Q,O,p,z){z=null!=z?z:y;var A=!1;if(!this.active){var C=Date.now();null!=p&&(I=window.setTimeout(function(){v.stop();I=null;p({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:K})},z));B.call(this,Q);this.active=!0;null!=O&&(t&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,d=document.body.clientWidth/+speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),y=this.timeout,B=v.spin,I=null,J=null,K=mxUtils.bind(this,function(Q){null!=Q&&Q()});v.spin=function(Q,P,p,z){z=null!=z?z:y;var A=!1;if(!this.active){var C=Date.now();null!=p&&(I=window.setTimeout(function(){v.stop();I=null;p({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:J})},z));B.call(this,Q);this.active=!0;null!=P&&(t&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,d=document.body.clientWidth/2-2),A=document.createElement("div"),A.className="geSpinnerStatus",A.style.position="absolute",A.style.whiteSpace="nowrap",A.style.background="#4B4243",A.style.color="white",A.style.fontFamily=Editor.defaultHtmlFont,A.style.fontSize="9pt",A.style.padding="6px",A.style.paddingLeft="10px",A.style.paddingRight="10px",A.style.zIndex=2E9,A.style.left=Math.max(0,d)+"px",A.style.top=Math.max(0,g+70)+"px",mxUtils.setPrefixedStyle(A.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(A.style,"transform",-"translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(A.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=O.substring(O.length-3,O.length)&&"!"!=O.charAt(O.length-1)&&(O+="..."),A.innerHTML=mxUtils.htmlEntities(O),Q.appendChild(A),v.status=A);this.pause=mxUtils.bind(this,function(){var M=J;this.active&&(z=Math.max(0,z-(Date.now()-C)),M=mxUtils.bind(this,function(S){this.spin(Q,O,p,z);if(null!=S)try{S(),K=mxUtils.bind(this,function(){this.spin(Q,O,p,z);try{S()}catch(l){null!=p&&p(l)}})}catch(l){null!=-p&&p(l)}}));this.stop();return M});A=!0}return A};var V=v.stop;v.stop=function(){V.call(this);this.active&&(this.active=!1,null!=I&&(window.clearTimeout(I),I=null),null!=v.status&&null!=v.status.parentNode&&v.status.parentNode.removeChild(v.status),v.status=null)};v.pause=function(){return J};return v};EditorUi.prototype.isCompatibleString=function(d){try{var g=mxUtils.parseXml(d),m=this.editor.extractGraphModel(g.documentElement,!0);return null!=m&&0==m.getElementsByTagName("parsererror").length}catch(t){}return!1};+"translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(A.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=P.substring(P.length-3,P.length)&&"!"!=P.charAt(P.length-1)&&(P+="..."),A.innerHTML=mxUtils.htmlEntities(P),Q.appendChild(A),v.status=A);this.pause=mxUtils.bind(this,function(){var M=K;this.active&&(z=Math.max(0,z-(Date.now()-C)),M=mxUtils.bind(this,function(S){this.spin(Q,P,p,z);if(null!=S)try{S(),J=mxUtils.bind(this,function(){this.spin(Q,P,p,z);try{S()}catch(l){null!=p&&p(l)}})}catch(l){null!=+p&&p(l)}}));this.stop();return M});A=!0}return A};var V=v.stop;v.stop=function(){V.call(this);this.active&&(this.active=!1,null!=I&&(window.clearTimeout(I),I=null),null!=v.status&&null!=v.status.parentNode&&v.status.parentNode.removeChild(v.status),v.status=null)};v.pause=function(){return K};return v};EditorUi.prototype.isCompatibleString=function(d){try{var g=mxUtils.parseXml(d),m=this.editor.extractGraphModel(g.documentElement,!0);return null!=m&&0==m.getElementsByTagName("parsererror").length}catch(t){}return!1};EditorUi.isVisioFilename=function(d){return/(\.v(dx|sdx?))($|\?)/i.test(d)||/(\.vs(x|sx?))($|\?)/i.test(d)};EditorUi.prototype.isVisioData=function(d){return 8<d.length&&(208==d.charCodeAt(0)&&207==d.charCodeAt(1)&&17==d.charCodeAt(2)&&224==d.charCodeAt(3)&&161==d.charCodeAt(4)&&177==d.charCodeAt(5)&&26==d.charCodeAt(6)&&225==d.charCodeAt(7)||80==d.charCodeAt(0)&&75==d.charCodeAt(1)&&3==d.charCodeAt(2)&&4==d.charCodeAt(3)||80==d.charCodeAt(0)&&75==d.charCodeAt(1)&&3==d.charCodeAt(2)&&6==d.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(d){return 8<d.length&&(208==d.charCodeAt(0)&&207==d.charCodeAt(1)&&17==d.charCodeAt(2)&&224==d.charCodeAt(3)&&161==d.charCodeAt(4)&&177==d.charCodeAt(5)&&26==d.charCodeAt(6)&&225==d.charCodeAt(7)||60==d.charCodeAt(0)&&63==d.charCodeAt(1)&&120==d.charCodeAt(2)&&109==d.charCodeAt(3)&&108==d.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(d){var g=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var m=g.getFunction,t=this.editor.graph,v=this;g.getFunction=function(y){if(t.isSelectionEmpty()&&null!=v.pages&&0<v.pages.length){var B=v.getSelectedPageIndex();if(mxEvent.isShiftDown(y)){if(37==y.keyCode)return function(){0<B&&v.movePage(B,B-1)};if(38==y.keyCode)return function(){0<B&&v.movePage(B,0)};if(39==y.keyCode)return function(){B<v.pages.length-1&&v.movePage(B,B+1)};if(40==y.keyCode)return function(){B<v.pages.length-1&&v.movePage(B,v.pages.length-1)}}else if(mxEvent.isControlDown(y)||mxClient.IS_MAC&&@@ -13001,12 +13001,12 @@ arguments):null}}return g};var e=EditorUi.prototype.extractGraphModelFromHtml;Edg=null!=y?mxUtils.getXml(y):""}}catch(B){}return g};EditorUi.prototype.validateFileData=function(d){if(null!=d&&0<d.length){var g=d.indexOf('<meta charset="utf-8">');0<=g&&(d=d.slice(0,g)+'<meta charset="utf-8"/>'+d.slice(g+23-1,d.length));d=Graph.zapGremlins(d)}return d};EditorUi.prototype.replaceFileData=function(d,g){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[d],"patches",g);d=this.validateFileData(d);d=null!=d&&0<d.length?mxUtils.parseXml(d).documentElement:null;var m=null!=d?this.editor.extractGraphModel(d,!0):null;null!=m&&(d=m);if(null!=d){m=this.editor.graph;m.model.beginUpdate();try{var t=null!=this.pages?this.pages.slice():null,v=d.getElementsByTagName("diagram");if(1<v.length||1==v.length&&v[0].hasAttribute("name")){this.fileNode=d;this.pages=null!=this.pages?this.pages:[];for(var y=v.length-1;0<=y;y--){var B=this.updatePageRoot(new DiagramPage(v[y]));null==B.getName()&&B.setName(mxResources.get("pageWithNumber",[y+1]));m.model.execute(new ChangePage(this,B,0==y?B:null,0))}}else null==this.fileNode&&(this.fileNode=d.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(d.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),m.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(d),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,m.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=t)for(y=0;y<t.length;y++)m.model.execute(new ChangePage(this,-t[y],null));var I=this.getCurrentFile();null!=I&&I.fileReplaced(g)}finally{m.model.endUpdate()}}};EditorUi.prototype.createFileData=function(d,g,m,t,v,y,B,I,K,J,V,Q,O){g=null!=g?g:this.editor.graph;v=null!=v?v:!1;K=null!=K?K:!0;V=null!=V?V:!Editor.defaultCompressed;var p=null;if(null==m||m.getMode()==App.MODE_DEVICE||m.getMode()==App.MODE_BROWSER)var z="_blank";else p=z=t;if(null==d)return"";var A=d;if("mxfile"!=A.nodeName.toLowerCase()){if(V){var C=d.ownerDocument.createElement("diagram");C.setAttribute("name",-mxResources.get("pageWithNumber",[1]));C.setAttribute("id",Editor.guid());C.appendChild(d)}else{C=Graph.zapGremlins(mxUtils.getXml(d));A=Graph.compress(C);if(Graph.decompress(A)!=C)return C;C=d.ownerDocument.createElement("diagram");C.setAttribute("name",mxResources.get("pageWithNumber",[1]));C.setAttribute("id",Editor.guid());mxUtils.setTextContent(C,A)}A=d.ownerDocument.createElement("mxfile");A.appendChild(C)}J?(A=A.cloneNode(!0),A.removeAttribute("modified"),A.removeAttribute("host"),A.removeAttribute("agent"),+t[y],null));var I=this.getCurrentFile();null!=I&&I.fileReplaced(g)}finally{m.model.endUpdate()}}};EditorUi.prototype.createFileData=function(d,g,m,t,v,y,B,I,J,K,V,Q,P){g=null!=g?g:this.editor.graph;v=null!=v?v:!1;J=null!=J?J:!0;V=null!=V?V:!Editor.defaultCompressed;var p=null;if(null==m||m.getMode()==App.MODE_DEVICE||m.getMode()==App.MODE_BROWSER)var z="_blank";else p=z=t;if(null==d)return"";var A=d;if("mxfile"!=A.nodeName.toLowerCase()){if(V){var C=d.ownerDocument.createElement("diagram");C.setAttribute("name",+mxResources.get("pageWithNumber",[1]));C.setAttribute("id",Editor.guid());C.appendChild(d)}else{C=Graph.zapGremlins(mxUtils.getXml(d));A=Graph.compress(C);if(Graph.decompress(A)!=C)return C;C=d.ownerDocument.createElement("diagram");C.setAttribute("name",mxResources.get("pageWithNumber",[1]));C.setAttribute("id",Editor.guid());mxUtils.setTextContent(C,A)}A=d.ownerDocument.createElement("mxfile");A.appendChild(C)}K?(A=A.cloneNode(!0),A.removeAttribute("modified"),A.removeAttribute("host"),A.removeAttribute("agent"),A.removeAttribute("etag"),A.removeAttribute("userAgent"),A.removeAttribute("version"),A.removeAttribute("editor"),A.removeAttribute("type")):(A.removeAttribute("userAgent"),A.removeAttribute("modified"),A.removeAttribute("version"),A.removeAttribute("editor"),A.removeAttribute("pages"),A.removeAttribute("type"),A.removeAttribute("etag"),mxClient.IS_CHROMEAPP?A.setAttribute("host","Chrome"):EditorUi.isElectronApp?A.setAttribute("host","Electron"):A.setAttribute("host",window.location.hostname),A.setAttribute("agent",-null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),A.setAttribute("version",EditorUi.VERSION),1<A.getElementsByTagName("diagram").length&&null!=this.pages&&A.setAttribute("pages",this.pages.length));null!=Q&&(A=A.cloneNode(!0),A.setAttribute("scale",Q));null!=O&&(A=A.cloneNode(!0),A.setAttribute("border",O));d=V?mxUtils.getPrettyXml(A):mxUtils.getXml(A);if(!y&&!v&&(B||null!=m&&/(\.html)$/i.test(m.getTitle())))d=this.getHtml2(mxUtils.getXml(A),g,null!=m?m.getTitle():null,z,p);else if(y||-!v&&null!=m&&/(\.svg)$/i.test(m.getTitle()))null==m||m.getMode()!=App.MODE_DEVICE&&m.getMode()!=App.MODE_BROWSER||(t=null),m=this.getSvgFileProperties(A),d=this.getEmbeddedSvg(d,g,t,null,I,K,p,null,null,m.scale,m.border,null,Editor.svgFileTheme);return d};EditorUi.prototype.getXmlFileData=function(d,g,m,t){d=null!=d?d:!0;g=null!=g?g:!1;m=null!=m?m:!Editor.defaultCompressed;var v=this.editor.getGraphXml(d,t);if(d&&null!=this.fileNode&&null!=this.currentPage)if(d=function(K){var J=K.getElementsByTagName("mxGraphModel"),-V=0<J.length?J[0]:null;J=K;null==V&&m?(V=mxUtils.getNodeValue(K),0<V.length&&(V=Graph.decompress(V),null!=V&&0<V.length&&(J=K.cloneNode(!1),J.appendChild(mxUtils.parseXml(V).documentElement)))):null==V||m?J=K.cloneNode(!0):(J=K.cloneNode(!1),mxUtils.setTextContent(J,Graph.compressNode(V)));v.appendChild(J)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(v),v=this.fileNode.cloneNode(!1),g)d(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var y=this.pages[g],+null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),A.setAttribute("version",EditorUi.VERSION),1<A.getElementsByTagName("diagram").length&&null!=this.pages&&A.setAttribute("pages",this.pages.length));null!=Q&&(A=A.cloneNode(!0),A.setAttribute("scale",Q));null!=P&&(A=A.cloneNode(!0),A.setAttribute("border",P));d=V?mxUtils.getPrettyXml(A):mxUtils.getXml(A);if(!y&&!v&&(B||null!=m&&/(\.html)$/i.test(m.getTitle())))d=this.getHtml2(mxUtils.getXml(A),g,null!=m?m.getTitle():null,z,p);else if(y||+!v&&null!=m&&/(\.svg)$/i.test(m.getTitle()))null==m||m.getMode()!=App.MODE_DEVICE&&m.getMode()!=App.MODE_BROWSER||(t=null),m=this.getSvgFileProperties(A),d=this.getEmbeddedSvg(d,g,t,null,I,J,p,null,null,m.scale,m.border,null,Editor.svgFileTheme);return d};EditorUi.prototype.getXmlFileData=function(d,g,m,t){d=null!=d?d:!0;g=null!=g?g:!1;m=null!=m?m:!Editor.defaultCompressed;var v=this.editor.getGraphXml(d,t);if(d&&null!=this.fileNode&&null!=this.currentPage)if(d=function(J){var K=J.getElementsByTagName("mxGraphModel"),+V=0<K.length?K[0]:null;K=J;null==V&&m?(V=mxUtils.getNodeValue(J),0<V.length&&(V=Graph.decompress(V),null!=V&&0<V.length&&(K=J.cloneNode(!1),K.appendChild(mxUtils.parseXml(V).documentElement)))):null==V||m?K=J.cloneNode(!0):(K=J.cloneNode(!1),mxUtils.setTextContent(K,Graph.compressNode(V)));v.appendChild(K)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(v),v=this.fileNode.cloneNode(!1),g)d(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var y=this.pages[g],B=y.node;if(y!=this.currentPage)if(y.needsUpdate){var I=new mxCodec(mxUtils.createXmlDocument());I=I.encode(new mxGraphModel(y.root));this.editor.graph.saveViewState(y.viewState,I,null,t);EditorUi.removeChildNodes(B);B.appendChild(I);delete y.needsUpdate}else t&&(this.updatePageRoot(y),null!=y.viewState.backgroundImage&&(null!=y.viewState.backgroundImage.originalSrc?y.viewState.backgroundImage=this.createImageForPageLink(y.viewState.backgroundImage.originalSrc,y):Graph.isPageLink(y.viewState.backgroundImage.src)&&(y.viewState.backgroundImage=this.createImageForPageLink(y.viewState.backgroundImage.src,y))),null!=y.viewState.backgroundImage&&null!=y.viewState.backgroundImage.originalSrc&&(I=new mxCodec(mxUtils.createXmlDocument()),I=I.encode(new mxGraphModel(y.root)),this.editor.graph.saveViewState(y.viewState,I,null,t),B=B.cloneNode(!1),B.appendChild(I)));d(B)}return v};EditorUi.prototype.anonymizeString=function(d,g){for(var m=[],t=0;t<d.length;t++){var v=d.charAt(t);0<=EditorUi.ignoredAnonymizedChars.indexOf(v)?m.push(v):isNaN(parseInt(v))?v.toLowerCase()!=v?m.push(String.fromCharCode(65+Math.round(25*Math.random()))):v.toUpperCase()!=v?m.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(v)?m.push(" "):m.push("?"):m.push(g?"0":Math.round(9*Math.random()))}return m.join("")};EditorUi.prototype.anonymizePatch=function(d){if(null!=d[EditorUi.DIFF_INSERT])for(var g=0;g<d[EditorUi.DIFF_INSERT].length;g++)try{var m=mxUtils.parseXml(d[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);@@ -13015,10 +13015,10 @@ null!=B[I].xmlValue&&(B[I].xmlValue="["+B[I].xmlValue.length+"]"),null!=B[I].styg){if(null!=d.attributes)for(var m=0;m<d.attributes.length;m++)"as"!=d.attributes[m].name&&d.setAttribute(d.attributes[m].name,this.anonymizeString(d.attributes[m].value,g));if(null!=d.childNodes)for(m=0;m<d.childNodes.length;m++)this.anonymizeAttributes(d.childNodes[m],g)};EditorUi.prototype.anonymizeNode=function(d,g){g=d.getElementsByTagName("mxCell");for(var m=0;m<g.length;m++)null!=g[m].getAttribute("value")&&g[m].setAttribute("value","["+g[m].getAttribute("value").length+"]"),null!=g[m].getAttribute("xmlValue")&&g[m].setAttribute("xmlValue","["+g[m].getAttribute("xmlValue").length+"]"),null!=g[m].getAttribute("style")&&g[m].setAttribute("style","["+g[m].getAttribute("style").length+"]"),null!=g[m].parentNode&&"root"!=g[m].parentNode.nodeName&&null!=g[m].parentNode.parentNode&&(g[m].setAttribute("id",g[m].parentNode.getAttribute("id")),g[m].parentNode.parentNode.replaceChild(g[m],g[m].parentNode));return d};EditorUi.prototype.synchronizeCurrentFile=function(d){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!d&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(g.clearAutosave(),this.editor.setStatus(""),d?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(m){this.spinner.stop();g.handleFileError(m,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),-mxUtils.bind(this,function(m){g.handleFileError(m,!0)}))))};EditorUi.prototype.getFileData=function(d,g,m,t,v,y,B,I,K,J,V,Q,O){v=null!=v?v:!0;y=null!=y?y:!1;J=null!=J?J:!Editor.defaultCompressed;var p=this.editor.graph;if((g||!d&&null!=K&&/(\.svg)$/i.test(K.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var z=p.getGlobalVariable;p=this.createTemporaryGraph(p.getStylesheet());p.setBackgroundImage=this.editor.graph.setBackgroundImage;p.background=this.editor.graph.background;var A=-null!=this.pages?this.pages[0]:null;null==A||this.currentPage==A?p.setBackgroundImage(this.editor.graph.backgroundImage):null!=A.viewState&&null!=A.viewState&&p.setBackgroundImage(A.viewState.backgroundImage);p.getGlobalVariable=function(C){return"page"==C&&null!=A?A.getName():"pagenumber"==C?1:z.apply(this,arguments)};document.body.appendChild(p.container);null!=A&&p.model.setRoot(A.root)}B=null!=B?B:this.getXmlFileData(v,y,J,V);K=null!=K?K:this.getCurrentFile();d=this.createFileData(B,p,K,window.location.href,-d,g,m,t,v,I,J,Q,O);p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);return d};EditorUi.prototype.getHtml=function(d,g,m,t,v,y){y=null!=y?y:!0;var B=null,I=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=g){B=y?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var K=g.view.scale;y=Math.floor(B.x/K-g.view.translate.x);K=Math.floor(B.y/K-g.view.translate.y);B=g.background;null==v&&(g=this.getBasenames().join(";"),0<g.length&&(I=EditorUi.drawHost+"/embed.js?s="+g));-d.setAttribute("x0",y);d.setAttribute("y0",K)}null!=d&&(d.setAttribute("pan","1"),d.setAttribute("zoom","1"),d.setAttribute("resize","0"),d.setAttribute("fit","0"),d.setAttribute("border","20"),d.setAttribute("links","1"),null!=t&&d.setAttribute("edit",t));null!=v&&(v=v.replace(/&/g,"&"));d=null!=d?Graph.zapGremlins(mxUtils.getXml(d)):"";t=Graph.compress(d);Graph.decompress(t)!=d&&(t=encodeURIComponent(d));return(null==v?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':+mxUtils.bind(this,function(m){g.handleFileError(m,!0)}))))};EditorUi.prototype.getFileData=function(d,g,m,t,v,y,B,I,J,K,V,Q,P){v=null!=v?v:!0;y=null!=y?y:!1;K=null!=K?K:!Editor.defaultCompressed;var p=this.editor.graph;if((g||!d&&null!=J&&/(\.svg)$/i.test(J.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var z=p.getGlobalVariable;p=this.createTemporaryGraph(p.getStylesheet());p.setBackgroundImage=this.editor.graph.setBackgroundImage;p.background=this.editor.graph.background;var A=+null!=this.pages?this.pages[0]:null;null==A||this.currentPage==A?p.setBackgroundImage(this.editor.graph.backgroundImage):null!=A.viewState&&null!=A.viewState&&p.setBackgroundImage(A.viewState.backgroundImage);p.getGlobalVariable=function(C){return"page"==C&&null!=A?A.getName():"pagenumber"==C?1:z.apply(this,arguments)};document.body.appendChild(p.container);null!=A&&p.model.setRoot(A.root)}B=null!=B?B:this.getXmlFileData(v,y,K,V);J=null!=J?J:this.getCurrentFile();d=this.createFileData(B,p,J,window.location.href,+d,g,m,t,v,I,K,Q,P);p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);return d};EditorUi.prototype.getHtml=function(d,g,m,t,v,y){y=null!=y?y:!0;var B=null,I=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=g){B=y?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var J=g.view.scale;y=Math.floor(B.x/J-g.view.translate.x);J=Math.floor(B.y/J-g.view.translate.y);B=g.background;null==v&&(g=this.getBasenames().join(";"),0<g.length&&(I=EditorUi.drawHost+"/embed.js?s="+g));+d.setAttribute("x0",y);d.setAttribute("y0",J)}null!=d&&(d.setAttribute("pan","1"),d.setAttribute("zoom","1"),d.setAttribute("resize","0"),d.setAttribute("fit","0"),d.setAttribute("border","20"),d.setAttribute("links","1"),null!=t&&d.setAttribute("edit",t));null!=v&&(v=v.replace(/&/g,"&"));d=null!=d?Graph.zapGremlins(mxUtils.getXml(d)):"";t=Graph.compress(d);Graph.decompress(t)!=d&&(t=encodeURIComponent(d));return(null==v?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=v?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==v?null!=m?"<title>"+mxUtils.htmlEntities(m)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=v?'<meta http-equiv="refresh" content="0;URL=\''+v+"'\"/>\n":"")+"</head>\n<body"+(null==v&&null!=B&&B!=mxConstants.NONE?' style="background-color:'+B+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+t+"</div>\n</div>\n"+(null==v?'<script type="text/javascript" src="'+I+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+v+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(d,g,m,t,v){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=v&&(v=v.replace(/&/g,"&"));d={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(d),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(d.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==v?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=v?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==v?null!=m?"<title>"+mxUtils.htmlEntities(m)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=v?'<meta http-equiv="refresh" content="0;URL=\''+@@ -13026,21 +13026,21 @@ v+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph"function(d){d=this.validateFileData(d);this.pages=this.fileNode=this.currentPage=null;var g=null!=d&&0<d.length?mxUtils.parseXml(d).documentElement:null,m=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(m)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[d],"node",[g],"cause",[m]),Error(mxResources.get("notADiagramFile")+" ("+m+")");d=null!=g?this.editor.extractGraphModel(g,!0):null;null!=d&&(g=d);if(null!=g&&"mxfile"==g.nodeName&&(d=g.getElementsByTagName("diagram"),m={},0<d.length)){var t=this.getHashObject(),v=null;this.fileNode=g;this.pages=[];for(var y=0;y<d.length;y++){null==d[y].getAttribute("id")&&d[y].setAttribute("id",y);g=new DiagramPage(d[y]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[y+1]));this.pages.push(g);if(null==t.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||null!=t.pageId&&g.getId()==t.pageId)v=g;if(null==m[g.getId()])m[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=v?v:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];g=this.currentPage.node}null==this.fileNode&&null!=g&&(this.fileNode=g.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(g.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),-this.scrollToPage());if(null!=urlParams["layer-ids"])try{var B=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(y=0;y<B.length;y++)g[B[y]]=!0;var I=this.editor.graph.getModel(),K=I.getChildren(I.root);for(y=0;y<K.length;y++){var J=K[y];I.setVisible(J,g[J.id]||!1)}}catch(V){}};EditorUi.prototype.getBaseFilename=function(d){var g=this.getCurrentFile();g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=-g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!d&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=function(d,g,m,t,v,y,B,I,K,J,V,Q,O,p,z,A){try{t=null!=t?t:this.editor.graph.isSelectionEmpty();var C=this.getBaseFilename(!v),M=C+("xml"==d||"pdf"==d&&V?".drawio":"")+"."+d;-if("xml"==d){var S=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,v,null,null,null,g);this.saveData(M,d,S,"text/xml")}else if("html"==d)S=this.getHtml2(this.getFileData(!0),this.editor.graph,C),this.saveData(M,d,S,"text/html");else if("svg"!=d&&"xmlsvg"!=d||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==d?M=C+".png":"jpeg"==d&&(M=C+".jpg"),this.saveRequest(M,d,mxUtils.bind(this,function(P,R){try{return this.createDownloadRequest(P,d,t,R,B,v,I,K,J,V,Q,void 0,-void 0,!y,O,p,z,A)}catch(T){this.handleError(T)}}));else{var l=null,x=mxUtils.bind(this,function(P){P.length<=MAX_REQUEST_SIZE?this.saveData(M,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(l)}))});if("svg"==d){var G=this.editor.graph.background;if(B||G==mxConstants.NONE)G=null;var N=this.editor.graph.getSvg(G,null,null,null,null,t);m&&this.editor.graph.addSvgShadow(N);this.editor.convertImages(N,-mxUtils.bind(this,mxUtils.bind(this,function(P){this.spinner.stop();x(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(P))})))}else M=C+".svg",l=this.getFileData(!1,!0,null,mxUtils.bind(this,function(P){this.spinner.stop();x(P)}),t)}}catch(P){this.handleError(P)}};EditorUi.prototype.createDownloadRequest=function(d,g,m,t,v,y,B,I,K,J,V,Q,O,p,z,A,C,M){d=this.downloadRequestBuilder(d,g,m,t,v,y,B,I,K,J,V,Q,O,p,z,A,C,M);g="";for(var S in d)m=d[S],null!=m&&(g+=S+"="+encodeURIComponent(m)+-"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(d,g,m,t,v,y,B,I,K,J,V,Q,O,p,z,A,C,M){var S=this.editor.graph,l=S.getGraphBounds();m=this.getFileData(!0,null,null,null,m,0==y?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var x=null,G=null,N=null;if(!EditorUi.isElectronApp&&(l.width*l.height>MAX_AREA||m.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};J=J?"1":"0";"pdf"==g&&(null!=V?(x=V.from,G=V.to):0==y&&(N=-"1"));"xmlpng"==g&&(J="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(y=0;y<this.pages.length;y++)if(this.pages[y]==this.currentPage){x=y;break}y=S.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!v?v||null!=y&&y!=mxConstants.NONE||(y="#ffffff"):y=mxConstants.NONE;v={globalVars:S.getExportVariables()};K&&(v.grid={size:S.gridSize,steps:S.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:S.view.gridColor});Graph.translateDiagram&&-(v.diagramLanguage=Graph.diagramLanguage);return{format:g,from:x,to:G,allPages:N,bg:null!=y?y:mxConstants.NONE,base64:t,embedXml:J,xml:m,filename:null!=d?d:"",extras:JSON.stringify(v),scale:B,border:I,pageMargin:z,w:Q&&isFinite(Q)?Q:null,h:O&&isFinite(O)?O:null,crop:null!=p&&p?"1":"0",fit:null!=A&&A?"1":"0",sheetsAcross:C,sheetsDown:M}};EditorUi.prototype.setMode=function(d,g){this.mode=d};EditorUi.prototype.getDiagramId=function(){var d=window.location.hash;null!=d&&0<d.length&&(d=d.substring(1));+this.scrollToPage());if(null!=urlParams["layer-ids"])try{var B=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(y=0;y<B.length;y++)g[B[y]]=!0;var I=this.editor.graph.getModel(),J=I.getChildren(I.root);for(y=0;y<J.length;y++){var K=J[y];I.setVisible(K,g[K.id]||!1)}}catch(V){}};EditorUi.prototype.getBaseFilename=function(d){var g=this.getCurrentFile();g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=+g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!d&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=function(d,g,m,t,v,y,B,I,J,K,V,Q,P,p,z,A){try{t=null!=t?t:this.editor.graph.isSelectionEmpty();var C=this.getBaseFilename(!v),M=C+("xml"==d||"pdf"==d&&V?".drawio":"")+"."+d;+if("xml"==d){var S=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,v,null,null,null,g);this.saveData(M,d,S,"text/xml")}else if("html"==d)S=this.getHtml2(this.getFileData(!0),this.editor.graph,C),this.saveData(M,d,S,"text/html");else if("svg"!=d&&"xmlsvg"!=d||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==d?M=C+".png":"jpeg"==d&&(M=C+".jpg"),this.saveRequest(M,d,mxUtils.bind(this,function(O,R){try{return this.createDownloadRequest(O,d,t,R,B,v,I,J,K,V,Q,void 0,+void 0,!y,P,p,z,A)}catch(T){this.handleError(T)}}));else{var l=null,x=mxUtils.bind(this,function(O){O.length<=MAX_REQUEST_SIZE?this.saveData(M,"svg",O,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(l)}))});if("svg"==d){var G=this.editor.graph.background;if(B||G==mxConstants.NONE)G=null;var N=this.editor.graph.getSvg(G,null,null,null,null,t);m&&this.editor.graph.addSvgShadow(N);this.editor.convertImages(N,+mxUtils.bind(this,mxUtils.bind(this,function(O){this.spinner.stop();x(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(O))})))}else M=C+".svg",l=this.getFileData(!1,!0,null,mxUtils.bind(this,function(O){this.spinner.stop();x(O)}),t)}}catch(O){this.handleError(O)}};EditorUi.prototype.createDownloadRequest=function(d,g,m,t,v,y,B,I,J,K,V,Q,P,p,z,A,C,M){d=this.downloadRequestBuilder(d,g,m,t,v,y,B,I,J,K,V,Q,P,p,z,A,C,M);g="";for(var S in d)m=d[S],null!=m&&(g+=S+"="+encodeURIComponent(m)++"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(d,g,m,t,v,y,B,I,J,K,V,Q,P,p,z,A,C,M){var S=this.editor.graph,l=S.getGraphBounds();m=this.getFileData(!0,null,null,null,m,0==y?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var x=null,G=null,N=null;if(!EditorUi.isElectronApp&&(l.width*l.height>MAX_AREA||m.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};K=K?"1":"0";"pdf"==g&&(null!=V?(x=V.from,G=V.to):0==y&&(N=+"1"));"xmlpng"==g&&(K="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(y=0;y<this.pages.length;y++)if(this.pages[y]==this.currentPage){x=y;break}y=S.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!v?v||null!=y&&y!=mxConstants.NONE||(y="#ffffff"):y=mxConstants.NONE;v={globalVars:S.getExportVariables()};J&&(v.grid={size:S.gridSize,steps:S.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:S.view.gridColor});Graph.translateDiagram&&+(v.diagramLanguage=Graph.diagramLanguage);return{format:g,from:x,to:G,allPages:N,bg:null!=y?y:mxConstants.NONE,base64:t,embedXml:K,xml:m,filename:null!=d?d:"",extras:JSON.stringify(v),scale:B,border:I,pageMargin:z,w:Q&&isFinite(Q)?Q:null,h:P&&isFinite(P)?P:null,crop:null!=p&&p?"1":"0",fit:null!=A&&A?"1":"0",sheetsAcross:C,sheetsDown:M}};EditorUi.prototype.setMode=function(d,g){this.mode=d};EditorUi.prototype.getDiagramId=function(){var d=window.location.hash;null!=d&&0<d.length&&(d=d.substring(1));if(null!=d&&1<d.length){var g=d.indexOf("#");0<=g&&(d=d.substring(0,g))}return d};EditorUi.prototype.getHashObject=function(){var d=window.location.hash,g={};if(null!=d&&0<d.length){var m=d.lastIndexOf("#");if(0<m){d=decodeURIComponent(d.substring(m+1));try{g=JSON.parse(d)}catch(t){}}}return g};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var d=this.getHashObject();d.pageId=this.currentPage.getId();this.setHashObject(d)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(d){if(Editor.enableHashObjects){var g=window.location.hash;if(null==g||""==g)g="#";var m=g.lastIndexOf("#");0<m&&(g=g.substring(0,m));try{null==d||mxUtils.isEmptyObject(d)||(g=g+"#"+encodeURIComponent(JSON.stringify(d)))}catch(t){}0<m&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};EditorUi.prototype.loadDescriptor=function(d,g,m){var t=window.location.hash,v=mxUtils.bind(this,function(B){var I=null!=d.data?d.data:"";null!=B&&0<B.length&&-(0<I.length&&(I+="\n"),I+=B);B=new LocalFile(this,"csv"!=d.format&&0<I.length?I:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);B.getHash=function(){return t};this.fileLoaded(B);"csv"==d.format&&this.importCsv(I,mxUtils.bind(this,function(O){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=d.update){var K=null!=d.interval?parseInt(d.interval):6E4,J=null,V=mxUtils.bind(this,function(){var O=this.currentPage;-mxUtils.post(d.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(p){O===this.currentPage&&(200<=p.getStatus()&&300>=p.getStatus()?(this.updateDiagram(p.getText()),Q()):this.handleError({message:mxResources.get("error")+" "+p.getStatus()}))}),mxUtils.bind(this,function(p){this.handleError(p)}))}),Q=mxUtils.bind(this,function(){window.clearTimeout(J);J=window.setTimeout(V,K)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){Q();+(0<I.length&&(I+="\n"),I+=B);B=new LocalFile(this,"csv"!=d.format&&0<I.length?I:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);B.getHash=function(){return t};this.fileLoaded(B);"csv"==d.format&&this.importCsv(I,mxUtils.bind(this,function(P){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=d.update){var J=null!=d.interval?parseInt(d.interval):6E4,K=null,V=mxUtils.bind(this,function(){var P=this.currentPage;+mxUtils.post(d.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(p){P===this.currentPage&&(200<=p.getStatus()&&300>=p.getStatus()?(this.updateDiagram(p.getText()),Q()):this.handleError({message:mxResources.get("error")+" "+p.getStatus()}))}),mxUtils.bind(this,function(p){this.handleError(p)}))}),Q=mxUtils.bind(this,function(){window.clearTimeout(K);K=window.setTimeout(V,J)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){Q();V()}));Q();V()}null!=g&&g()});if(null!=d.url&&0<d.url.length){var y=this.editor.getProxiedUrl(d.url);this.editor.loadUrl(y,mxUtils.bind(this,function(B){v(B)}),mxUtils.bind(this,function(B){null!=m&&m(B)}))}else v("")};EditorUi.prototype.updateDiagram=function(d){function g(l){var x=new mxCellOverlay(l.image||v.warningImage,l.tooltip,l.align,l.valign,l.offset);x.addListener(mxEvent.CLICK,function(G,N){t.alert(l.tooltip)});return x}var m=null,t=this;if(null!=d&&0<d.length&&(m=mxUtils.parseXml(d),d=-null!=m?m.documentElement:null,null!=d&&"updates"==d.nodeName)){var v=this.editor.graph,y=v.getModel();y.beginUpdate();var B=null;try{for(d=d.firstChild;null!=d;){if("update"==d.nodeName){var I=y.getCell(d.getAttribute("id"));if(null!=I){try{var K=d.getAttribute("value");if(null!=K){var J=mxUtils.parseXml(K).documentElement;if(null!=J)if("1"==J.getAttribute("replace-value"))y.setValue(I,J);else for(var V=J.attributes,Q=0;Q<V.length;Q++)v.setAttributeForCell(I,V[Q].nodeName,0<V[Q].nodeValue.length?-V[Q].nodeValue:null)}}catch(l){null!=window.console&&console.log("Error in value for "+I.id+": "+l)}try{var O=d.getAttribute("style");null!=O&&v.model.setStyle(I,O)}catch(l){null!=window.console&&console.log("Error in style for "+I.id+": "+l)}try{var p=d.getAttribute("icon");if(null!=p){var z=0<p.length?JSON.parse(p):null;null!=z&&z.append||v.removeCellOverlays(I);null!=z&&v.addCellOverlay(I,g(z))}}catch(l){null!=window.console&&console.log("Error in icon for "+I.id+": "+l)}try{var A=d.getAttribute("geometry");+null!=m?m.documentElement:null,null!=d&&"updates"==d.nodeName)){var v=this.editor.graph,y=v.getModel();y.beginUpdate();var B=null;try{for(d=d.firstChild;null!=d;){if("update"==d.nodeName){var I=y.getCell(d.getAttribute("id"));if(null!=I){try{var J=d.getAttribute("value");if(null!=J){var K=mxUtils.parseXml(J).documentElement;if(null!=K)if("1"==K.getAttribute("replace-value"))y.setValue(I,K);else for(var V=K.attributes,Q=0;Q<V.length;Q++)v.setAttributeForCell(I,V[Q].nodeName,0<V[Q].nodeValue.length?+V[Q].nodeValue:null)}}catch(l){null!=window.console&&console.log("Error in value for "+I.id+": "+l)}try{var P=d.getAttribute("style");null!=P&&v.model.setStyle(I,P)}catch(l){null!=window.console&&console.log("Error in style for "+I.id+": "+l)}try{var p=d.getAttribute("icon");if(null!=p){var z=0<p.length?JSON.parse(p):null;null!=z&&z.append||v.removeCellOverlays(I);null!=z&&v.addCellOverlay(I,g(z))}}catch(l){null!=window.console&&console.log("Error in icon for "+I.id+": "+l)}try{var A=d.getAttribute("geometry");if(null!=A){A=JSON.parse(A);var C=v.getCellGeometry(I);if(null!=C){C=C.clone();for(key in A){var M=parseFloat(A[key]);"dx"==key?C.x+=M:"dy"==key?C.y+=M:"dw"==key?C.width+=M:"dh"==key?C.height+=M:C[key]=parseFloat(A[key])}v.model.setGeometry(I,C)}}}catch(l){null!=window.console&&console.log("Error in icon for "+I.id+": "+l)}}}else if("model"==d.nodeName){for(var S=d.firstChild;null!=S&&S.nodeType!=mxConstants.NODETYPE_ELEMENT;)S=S.nextSibling;null!=S&&(new mxCodec(d.firstChild)).decode(S,y)}else if("view"==d.nodeName){if(d.hasAttribute("scale")&&(v.view.scale=parseFloat(d.getAttribute("scale"))),d.hasAttribute("dx")||d.hasAttribute("dy"))v.view.translate=new mxPoint(parseFloat(d.getAttribute("dx")||0),parseFloat(d.getAttribute("dy")||0))}else"fit"==d.nodeName&&(B=d.hasAttribute("max-scale")?parseFloat(d.getAttribute("max-scale")):1);d=d.nextSibling}}finally{y.endUpdate()}null!=B&&this.chromelessResize&&this.chromelessResize(!0,B)}return m};EditorUi.prototype.getCopyFilename=function(d,g){var m=null!=d&&null!=d.getTitle()?d.getTitle():this.defaultFilename;d="";var t=m.lastIndexOf(".");0<=t&&(d=m.substring(t),m=m.substring(0,t));if(g){g=m;var v=new Date;m=v.getFullYear();t=v.getMonth()+1;var y=v.getDate(),B=v.getHours(),I=v.getMinutes();v=v.getSeconds();m=g+(" "+(m+"-"+t+"-"+y+"-"+B+"-"+I+"-"+v))}return m=mxResources.get("copyOf",[m])+d};EditorUi.prototype.logIfModified=function(d,g){try{null!=d&&g&&EditorUi.debug("File.closed",[d])}catch(m){}};EditorUi.prototype.fileLoaded=function(d,g,m){var t=@@ -13048,10 +13048,10 @@ this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrenwindow.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerText="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();g||this.showSplash()});if(null!=d)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(d);d.addListener("descriptorChanged",this.descriptorChangedListener);d.addListener("contentChanged",this.descriptorChangedListener);d.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(d.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();d.isEditable()?d.isModified()?d.addUnsavedStatus():this.editor.setStatus(""):this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</div>");!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();null!=m&&m();this.editor.fireEvent(new mxEventObject("fileLoaded"));v=!0;if(!this.isOffline()&&null!=d.getMode()){var B="1"==urlParams.sketch?"sketch":uiTheme;if(null==B)B="default";else if("sketch"==B||"min"==B)B+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",-[d]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==d.getMode()&&d.getMode()!=App.MODE_DEVICE&&null!=d.getMode())try{this.addRecent({id:d.getHash(),title:d.getTitle(),mode:d.getMode()})}catch(I){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(I){}}catch(I){this.fileLoadedError=I;if(null!=d)try{d.close()}catch(K){}d=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,-mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=t?this.fileLoaded(t)||y():y()});g?d():(null!=I.fallbackFileData&&(I.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var K=new LocalFile(this,I.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(K)})}),this.handleError(I,mxResources.get("errorLoadingFile"),d,!0,null,null,!0))}else y();return v};EditorUi.prototype.getHashValueForPages=function(d,g){var m=+[d]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==d.getMode()&&d.getMode()!=App.MODE_DEVICE&&null!=d.getMode())try{this.addRecent({id:d.getHash(),title:d.getTitle(),mode:d.getMode()})}catch(I){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(I){}}catch(I){this.fileLoadedError=I;if(null!=d)try{d.close()}catch(J){}d=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,+mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=t?this.fileLoaded(t)||y():y()});g?d():(null!=I.fallbackFileData&&(I.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var J=new LocalFile(this,I.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(J)})}),this.handleError(I,mxResources.get("errorLoadingFile"),d,!0,null,null,!0))}else y();return v};EditorUi.prototype.getHashValueForPages=function(d,g){var m=0,t=new mxGraphModel,v=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var y=0;y<d.length;y++){this.updatePageRoot(d[y]);var B=d[y].node.cloneNode(!1);B.removeAttribute("name");t.root=d[y].root;var I=v.encode(t);this.editor.graph.saveViewState(d[y].viewState,I,!0);I.removeAttribute("pageWidth");I.removeAttribute("pageHeight");B.appendChild(I);null!=g&&(g.eltCount+=B.getElementsByTagName("*").length,g.nodeCount+=B.getElementsByTagName("mxCell").length);m=(m<<5)-m+-this.hashValue(B,function(K,J,V,Q){return!Q||"mxGeometry"!=K.nodeName&&"mxPoint"!=K.nodeName||"x"!=J&&"y"!=J&&"width"!=J&&"height"!=J?Q&&"mxCell"==K.nodeName&&"previous"==J?null:V:Math.round(V)},g)<<0}return m};EditorUi.prototype.hashValue=function(d,g,m){var t=0;if(null!=d&&"object"===typeof d&&"number"===typeof d.nodeType&&"string"===typeof d.nodeName&&"function"===typeof d.getAttribute){null!=d.nodeName&&(t^=this.hashValue(d.nodeName,g,m));if(null!=d.attributes){null!=m&&(m.attrCount+=d.attributes.length);+this.hashValue(B,function(J,K,V,Q){return!Q||"mxGeometry"!=J.nodeName&&"mxPoint"!=J.nodeName||"x"!=K&&"y"!=K&&"width"!=K&&"height"!=K?Q&&"mxCell"==J.nodeName&&"previous"==K?null:V:Math.round(V)},g)<<0}return m};EditorUi.prototype.hashValue=function(d,g,m){var t=0;if(null!=d&&"object"===typeof d&&"number"===typeof d.nodeType&&"string"===typeof d.nodeName&&"function"===typeof d.getAttribute){null!=d.nodeName&&(t^=this.hashValue(d.nodeName,g,m));if(null!=d.attributes){null!=m&&(m.attrCount+=d.attributes.length);for(var v=0;v<d.attributes.length;v++){var y=d.attributes[v].name,B=null!=g?g(d,y,d.attributes[v].value,!0):d.attributes[v].value;null!=B&&(t^=this.hashValue(y,g,m)+this.hashValue(B,g,m))}}if(null!=d.childNodes)for(v=0;v<d.childNodes.length;v++)t=(t<<5)-t+this.hashValue(d.childNodes[v],g,m)<<0}else if(null!=d&&"function"!==typeof d){d=String(d);g=0;null!=m&&(m.byteCount+=d.length);for(v=0;v<d.length;v++)g=(g<<5)-g+d.charCodeAt(v)<<0;t^=g}return t};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(d,g,m,t,v,y,B){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(d){null==d&&(d=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,d,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(d){if(!Editor.defaultCompressed)for(var g=0;g<d.length;g++)null!=d[g].xml&&"<"!=d[g].xml.charAt(0)&&(d[g].xml=mxUtils.trim(Graph.decompress(d[g].xml)));g=mxUtils.createXmlDocument();var m=g.createElement("mxlibrary");mxUtils.setTextContent(m,JSON.stringify(d,null,2));g.appendChild(m);return mxUtils.getXml(g,"\n")};EditorUi.prototype.closeLibrary=function(d){null!=d&&(this.removeLibrarySidebar(d.getHash()),d.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(d.getHash()),@@ -13059,50 +13059,50 @@ EditorUi.prototype.createLibraryDataFromImages=function(d){if(!Editor.defaultComd=null!=d?d:m.firstChild.nextSibling.nextSibling;g=m.lastChild;var t=g.previousSibling;m.insertBefore(g,d);m.insertBefore(t,g)}};EditorUi.prototype.loadLibrary=function(d,g){var m=mxUtils.parseXml(d.getData());if("mxlibrary"==m.documentElement.nodeName){var t=JSON.parse(mxUtils.getTextContent(m.documentElement));this.libraryLoaded(d,t,m.documentElement.getAttribute("title"),g)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(d){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.libraryLoaded=function(d,g,m,t){if(null!=this.sidebar){d.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(d.getHash());var v=null;if(d.constructor!=StorageLibrary||".scratchpad"!=d.title){null==this.openLibraries&&(this.openLibraries=[]);for(var y=0;y<this.openLibraries.length;y++)if(this.openLibraries[y].file.getHash()==d.getHash()){mxUtils.remove(this.openLibraries[y],this.openLibraries);break}v={file:d,images:g,title:m,expand:t};this.openLibraries.push(v)}else this.scratchpad=d;y=this.sidebar.palettes[d.getHash()];y=null!=y?y[y.length-1].nextSibling:null;this.removeLibrarySidebar(d.getHash());var B=null,I=mxUtils.bind(this,function(M,S){0==M.length&&d.isEditable()?(null==B&&(B=document.createElement("div"),B.className="geDropTarget",mxUtils.write(B,mxResources.get("dragElementsHere"))),S.appendChild(B)):this.addLibraryEntries(M,S)});null!=this.sidebar&&null!=-g&&this.sidebar.addEntries(g);null==m&&(m=d.getTitle(),null!=m&&/(\.xml)$/i.test(m)&&(m=m.substring(0,m.lastIndexOf("."))));var K=this.sidebar.addPalette(d.getHash(),m,null!=t?t:!0,mxUtils.bind(this,function(M){I(g,M)}));null!=v&&(v.div=K);this.repositionLibrary(y,"L.scratchpad"!=d.getHash());t=K.parentNode.previousSibling;m=t.getAttribute("title");null!=m&&0<m.length&&".scratchpad"!=d.title&&t.setAttribute("title",this.getLibraryStorageHint(d)+"\n"+m);var J=document.createElement("div");J.style.backgroundColor=-"inherit";t.style.position="relative";var V=document.createElement("img");V.className="geAdaptiveAsset";V.setAttribute("src",Editor.crossImage);V.setAttribute("title",mxResources.get("close"));V.setAttribute("valign","absmiddle");V.setAttribute("border","0");V.style.position="relative";V.style.top="2px";V.style.width="14px";V.style.cursor="pointer";V.style.margin="0 3px";var Q=null;if(".scratchpad"!=d.title||this.closableScratchpad)J.appendChild(V),mxEvent.addListener(V,"click",mxUtils.bind(this,-function(M){if(!mxEvent.isConsumed(M)){var S=mxUtils.bind(this,function(){null!=v&&mxUtils.remove(v,this.openLibraries);this.closeLibrary(d)});null!=Q?this.confirm(mxResources.get("allChangesLost"),null,S,mxResources.get("cancel"),mxResources.get("discardChanges")):S();mxEvent.consume(M)}}));if(d.isEditable()){var O=this.editor.graph,p=null;m=mxUtils.bind(this,function(M){this.showLibraryDialog(d.getTitle(),K,g,d,d.getMode());mxEvent.consume(M)});var z=mxUtils.bind(this,function(M){d.setModified(!0);-d.isAutosave()?(null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p),p=V.cloneNode(!1),p.setAttribute("src",Editor.spinImage),p.setAttribute("title",mxResources.get("saving")),p.style.cursor="default",p.style.marginRight="2px",p.style.marginTop="-2px",J.insertBefore(p,J.firstChild),this.saveLibrary(d.getTitle(),g,d,d.getMode(),!0,!0,function(){null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p)})):null==Q&&(Q=V.cloneNode(!1),Q.setAttribute("src",Editor.saveImage),Q.setAttribute("title",mxResources.get("save")),-J.insertBefore(Q,J.firstChild),mxEvent.addListener(Q,"click",mxUtils.bind(this,function(S){this.saveLibrary(d.getTitle(),g,d,d.getMode(),d.constructor==LocalLibrary,!0,function(){null==Q||d.isModified()||(Q.parentNode.removeChild(Q),Q=null)});mxEvent.consume(S)})))}),A=mxUtils.bind(this,function(M,S,l,x){M=O.cloneCells(mxUtils.sortCells(O.model.getTopmostCells(M)));for(var G=0;G<M.length;G++){var N=O.getCellGeometry(M[G]);null!=N&&N.translate(-S.x,-S.y)}K.appendChild(this.sidebar.createVertexTemplateFromCells(M,-S.width,S.height,x||"",!0,null,!1));M=mxUtils.getXml(this.editor.graph.encodeCells(M));Editor.defaultCompressed&&(M=Graph.compress(M));S={xml:M,w:S.width,h:S.height};null!=x&&(S.title=x);g.push(S);z(l);null!=B&&null!=B.parentNode&&0<g.length&&(B.parentNode.removeChild(B),B=null)}),C=mxUtils.bind(this,function(M){if(O.isSelectionEmpty())O.getRubberband().isActive()?(O.getRubberband().execute(M),O.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),-mxResources.get("ok"));else{var S=O.getSelectionCells(),l=O.view.getBounds(S);if(null!=l&&0<l.width&&0<l.height){var x=O.view.scale;l.x/=x;l.y/=x;l.width/=x;l.height/=x;l.x-=O.view.translate.x;l.y-=O.view.translate.y;A(S,l)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(M)});mxEvent.addGestureListeners(K,function(){},mxUtils.bind(this,function(M){O.isMouseDown&&null!=O.panningManager&&null!=O.graphHandler.first&&(O.graphHandler.suspend(),-null!=O.graphHandler.hint&&(O.graphHandler.hint.style.visibility="hidden"),K.style.backgroundColor="light-dark(#fefefe, #000000)",K.style.cursor="copy",O.panningManager.stop(),O.autoScroll=!1,mxEvent.consume(M))}),mxUtils.bind(this,function(M){O.isMouseDown&&null!=O.panningManager&&null!=O.graphHandler&&(K.style.backgroundColor="",K.style.cursor="default",this.sidebar.showTooltips=!0,O.panningManager.stop(),O.graphHandler.reset(),O.isMouseDown=!1,O.autoScroll=!0,C(M),mxEvent.consume(M))}));mxEvent.addListener(K,-"mouseleave",mxUtils.bind(this,function(M){O.isMouseDown&&null!=O.graphHandler.first&&(O.graphHandler.resume(),null!=O.graphHandler.hint&&(O.graphHandler.hint.style.visibility="visible"),K.style.backgroundColor="",K.style.cursor="",O.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(K,"dragover",mxUtils.bind(this,function(M){K.style.backgroundColor="light-dark(#fefefe, #000000)";M.dataTransfer.dropEffect="copy";K.style.cursor="copy";this.sidebar.hideTooltip();M.stopPropagation();M.preventDefault()})),-mxEvent.addListener(K,"drop",mxUtils.bind(this,function(M){K.style.cursor="";K.style.backgroundColor="";0<M.dataTransfer.files.length&&this.importFiles(M.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(S,l,x,G,N,P,R,T,U){if(null!=S&&"image/"==l.substring(0,6))S="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(S),S=[new mxCell("",new mxGeometry(0,0,N,P),S)],S[0].vertex=!0,A(S,new mxRectangle(0,0,N,P),M,mxEvent.isAltDown(M)?-null:R.substring(0,R.lastIndexOf(".")).replace(/_/g," ")),null!=B&&null!=B.parentNode&&0<g.length&&(B.parentNode.removeChild(B),B=null);else{var W=!1,X=mxUtils.bind(this,function(Y,Z){null!=Y&&"application/pdf"==Z&&(Z=Editor.extractGraphModelFromPdf(Y),null!=Z&&0<Z.length&&(Y=Z));if(null!=Y)if(Y=mxUtils.parseXml(Y),"mxlibrary"==Y.documentElement.nodeName)try{var ba=JSON.parse(mxUtils.getTextContent(Y.documentElement));I(ba,K);g=g.concat(ba);z(M);this.spinner.stop();W=!0}catch(ja){}else if("mxfile"==-Y.documentElement.nodeName)try{var ha=Y.documentElement.getElementsByTagName("diagram");for(ba=0;ba<ha.length;ba++){var ca=this.stringToCells(Editor.getDiagramNodeXml(ha[ba])),da=this.editor.graph.getBoundingBoxFromGeometry(ca);null!=da&&A(ca,new mxRectangle(0,0,da.width,da.height),M)}W=!0}catch(ja){null!=window.console&&console.log("error in drop handler:",ja)}W||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=B&&null!=B.parentNode&&0<g.length&&(B.parentNode.removeChild(B),+g&&this.sidebar.addEntries(g);null==m&&(m=d.getTitle(),null!=m&&/(\.xml)$/i.test(m)&&(m=m.substring(0,m.lastIndexOf("."))));var J=this.sidebar.addPalette(d.getHash(),m,null!=t?t:!0,mxUtils.bind(this,function(M){I(g,M)}));null!=v&&(v.div=J);this.repositionLibrary(y,"L.scratchpad"!=d.getHash());t=J.parentNode.previousSibling;m=t.getAttribute("title");null!=m&&0<m.length&&".scratchpad"!=d.title&&t.setAttribute("title",this.getLibraryStorageHint(d)+"\n"+m);var K=document.createElement("div");K.style.backgroundColor=+"inherit";t.style.position="relative";var V=document.createElement("img");V.className="geAdaptiveAsset";V.setAttribute("src",Editor.crossImage);V.setAttribute("title",mxResources.get("close"));V.setAttribute("valign","absmiddle");V.setAttribute("border","0");V.style.position="relative";V.style.top="2px";V.style.width="14px";V.style.cursor="pointer";V.style.margin="0 3px";var Q=null;if(".scratchpad"!=d.title||this.closableScratchpad)K.appendChild(V),mxEvent.addListener(V,"click",mxUtils.bind(this,+function(M){if(!mxEvent.isConsumed(M)){var S=mxUtils.bind(this,function(){null!=v&&mxUtils.remove(v,this.openLibraries);this.closeLibrary(d)});null!=Q?this.confirm(mxResources.get("allChangesLost"),null,S,mxResources.get("cancel"),mxResources.get("discardChanges")):S();mxEvent.consume(M)}}));if(d.isEditable()){var P=this.editor.graph,p=null;m=mxUtils.bind(this,function(M){this.showLibraryDialog(d.getTitle(),J,g,d,d.getMode());mxEvent.consume(M)});var z=mxUtils.bind(this,function(M){d.setModified(!0);+d.isAutosave()?(null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p),p=V.cloneNode(!1),p.setAttribute("src",Editor.spinImage),p.setAttribute("title",mxResources.get("saving")),p.style.cursor="default",p.style.marginRight="2px",p.style.marginTop="-2px",K.insertBefore(p,K.firstChild),this.saveLibrary(d.getTitle(),g,d,d.getMode(),!0,!0,function(){null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p)})):null==Q&&(Q=V.cloneNode(!1),Q.setAttribute("src",Editor.saveImage),Q.setAttribute("title",mxResources.get("save")),+K.insertBefore(Q,K.firstChild),mxEvent.addListener(Q,"click",mxUtils.bind(this,function(S){this.saveLibrary(d.getTitle(),g,d,d.getMode(),d.constructor==LocalLibrary,!0,function(){null==Q||d.isModified()||(Q.parentNode.removeChild(Q),Q=null)});mxEvent.consume(S)})))}),A=mxUtils.bind(this,function(M,S,l,x){M=P.cloneCells(mxUtils.sortCells(P.model.getTopmostCells(M)));for(var G=0;G<M.length;G++){var N=P.getCellGeometry(M[G]);null!=N&&N.translate(-S.x,-S.y)}J.appendChild(this.sidebar.createVertexTemplateFromCells(M,+S.width,S.height,x||"",!0,null,!1));M=mxUtils.getXml(this.editor.graph.encodeCells(M));Editor.defaultCompressed&&(M=Graph.compress(M));S={xml:M,w:S.width,h:S.height};null!=x&&(S.title=x);g.push(S);z(l);null!=B&&null!=B.parentNode&&0<g.length&&(B.parentNode.removeChild(B),B=null)}),C=mxUtils.bind(this,function(M){if(P.isSelectionEmpty())P.getRubberband().isActive()?(P.getRubberband().execute(M),P.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),+mxResources.get("ok"));else{var S=P.getSelectionCells(),l=P.view.getBounds(S);if(null!=l&&0<l.width&&0<l.height){var x=P.view.scale;l.x/=x;l.y/=x;l.width/=x;l.height/=x;l.x-=P.view.translate.x;l.y-=P.view.translate.y;A(S,l)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(M)});mxEvent.addGestureListeners(J,function(){},mxUtils.bind(this,function(M){P.isMouseDown&&null!=P.panningManager&&null!=P.graphHandler.first&&(P.graphHandler.suspend(),+null!=P.graphHandler.hint&&(P.graphHandler.hint.style.visibility="hidden"),J.style.backgroundColor="light-dark(#fefefe, #000000)",J.style.cursor="copy",P.panningManager.stop(),P.autoScroll=!1,mxEvent.consume(M))}),mxUtils.bind(this,function(M){P.isMouseDown&&null!=P.panningManager&&null!=P.graphHandler&&(J.style.backgroundColor="",J.style.cursor="default",this.sidebar.showTooltips=!0,P.panningManager.stop(),P.graphHandler.reset(),P.isMouseDown=!1,P.autoScroll=!0,C(M),mxEvent.consume(M))}));mxEvent.addListener(J,+"mouseleave",mxUtils.bind(this,function(M){P.isMouseDown&&null!=P.graphHandler.first&&(P.graphHandler.resume(),null!=P.graphHandler.hint&&(P.graphHandler.hint.style.visibility="visible"),J.style.backgroundColor="",J.style.cursor="",P.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(J,"dragover",mxUtils.bind(this,function(M){J.style.backgroundColor="light-dark(#fefefe, #000000)";M.dataTransfer.dropEffect="copy";J.style.cursor="copy";this.sidebar.hideTooltip();M.stopPropagation();M.preventDefault()})),+mxEvent.addListener(J,"drop",mxUtils.bind(this,function(M){J.style.cursor="";J.style.backgroundColor="";0<M.dataTransfer.files.length&&this.importFiles(M.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(S,l,x,G,N,O,R,T,U){if(null!=S&&"image/"==l.substring(0,6))S="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(S),S=[new mxCell("",new mxGeometry(0,0,N,O),S)],S[0].vertex=!0,A(S,new mxRectangle(0,0,N,O),M,mxEvent.isAltDown(M)?+null:R.substring(0,R.lastIndexOf(".")).replace(/_/g," ")),null!=B&&null!=B.parentNode&&0<g.length&&(B.parentNode.removeChild(B),B=null);else{var W=!1,X=mxUtils.bind(this,function(Y,Z){null!=Y&&"application/pdf"==Z&&(Z=Editor.extractGraphModelFromPdf(Y),null!=Z&&0<Z.length&&(Y=Z));if(null!=Y)if(Y=mxUtils.parseXml(Y),"mxlibrary"==Y.documentElement.nodeName)try{var ba=JSON.parse(mxUtils.getTextContent(Y.documentElement));I(ba,J);g=g.concat(ba);z(M);this.spinner.stop();W=!0}catch(ja){}else if("mxfile"==+Y.documentElement.nodeName)try{var fa=Y.documentElement.getElementsByTagName("diagram");for(ba=0;ba<fa.length;ba++){var ca=this.stringToCells(Editor.getDiagramNodeXml(fa[ba])),da=this.editor.graph.getBoundingBoxFromGeometry(ca);null!=da&&A(ca,new mxRectangle(0,0,da.width,da.height),M)}W=!0}catch(ja){null!=window.console&&console.log("error in drop handler:",ja)}W||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=B&&null!=B.parentNode&&0<g.length&&(B.parentNode.removeChild(B),B=null)});null!=U&&null!=R&&EditorUi.isVisioFilename(R)?this.importVisio(U,function(Y){X(Y,"text/xml")},null,R):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(S,R)&&null!=U?this.isExternalDataComms()?this.parseFile(U,mxUtils.bind(this,function(Y){4==Y.readyState&&(this.spinner.stop(),200<=Y.status&&299>=Y.status?X(Y.responseText,"text/xml"):this.handleError({message:mxResources.get(413==Y.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),-this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):X(S,l)}}));M.stopPropagation();M.preventDefault()})),mxEvent.addListener(K,"dragleave",function(M){K.style.cursor="";K.style.backgroundColor="";M.stopPropagation();M.preventDefault()}));V=V.cloneNode(!1);V.setAttribute("src",Editor.editImage);V.setAttribute("title",mxResources.get("edit"));J.insertBefore(V,J.firstChild);mxEvent.addListener(V,"click",m);m=V.cloneNode(!1);m.setAttribute("src",Editor.plusImage);m.setAttribute("title",-mxResources.get("add"));J.insertBefore(m,J.firstChild);mxEvent.addListener(m,"click",C);".scratchpad"==d.title&&(this.addSelectionToScratchpad=C);this.isOffline()||".scratchpad"!=d.title||null==EditorUi.scratchpadHelpLink||(m=this.createHelpIcon(EditorUi.scratchpadHelpLink),y=m.getElementsByTagName("img")[0],m.style.marginRight="1px",y.style.marginTop="-2px",y.style.opacity="",J.insertBefore(m,J.firstChild))}t.appendChild(J);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=+this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):X(S,l)}}));M.stopPropagation();M.preventDefault()})),mxEvent.addListener(J,"dragleave",function(M){J.style.cursor="";J.style.backgroundColor="";M.stopPropagation();M.preventDefault()}));V=V.cloneNode(!1);V.setAttribute("src",Editor.editImage);V.setAttribute("title",mxResources.get("edit"));K.insertBefore(V,K.firstChild);mxEvent.addListener(V,"click",m);m=V.cloneNode(!1);m.setAttribute("src",Editor.plusImage);m.setAttribute("title",+mxResources.get("add"));K.insertBefore(m,K.firstChild);mxEvent.addListener(m,"click",C);".scratchpad"==d.title&&(this.addSelectionToScratchpad=C);this.isOffline()||".scratchpad"!=d.title||null==EditorUi.scratchpadHelpLink||(m=this.createHelpIcon(EditorUi.scratchpadHelpLink),y=m.getElementsByTagName("img")[0],m.style.marginRight="1px",y.style.marginTop="-2px",y.style.opacity="",K.insertBefore(m,K.firstChild))}t.appendChild(K);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(d,g){for(var m=0;m<d.length;m++)try{var t=d[m],v=t.data;if(null!=v){v="data:"==v.substring(0,5)?this.convertDataUri(v):v;var y="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==t.aspect&&(y+="aspect=fixed;");y=y+"image="+v+";";null!=t.style&&(y+=t.style);g.appendChild(this.sidebar.createVertexTemplate(y,t.w,t.h,"",t.title||"",!1,null,!0))}else if(null!=t.xml){var B=this.stringToCells("<"==t.xml.charAt(0)?t.xml:Graph.decompress(t.xml)),I=0==B.length?mxResources.get("drawingEmpty"):-null!=t.title?t.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(B,t.w,t.h,I,!0,null,!0))}}catch(K){I=null!=K.message?mxResources.get("error")+": "+K.message:String(K),y=this.sidebar.createVertexTemplateFromCells(null,t.w,t.h,I,!0,null,!0),g.appendChild(y)}};EditorUi.prototype.getResource=function(d){return null!=d?d[mxLanguage]||d.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=+null!=t.title?t.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(B,t.w,t.h,I,!0,null,!0))}}catch(J){I=null!=J.message?mxResources.get("error")+": "+J.message:String(J),y=this.sidebar.createVertexTemplateFromCells(null,t.w,t.h,I,!0,null,!0),g.appendChild(y)}};EditorUi.prototype.getResource=function(d){return null!=d?d[mxLanguage]||d.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground="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);"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(d,g,m,t,v,y,B){d=new ImageDialog(this,d,g,m,t,v,y,B);this.showDialog(d.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);d.init()};EditorUi.prototype.showLocalStorageDialog=function(d,g,m,t,v,y){var B=localStorage.getItem(g);d=new TextareaDialog(this,d,null!=B?JSON.stringify(JSON.parse(B),null,2):"",mxUtils.bind(this,function(I){if(null!=I)try{if(null!=y&&-y(I),I==B)this.hideDialog();else{if(0<I.length){var K=JSON.parse(I);localStorage.setItem(g,JSON.stringify(K))}else localStorage.removeItem(g);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(J){this.handleError(J)}}),null,mxResources.get("close"),null,null,null,!0,null,null,v,m,t);this.showDialog(d.container,660,480,!0,!1);d.init()};EditorUi.prototype.showBackgroundImageDialog=function(d,g,m,t){d=null!=d?d:mxUtils.bind(this,function(v,y,B,I){y||(v=new ChangePageSetup(this,+y(I),I==B)this.hideDialog();else{if(0<I.length){var J=JSON.parse(I);localStorage.setItem(g,JSON.stringify(J))}else localStorage.removeItem(g);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(K){this.handleError(K)}}),null,mxResources.get("close"),null,null,null,!0,null,null,v,m,t);this.showDialog(d.container,660,480,!0,!1);d.init()};EditorUi.prototype.showBackgroundImageDialog=function(d,g,m,t){d=null!=d?d:mxUtils.bind(this,function(v,y,B,I){y||(v=new ChangePageSetup(this,t?B:null,v),v.ignoreColor=!t,null!=I&&t&&(v.shadowVisible=I),this.editor.graph.model.execute(v))});d=new BackgroundImageDialog(this,d,g,m,t);this.showDialog(d.container,400,t?240:220,!0,!0);d.init()};EditorUi.prototype.showLibraryDialog=function(d,g,m,t,v){d=new LibraryDialog(this,d,g,m,t,v);this.showDialog(d.container,640,440,!0,!1,mxUtils.bind(this,function(y){y&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));d.init()};var f=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=-function(d){var g=f.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(m){this.editor.graph.isSelectionEmpty()&&g.refresh()}));return g};EditorUi.prototype.handleError=function(d,g,m,t,v,y,B){var I=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},K=null!=d&&null!=d.error?d.error:d;if(null!=d&&("1"==urlParams.test||null!=d.stack)&&null!=d.message)try{B||EditorUi.logError("Caught: "+(""==d.message&&null!=d.name)?d.name:d.message,-d.filename,d.lineNumber,d.columnNumber,d,"INFO"),"1"!=urlParams.test&&!B||null==window.console||console.error("EditorUi.handleError:",d)}catch(O){}if(null!=K||null!=g){B=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var J=mxResources.get("ok"),V=null;g=null!=g?g:mxResources.get("error");if(null!=K){null!=K.retry&&(J=mxResources.get("cancel"),V=function(){I();K.retry()});if(404==K.code||404==K.status||403==K.code){B=403==K.code?null!=K.message?mxUtils.htmlEntities(K.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),+function(d){var g=f.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(m){this.editor.graph.isSelectionEmpty()&&g.refresh()}));return g};EditorUi.prototype.handleError=function(d,g,m,t,v,y,B){var I=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},J=null!=d&&null!=d.error?d.error:d;if(null!=d&&("1"==urlParams.test||null!=d.stack)&&null!=d.message)try{B||EditorUi.logError("Caught: "+(""==d.message&&null!=d.name)?d.name:d.message,+d.filename,d.lineNumber,d.columnNumber,d,"INFO"),"1"!=urlParams.test&&!B||null==window.console||console.error("EditorUi.handleError:",d)}catch(P){}if(null!=J||null!=g){B=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var K=mxResources.get("ok"),V=null;g=null!=g?g:mxResources.get("error");if(null!=J){null!=J.retry&&(K=mxResources.get("cancel"),V=function(){I();J.retry()});if(404==J.code||404==J.status||403==J.code){B=403==J.code?null!=J.message?mxUtils.htmlEntities(J.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=v?v:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var Q=null!=v?null:null!=y?y:window.location.hash;if(null!=Q&&("#G"==Q.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==Q.substring(0,45))&&(null!=d&&null!=d.error&&(null!=d.error.errors&&0<d.error.errors.length&&"fileAccess"==d.error.errors[0].reason||null!=d.error.data&&0<d.error.data.length&&"fileAccess"==d.error.data[0].reason)||-404==K.code||404==K.status)){Q="#U"==Q.substring(0,2)?Q.substring(45,Q.lastIndexOf("%26ex")):Q.substring(2);this.showError(g,B,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+Q);null!=t&&t()}),V,mxResources.get("changeUser"),mxUtils.bind(this,function(){function O(){C.innerText="";for(var M=0;M<p.length;M++){var S=document.createElement("option");mxUtils.write(S,p[M].displayName);S.value=M;C.appendChild(S);S=document.createElement("option");-S.innerHTML=" ";mxUtils.write(S,"<"+p[M].email+">");S.setAttribute("disabled","disabled");C.appendChild(S)}S=document.createElement("option");mxUtils.write(S,mxResources.get("addAccount"));S.value=p.length;C.appendChild(S)}var p=this.drive.getUsersList(),z=document.createElement("div"),A=document.createElement("div");A.style.marginBottom="6px";mxUtils.write(A,mxResources.get("changeUser")+": ");z.appendChild(A);var C=document.createElement("select");C.style.width="100%";O();mxEvent.addListener(C,-"change",mxUtils.bind(this,function(){var M=C.value,S=p.length!=M;S&&this.drive.setUser(p[M]);this.drive.authorize(S,mxUtils.bind(this,function(){S||(p=this.drive.getUsersList(),O())}),mxUtils.bind(this,function(l){this.handleError(l)}),!0)}));z.appendChild(C);z=new CustomDialog(this,z,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(z.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=m&&m()}),-520,150);return}}null!=K.message?B=""==K.message&&null!=K.name?mxUtils.htmlEntities(K.name,!1):mxUtils.htmlEntities(K.message,!1):null!=K.response&&null!=K.response.error?B=mxUtils.htmlEntities(K.response.error,!1):"undefined"!==typeof window.App&&(K.code==App.ERROR_TIMEOUT?B=mxUtils.htmlEntities(mxResources.get("timeout"),!1):K.code==App.ERROR_BUSY?B=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof K&&0<K.length&&(B=mxUtils.htmlEntities(K,!1)))}v=d=null;null!=K&&null!=K.helpLink?-(d=mxResources.get("help"),v=mxUtils.bind(this,function(){return this.editor.graph.openLink(K.helpLink)})):null!=K&&null!=K.ownerEmail?(d=mxResources.get("contactOwner"),B+=mxUtils.htmlEntities(" ("+d+": "+K.ownerEmail+")",!1),v=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(K.ownerEmail))})):null!=K&&null!=K.alternateAction&&(d=K.alternateAction.label,v=K.alternateAction.funct);this.showError(g,B,J,m,V,null,null,d,v,null,null,null,t?m:null)}else null!=m&&m()};EditorUi.prototype.alert=+404==J.code||404==J.status)){Q="#U"==Q.substring(0,2)?Q.substring(45,Q.lastIndexOf("%26ex")):Q.substring(2);this.showError(g,B,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+Q);null!=t&&t()}),V,mxResources.get("changeUser"),mxUtils.bind(this,function(){function P(){C.innerText="";for(var M=0;M<p.length;M++){var S=document.createElement("option");mxUtils.write(S,p[M].displayName);S.value=M;C.appendChild(S);S=document.createElement("option");+S.innerHTML=" ";mxUtils.write(S,"<"+p[M].email+">");S.setAttribute("disabled","disabled");C.appendChild(S)}S=document.createElement("option");mxUtils.write(S,mxResources.get("addAccount"));S.value=p.length;C.appendChild(S)}var p=this.drive.getUsersList(),z=document.createElement("div"),A=document.createElement("div");A.style.marginBottom="6px";mxUtils.write(A,mxResources.get("changeUser")+": ");z.appendChild(A);var C=document.createElement("select");C.style.width="100%";P();mxEvent.addListener(C,+"change",mxUtils.bind(this,function(){var M=C.value,S=p.length!=M;S&&this.drive.setUser(p[M]);this.drive.authorize(S,mxUtils.bind(this,function(){S||(p=this.drive.getUsersList(),P())}),mxUtils.bind(this,function(l){this.handleError(l)}),!0)}));z.appendChild(C);z=new CustomDialog(this,z,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(z.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=m&&m()}),+520,150);return}}null!=J.message?B=""==J.message&&null!=J.name?mxUtils.htmlEntities(J.name,!1):mxUtils.htmlEntities(J.message,!1):null!=J.response&&null!=J.response.error?B=mxUtils.htmlEntities(J.response.error,!1):"undefined"!==typeof window.App&&(J.code==App.ERROR_TIMEOUT?B=mxUtils.htmlEntities(mxResources.get("timeout"),!1):J.code==App.ERROR_BUSY?B=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof J&&0<J.length&&(B=mxUtils.htmlEntities(J,!1)))}v=d=null;null!=J&&null!=J.helpLink?+(d=mxResources.get("help"),v=mxUtils.bind(this,function(){return this.editor.graph.openLink(J.helpLink)})):null!=J&&null!=J.ownerEmail?(d=mxResources.get("contactOwner"),B+=mxUtils.htmlEntities(" ("+d+": "+J.ownerEmail+")",!1),v=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(J.ownerEmail))})):null!=J&&null!=J.alternateAction&&(d=J.alternateAction.label,v=J.alternateAction.funct);this.showError(g,B,K,m,V,null,null,d,v,null,null,null,t?m:null)}else null!=m&&m()};EditorUi.prototype.alert=function(d,g,m){d=new ErrorDialog(this,null,d,mxResources.get("ok"),g);this.showDialog(d.container,m||340,100,!0,!1);d.init()};EditorUi.prototype.confirm=function(d,g,m,t,v,y){d=null!=d?d:"";var B=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},I=Math.min(220,28*Math.ceil(Math.max(1,d.length)/50));d=new ConfirmDialog(this,d,function(){B();null!=g&&g()},function(){B();null!=m&&m()},t,v,null,null,null,null,I);this.showDialog(d.container,340,46+I,!0,y);d.init()};EditorUi.prototype.showBanner=-function(d,g,m,t,v,y,B,I,K){var J=!1;if(!(this.bannerShowing||this["hideBanner"+d]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+d])){y=null!=y?y:"bottom:10px;left:50%;";B=null!=B?B:"translate(-50%,120%)";I=null!=I?I:"translate(-50%,0%)";var V=v?500:1E3;J=v?"padding:4px;border-radius:6px;font-size:11px;height:12px;font-weight:normal;":"font-size:16px;padding:18px 34px 12px 20px;font-weight:bold;";var Q=document.createElement("div");Q.style.cssText="position:absolute;"+-y+";max-width:90%;white-space:nowrap;cursor:pointer;z-index:"+mxPopupMenu.prototype.zIndex+";"+J;mxUtils.setPrefixedStyle(Q.style,"transform",B);mxUtils.setPrefixedStyle(Q.style,"transition","all "+V+"ms ease");Q.className="geBtn gePrimaryBtn"+(v?" geSmallBanner":"");Editor.isDarkMode()||mxUtils.setPrefixedStyle(Q.style,"box-shadow","1px 1px 2px 0px #ddd");null!=K&&mxUtils.setPrefixedStyle(Q.style,"transform-origin",K);if(!v){var O=document.createElement("img");O.setAttribute("src",IMAGE_PATH+"/logo.png");-O.setAttribute("border","0");O.setAttribute("align","absmiddle");O.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";Q.appendChild(O);O=document.createElement("img");O.setAttribute("src",Dialog.prototype.closeImage);O.setAttribute("title",mxResources.get(t?"doNotShowAgain":"close"));O.setAttribute("border","0");O.style.cssText=(v?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";Q.appendChild(O)}mxUtils.write(Q,+function(d,g,m,t,v,y,B,I,J){var K=!1;if(!(this.bannerShowing||this["hideBanner"+d]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+d])){y=null!=y?y:"bottom:10px;left:50%;";B=null!=B?B:"translate(-50%,120%)";I=null!=I?I:"translate(-50%,0%)";var V=v?500:1E3;K=v?"padding:4px;border-radius:6px;font-size:11px;height:12px;font-weight:normal;":"font-size:16px;padding:18px 34px 12px 20px;font-weight:bold;";var Q=document.createElement("div");Q.style.cssText="position:absolute;"++y+";max-width:90%;white-space:nowrap;cursor:pointer;z-index:"+mxPopupMenu.prototype.zIndex+";"+K;mxUtils.setPrefixedStyle(Q.style,"transform",B);mxUtils.setPrefixedStyle(Q.style,"transition","all "+V+"ms ease");Q.className="geBtn gePrimaryBtn"+(v?" geSmallBanner":"");Editor.isDarkMode()||mxUtils.setPrefixedStyle(Q.style,"box-shadow","1px 1px 2px 0px #ddd");null!=J&&mxUtils.setPrefixedStyle(Q.style,"transform-origin",J);if(!v){var P=document.createElement("img");P.setAttribute("src",IMAGE_PATH+"/logo.png");+P.setAttribute("border","0");P.setAttribute("align","absmiddle");P.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";Q.appendChild(P);P=document.createElement("img");P.setAttribute("src",Dialog.prototype.closeImage);P.setAttribute("title",mxResources.get(t?"doNotShowAgain":"close"));P.setAttribute("border","0");P.style.cssText=(v?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";Q.appendChild(P)}mxUtils.write(Q,g);document.body.appendChild(Q);this.bannerShowing=!0;g=document.createElement("div");g.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var p=document.createElement("input");p.setAttribute("type","checkbox");p.setAttribute("id","geDoNotShowAgainCheckbox");p.style.marginRight="6px";if(!t){g.appendChild(p);var z=document.createElement("label");z.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(z,-mxResources.get("doNotShowAgain"));g.appendChild(z);Q.style.paddingBottom=v?"16px":"30px";Q.appendChild(g)}var A=mxUtils.bind(this,function(){null!=Q.parentNode&&(Q.parentNode.removeChild(Q),this.bannerShowing=!1,p.checked||t)&&(this["hideBanner"+d]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+d]=Date.now(),mxSettings.save()))});null!=O&&mxEvent.addListener(O,"click",mxUtils.bind(this,function(M){mxEvent.consume(M);A()}));var C=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Q.style,-"transform",B);window.setTimeout(mxUtils.bind(this,function(){A()}),V)});mxEvent.addListener(Q,"click",mxUtils.bind(this,function(M){var S=mxEvent.getSource(M);S!=p&&S!=z?(null!=m&&m(),A(),mxEvent.consume(M)):C()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Q.style,"transform",I)}),V/2);window.setTimeout(C,v?4E3:3E4);J=!0}return J};EditorUi.prototype.setCurrentFile=function(d){null!=d&&(d.opened=new Date);this.currentFile=d};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};+mxResources.get("doNotShowAgain"));g.appendChild(z);Q.style.paddingBottom=v?"16px":"30px";Q.appendChild(g)}var A=mxUtils.bind(this,function(){null!=Q.parentNode&&(Q.parentNode.removeChild(Q),this.bannerShowing=!1,p.checked||t)&&(this["hideBanner"+d]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+d]=Date.now(),mxSettings.save()))});null!=P&&mxEvent.addListener(P,"click",mxUtils.bind(this,function(M){mxEvent.consume(M);A()}));var C=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Q.style,+"transform",B);window.setTimeout(mxUtils.bind(this,function(){A()}),V)});mxEvent.addListener(Q,"click",mxUtils.bind(this,function(M){var S=mxEvent.getSource(M);S!=p&&S!=z?(null!=m&&m(),A(),mxEvent.consume(M)):C()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Q.style,"transform",I)}),V/2);window.setTimeout(C,v?4E3:3E4);K=!0}return K};EditorUi.prototype.setCurrentFile=function(d){null!=d&&(d.opened=new Date);this.currentFile=d};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return this.editor.isExportToCanvas()};EditorUi.prototype.createImageDataUri=function(d,g,m,t){d=d.toDataURL("image/"+m);if(null!=d&&6<d.length)null!=g&&(d=Editor.writeGraphModelToPng(d,"tEXt","mxfile",encodeURIComponent(g))),0<t&&(d=Editor.writeGraphModelToPng(d,"pHYs","dpi",t));else throw{message:mxResources.get("unknownError")};return d};EditorUi.prototype.saveCanvas=function(d,g,m,t,v){var y="jpeg"==m?"jpg":m;t=this.getBaseFilename(t)+(null!=g?".drawio":"")+"."+y;d=this.createImageDataUri(d,g,m,v);this.saveData(t,y,d.substring(d.lastIndexOf(",")+1),"image/"+m,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(d,g){d=new TextareaDialog(this,d,g,null,null,mxResources.get("close"));this.showDialog(d.container,620,460,!0,!0,null,null,null,null,!0);d.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(d,g,m,t,v,y){"text/xml"!=m||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.html)$/i.test(g)||(g=g+"."+(null!=y?y:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)d=t?this.base64ToBlob(d,m):new Blob([d],{type:m}),navigator.msSaveOrOpenBlob(d,g);else if(mxClient.IS_IE)m=window.open("about:blank","_blank"),null==m?mxUtils.popup(d,!0):(m.document.write(d),m.document.close(),m.document.execCommand("SaveAs",!0,g),m.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==m||"image/"!=m.substring(0,6)?this.showTextDialog(g+":",d):this.openInNewWindow(d,m,t);else{var B=document.createElement("a");y=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof B.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var I=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);-y=65==(I?parseInt(I[2],10):!1)?!1:y}if(y||this.isOffline()){B.href=URL.createObjectURL(t?this.base64ToBlob(d,m):new Blob([d],{type:m}));y?B.download=g:B.setAttribute("target","_blank");document.body.appendChild(B);try{window.setTimeout(function(){URL.revokeObjectURL(B.href)},2E4),B.click(),B.parentNode.removeChild(B)}catch(K){}}else this.createEchoRequest(d,g,m,t,v).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(d,g,m,t,v,y){d="xml="+encodeURIComponent(d);return new mxXmlRequest(SAVE_URL,-d+(null!=m?"&mime="+m:"")+(null!=v?"&format="+v:"")+(null!=y?"&base64="+y:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(d,g,m,t,v,y,B,I){y=null!=y?y:!1;B=null!=B?B:"vsdx"!=v&&(!mxClient.IS_IOS||!navigator.standalone);var K=mxUtils.bind(this,function(V,Q,O,p){try{if("_blank"==Q)if(null!=m&&"image/"==m.substring(0,6))this.openInNewWindow(d,m,t);else if(null!=m&&"text/html"==m.substring(0,9)){var z=new EmbedDialog(this,d);this.showDialog(z.container,+y=65==(I?parseInt(I[2],10):!1)?!1:y}if(y||this.isOffline()){B.href=URL.createObjectURL(t?this.base64ToBlob(d,m):new Blob([d],{type:m}));y?B.download=g:B.setAttribute("target","_blank");document.body.appendChild(B);try{window.setTimeout(function(){URL.revokeObjectURL(B.href)},2E4),B.click(),B.parentNode.removeChild(B)}catch(J){}}else this.createEchoRequest(d,g,m,t,v).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(d,g,m,t,v,y){d="xml="+encodeURIComponent(d);return new mxXmlRequest(SAVE_URL,+d+(null!=m?"&mime="+m:"")+(null!=v?"&format="+v:"")+(null!=y?"&base64="+y:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(d,g,m,t,v,y,B,I){y=null!=y?y:!1;B=null!=B?B:"vsdx"!=v&&(!mxClient.IS_IOS||!navigator.standalone);var J=mxUtils.bind(this,function(V,Q,P,p){try{if("_blank"==Q)if(null!=m&&"image/"==m.substring(0,6))this.openInNewWindow(d,m,t);else if(null!=m&&"text/html"==m.substring(0,9)){var z=new EmbedDialog(this,d);this.showDialog(z.container,450,240,!0,!0);z.init()}else{var A=window.open("about:blank");null==A?mxUtils.popup(d,!0):(A.document.write("<pre>"+mxUtils.htmlEntities(d,!1)+"</pre>"),A.document.close())}else if(Q==App.MODE_DEVICE||"download"==Q)this.doSaveLocalFile(d,V,m,t,null,I);else if(null!=V&&0<V.length){var C=mxUtils.bind(this,function(M){try{this.exportFile(d,V,m,t,Q,M)}catch(S){this.handleError(S)}});null!=p?C(p):this.pickFolder(Q,C)}}catch(M){this.handleError(M)}});v=[];y||v.push(App.MODE_BROWSER);B||v.push("_blank");-var J=new SaveDialog(this,g,mxUtils.bind(this,function(V,Q,O){K(V.value,Q,V,O);this.hideDialog(null,null,J.container)}),v,d,m,t);this.showDialog(J.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));J.init()};EditorUi.prototype.openInNewWindow=function(d,g,m){var t=window.open("about:blank");if(null==t||null==t.document)mxUtils.popup(d,!0);else{var v="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var y=mxUtils.parseXml(d).documentElement.style.backgroundColor;+var K=new SaveDialog(this,g,mxUtils.bind(this,function(V,Q,P){J(V.value,Q,V,P);this.hideDialog(null,null,K.container)}),v,d,m,t);this.showDialog(K.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));K.init()};EditorUi.prototype.openInNewWindow=function(d,g,m){var t=window.open("about:blank");if(null==t||null==t.document)mxUtils.popup(d,!0);else{var v="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var y=mxUtils.parseXml(d).documentElement.style.backgroundColor;""!=y&&(v="background: "+y+";")}v='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+v+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||m?(y=m?d:btoa(unescape(encodeURIComponent(d))),t.document.write(v+'<img style="max-width:100%;" src="data:'+g+";base64,"+y+'"/></body></html>')):t.document.write(v+d+"</body></html>"):t.document.write(v+"<pre>"+mxUtils.htmlEntities(d,!1)+"</pre></body></html>");t.document.close()}};var c=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(d){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var g=d(mxUtils.bind(this,function(t){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.className="geScrollable",this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=@@ -13113,185 +13113,187 @@ null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function("click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.isExportToCanvas()&&this.isChromelessImageExportEnabled()){this.exportDialog=null;var m=d(mxUtils.bind(this,function(t){var v=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",v);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)v.apply(this);else{this.exportDialog=document.createElement("div");var y=m.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=y.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";y=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=y.zIndex;var B=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});B.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",v);this.editor.exportToCanvas(mxUtils.bind(this,function(I){B.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var K=this.createImageDataUri(I,null,"png");I=document.createElement("img");I.style.maxWidth="140px";I.style.maxHeight="140px";-I.style.cursor="pointer";I.style.backgroundColor="white";I.setAttribute("title",mxResources.get("openInNewWindow"));I.setAttribute("border","0");I.setAttribute("src",K);this.exportDialog.appendChild(I);mxEvent.addListener(I,"click",mxUtils.bind(this,function(){this.openInNewWindow(K.substring(K.indexOf(",")+1),"image/png",!0);v.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(I){B.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),+speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});B.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",v);this.editor.exportToCanvas(mxUtils.bind(this,function(I){B.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var J=this.createImageDataUri(I,null,"png");I=document.createElement("img");I.style.maxWidth="140px";I.style.maxHeight="140px";+I.style.cursor="pointer";I.style.backgroundColor="white";I.setAttribute("title",mxResources.get("openInNewWindow"));I.setAttribute("border","0");I.setAttribute("src",J);this.exportDialog.appendChild(I);mxEvent.addListener(I,"click",mxUtils.bind(this,function(){this.openInNewWindow(J.substring(J.indexOf(",")+1),"image/png",!0);v.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(I){B.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(I)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(t)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(d,g,m,t,v){this.isLocalFileSave()?this.saveLocalFile(m,d,t,v,g):this.saveRequest(d,g,mxUtils.bind(this,function(y,B){return this.createEchoRequest(m,y,t,v,g,B)}),m,v,t)};EditorUi.prototype.saveRequest=function(d,g,m,t,v,y,B){B=null!=B?B:!mxClient.IS_IOS||!navigator.standalone;var I=mxUtils.bind(this,-function(J,V,Q,O){if("_blank"==V||null!=J&&0<J.length){var p=m("_blank"==V?null:J,V==App.MODE_DEVICE||"download"==V||null==V||"_blank"==V?"0":"1");null!=p&&(V==App.MODE_DEVICE||"download"==V||"_blank"==V?p.simulate(document,"_blank"):(Q=mxUtils.bind(this,function(z){y=null!=y?y:"pdf"==g?"application/pdf":"image/"+g;if(null!=t)try{this.exportFile(t,J,y,!0,V,z)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&p.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=p.getStatus()&&299>=p.getStatus())try{this.exportFile(p.getText(),J,y,!0,V,z)}catch(A){this.handleError(A)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(A){this.spinner.stop();this.handleError(A)}))}),null!=O?Q(O):this.pickFolder(V,Q)))}});v=[App.MODE_BROWSER];B||v.push("_blank");var K=new SaveDialog(this,d,mxUtils.bind(this,function(J,V,Q){I(J.value,V,J,Q);this.hideDialog(null,null,K.container)}),v,null,"application/pdf");this.showDialog(K.container,-420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));K.init()};EditorUi.prototype.isServices=function(d){return 1!=d};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(d,g,m,t,v,y){};EditorUi.prototype.getServiceForName=function(d){return null};EditorUi.prototype.getTitleForService=function(d){return mxResources.get(d)};EditorUi.prototype.pickFolder=function(d,g,m){g(null)};EditorUi.prototype.exportSvg=function(d,g,m,t,v,y,-B,I,K,J,V,Q,O,p){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(P){Editor.addRetryToError(P,mxUtils.bind(this,function(){this.exportSvg(d,g,m,t,v,y,B,I,K,J,V,Q,O,p)}));this.handleError(P)})))try{var z=this.editor.graph.isSelectionEmpty();m=null!=m?m:z;var A=g?null:this.editor.graph.background;A==mxConstants.NONE&&(A=null);null==A&&0==g&&(A=this.editor.graph.shapeBackgroundColor);var C=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&-(this.editor.graph.addForeignObjectWarning=function(){});var M=this.editor.graph.createSvgImageExport(v),S=this.editor.graph.getSvg(A,d,B,I,null,m,null,M,"blank"==J?"_blank":"self"==J?"_top":null,null,!O,V,Q);this.editor.graph.addForeignObjectWarning=C;t&&this.editor.graph.addSvgShadow(S);var l=this.getBaseFilename()+(v?".drawio":"")+".svg";p=null!=p?p:mxUtils.bind(this,function(P){this.isLocalFileSave()||P.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},-mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}))});var x=mxUtils.bind(this,function(P){this.spinner.stop();v&&P.setAttribute("content",this.getFileData(!0,null,null,null,m,K,null,null,null,null,null,d,B));p(Graph.xmlDeclaration+"\n"+(v?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(P))});this.editor.graph.mathEnabled&&this.editor.addMathCss(S);var G=mxUtils.bind(this,function(P){Editor.replaceSvgDataUris&&y&&EditorUi.embedSvgImages(P);Editor.foreignObjectImages&&-O?this.replaceAlternateContent(P,V,x):x(P)}),N=mxUtils.bind(this,function(P){y&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(P,G,this.thumbImageCache)):G(P)});O?this.embedFonts(S,N):(this.editor.addFontCss(S),N(S))}catch(P){this.handleError(P)}};EditorUi.prototype.replaceAlternateContent=function(d,g,m){function t(Q,O,p,z,A){var C=mxUtils.createElementNs(d.ownerDocument,mxConstants.NS_SVG,"image");C.setAttribute("x",O);C.setAttribute("y",-p+.5);C.setAttribute("width",z.width);C.setAttribute("height",z.height);null==C.setAttributeNS?C.setAttribute("xlink:href",A):C.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",A);Q.replaceChild(C,Q.lastChild);I()}function v(){if(B<V.length)V[B++](v)}var y="";g=d.getElementsByTagName("style");for(var B=0;B<g.length;B++)y+=g[B].innerHTML;g=d.getElementsByTagName("switch");counter=g.length;var I=mxUtils.bind(this,function(){counter--;0==counter&&m(d)}),K={},J={},V=[];for(B=0;B<g.length;B++)mxUtils.bind(this,-function(Q){var O=Q.getElementsByTagName("div");if(0<O.length)try{var p=O[0].cloneNode(!0),z=parseInt(p.style.marginLeft),A=parseInt(p.style.paddingTop),C=p.getElementsByTagName("div")[1],M=O=!1,S=p.style.alignItems,l=p.style.justifyContent;if(null!=p.style.writingMode){var x=p.style.writingMode;M="vertical-"==x.substring(0,9);O="-rl"==x.substring(x.length-3)}var G=!M&&"1px"==p.style.width||M&&"1px"==p.style.height;if(!M&&"1px"==p.style.height||M&&"1px"==p.style.width)p.style.alignItems=M&&O?"unsafe flex-end":-"unsafe flex-start";G&&(p.style.justifyContent="unsafe flex-start");p.style.paddingTop="";p.style.marginLeft="";var N=p.outerHTML,P=K[N];null==P&&(p.style.position="absolute",p.style.visibility="hidden",document.body.appendChild(p),x=1,x="1px"==p.style.width?C.offsetWidth:parseInt(p.style.width),G=1,G="1px"==p.style.height?C.offsetHeight:parseInt(p.style.height),document.body.removeChild(p),P=new mxRectangle(z,A,x,G),K[N]=P);"1px"==p.style.height&&("unsafe center"==S?A-=P.height/2:"unsafe flex-end"==-S&&(A-=P.height));if("1px"==p.style.width)if(!M&&"unsafe center"==l||M&&"unsafe center"==S)z-=P.width/2;else if(!M&&"unsafe flex-end"==l||M&&(!O&&"unsafe flex-end"==S||O&&"unsafe flex-start"==S))z-=P.width;P=new mxRectangle(z,A,P.width,P.height+parseInt(C.style.fontSize)/4);V.push(mxUtils.bind(this,function(R){var T=J[N];null==T?Graph.htmlToPng(N,P.width,P.height,mxUtils.bind(this,function(U){t(Q,z,A,P,U);J[N]=U;R()}),y):(t(Q,z,A,P,T),R())}))}catch(R){I()}else I()})(g[B]);0==counter&&m(d);B=0;v()};-EditorUi.prototype.addRadiobox=function(d,g,m,t,v,y,B){return this.addCheckbox(d,m,t,v,y,B,!0,g)};EditorUi.prototype.addCheckbox=function(d,g,m,t,v,y,B,I){y=null!=y?y:!0;var K=document.createElement("input");K.style.marginRight="8px";K.style.marginTop="16px";K.setAttribute("type",B?"radio":"checkbox");B="geCheckbox-"+Editor.guid();K.id=B;null!=I&&K.setAttribute("name",I);m&&(K.setAttribute("checked","checked"),K.defaultChecked=!0);t&&K.setAttribute("disabled","disabled");y&&(d.appendChild(K),m=document.createElement("label"),-mxUtils.write(m,g),m.setAttribute("for",B),d.appendChild(m),v||mxUtils.br(d));return K};EditorUi.prototype.addEditButton=function(d,g){var m=this.addCheckbox(d,mxResources.get("edit")+":",!0,null,!0);m.style.marginLeft="24px";var t=this.getCurrentFile(),v="";null!=t&&t.getMode()!=App.MODE_DEVICE&&t.getMode()!=App.MODE_BROWSER&&(v=window.location.href);var y=document.createElement("select");y.style.maxWidth="200px";y.style.width="auto";y.style.marginLeft="8px";y.style.marginRight="10px";y.className=-"geBtn";t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("makeCopy"));y.appendChild(t);var B=document.createElement("option");B.setAttribute("value","custom");mxUtils.write(B,mxResources.get("custom")+"...");y.appendChild(B);d.appendChild(y);mxEvent.addListener(y,"change",mxUtils.bind(this,function(){if("custom"==y.value){var I=new FilenameDialog(this,v,mxResources.get("ok"),function(K){null!=K?(v=K,B.setAttribute("title",K)):(y.value="blank",B.removeAttribute("title"))},+function(K,V,Q,P){if("_blank"==V||null!=K&&0<K.length){var p=m("_blank"==V?null:K,V==App.MODE_DEVICE||"download"==V||null==V||"_blank"==V?"0":"1");null!=p&&(V==App.MODE_DEVICE||"download"==V||"_blank"==V?p.simulate(document,"_blank"):(Q=mxUtils.bind(this,function(z){y=null!=y?y:"pdf"==g?"application/pdf":"image/"+g;if(null!=t)try{this.exportFile(t,K,y,!0,V,z)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&p.send(mxUtils.bind(this,function(){this.spinner.stop();+if(200<=p.getStatus()&&299>=p.getStatus())try{this.exportFile(p.getText(),K,y,!0,V,z)}catch(A){this.handleError(A)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(A){this.spinner.stop();this.handleError(A)}))}),null!=P?Q(P):this.pickFolder(V,Q)))}});v=[App.MODE_BROWSER];B||v.push("_blank");var J=new SaveDialog(this,d,mxUtils.bind(this,function(K,V,Q){I(K.value,V,K,Q);this.hideDialog(null,null,J.container)}),v,null,"application/pdf");this.showDialog(J.container,+420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));J.init()};EditorUi.prototype.isServices=function(d){return 1!=d};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(d,g,m,t,v,y){};EditorUi.prototype.getServiceForName=function(d){return null};EditorUi.prototype.getTitleForService=function(d){return mxResources.get(d)};EditorUi.prototype.pickFolder=function(d,g,m){g(null)};EditorUi.prototype.exportSvg=function(d,g,m,t,v,y,+B,I,J,K,V,Q,P,p){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(O){Editor.addRetryToError(O,mxUtils.bind(this,function(){this.exportSvg(d,g,m,t,v,y,B,I,J,K,V,Q,P,p)}));this.handleError(O)})))try{var z=this.editor.graph.isSelectionEmpty();m=null!=m?m:z;var A=g?null:this.editor.graph.background;A==mxConstants.NONE&&(A=null);null==A&&0==g&&(A=this.editor.graph.shapeBackgroundColor);var C=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+(this.editor.graph.addForeignObjectWarning=function(){});var M=this.editor.graph.createSvgImageExport(v),S=this.editor.graph.getSvg(A,d,B,I,null,m,null,M,"blank"==K?"_blank":"self"==K?"_top":null,null,!P,V,Q);this.editor.graph.addForeignObjectWarning=C;t&&this.editor.graph.addSvgShadow(S);var l=this.getBaseFilename()+(v?".drawio":"")+".svg";p=null!=p?p:mxUtils.bind(this,function(O){this.isLocalFileSave()||O.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",O,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},+mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(O)}))});var x=mxUtils.bind(this,function(O){this.spinner.stop();v&&O.setAttribute("content",this.getFileData(!0,null,null,null,m,J,null,null,null,null,null,d,B));p(Graph.xmlDeclaration+"\n"+(v?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(O))});this.editor.graph.mathEnabled&&this.editor.addMathCss(S);var G=mxUtils.bind(this,function(O){Editor.replaceSvgDataUris&&y&&EditorUi.embedSvgImages(O);Editor.foreignObjectImages&&+P?this.replaceAlternateContent(O,V,x):x(O)}),N=mxUtils.bind(this,function(O){y&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(O,G,this.thumbImageCache)):G(O)});P?this.embedFonts(S,N):(this.editor.addFontCss(S),N(S))}catch(O){this.handleError(O)}};EditorUi.prototype.replaceAlternateContent=function(d,g,m){function t(Q,P,p,z,A){var C=mxUtils.createElementNs(d.ownerDocument,mxConstants.NS_SVG,"image");C.setAttribute("x",P);C.setAttribute("y",+p+.5);C.setAttribute("width",z.width);C.setAttribute("height",z.height);null==C.setAttributeNS?C.setAttribute("xlink:href",A):C.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",A);Q.replaceChild(C,Q.lastChild);I()}function v(){if(B<V.length)V[B++](v)}var y="";g=d.getElementsByTagName("style");for(var B=0;B<g.length;B++)y+=g[B].innerHTML;g=d.getElementsByTagName("switch");counter=g.length;var I=mxUtils.bind(this,function(){counter--;0==counter&&m(d)}),J={},K={},V=[];for(B=0;B<g.length;B++)mxUtils.bind(this,+function(Q){var P=Q.getElementsByTagName("div");if(0<P.length)try{var p=P[0].cloneNode(!0),z=parseInt(p.style.marginLeft),A=parseInt(p.style.paddingTop),C=p.getElementsByTagName("div")[1],M=P=!1,S=p.style.alignItems,l=p.style.justifyContent;if(null!=p.style.writingMode){var x=p.style.writingMode;M="vertical-"==x.substring(0,9);P="-rl"==x.substring(x.length-3)}var G=!M&&"1px"==p.style.width||M&&"1px"==p.style.height;if(!M&&"1px"==p.style.height||M&&"1px"==p.style.width)p.style.alignItems=M&&P?"unsafe flex-end":+"unsafe flex-start";G&&(p.style.justifyContent="unsafe flex-start");p.style.paddingTop="";p.style.marginLeft="";var N=p.outerHTML,O=J[N];null==O&&(p.style.position="absolute",p.style.visibility="hidden",document.body.appendChild(p),x=1,x="1px"==p.style.width?C.offsetWidth:parseInt(p.style.width),G=1,G="1px"==p.style.height?C.offsetHeight:parseInt(p.style.height),document.body.removeChild(p),O=new mxRectangle(z,A,x,G),J[N]=O);"1px"==p.style.height&&("unsafe center"==S?A-=O.height/2:"unsafe flex-end"==+S&&(A-=O.height));if("1px"==p.style.width)if(!M&&"unsafe center"==l||M&&"unsafe center"==S)z-=O.width/2;else if(!M&&"unsafe flex-end"==l||M&&(!P&&"unsafe flex-end"==S||P&&"unsafe flex-start"==S))z-=O.width;O=new mxRectangle(z,A,O.width,O.height+parseInt(C.style.fontSize)/4);V.push(mxUtils.bind(this,function(R){var T=K[N];null==T?Graph.htmlToPng(N,O.width,O.height,mxUtils.bind(this,function(U){t(Q,z,A,O,U);K[N]=U;R()}),y):(t(Q,z,A,O,T),R())}))}catch(R){I()}else I()})(g[B]);0==counter&&m(d);B=0;v()};+EditorUi.prototype.addRadiobox=function(d,g,m,t,v,y,B){return this.addCheckbox(d,m,t,v,y,B,!0,g)};EditorUi.prototype.addCheckbox=function(d,g,m,t,v,y,B,I){y=null!=y?y:!0;var J=document.createElement("input");J.style.marginRight="8px";J.style.marginTop="16px";J.setAttribute("type",B?"radio":"checkbox");B="geCheckbox-"+Editor.guid();J.id=B;null!=I&&J.setAttribute("name",I);m&&(J.setAttribute("checked","checked"),J.defaultChecked=!0);t&&J.setAttribute("disabled","disabled");y&&(d.appendChild(J),m=document.createElement("label"),+mxUtils.write(m,g),m.setAttribute("for",B),d.appendChild(m),v||mxUtils.br(d));return J};EditorUi.prototype.addEditButton=function(d,g){var m=this.addCheckbox(d,mxResources.get("edit")+":",!0,null,!0);m.style.marginLeft="24px";var t=this.getCurrentFile(),v="";null!=t&&t.getMode()!=App.MODE_DEVICE&&t.getMode()!=App.MODE_BROWSER&&(v=window.location.href);var y=document.createElement("select");y.style.maxWidth="200px";y.style.width="auto";y.style.marginLeft="8px";y.style.marginRight="10px";y.className=+"geBtn";t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("makeCopy"));y.appendChild(t);var B=document.createElement("option");B.setAttribute("value","custom");mxUtils.write(B,mxResources.get("custom")+"...");y.appendChild(B);d.appendChild(y);mxEvent.addListener(y,"change",mxUtils.bind(this,function(){if("custom"==y.value){var I=new FilenameDialog(this,v,mxResources.get("ok"),function(J){null!=J?(v=J,B.setAttribute("title",J)):(y.value="blank",B.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){y.value="blank"});this.showDialog(I.container,300,80,!0,!1);I.init()}}));mxEvent.addListener(m,"change",mxUtils.bind(this,function(){m.checked&&(null==g||g.checked)?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}));mxUtils.br(d);return{getLink:function(){return m.checked?"blank"===y.value?"_blank":v:null},getEditInput:function(){return m},getEditSelect:function(){return y}}};EditorUi.prototype.addLinkSection=function(d,g){function m(){var I=document.createElement("div");I.style.width="100%";I.style.height="100%";I.style.boxSizing="border-box";null!=y&&y!=mxConstants.NONE?(I.style.border="1px solid black",I.style.backgroundColor=y):(I.style.backgroundPosition="center center",I.style.backgroundRepeat="no-repeat",I.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");B.innerText="";B.appendChild(I)}mxUtils.write(d,mxResources.get("links")+":");var t=document.createElement("select");t.style.width="100px";t.style.padding="0px";t.style.marginLeft="8px";t.style.marginRight="10px";t.className="geBtn";var v=document.createElement("option");v.setAttribute("value","auto");mxUtils.write(v,mxResources.get("automatic"));t.appendChild(v);v=document.createElement("option");v.setAttribute("value","blank");mxUtils.write(v,mxResources.get("openInNewWindow"));t.appendChild(v);v=document.createElement("option");v.setAttribute("value","self");mxUtils.write(v,mxResources.get("openInThisWindow"));t.appendChild(v);g&&(g=document.createElement("option"),-g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(g));d.appendChild(t);mxUtils.write(d,mxResources.get("borderColor")+":");var y="#0000ff",B=null;B=mxUtils.button("",mxUtils.bind(this,function(I){this.pickColor(y||"none",function(K){y=K;m()});mxEvent.consume(I)}));m();B.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";B.style.marginLeft="4px";B.style.height="22px";B.style.width="22px";B.style.position="relative";+g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(g));d.appendChild(t);mxUtils.write(d,mxResources.get("borderColor")+":");var y="#0000ff",B=null;B=mxUtils.button("",mxUtils.bind(this,function(I){this.pickColor(y||"none",function(J){y=J;m()});mxEvent.consume(I)}));m();B.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";B.style.marginLeft="4px";B.style.height="22px";B.style.width="22px";B.style.position="relative";B.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";B.className="geColorBtn";d.appendChild(B);mxUtils.br(d);return{getColor:function(){return y},getTarget:function(){return t.value},focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(d,g,m,t,v,y){y=null!=y?y:[];m&&(y.push("lightbox=1"),"auto"!=d&&y.push("target="+d),null!=g&&g!=mxConstants.NONE&&y.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=t&&0<t.length&&y.push("edit="+encodeURIComponent(t)),-v&&y.push("layers=1"),this.editor.graph.foldingEnabled&&y.push("nav=1"));return y};EditorUi.prototype.createLink=function(d,g,m,t,v,y,B,I,K,J,V){var Q=this.getCurrentFile();K=this.createUrlParameters(d,g,t,v,y,K);d=!0;null!=B?m="#U"+encodeURIComponent(B):I||null==Q||""==Q.getHash()?m="#R"+encodeURIComponent(m?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(m="#"+Q.getHash(),d=!1);d&&null!=Q&&null!=Q.getTitle()&&Q.getTitle()!=-this.defaultFilename&&K.push("title="+encodeURIComponent(Q.getTitle()));J&&1<m.length&&(K.push("open="+m.substring(1)),m="");V&&null!=this.currentPage&&K.push("page-id="+this.currentPage.getId());return(t&&(null!=B||null!=Q&&Q.getMode()!=App.MODE_GITHUB&&Q.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<K.length?"?"+K.join("&"):"")+m};EditorUi.prototype.createHtml=-function(d,g,m,t,v,y,B,I,K,J,V,Q){this.getBasenames();var O={};""!=v&&v!=mxConstants.NONE&&(O.highlight=v);"auto"!==t&&(O.target=t);J||(O.lightbox=!1);O.nav=this.editor.graph.foldingEnabled;m=parseInt(m);isNaN(m)||100==m||(O.zoom=m/100);m=[];B&&(m.push("pages"),O.resize=!0,null!=this.pages&&null!=this.currentPage&&(O.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(m.push("zoom"),O.resize=!0);I&&m.push("layers");K&&m.push("tags");0<m.length&&(J&&m.push("lightbox"),O.toolbar=m.join(" "));null!=-V&&0<V.length&&(O.edit=V);null!=d?O.url=d:O.xml=this.getFileData(!0,null,null,null,null,!B);g='<div class="mxgraph" style="'+(y?"max-width:100%;":"")+(""!=m?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(O))+'"></div>';d=null!=d?"&fetch="+encodeURIComponent(d):"";Q(g,'<script type="text/javascript" src="'+(0<d.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+d:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":-window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(d,g,m,t){var v=document.createElement("div");v.style.whiteSpace="nowrap";var y=document.createElement("h3");mxUtils.write(y,mxResources.get("html"));y.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";v.appendChild(y);var B=document.createElement("div");B.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";-var I=document.createElement("input");I.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";I.setAttribute("value","url");I.setAttribute("type","radio");I.setAttribute("name","type-embedhtmldialog");y=I.cloneNode(!0);y.setAttribute("value","copy");B.appendChild(y);var K=document.createElement("span");mxUtils.write(K,mxResources.get("includeCopyOfMyDiagram"));B.appendChild(K);mxUtils.br(B);B.appendChild(I);K=document.createElement("span");mxUtils.write(K,mxResources.get("publicDiagramUrl"));-B.appendChild(K);var J=this.getCurrentFile();null==m&&null!=J&&J.constructor==window.DriveFile&&(K=document.createElement("a"),K.style.paddingLeft="12px",K.style.color="gray",K.style.cursor="pointer",mxUtils.write(K,mxResources.get("share")),B.appendChild(K),mxEvent.addListener(K,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(J.getId(),J)})));y.setAttribute("checked","checked");null==m&&I.setAttribute("disabled","disabled");v.appendChild(B);var V=this.addLinkSection(v),-Q=this.addCheckbox(v,mxResources.get("zoom"),!0,null,!0);mxUtils.write(v,":");var O=document.createElement("input");O.setAttribute("type","text");O.style.marginRight="16px";O.style.width="60px";O.style.marginLeft="4px";O.style.marginRight="12px";O.value="100%";v.appendChild(O);var p=this.addCheckbox(v,mxResources.get("fit"),!0);B=null!=this.pages&&1<this.pages.length;var z=z=this.addCheckbox(v,mxResources.get("allPages"),B,!B),A=this.addCheckbox(v,mxResources.get("layers"),!0),C=this.addCheckbox(v,-mxResources.get("tags"),!0),M=this.addCheckbox(v,mxResources.get("lightbox"),!0),S=null;B=380;if(EditorUi.enableHtmlEditOption){S=this.addEditButton(v,M);var l=S.getEditInput();l.style.marginBottom="16px";B+=50;mxEvent.addListener(M,"change",function(){M.checked?l.removeAttribute("disabled"):l.setAttribute("disabled","disabled");l.checked&&M.checked?S.getEditSelect().removeAttribute("disabled"):S.getEditSelect().setAttribute("disabled","disabled")})}d=new CustomDialog(this,v,mxUtils.bind(this,function(){t(I.checked?-m:null,Q.checked,O.value,V.getTarget(),V.getColor(),p.checked,z.checked,A.checked,C.checked,M.checked,null!=S?S.getLink():null)}),null,d,g);this.showDialog(d.container,340,B,!0,!0);y.focus()};EditorUi.prototype.showPublishLinkDialog=function(d,g,m,t,v,y,B,I,K){var J=document.createElement("div");J.style.whiteSpace="nowrap";var V=document.createElement("h3");mxUtils.write(V,d||mxResources.get("publish"));V.style.width="100%";V.style.textAlign="center";V.style.marginTop="2px";V.style.marginBottom="20px";-J.appendChild(V);var Q=document.createElement("select");d=30;Q.className="geBtn";Q.style.marginBottom="8px";Q.style.marginLeft="0px";Q.style.width="100%";Q.style.boxSizing="border-box";if(null==I||""==I.getHash())v=null!=v?v:"https://www.drawio.com/doc/faq/publish-diagram-as-link",V=document.createElement("option"),mxUtils.write(V,mxResources.get("makeCopy")),V.setAttribute("value","copy"),Q.appendChild(V);V=document.createElement("option");mxUtils.write(V,mxResources.get("authorizationRequired"));-V.setAttribute("value","auth");Q.appendChild(V);null!=I&&""!=I.getHash()||V.setAttribute("disabled","disabled");I=document.createElement("option");I.setAttribute("value","public");Q.appendChild(I);null!=B?(mxUtils.write(I,mxResources.get("publicDiagramUrl")),I.setAttribute("title",B),Q.value="public"):(mxUtils.write(I,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),I.setAttribute("disabled","disabled"));J.appendChild(Q);mxUtils.br(J);Q.focus();var O=null,p=null;-if(null!=g||null!=m)d+=30,mxUtils.write(J,mxResources.get("width")+":"),O=document.createElement("input"),O.setAttribute("type","text"),O.style.marginRight="16px",O.style.width="50px",O.style.marginLeft="6px",O.style.marginRight="16px",O.style.marginBottom="10px",O.value="100%",J.appendChild(O),mxUtils.write(J,mxResources.get("height")+":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.width="50px",p.style.marginLeft="6px",p.style.marginBottom="10px",p.value=m+"px",J.appendChild(p),-mxUtils.br(J);var z=this.addLinkSection(J,t),A=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(d+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),A=this.addCheckbox(J,mxResources.get("selectedPage")+": "+g));var C=this.addCheckbox(J,mxResources.get("lightbox"),!0,null,null,!t),M=this.addEditButton(J,C),S=M.getEditInput();t&&(S.style.marginLeft=C.style.marginLeft,C.style.display="none",d-=20);var l=this.addCheckbox(J,-mxResources.get("layers"),!0);l.style.marginLeft=S.style.marginLeft;l.style.marginTop="8px";var x=this.addCheckbox(J,mxResources.get("tags"),!0);x.style.marginLeft=S.style.marginLeft;x.style.marginBottom="16px";x.style.marginTop="16px";mxEvent.addListener(C,"change",function(){C.checked?(l.removeAttribute("disabled"),S.removeAttribute("disabled"),x.removeAttribute("disabled")):(l.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"));S.checked&&-C.checked?M.getEditSelect().removeAttribute("disabled"):M.getEditSelect().setAttribute("disabled","disabled")});t=new CustomDialog(this,J,mxUtils.bind(this,function(){K(z.getTarget(),z.getColor(),null==A?!1:A.checked,C.checked,M.getLink(),l.checked,null!=O?O.value:null,null!=p?p.value:null,x.checked,Q.value)}),null,mxResources.get("create"),v,y);this.showDialog(t.container,340,296+d,!0,!0);null!=O?(O.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?O.select():document.execCommand("selectAll",-!1,null)):null==Q.parentNode;z.focus()};EditorUi.prototype.showRemoteExportDialog=function(d,g,m,t,v){var y=document.createElement("div");y.style.whiteSpace="nowrap";var B=document.createElement("h3");mxUtils.write(B,mxResources.get("image"));B.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(v?"10":"4")+"px";y.appendChild(B);if(v){mxUtils.write(y,mxResources.get("zoom")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.marginRight="16px";-I.style.width="60px";I.style.marginLeft="4px";I.style.marginRight="12px";I.value=this.lastExportZoom||"100%";y.appendChild(I);mxUtils.write(y,mxResources.get("borderWidth")+":");var K=document.createElement("input");K.setAttribute("type","text");K.style.marginRight="16px";K.style.width="60px";K.style.marginLeft="4px";K.value=this.lastExportBorder||"0";y.appendChild(K);mxUtils.br(y)}var J=this.addCheckbox(y,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),V=t?null:this.addCheckbox(y,-mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);B=this.editor.graph;var Q=t?null:this.addCheckbox(y,mxResources.get("transparentBackground"),B.background==mxConstants.NONE||null==B.background);null!=Q&&(Q.style.marginBottom="16px");d=new CustomDialog(this,y,mxUtils.bind(this,function(){var O=parseInt(I.value)/100||1,p=parseInt(K.value)||0;m(!J.checked,null!=V?V.checked:!1,null!=Q?Q.checked:!1,O,p)}),null,d,g);this.showDialog(d.container,300,(v?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=-function(d,g,m,t,v,y,B,I,K){B=null!=B?B:Editor.defaultIncludeDiagram;var J=document.createElement("div");J.style.whiteSpace="nowrap";var V=this.editor.graph,Q="jpeg"==I||"webp"==I?220:320,O=document.createElement("h3");mxUtils.write(O,d);O.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";J.appendChild(O);mxUtils.write(J,mxResources.get("zoom")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft=-"4px";p.style.marginRight="12px";p.value=this.lastExportZoom||"100%";J.appendChild(p);mxUtils.write(J,mxResources.get("borderWidth")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.marginRight="16px";z.style.width="60px";z.style.marginLeft="4px";z.value=this.lastExportBorder||"0";J.appendChild(z);mxUtils.br(J);var A=this.addCheckbox(J,mxResources.get("selectionOnly"),!1,V.isSelectionEmpty()),C=document.createElement("input");C.style.marginTop="16px";C.style.marginRight=-"8px";C.style.marginLeft="24px";C.setAttribute("disabled","disabled");C.setAttribute("type","checkbox");var M=document.createElement("select");M.style.marginTop="16px";M.style.marginLeft="8px";d=["selectionOnly","diagram","page"];for(O=0;O<d.length;O++)if(!V.isSelectionEmpty()||"selectionOnly"!=d[O]){var S=document.createElement("option");mxUtils.write(S,mxResources.get(d[O]));S.setAttribute("value",d[O]);M.appendChild(S)}K?(mxUtils.write(J,mxResources.get("size")+":"),J.appendChild(M),mxUtils.br(J),-Q+=26,mxEvent.addListener(M,"change",function(){"selectionOnly"==M.value&&(A.checked=!0)})):y&&(J.appendChild(C),mxUtils.write(J,mxResources.get("crop")),mxUtils.br(J),Q+=30,mxEvent.addListener(A,"change",function(){A.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));V.isSelectionEmpty()?K&&(A.style.display="none",A.nextSibling.style.display="none",A.nextSibling.nextSibling.style.display="none",Q-=30):(M.value="diagram",C.setAttribute("checked","checked"),C.defaultChecked=-!0,mxEvent.addListener(A,"change",function(){M.value=A.checked?"selectionOnly":"diagram"}));var l=this.addCheckbox(J,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=I&&"webp"!=I),x=document.createElement("select");x.style.maxWidth="260px";x.style.marginLeft="8px";x.style.marginTop="16px";y=document.createElement("option");y.setAttribute("value","light");mxUtils.write(y,mxResources.get("light"));x.appendChild(y);K=document.createElement("option");K.setAttribute("value","dark");mxUtils.write(K,-mxResources.get("dark"));x.appendChild(K);"svg"==I?(y=document.createElement("option"),y.setAttribute("value","auto"),mxUtils.write(y,mxResources.get("automatic")),y.setAttribute("selected","selected"),x.appendChild(y)):Editor.isDarkMode()?K.setAttribute("selected","selected"):y.setAttribute("selected","selected");mxUtils.write(J,mxResources.get("appearance")+":");J.appendChild(x);mxUtils.br(J);Q+=26;var G=this.addCheckbox(J,mxResources.get("shadow"),V.shadowVisible),N=null;if("png"==I||"jpeg"==I||-"webp"==I)N=this.addCheckbox(J,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),Q+=30;var P=this.addCheckbox(J,mxResources.get("includeCopyOfMyDiagram")+":",B,null,null,"jpeg"!=I&&"webp"!=I),R=document.createElement("select");R.style.maxWidth="260px";R.style.marginLeft="28px";"png"==I||"svg"==I?(B=function(){P.checked?R.removeAttribute("disabled"):R.setAttribute("disabled","disabled")},V=document.createElement("option"),V.setAttribute("value","allPages"),mxUtils.write(V,mxResources.get("allPages")),-R.appendChild(V),V=document.createElement("option"),V.setAttribute("value","currentPage"),mxUtils.write(V,mxResources.get("currentPage")),R.appendChild(V),P.style.marginBottom="12px",R.style.marginBottom="16px",J.appendChild(R),mxUtils.br(J),Q+=20,null!=this.lastEmbedInclude&&(R.value=this.lastEmbedInclude),mxEvent.addListener(P,"change",B),B()):P.style.marginBottom="16px";var T=document.createElement("input");T.style.marginBottom="16px";T.style.marginRight="8px";T.setAttribute("type","checkbox");-var U=document.createElement("input");U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");g&&(T.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,J.appendChild(T),mxUtils.write(J,mxResources.get("embedImages")),mxUtils.br(J),U.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,J.appendChild(U),mxUtils.write(J,mxResources.get("embedFonts")),mxUtils.br(J),Q+=50);var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";-y=document.createElement("option");y.setAttribute("value","auto");mxUtils.write(y,mxResources.get("automatic"));W.appendChild(y);B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("openInNewWindow"));W.appendChild(B);B=document.createElement("option");B.setAttribute("value","self");mxUtils.write(B,mxResources.get("openInThisWindow"));W.appendChild(B);B=document.createElement("div");mxUtils.write(B,mxResources.get("LinksLost"));B.style.margin="7px";B.style.display=-"none";"svg"==I&&(mxUtils.write(J,mxResources.get("links")+":"),J.appendChild(W),J.appendChild(B),mxUtils.br(J),mxUtils.br(J),Q+=50);m=new CustomDialog(this,J,mxUtils.bind(this,function(){this.lastExportBorder=z.value;this.lastExportZoom=p.value;this.lastEmbedImages=T.checked;this.lastEmbedFonts=U.checked;this.lastEmbedInclude=R.value;v(p.value,l.checked,!A.checked,G.checked,P.checked,T.checked&&g,z.value,C.checked,("png"==I||"svg"==I)&&"currentPage"==R.value,W.value,null!=N?N.checked:null,null!=-x?x.value:null,M.value,U.checked)}),null,m,t);this.showDialog(m.container,340,Q,!0,!0,null,null,null,null,!0);p.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?p.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(d,g,m,t,v){var y=document.createElement("div");y.style.whiteSpace="nowrap";var B=this.editor.graph;if(null!=g){var I=document.createElement("h3");mxUtils.write(I,g);I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";-y.appendChild(I)}var K=this.addCheckbox(y,mxResources.get("fit"),!0),J=this.addCheckbox(y,mxResources.get("shadow"),B.shadowVisible&&t,!t),V=this.addCheckbox(y,m),Q=this.addCheckbox(y,mxResources.get("lightbox"),!0),O=this.addEditButton(y,Q),p=O.getEditInput(),z=1<B.model.getChildCount(B.model.getRoot()),A=this.addCheckbox(y,mxResources.get("layers"),z,!z);A.style.marginLeft=p.style.marginLeft;A.style.marginBottom="12px";A.style.marginTop="8px";mxEvent.addListener(Q,"change",function(){Q.checked?-(z&&A.removeAttribute("disabled"),p.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"));p.checked&&Q.checked?O.getEditSelect().removeAttribute("disabled"):O.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,y,mxUtils.bind(this,function(){d(K.checked,J.checked,V.checked,Q.checked,O.getLink(),A.checked)}),null,mxResources.get("embed"),v);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=-function(d,g,m,t,v,y,B,I){function K(p){var z=" ",A="";t&&(z=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(null!=V?"&page="+V:"")+(v?"&edit=_blank":"")+(y?"&layers=1":"")+"');}})(this);\"",A+=-"cursor:pointer;");d&&(A+="max-width:100%;");var C="";m&&(C=' width="'+Math.round(J.width)+'" height="'+Math.round(J.height)+'"');B('<img src="'+p+'"'+C+(""!=A?' style="'+A+'"':"")+z+"/>")}var J=this.editor.graph.getGraphBounds(),V=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(p){var z=t?this.getFileData(!0):null;p=this.createImageDataUri(p,z,"png");K(p)}),null,null,null,mxUtils.bind(this,function(p){I({message:mxResources.get("unknownError")})}),-null,!0,m?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),J.width*J.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var Q="";m&&(Q="&w="+Math.round(2*J.width)+"&h="+Math.round(2*J.height));var O=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(t?"1":"0")+Q+"&xml="+encodeURIComponent(g));O.send(mxUtils.bind(this,function(){200<=O.getStatus()&&299>=O.getStatus()?K("data:image/png;base64,"+O.getText()):I({message:mxResources.get("unknownError")})}))}else I({message:mxResources.get("drawingTooLarge")})};-EditorUi.prototype.createEmbedSvg=function(d,g,m,t,v,y,B){var I=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!m,"auto"),K=I.getElementsByTagName("a");if(null!=K)for(var J=0;J<K.length;J++){var V=K[J].getAttribute("href");null!=V&&"#"==V.charAt(0)&&"_blank"==K[J].getAttribute("target")&&K[J].removeAttribute("target")}t&&I.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(I);if(m){var Q=" ",O="";t&&(Q="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(v?"&edit=_blank":"")+(y?"&layers=1":"")+"');}})(this);\"",O+="cursor:pointer;");d&&(O+="max-width:100%;");this.editor.convertImages(I,mxUtils.bind(this,function(p){B('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(p))+'"'+(""!=O?' style="'+O+'"':"")+Q+"/>")}))}else O="",t&&(g=this.getSelectedPageIndex(),I.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=g?"&page="+g:"")+(v?"&edit=_blank":"")+(y?"&layers=1":"")+"');}}})(this);"),O+="cursor:pointer;"),d&&(d=parseInt(I.getAttribute("width")),v=parseInt(I.getAttribute("height")),I.setAttribute("viewBox","-0.5 -0.5 "+d+" "+v),O+="max-width:100%;max-height:"+v+"px;",I.removeAttribute("height")),""!=O&&I.setAttribute("style",O),this.editor.addFontCss(I),this.editor.graph.mathEnabled&&this.editor.addMathCss(I),B(mxUtils.getXml(I))};EditorUi.prototype.timeSince=function(d){d=+v&&y.push("layers=1"),this.editor.graph.foldingEnabled&&y.push("nav=1"));return y};EditorUi.prototype.createLink=function(d,g,m,t,v,y,B,I,J,K,V){var Q=this.getCurrentFile();J=this.createUrlParameters(d,g,t,v,y,J);d=!0;null!=B?m="#U"+encodeURIComponent(B):I||null==Q||""==Q.getHash()?m="#R"+encodeURIComponent(m?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(m="#"+Q.getHash(),d=!1);d&&null!=Q&&null!=Q.getTitle()&&Q.getTitle()!=+this.defaultFilename&&J.push("title="+encodeURIComponent(Q.getTitle()));K&&1<m.length&&(J.push("open="+m.substring(1)),m="");V&&null!=this.currentPage&&J.push("page-id="+this.currentPage.getId());return(t&&(null!=B||null!=Q&&Q.getMode()!=App.MODE_GITHUB&&Q.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<J.length?"?"+J.join("&"):"")+m};EditorUi.prototype.createHtml=+function(d,g,m,t,v,y,B,I,J,K,V,Q,P){this.getBasenames();var p={};""!=v&&v!=mxConstants.NONE&&(p.highlight=v);"auto"!==t&&(p.target=t);K||(p.lightbox=!1);p.nav=this.editor.graph.foldingEnabled;m=parseInt(m);isNaN(m)||100==m||(p.zoom=m/100);m=[];B&&(m.push("pages"),p.resize=!0,null!=this.pages&&null!=this.currentPage&&(p.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(m.push("zoom"),p.resize=!0);I&&m.push("layers");J&&m.push("tags");null!=P&&(p["dark-mode"]=P);0<m.length&&(K&&m.push("lightbox"),+p.toolbar=m.join(" "));null!=V&&0<V.length&&(p.edit=V);null!=d?p.url=d:p.xml=this.getFileData(!0,null,null,null,null,!B);g='<div class="mxgraph" style="'+(y?"max-width:100%;":"")+(""!=m?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(p))+'"></div>';d=null!=d?"&fetch="+encodeURIComponent(d):"";Q(g,'<script type="text/javascript" src="'+(0<d.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+d:"1"==urlParams.dev?+"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(d,g,m,t){var v=document.createElement("div");v.style.whiteSpace="nowrap";var y=document.createElement("h3");mxUtils.write(y,mxResources.get("html"));y.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";v.appendChild(y);var B=document.createElement("div");B.style.cssText=+"border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var I=document.createElement("input");I.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";I.setAttribute("value","url");I.setAttribute("type","radio");I.setAttribute("name","type-embedhtmldialog");y=I.cloneNode(!0);y.setAttribute("value","copy");B.appendChild(y);var J=document.createElement("span");mxUtils.write(J,mxResources.get("includeCopyOfMyDiagram"));B.appendChild(J);mxUtils.br(B);B.appendChild(I);J=+document.createElement("span");mxUtils.write(J,mxResources.get("publicDiagramUrl"));B.appendChild(J);var K=this.getCurrentFile();null==m&&null!=K&&K.constructor==window.DriveFile&&(J=document.createElement("a"),J.style.paddingLeft="12px",J.style.color="gray",J.style.cursor="pointer",mxUtils.write(J,mxResources.get("share")),B.appendChild(J),mxEvent.addListener(J,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(K.getId(),K)})));y.setAttribute("checked","checked");null==+m&&I.setAttribute("disabled","disabled");v.appendChild(B);B=380;var V=this.addLinkSection(v),Q=document.createElement("select");Q.style.maxWidth="260px";Q.style.marginLeft="8px";Q.style.marginTop="16px";J=document.createElement("option");J.setAttribute("value","light");mxUtils.write(J,mxResources.get("light"));Q.appendChild(J);J=document.createElement("option");J.setAttribute("value","dark");mxUtils.write(J,mxResources.get("dark"));Q.appendChild(J);J=document.createElement("option");J.setAttribute("value",+"auto");mxUtils.write(J,mxResources.get("automatic"));J.setAttribute("selected","selected");Q.appendChild(J);J.setAttribute("selected","selected");mxUtils.write(v,mxResources.get("appearance")+":");v.appendChild(Q);mxUtils.br(v);B+=26;var P=this.addCheckbox(v,mxResources.get("zoom"),!0,null,!0);mxUtils.write(v,":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight="12px";p.value="100%";v.appendChild(p);+var z=this.addCheckbox(v,mxResources.get("fit"),!0);J=null!=this.pages&&1<this.pages.length;var A=A=this.addCheckbox(v,mxResources.get("allPages"),J,!J),C=this.addCheckbox(v,mxResources.get("layers"),!0),M=this.addCheckbox(v,mxResources.get("tags"),!0),S=this.addCheckbox(v,mxResources.get("lightbox"),!0),l=null;if(EditorUi.enableHtmlEditOption){l=this.addEditButton(v,S);var x=l.getEditInput();x.style.marginBottom="16px";B+=50;mxEvent.addListener(S,"change",function(){S.checked?x.removeAttribute("disabled"):+x.setAttribute("disabled","disabled");x.checked&&S.checked?l.getEditSelect().removeAttribute("disabled"):l.getEditSelect().setAttribute("disabled","disabled")})}d=new CustomDialog(this,v,mxUtils.bind(this,function(){t(I.checked?m:null,P.checked,p.value,V.getTarget(),V.getColor(),z.checked,A.checked,C.checked,M.checked,S.checked,null!=l?l.getLink():null,null!=Q?Q.value:null)}),null,d,g);this.showDialog(d.container,340,B,!0,!0);y.focus()};EditorUi.prototype.showPublishLinkDialog=function(d,g,m,t,v,+y,B,I,J){var K=document.createElement("div");K.style.whiteSpace="nowrap";var V=document.createElement("h3");mxUtils.write(V,d||mxResources.get("publish"));V.style.width="100%";V.style.textAlign="center";V.style.marginTop="2px";V.style.marginBottom="20px";K.appendChild(V);var Q=document.createElement("select");d=30;Q.className="geBtn";Q.style.marginBottom="8px";Q.style.marginLeft="0px";Q.style.width="100%";Q.style.boxSizing="border-box";if(null==I||""==I.getHash())v=null!=v?v:"https://www.drawio.com/doc/faq/publish-diagram-as-link",+V=document.createElement("option"),mxUtils.write(V,mxResources.get("makeCopy")),V.setAttribute("value","copy"),Q.appendChild(V);V=document.createElement("option");mxUtils.write(V,mxResources.get("authorizationRequired"));V.setAttribute("value","auth");Q.appendChild(V);null!=I&&""!=I.getHash()||V.setAttribute("disabled","disabled");I=document.createElement("option");I.setAttribute("value","public");Q.appendChild(I);null!=B?(mxUtils.write(I,mxResources.get("publicDiagramUrl")),I.setAttribute("title",+B),Q.value="public"):(mxUtils.write(I,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),I.setAttribute("disabled","disabled"));K.appendChild(Q);mxUtils.br(K);Q.focus();var P=null,p=null;if(null!=g||null!=m)d+=30,mxUtils.write(K,mxResources.get("width")+":"),P=document.createElement("input"),P.setAttribute("type","text"),P.style.marginRight="16px",P.style.width="50px",P.style.marginLeft="6px",P.style.marginRight="16px",P.style.marginBottom="10px",P.value="100%",K.appendChild(P),+mxUtils.write(K,mxResources.get("height")+":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.width="50px",p.style.marginLeft="6px",p.style.marginBottom="10px",p.value=m+"px",K.appendChild(p),mxUtils.br(K);var z=this.addLinkSection(K,t),A=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(d+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),A=this.addCheckbox(K,mxResources.get("selectedPage")++": "+g));var C=this.addCheckbox(K,mxResources.get("lightbox"),!0,null,null,!t),M=this.addEditButton(K,C),S=M.getEditInput();t&&(S.style.marginLeft=C.style.marginLeft,C.style.display="none",d-=20);var l=this.addCheckbox(K,mxResources.get("layers"),!0);l.style.marginLeft=S.style.marginLeft;l.style.marginTop="8px";var x=this.addCheckbox(K,mxResources.get("tags"),!0);x.style.marginLeft=S.style.marginLeft;x.style.marginBottom="16px";x.style.marginTop="16px";mxEvent.addListener(C,"change",function(){C.checked?+(l.removeAttribute("disabled"),S.removeAttribute("disabled"),x.removeAttribute("disabled")):(l.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"));S.checked&&C.checked?M.getEditSelect().removeAttribute("disabled"):M.getEditSelect().setAttribute("disabled","disabled")});t=new CustomDialog(this,K,mxUtils.bind(this,function(){J(z.getTarget(),z.getColor(),null==A?!1:A.checked,C.checked,M.getLink(),l.checked,null!=P?P.value:null,null!=p?p.value:+null,x.checked,Q.value)}),null,mxResources.get("create"),v,y);this.showDialog(t.container,340,296+d,!0,!0);null!=P?(P.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?P.select():document.execCommand("selectAll",!1,null)):null==Q.parentNode;z.focus()};EditorUi.prototype.showRemoteExportDialog=function(d,g,m,t,v){var y=document.createElement("div");y.style.whiteSpace="nowrap";var B=document.createElement("h3");mxUtils.write(B,mxResources.get("image"));B.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"++(v?"10":"4")+"px";y.appendChild(B);if(v){mxUtils.write(y,mxResources.get("zoom")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.marginRight="16px";I.style.width="60px";I.style.marginLeft="4px";I.style.marginRight="12px";I.value=this.lastExportZoom||"100%";y.appendChild(I);mxUtils.write(y,mxResources.get("borderWidth")+":");var J=document.createElement("input");J.setAttribute("type","text");J.style.marginRight="16px";J.style.width="60px";J.style.marginLeft="4px";J.value=+this.lastExportBorder||"0";y.appendChild(J);mxUtils.br(y)}var K=this.addCheckbox(y,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),V=t?null:this.addCheckbox(y,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);B=this.editor.graph;var Q=t?null:this.addCheckbox(y,mxResources.get("transparentBackground"),B.background==mxConstants.NONE||null==B.background);null!=Q&&(Q.style.marginBottom="16px");d=new CustomDialog(this,y,mxUtils.bind(this,function(){var P=+parseInt(I.value)/100||1,p=parseInt(J.value)||0;m(!K.checked,null!=V?V.checked:!1,null!=Q?Q.checked:!1,P,p)}),null,d,g);this.showDialog(d.container,300,(v?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(d,g,m,t,v,y,B,I,J){B=null!=B?B:Editor.defaultIncludeDiagram;var K=document.createElement("div");K.style.whiteSpace="nowrap";var V=this.editor.graph,Q="jpeg"==I||"webp"==I?220:320,P=document.createElement("h3");mxUtils.write(P,d);P.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";+K.appendChild(P);mxUtils.write(K,mxResources.get("zoom")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight="12px";p.value=this.lastExportZoom||"100%";K.appendChild(p);mxUtils.write(K,mxResources.get("borderWidth")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.marginRight="16px";z.style.width="60px";z.style.marginLeft="4px";z.value=this.lastExportBorder||+"0";K.appendChild(z);mxUtils.br(K);var A=this.addCheckbox(K,mxResources.get("selectionOnly"),!1,V.isSelectionEmpty()),C=document.createElement("input");C.style.marginTop="16px";C.style.marginRight="8px";C.style.marginLeft="24px";C.setAttribute("disabled","disabled");C.setAttribute("type","checkbox");var M=document.createElement("select");M.style.marginTop="16px";M.style.marginLeft="8px";d=["selectionOnly","diagram","page"];for(P=0;P<d.length;P++)if(!V.isSelectionEmpty()||"selectionOnly"!=d[P]){var S=+document.createElement("option");mxUtils.write(S,mxResources.get(d[P]));S.setAttribute("value",d[P]);M.appendChild(S)}J?(mxUtils.write(K,mxResources.get("size")+":"),K.appendChild(M),mxUtils.br(K),Q+=26,mxEvent.addListener(M,"change",function(){"selectionOnly"==M.value&&(A.checked=!0)})):y&&(K.appendChild(C),mxUtils.write(K,mxResources.get("crop")),mxUtils.br(K),Q+=30,mxEvent.addListener(A,"change",function(){A.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));V.isSelectionEmpty()?+J&&(A.style.display="none",A.nextSibling.style.display="none",A.nextSibling.nextSibling.style.display="none",Q-=30):(M.value="diagram",C.setAttribute("checked","checked"),C.defaultChecked=!0,mxEvent.addListener(A,"change",function(){M.value=A.checked?"selectionOnly":"diagram"}));var l=this.addCheckbox(K,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=I&&"webp"!=I),x=document.createElement("select");x.style.maxWidth="260px";x.style.marginLeft="8px";x.style.marginTop="16px";y=document.createElement("option");+y.setAttribute("value","light");mxUtils.write(y,mxResources.get("light"));x.appendChild(y);J=document.createElement("option");J.setAttribute("value","dark");mxUtils.write(J,mxResources.get("dark"));x.appendChild(J);"svg"==I?(y=document.createElement("option"),y.setAttribute("value","auto"),mxUtils.write(y,mxResources.get("automatic")),y.setAttribute("selected","selected"),x.appendChild(y)):Editor.isDarkMode()?J.setAttribute("selected","selected"):y.setAttribute("selected","selected");mxUtils.write(K,+mxResources.get("appearance")+":");K.appendChild(x);mxUtils.br(K);Q+=26;var G=this.addCheckbox(K,mxResources.get("shadow"),V.shadowVisible),N=null;if("png"==I||"jpeg"==I||"webp"==I)N=this.addCheckbox(K,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),Q+=30;var O=this.addCheckbox(K,mxResources.get("includeCopyOfMyDiagram")+":",B,null,null,"jpeg"!=I&&"webp"!=I),R=document.createElement("select");R.style.maxWidth="260px";R.style.marginLeft="28px";"png"==I||"svg"==I?(B=function(){O.checked?+R.removeAttribute("disabled"):R.setAttribute("disabled","disabled")},V=document.createElement("option"),V.setAttribute("value","allPages"),mxUtils.write(V,mxResources.get("allPages")),R.appendChild(V),V=document.createElement("option"),V.setAttribute("value","currentPage"),mxUtils.write(V,mxResources.get("currentPage")),R.appendChild(V),O.style.marginBottom="12px",R.style.marginBottom="16px",K.appendChild(R),mxUtils.br(K),Q+=20,null!=this.lastEmbedInclude&&(R.value=this.lastEmbedInclude),mxEvent.addListener(O,+"change",B),B()):O.style.marginBottom="16px";var T=document.createElement("input");T.style.marginBottom="16px";T.style.marginRight="8px";T.setAttribute("type","checkbox");var U=document.createElement("input");U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");g&&(T.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,K.appendChild(T),mxUtils.write(K,mxResources.get("embedImages")),mxUtils.br(K),U.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,+K.appendChild(U),mxUtils.write(K,mxResources.get("embedFonts")),mxUtils.br(K),Q+=50);var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";y=document.createElement("option");y.setAttribute("value","auto");mxUtils.write(y,mxResources.get("automatic"));W.appendChild(y);B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("openInNewWindow"));W.appendChild(B);B=document.createElement("option");B.setAttribute("value","self");+mxUtils.write(B,mxResources.get("openInThisWindow"));W.appendChild(B);B=document.createElement("div");mxUtils.write(B,mxResources.get("LinksLost"));B.style.margin="7px";B.style.display="none";"svg"==I&&(mxUtils.write(K,mxResources.get("links")+":"),K.appendChild(W),K.appendChild(B),mxUtils.br(K),mxUtils.br(K),Q+=50);m=new CustomDialog(this,K,mxUtils.bind(this,function(){this.lastExportBorder=z.value;this.lastExportZoom=p.value;this.lastEmbedImages=T.checked;this.lastEmbedFonts=U.checked;this.lastEmbedInclude=+R.value;v(p.value,l.checked,!A.checked,G.checked,O.checked,T.checked&&g,z.value,C.checked,("png"==I||"svg"==I)&&"currentPage"==R.value,W.value,null!=N?N.checked:null,null!=x?x.value:null,M.value,U.checked)}),null,m,t);this.showDialog(m.container,340,Q,!0,!0,null,null,null,null,!0);p.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?p.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(d,g,m,t,v){var y=document.createElement("div");y.style.whiteSpace=+"nowrap";var B=this.editor.graph;if(null!=g){var I=document.createElement("h3");mxUtils.write(I,g);I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";y.appendChild(I)}var J=this.addCheckbox(y,mxResources.get("fit"),!0),K=this.addCheckbox(y,mxResources.get("shadow"),B.shadowVisible&&t,!t),V=this.addCheckbox(y,m),Q=this.addCheckbox(y,mxResources.get("lightbox"),!0),P=this.addEditButton(y,Q),p=P.getEditInput(),z=1<B.model.getChildCount(B.model.getRoot()),A=this.addCheckbox(y,+mxResources.get("layers"),z,!z);A.style.marginLeft=p.style.marginLeft;A.style.marginBottom="12px";A.style.marginTop="8px";mxEvent.addListener(Q,"change",function(){Q.checked?(z&&A.removeAttribute("disabled"),p.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"));p.checked&&Q.checked?P.getEditSelect().removeAttribute("disabled"):P.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,y,mxUtils.bind(this,function(){d(J.checked,+K.checked,V.checked,Q.checked,P.getLink(),A.checked)}),null,mxResources.get("embed"),v);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(d,g,m,t,v,y,B,I){function J(p){var z=" ",A="";t&&(z=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=V?"&page="+V:"")+(v?"&edit=_blank":"")+(y?"&layers=1":"")+"');}})(this);\"",A+="cursor:pointer;");d&&(A+="max-width:100%;");var C="";m&&(C=' width="'+Math.round(K.width)+'" height="'+Math.round(K.height)+'"');B('<img src="'+p+'"'+C+(""!=A?' style="'+A+'"':"")+z+"/>")}var K=this.editor.graph.getGraphBounds(),V=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(p){var z=t?this.getFileData(!0):null;p=+this.createImageDataUri(p,z,"png");J(p)}),null,null,null,mxUtils.bind(this,function(p){I({message:mxResources.get("unknownError")})}),null,!0,m?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),K.width*K.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var Q="";m&&(Q="&w="+Math.round(2*K.width)+"&h="+Math.round(2*K.height));var P=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(t?"1":"0")+Q+"&xml="+encodeURIComponent(g));P.send(mxUtils.bind(this,function(){200<=P.getStatus()&&+299>=P.getStatus()?J("data:image/png;base64,"+P.getText()):I({message:mxResources.get("unknownError")})}))}else I({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(d,g,m,t,v,y,B){var I=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!m,"auto"),J=I.getElementsByTagName("a");if(null!=J)for(var K=0;K<J.length;K++){var V=J[K].getAttribute("href");null!=V&&"#"==V.charAt(0)&&"_blank"==J[K].getAttribute("target")&&J[K].removeAttribute("target")}t&&+I.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(I);if(m){var Q=" ",P="";t&&(Q="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(v?"&edit=_blank":"")+(y?"&layers=1":+"")+"');}})(this);\"",P+="cursor:pointer;");d&&(P+="max-width:100%;");this.editor.convertImages(I,mxUtils.bind(this,function(p){B('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(p))+'"'+(""!=P?' style="'+P+'"':"")+Q+"/>")}))}else P="",t&&(g=this.getSelectedPageIndex(),I.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=g?"&page="+g:"")+(v?"&edit=_blank":"")+(y?"&layers=1":"")+"');}}})(this);"),P+="cursor:pointer;"),d&&(d=parseInt(I.getAttribute("width")),v=parseInt(I.getAttribute("height")),I.setAttribute("viewBox","-0.5 -0.5 "+d+" "+v),P+="max-width:100%;max-height:"+v+"px;",I.removeAttribute("height")),""!=P&&I.setAttribute("style",P),this.editor.addFontCss(I),this.editor.graph.mathEnabled&&this.editor.addMathCss(I),B(mxUtils.getXml(I))};EditorUi.prototype.timeSince=function(d){d=Math.floor((new Date-d)/1E3);var g=Math.floor(d/31536E3);if(1<g)return g+" "+mxResources.get("years");g=Math.floor(d/2592E3);if(1<g)return g+" "+mxResources.get("months");g=Math.floor(d/86400);if(1<g)return g+" "+mxResources.get("days");g=Math.floor(d/3600);if(1<g)return g+" "+mxResources.get("hours");g=Math.floor(d/60);return 1<g?g+" "+mxResources.get("minutes"):1==g?g+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(d,g){if(null!=d){var m=null;if("diagram"==d.nodeName)m=d;else if("mxfile"==d.nodeName){var t=d.getElementsByTagName("diagram");if(0<t.length){m=t[0];var v=g.getGlobalVariable;g.getGlobalVariable=function(y){return"page"==y?m.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==y?1:v.apply(this,arguments)}}}null!=m&&(d=Editor.parseDiagramNode(m))}t=this.editor.graph;try{this.editor.graph=g,this.editor.setGraphXml(d)}catch(y){}finally{this.editor.graph=t}return d};EditorUi.prototype.getSvgFileProperties=function(d){return this.getPngFileProperties(d)};EditorUi.prototype.getPngFileProperties=function(d){var g=1,m=0;if(null!=d){if(d.hasAttribute("scale")){var t=parseFloat(d.getAttribute("scale"));!isNaN(t)&&0<t&&(g=t)}d.hasAttribute("border")&&(t=parseInt(d.getAttribute("border")),!isNaN(t)&&0<t&&(m=t))}return{scale:g,border:m}};EditorUi.prototype.getEmbeddedPng=function(d,g,m,t,v){try{var y=this.editor.graph,B=null;if(null!=m&&0<m.length)y=this.createTemporaryGraph(y.getStylesheet()),document.body.appendChild(y.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(m).documentElement,-!0),y),B=m;else if(null!=this.pages&&this.currentPage!=this.pages[0]){y=this.createTemporaryGraph(y.getStylesheet());var I=y.getGlobalVariable;y.setBackgroundImage=this.editor.graph.setBackgroundImage;var K=this.pages[0];this.currentPage==K?y.setBackgroundImage(this.editor.graph.backgroundImage):null!=K.viewState&&null!=K.viewState&&y.setBackgroundImage(K.viewState.backgroundImage);y.getGlobalVariable=function(J){return"page"==J?K.getName():"pagenumber"==J?1:I.apply(this,arguments)};document.body.appendChild(y.container);-y.model.setRoot(K.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(J){try{null==B&&(B=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var V=J.toDataURL("image/png");V=Editor.writeGraphModelToPng(V,"tEXt","mxfile",encodeURIComponent(B));d(V.substring(V.lastIndexOf(",")+1));y!=this.editor.graph&&y.container.parentNode.removeChild(y.container)}catch(Q){null!=g&&g(Q)}}),null,null,null,mxUtils.bind(this,function(J){null!=g&&g(J)}),null,null,t,null,y.shadowVisible,null,y,v,null,-null,null,"diagram",null)}catch(J){null!=g&&g(J)}};EditorUi.prototype.getEmbeddedSvg=function(d,g,m,t,v,y,B,I,K,J,V,Q,O){I=null!=I?I:!0;V=null!=V?V:0;B=null!=K?K:g.background;B==mxConstants.NONE&&(B=null);null==B&&"none"==g.getAdaptiveColors()&&(B="#ffffff");K=this.editor.graph.createSvgImageExport(null!=d);y=g.getSvg(B,J,V,null,null,y,null,K,null,g.shadowVisible||Q,null,O,"diagram");(g.shadowVisible||Q)&&g.addSvgShadow(y,null,null,0==V);null!=d&&y.setAttribute("content",d);null!=m&&y.setAttribute("resource",+!0),y),B=m;else if(null!=this.pages&&this.currentPage!=this.pages[0]){y=this.createTemporaryGraph(y.getStylesheet());var I=y.getGlobalVariable;y.setBackgroundImage=this.editor.graph.setBackgroundImage;var J=this.pages[0];this.currentPage==J?y.setBackgroundImage(this.editor.graph.backgroundImage):null!=J.viewState&&null!=J.viewState&&y.setBackgroundImage(J.viewState.backgroundImage);y.getGlobalVariable=function(K){return"page"==K?J.getName():"pagenumber"==K?1:I.apply(this,arguments)};document.body.appendChild(y.container);+y.model.setRoot(J.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(K){try{null==B&&(B=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var V=K.toDataURL("image/png");V=Editor.writeGraphModelToPng(V,"tEXt","mxfile",encodeURIComponent(B));d(V.substring(V.lastIndexOf(",")+1));y!=this.editor.graph&&y.container.parentNode.removeChild(y.container)}catch(Q){null!=g&&g(Q)}}),null,null,null,mxUtils.bind(this,function(K){null!=g&&g(K)}),null,null,t,null,y.shadowVisible,null,y,v,null,+null,null,"diagram",null)}catch(K){null!=g&&g(K)}};EditorUi.prototype.getEmbeddedSvg=function(d,g,m,t,v,y,B,I,J,K,V,Q,P){I=null!=I?I:!0;V=null!=V?V:0;B=null!=J?J:g.background;B==mxConstants.NONE&&(B=null);null==B&&"none"==g.getAdaptiveColors()&&(B="#ffffff");J=this.editor.graph.createSvgImageExport(null!=d);y=g.getSvg(B,K,V,null,null,y,null,J,null,g.shadowVisible||Q,null,P,"diagram");(g.shadowVisible||Q)&&g.addSvgShadow(y,null,null,0==V);null!=d&&y.setAttribute("content",d);null!=m&&y.setAttribute("resource",m);var p=mxUtils.bind(this,function(z){z=(t?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(z);null!=v&&v(z);return z});g.mathEnabled&&this.editor.addMathCss(y);if(null!=v)this.embedFonts(y,mxUtils.bind(this,function(z){I?this.editor.convertImages(z,mxUtils.bind(this,function(A){p(A)})):p(z)}));else return p(y)};EditorUi.prototype.embedFonts=function(d,g){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(d,-this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(m){try{null!=m&&this.editor.addFontCss(d,m),g(d)}catch(t){g(d)}}))}catch(m){g(d)}}))};EditorUi.prototype.exportImage=function(d,g,m,t,v,y,B,I,K,J,V,Q,O){K=null!=K?K:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(z){Editor.addRetryToError(z,mxUtils.bind(this,function(){this.exportImage(d,g,m,t,v,y,B,I,K,J,V,Q,O)}));this.handleError(z)}))){var p=this.editor.graph.isSelectionEmpty();-m=null!=m?m:p;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(z){this.spinner.stop();try{this.saveCanvas(z,v?this.getFileData(!0,null,null,null,m,I,null,null,null,null,null,d,y):null,K,null==this.pages||0==this.pages.length,V)}catch(A){this.handleError(A)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),null,m,d||1,g,t,null,null,y,B,J,Q,O)}catch(z){this.spinner.stop(),this.handleError(z)}}};-EditorUi.prototype.isCorsEnabledForUrl=function(d){return this.editor.isCorsEnabledForUrl(d)};EditorUi.prototype.addLocalPagesToMapping=function(d){d=null!=d?d:{};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)d[this.pages[g].getId()]=this.pages[g].getId();return d};EditorUi.prototype.importXml=function(d,g,m,t,v,y,B){g=null!=g?g:0;m=null!=m?m:0;var I=[];try{var K=this.editor.graph;if(null!=d&&0<d.length){K.model.beginUpdate();try{var J=mxUtils.parseXml(d);d={};var V=this.editor.extractGraphModel(J.documentElement,-null!=this.pages);if(null!=V&&"mxfile"==V.nodeName&&null!=this.pages){var Q=V.getElementsByTagName("diagram");if(1==Q.length&&!y){if(V=Editor.parseDiagramNode(Q[0]),null!=this.currentPage&&(d[Q[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var O=Q[0].getAttribute("name");null!=O&&""!=O&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,O))}}else if(0<Q.length){y=[];var p=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(d[Q[0].getAttribute("id")]=-this.pages[0].getId(),O=Q[0].getAttribute("name"),null!=O&&""!=O&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],O)),V=Editor.parseDiagramNode(Q[0]),t=!1,p=1);for(;p<Q.length;p++){var z=Q[p].getAttribute("id");Q[p].removeAttribute("id");var A=this.updatePageRoot(new DiagramPage(Q[p]));d[z]=Q[p].getAttribute("id");var C=this.pages.length;null==A.getName()&&A.setName(mxResources.get("pageWithNumber",[C+1]));K.model.execute(new ChangePage(this,A,A,C,!0));y.push(A)}this.updatePageLinks(d,-y)}}if(null!=V&&"mxGraphModel"===V.nodeName){I=K.importGraphModel(V,g,m,t);if(null!=I)for(this.addLocalPagesToMapping(d),p=0;p<I.length;p++)this.updatePageLinksForCell(d,I[p]);var M=K.parseBackgroundImage(V.getAttribute("backgroundImage"));if(null!=M&&null!=M.originalSrc){this.updateBackgroundPageLink(d,M);var S=new ChangePageSetup(this,null,M);S.ignoreColor=!0;K.model.execute(S)}}B&&K.pasteCellStyles(K.includeDescendants(I),K.defaultVertexStyle,K.defaultEdgeStyle)}finally{K.model.endUpdate()}}}catch(l){if(v)throw l;+this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(m){try{null!=m&&this.editor.addFontCss(d,m),g(d)}catch(t){g(d)}}))}catch(m){g(d)}}))};EditorUi.prototype.exportImage=function(d,g,m,t,v,y,B,I,J,K,V,Q,P){J=null!=J?J:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(z){Editor.addRetryToError(z,mxUtils.bind(this,function(){this.exportImage(d,g,m,t,v,y,B,I,J,K,V,Q,P)}));this.handleError(z)}))){var p=this.editor.graph.isSelectionEmpty();+m=null!=m?m:p;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(z){this.spinner.stop();try{this.saveCanvas(z,v?this.getFileData(!0,null,null,null,m,I,null,null,null,null,null,d,y):null,J,null==this.pages||0==this.pages.length,V)}catch(A){this.handleError(A)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),null,m,d||1,g,t,null,null,y,B,K,Q,P)}catch(z){this.spinner.stop(),this.handleError(z)}}};+EditorUi.prototype.isCorsEnabledForUrl=function(d){return this.editor.isCorsEnabledForUrl(d)};EditorUi.prototype.addLocalPagesToMapping=function(d){d=null!=d?d:{};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)d[this.pages[g].getId()]=this.pages[g].getId();return d};EditorUi.prototype.importXml=function(d,g,m,t,v,y,B){g=null!=g?g:0;m=null!=m?m:0;var I=[];try{var J=this.editor.graph;if(null!=d&&0<d.length){J.model.beginUpdate();try{var K=mxUtils.parseXml(d);d={};var V=this.editor.extractGraphModel(K.documentElement,+null!=this.pages);if(null!=V&&"mxfile"==V.nodeName&&null!=this.pages){var Q=V.getElementsByTagName("diagram");if(1==Q.length&&!y){if(V=Editor.parseDiagramNode(Q[0]),null!=this.currentPage&&(d[Q[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var P=Q[0].getAttribute("name");null!=P&&""!=P&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,P))}}else if(0<Q.length){y=[];var p=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(d[Q[0].getAttribute("id")]=+this.pages[0].getId(),P=Q[0].getAttribute("name"),null!=P&&""!=P&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],P)),V=Editor.parseDiagramNode(Q[0]),t=!1,p=1);for(;p<Q.length;p++){var z=Q[p].getAttribute("id");Q[p].removeAttribute("id");var A=this.updatePageRoot(new DiagramPage(Q[p]));d[z]=Q[p].getAttribute("id");var C=this.pages.length;null==A.getName()&&A.setName(mxResources.get("pageWithNumber",[C+1]));J.model.execute(new ChangePage(this,A,A,C,!0));y.push(A)}this.updatePageLinks(d,+y)}}if(null!=V&&"mxGraphModel"===V.nodeName){I=J.importGraphModel(V,g,m,t);if(null!=I)for(this.addLocalPagesToMapping(d),p=0;p<I.length;p++)this.updatePageLinksForCell(d,I[p]);var M=J.parseBackgroundImage(V.getAttribute("backgroundImage"));if(null!=M&&null!=M.originalSrc){this.updateBackgroundPageLink(d,M);var S=new ChangePageSetup(this,null,M);S.ignoreColor=!0;J.model.execute(S)}}B&&J.pasteCellStyles(J.includeDescendants(I),J.defaultVertexStyle,J.defaultEdgeStyle)}finally{J.model.endUpdate()}}}catch(l){if(v)throw l;this.handleError(l)}return I};EditorUi.prototype.updatePageLinks=function(d,g){for(var m=0;m<g.length;m++)this.updatePageLinksForCell(d,g[m].root),null!=g[m].viewState&&this.updateBackgroundPageLink(d,g[m].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(d,g){try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var m=d[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=m&&(g.originalSrc="data:page/id,"+m)}}catch(t){}};EditorUi.prototype.updatePageLinksForCell=function(d,g){var m=document.createElement("div"),t=this.editor.graph,v=t.getLinkForCell(g);null!=v&&t.setLinkForCell(g,this.updatePageLink(d,v));if(t.isHtmlLabel(g)){m.innerHTML=Graph.sanitizeHtml(t.getLabel(g));for(var y=m.getElementsByTagName("a"),B=!1,I=0;I<y.length;I++)v=y[I].getAttribute("href"),null!=v&&(y[I].setAttribute("href",this.updatePageLink(d,v)),B=!0);B&&t.labelChanged(g,m.innerHTML)}for(I=0;I<t.model.getChildCount(g);I++)this.updatePageLinksForCell(d,t.model.getChildAt(g,I))};EditorUi.prototype.updatePageLink=function(d,g){if(Graph.isPageLink(g)){var m=d[g.substring(g.indexOf(",")+1)];g=null!=m?"data:page/id,"+m:null}else if("data:action/json,"==g.substring(0,17))try{var t=JSON.parse(g.substring(17));if(null!=t.actions){for(var v=0;v<t.actions.length;v++){var y=t.actions[v];if(null!=y.open&&Graph.isPageLink(y.open)){var B=y.open.substring(y.open.indexOf(",")+1);m=d[B];null!=m?y.open="data:page/id,"+m:null==this.getPageById(B)&&delete y.open}}g="data:action/json,"+JSON.stringify(t)}}catch(I){}return g};-EditorUi.prototype.isRemoteVisioFormat=function(d){return/(\.v(sd|dx))($|\?)/i.test(d)||/(\.vs(s|x))($|\?)/i.test(d)};EditorUi.prototype.importVisio=function(d,g,m,t,v){var y=mxUtils.bind(this,function(B){this.loadingExtensions=!1;null!=m?m(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){t=null!=t?t:d.name;var I=mxUtils.bind(this,function(J){B.clear()&&y(J)}),K=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var J=this.isRemoteVisioFormat(t);-try{var V=t.lastIndexOf(".");if(0<=V&&V<t.length)t.substring(V+1).toUpperCase();else{var Q=t.lastIndexOf("/");0<=Q&&Q<t.length&&(t=t.substring(Q+1))}}catch(p){}if(J)if(null==VSD_CONVERT_URL||this.isOffline())I({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{J=new FormData;J.append("file1",d,t);var O=new XMLHttpRequest;O.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));O.responseType="blob";this.addRemoteServiceSecurityCheck(O);-null!=v&&O.setRequestHeader("x-convert-custom",v);O.onreadystatechange=mxUtils.bind(this,function(){if(4==O.readyState&&B.clear())if(200<=O.status&&299>=O.status)try{var p=O.response;if("text/xml"==p.type){var z=new FileReader;z.onload=mxUtils.bind(this,function(A){try{g(A.target.result)}catch(C){I({message:mxResources.get("errorLoadingFile")})}});z.readAsText(p)}else this.doImportVisio(p,g,I,t)}catch(A){I(A)}else try{""==O.responseType||"text"==O.responseType?I({message:O.responseText}):(z=new FileReader,-z.onload=function(){try{I({message:JSON.parse(z.result).Message})}catch(A){I(A)}},z.readAsText(O.response))}catch(A){I({})}});O.send(J)}else if(B.clear())try{this.doImportVisio(d,g,I,t)}catch(p){I(p)}}else I({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?K():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",K,null,null,null,I))}),y)};EditorUi.prototype.importGraphML=function(d,g,m){var t=+EditorUi.prototype.isRemoteVisioFormat=function(d){return/(\.v(sd|dx))($|\?)/i.test(d)||/(\.vs(s|x))($|\?)/i.test(d)};EditorUi.prototype.importVisio=function(d,g,m,t,v){var y=mxUtils.bind(this,function(B){this.loadingExtensions=!1;null!=m?m(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){t=null!=t?t:d.name;var I=mxUtils.bind(this,function(K){B.clear()&&y(K)}),J=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var K=this.isRemoteVisioFormat(t);+try{var V=t.lastIndexOf(".");if(0<=V&&V<t.length)t.substring(V+1).toUpperCase();else{var Q=t.lastIndexOf("/");0<=Q&&Q<t.length&&(t=t.substring(Q+1))}}catch(p){}if(K)if(null==VSD_CONVERT_URL||this.isOffline())I({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{K=new FormData;K.append("file1",d,t);var P=new XMLHttpRequest;P.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));P.responseType="blob";this.addRemoteServiceSecurityCheck(P);+null!=v&&P.setRequestHeader("x-convert-custom",v);P.onreadystatechange=mxUtils.bind(this,function(){if(4==P.readyState&&B.clear())if(200<=P.status&&299>=P.status)try{var p=P.response;if("text/xml"==p.type){var z=new FileReader;z.onload=mxUtils.bind(this,function(A){try{g(A.target.result)}catch(C){I({message:mxResources.get("errorLoadingFile")})}});z.readAsText(p)}else this.doImportVisio(p,g,I,t)}catch(A){I(A)}else try{""==P.responseType||"text"==P.responseType?I({message:P.responseText}):(z=new FileReader,+z.onload=function(){try{I({message:JSON.parse(z.result).Message})}catch(A){I(A)}},z.readAsText(P.response))}catch(A){I({})}});P.send(K)}else if(B.clear())try{this.doImportVisio(d,g,I,t)}catch(p){I(p)}}else I({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?J():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",J,null,null,null,I))}),y)};EditorUi.prototype.importGraphML=function(d,g,m){var t=mxUtils.bind(this,function(v){this.loadingExtensions=!1;null!=m?m(v):this.handleError(v)});this.createTimeout(null,mxUtils.bind(this,function(v){var y=mxUtils.bind(this,function(I){v.clear()&&t(I)}),B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(v.clear())if(this.doImportGraphML)try{this.doImportGraphML(d,g,t)}catch(I){y(I)}else y({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?B():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,y))}),t)};EditorUi.prototype.exportVisio=function(d){if(this.spinner.spin(document.body,mxResources.get("loading"))){var g=mxUtils.bind(this,function(m){this.loadingExtensions=!1;this.handleError(m)});this.createTimeout(null,mxUtils.bind(this,function(m){var t=mxUtils.bind(this,function(y){m.clear()&&g(y)}),v=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(m.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(d)||t({message:mxResources.get("unknownError")})}catch(y){t(y)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(v,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",v,null,null,null,t))}),g)}};EditorUi.prototype.convertLucidChart=function(d,g,m){var t=mxUtils.bind(this,function(v){this.loadingExtensions=!1;-null!=m?m(v):this.handleError(v)});this.createTimeout(null,mxUtils.bind(this,function(v){var y=mxUtils.bind(this,function(I){v.clear()&&t(I)}),B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(v.clear())if("undefined"!==typeof window.LucidImporter)try{var I=JSON.parse(d);g(LucidImporter.importState(I));try{if(null!=window.console&&"1"==urlParams.test){var K=[(new Date).toISOString(),"convertLucidChart",I];null!=I.state&&K.push(JSON.parse(I.state));if(null!=I.svgThumbs)for(var J=0;J<I.svgThumbs.length;J++)K.push(Editor.createSvgDataUri(I.svgThumbs[J]));-null!=I.thumb&&K.push(I.thumb);console.log.apply(console,K)}}catch(V){}}catch(V){null!=window.console&&console.error(V),y(V)}else y({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(B,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",+null!=m?m(v):this.handleError(v)});this.createTimeout(null,mxUtils.bind(this,function(v){var y=mxUtils.bind(this,function(I){v.clear()&&t(I)}),B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(v.clear())if("undefined"!==typeof window.LucidImporter)try{var I=JSON.parse(d);g(LucidImporter.importState(I));try{if(null!=window.console&&"1"==urlParams.test){var J=[(new Date).toISOString(),"convertLucidChart",I];null!=I.state&&J.push(JSON.parse(I.state));if(null!=I.svgThumbs)for(var K=0;K<I.svgThumbs.length;K++)J.push(Editor.createSvgDataUri(I.svgThumbs[K]));+null!=I.thumb&&J.push(I.thumb);console.log.apply(console,J)}}catch(V){}}catch(V){null!=window.console&&console.error(V),y(V)}else y({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(B,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",B,null,null,null,y)},null,null,null,y)},null,null,null,y)},null,null,null,y)},null,null,null,y):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,y))}),t)};EditorUi.prototype.createMermaidXml=function(d,g,m,t,v,y){var B=new Graph(document.createElement("div"));m=B.insertVertex(null,null,null,0,0,t,v,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+m+";");B.setAttributeForCell(m,"mermaidData",JSON.stringify({data:d,-config:g},null,2));null!=y&&B.setAttributeForCell(m,"templatePrompt",y);d=(new mxCodec).encode(B.getModel());return mxUtils.getXml(d)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(d,g,m){var t=0,v=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(y){var B=new mxXmlRequest("https://www.draw.io/generate/v2",d,"POST"),I=mxUtils.bind(this,function(K){y.clear()&&m(K)});B.send(mxUtils.bind(this,function(K){if(y.isAlive())if(200<=K.getStatus()&&299>=K.getStatus())this.tryAndHandle(mxUtils.bind(this,-function(){var V=mxUtils.trim(K.getText());this.generateMermaidImage(V,null,mxUtils.bind(this,function(Q,O,p){this.tryAndHandle(mxUtils.bind(this,function(){y.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",d,"\nresult:",V),g(V,Q,O,p))}),I)}),I,mxUtils.bind(this,function(Q){3>t++?y.clear()&&v():I(Q)}))}),I);else{var J={message:mxResources.get("error")+" "+K.getStatus()};try{J=JSON.parse(K.getText()),J=J.error}catch(V){}I(J)}}),I)}),m)});v()};EditorUi.prototype.extractMermaidDeclaration=+config:g},null,2));null!=y&&B.setAttributeForCell(m,"templatePrompt",y);d=(new mxCodec).encode(B.getModel());return mxUtils.getXml(d)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(d,g,m){var t=0,v=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(y){var B=new mxXmlRequest("https://www.draw.io/generate/v2",d,"POST"),I=mxUtils.bind(this,function(J){y.clear()&&m(J)});B.send(mxUtils.bind(this,function(J){if(y.isAlive())if(200<=J.getStatus()&&299>=J.getStatus())this.tryAndHandle(mxUtils.bind(this,+function(){var V=mxUtils.trim(J.getText());this.generateMermaidImage(V,null,mxUtils.bind(this,function(Q,P,p){this.tryAndHandle(mxUtils.bind(this,function(){y.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",d,"\nresult:",V),g(V,Q,P,p))}),I)}),I,mxUtils.bind(this,function(Q){3>t++?y.clear()&&v():I(Q)}))}),I);else{var K={message:mxResources.get("error")+" "+J.getStatus()};try{K=JSON.parse(J.getText()),K=K.error}catch(V){}I(K)}}),I)}),m)});v()};EditorUi.prototype.extractMermaidDeclaration=function(d){d=mxUtils.trim(d);"o\n\n"==d.substring(0,3)&&(d=d.substring(3));var g=d.split("```");g=1<g.length?g:d.split("<pre>");g=1<g.length?g:d.split("~~~");g=1<g.length?g:d.split("%%");g=1<g.length?g:d.split("(Begins)");d=mxUtils.trim(1>=g.length?d:g[1]);g=d.split("\n");var m=1<g.length?g[1]:null;if(null!=m){var t=m.indexOf("-");0<t&&(m=m.substring(0,t))}if(0<g.length&&"mermaid"==mxUtils.trim(g[0])||null!=m&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,m))g.shift(),d=mxUtils.trim(g.join("\n")),g=d.split("\n");m=g[0].split(" ")[0].replace(/:$/,"");t=m.indexOf("-");0<t&&(m=m.substring(0,t));try{"mindmap"==m&&2<g.length&&(d=extractMermaidMindmap(g))}catch(v){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,m)&&(d=null);return d};EditorUi.prototype.generateMermaidImage=function(d,g,m,t,v){var y=mxUtils.bind(this,function(I){this.loadingMermaid=!1;null!=t?t(I):this.handleError(I)}),B=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;g=null!=g?g:mxUtils.clone(EditorUi.defaultMermaidConfig);-g.securityLevel="strict";g.startOnLoad=!1;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=d.indexOf("$$")&&(g.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(g.theme="dark");var I=mxUtils.bind(this,function(K){try{if(mxClient.IS_IE||mxClient.IS_IE11)K=K.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var J=mxUtils.parseXml(K).getElementsByTagName("svg");if(0<J.length&&"error"!=-J[0].getAttribute("aria-roledescription")){var V=parseFloat(J[0].getAttribute("width")),Q=parseFloat(J[0].getAttribute("height"));if(isNaN(V)||isNaN(Q))try{var O=J[0].getAttribute("viewBox").split(/\s+/);V=parseFloat(O[2]);Q=parseFloat(O[3])}catch(p){V=V||100,Q=Q||100}m(this.convertDataUri(Editor.createSvgDataUri(K)),V,Q)}else null!=v?v():t({message:mxResources.get("invalidInput")})}catch(p){t(p)}});mermaid.mermaidAPI.initialize(g);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),-d).then(function(K){I(K.svg)}).catch(function(K){null!=v?v(K):t(K)})}catch(K){t(K)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(B,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(I){this.importXml(I,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",B,null,null,null,y)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,y))};-EditorUi.prototype.generatePlantUmlImage=function(d,g,m,t){function v(I,K,J){c1=I>>2;c2=(I&3)<<4|K>>4;c3=(K&15)<<2|J>>6;c4=J&63;r="";r+=y(c1&63);r+=y(c2&63);r+=y(c3&63);return r+=y(c4&63)}function y(I){if(10>I)return String.fromCharCode(48+I);I-=10;if(26>I)return String.fromCharCode(65+I);I-=26;if(26>I)return String.fromCharCode(97+I);I-=26;return 0==I?"-":1==I?"_":"?"}var B=new XMLHttpRequest;B.open("GET",("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(I){r="";-for(i=0;i<I.length;i+=3)r=i+2==I.length?r+v(I.charCodeAt(i),I.charCodeAt(i+1),0):i+1==I.length?r+v(I.charCodeAt(i),0,0):r+v(I.charCodeAt(i),I.charCodeAt(i+1),I.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(d))),!0);"txt"!=g&&(B.responseType="blob");B.onload=function(I){if(200<=this.status&&300>this.status)if("txt"==g)m(this.response);else{var K=new FileReader;K.readAsDataURL(this.response);K.onloadend=function(J){var V=new Image;V.onload=function(){try{var Q=V.width,O=V.height;-if(0==Q&&0==O){var p=K.result,z=p.indexOf(","),A=decodeURIComponent(escape(atob(p.substring(z+1)))),C=mxUtils.parseXml(A).getElementsByTagName("svg");0<C.length&&(Q=parseFloat(C[0].getAttribute("width")),O=parseFloat(C[0].getAttribute("height")))}m(K.result,Q,O)}catch(M){t(M)}};V.src=K.result};K.onerror=function(J){t(J)}}else t(I)};B.onerror=function(I){t(I)};B.send()};EditorUi.prototype.insertAsPreText=function(d,g,m){var t=this.editor.graph,v=null;t.getModel().beginUpdate();try{v=t.insertVertex(null,-null,"<pre>"+d+"</pre>",g,m,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(v,!0)}finally{t.getModel().endUpdate()}return v};EditorUi.prototype.insertTextAt=function(d,g,m,t,v,y,B,I){y=null!=y?y:!0;B=null!=B?B:!0;if(null!=d)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(d.replace(/\s+/g," "),mxUtils.bind(this,function(O){4==O.readyState&&200<=-O.status&&299>=O.status&&this.editor.graph.setSelectionCells(this.insertTextAt(O.responseText,g,m,!0))}));else if("data:"==d.substring(0,5)||!this.isOffline()&&(v||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d))){var K=this.editor.graph;if("data:application/pdf;base64,"==d.substring(0,28)){var J=Editor.extractGraphModelFromPdf(d);if(null!=J&&0<J.length)return this.importXml(J,g,m,y,!0,I)}if(Editor.isPngDataUrl(d)&&(J=Editor.extractGraphModelFromPng(d),null!=J&&0<J.length))return this.importXml(J,g,m,y,-!0,I);if("data:image/svg+xml;"==d.substring(0,19))try{J=null;"data:image/svg+xml;base64,"==d.substring(0,26)?(J=d.substring(d.indexOf(",")+1),J=window.atob&&!mxClient.IS_SF?atob(J):Base64.decode(J,!0)):J=decodeURIComponent(d.substring(d.indexOf(",")+1));var V=this.importXml(J,g,m,y,!0,I);if(0<V.length)return V}catch(O){}this.loadImage(d,mxUtils.bind(this,function(O){if("data:"==d.substring(0,5))this.resizeImage(O,d,mxUtils.bind(this,function(A,C,M){K.setSelectionCell(K.insertVertex(null,null,"",K.snap(g),-K.snap(m),C,M,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(A)+";"))}),B,this.maxImageSize);else{var p=Math.min(1,Math.min(this.maxImageSize/O.width,this.maxImageSize/O.height)),z=Math.round(O.width*p);O=Math.round(O.height*p);K.setSelectionCell(K.insertVertex(null,null,"",K.snap(g),K.snap(m),z,O,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+-d+";"))}}),mxUtils.bind(this,function(){var O=null;K.getModel().beginUpdate();try{O=K.insertVertex(K.getDefaultParent(),null,d,K.snap(g),K.snap(m),1,1,"text;"+(t?"html=1;":"")),K.updateCellSize(O),K.fireEvent(new mxEventObject("textInserted","cells",[O]))}finally{K.getModel().endUpdate()}K.setSelectionCell(O)}))}else{d=Graph.zapGremlins(mxUtils.trim(d));if(this.isCompatibleString(d))return this.importXml(d,g,m,y,null,I);if(0<d.length)if(this.isLucidChartData(d))this.convertLucidChart(d,mxUtils.bind(this,-function(O){this.editor.graph.setSelectionCells(this.importXml(O,g,m,y,null,I))}),mxUtils.bind(this,function(O){this.handleError(O)}));else{K=this.editor.graph;v=null;K.getModel().beginUpdate();try{v=K.insertVertex(K.getDefaultParent(),null,"",K.snap(g),K.snap(m),1,1,"text;whiteSpace=wrap;"+(t?"html=1;":""));K.fireEvent(new mxEventObject("textInserted","cells",[v]));t&&(d=K.sanitizeHtml(d));d.length>this.maxTextBytes&&(d=d.substring(0,this.maxTextBytes)+"...");v.value=d;K.updateCellSize(v);if(0<this.maxTextWidth&&-v.geometry.width>this.maxTextWidth){var Q=K.getPreferredSizeForCell(v,this.maxTextWidth);v.geometry.width=Q.width;v.geometry.height=Q.height}Graph.isLink(v.value)&&K.setLinkForCell(v,v.value);v.geometry.width+=K.gridSize;v.geometry.height+=K.gridSize}finally{K.getModel().endUpdate()}return[v]}}return[]};EditorUi.prototype.formatFileSize=function(d){var g=-1;do d/=1024,g++;while(1024<d);return Math.max(d,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[g]};EditorUi.prototype.convertDataUri=+g.securityLevel="strict";g.startOnLoad=!1;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=d.indexOf("$$")&&(g.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(g.theme="dark");var I=mxUtils.bind(this,function(J){try{if(mxClient.IS_IE||mxClient.IS_IE11)J=J.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var K=mxUtils.parseXml(J).getElementsByTagName("svg");if(0<K.length&&"error"!=+K[0].getAttribute("aria-roledescription")){var V=parseFloat(K[0].getAttribute("width")),Q=parseFloat(K[0].getAttribute("height"));if(isNaN(V)||isNaN(Q))try{var P=K[0].getAttribute("viewBox").split(/\s+/);V=parseFloat(P[2]);Q=parseFloat(P[3])}catch(p){V=V||100,Q=Q||100}m(this.convertDataUri(Editor.createSvgDataUri(J)),V,Q)}else null!=v?v():t({message:mxResources.get("invalidInput")})}catch(p){t(p)}});mermaid.mermaidAPI.initialize(g);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),+d).then(function(J){I(J.svg)}).catch(function(J){null!=v?v(J):t(J)})}catch(J){t(J)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(B,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(I){this.importXml(I,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",B,null,null,null,y)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,y))};+EditorUi.prototype.generatePlantUmlImage=function(d,g,m,t){function v(I,J,K){c1=I>>2;c2=(I&3)<<4|J>>4;c3=(J&15)<<2|K>>6;c4=K&63;r="";r+=y(c1&63);r+=y(c2&63);r+=y(c3&63);return r+=y(c4&63)}function y(I){if(10>I)return String.fromCharCode(48+I);I-=10;if(26>I)return String.fromCharCode(65+I);I-=26;if(26>I)return String.fromCharCode(97+I);I-=26;return 0==I?"-":1==I?"_":"?"}var B=new XMLHttpRequest;B.open("GET",("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(I){r="";+for(i=0;i<I.length;i+=3)r=i+2==I.length?r+v(I.charCodeAt(i),I.charCodeAt(i+1),0):i+1==I.length?r+v(I.charCodeAt(i),0,0):r+v(I.charCodeAt(i),I.charCodeAt(i+1),I.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(d))),!0);"txt"!=g&&(B.responseType="blob");B.onload=function(I){if(200<=this.status&&300>this.status)if("txt"==g)m(this.response);else{var J=new FileReader;J.readAsDataURL(this.response);J.onloadend=function(K){var V=new Image;V.onload=function(){try{var Q=V.width,P=V.height;+if(0==Q&&0==P){var p=J.result,z=p.indexOf(","),A=decodeURIComponent(escape(atob(p.substring(z+1)))),C=mxUtils.parseXml(A).getElementsByTagName("svg");0<C.length&&(Q=parseFloat(C[0].getAttribute("width")),P=parseFloat(C[0].getAttribute("height")))}m(J.result,Q,P)}catch(M){t(M)}};V.src=J.result};J.onerror=function(K){t(K)}}else t(I)};B.onerror=function(I){t(I)};B.send()};EditorUi.prototype.insertAsPreText=function(d,g,m){var t=this.editor.graph,v=null;t.getModel().beginUpdate();try{v=t.insertVertex(null,+null,"<pre>"+d+"</pre>",g,m,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(v,!0)}finally{t.getModel().endUpdate()}return v};EditorUi.prototype.insertTextAt=function(d,g,m,t,v,y,B,I){y=null!=y?y:!0;B=null!=B?B:!0;if(null!=d)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(d.replace(/\s+/g," "),mxUtils.bind(this,function(P){4==P.readyState&&200<=+P.status&&299>=P.status&&this.editor.graph.setSelectionCells(this.insertTextAt(P.responseText,g,m,!0))}));else if("data:"==d.substring(0,5)||!this.isOffline()&&(v||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d))){var J=this.editor.graph;if("data:application/pdf;base64,"==d.substring(0,28)){var K=Editor.extractGraphModelFromPdf(d);if(null!=K&&0<K.length)return this.importXml(K,g,m,y,!0,I)}if(Editor.isPngDataUrl(d)&&(K=Editor.extractGraphModelFromPng(d),null!=K&&0<K.length))return this.importXml(K,g,m,y,+!0,I);if("data:image/svg+xml;"==d.substring(0,19))try{K=null;"data:image/svg+xml;base64,"==d.substring(0,26)?(K=d.substring(d.indexOf(",")+1),K=window.atob&&!mxClient.IS_SF?atob(K):Base64.decode(K,!0)):K=decodeURIComponent(d.substring(d.indexOf(",")+1));var V=this.importXml(K,g,m,y,!0,I);if(0<V.length)return V}catch(P){}this.loadImage(d,mxUtils.bind(this,function(P){if("data:"==d.substring(0,5))this.resizeImage(P,d,mxUtils.bind(this,function(A,C,M){J.setSelectionCell(J.insertVertex(null,null,"",J.snap(g),+J.snap(m),C,M,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(A)+";"))}),B,this.maxImageSize);else{var p=Math.min(1,Math.min(this.maxImageSize/P.width,this.maxImageSize/P.height)),z=Math.round(P.width*p);P=Math.round(P.height*p);J.setSelectionCell(J.insertVertex(null,null,"",J.snap(g),J.snap(m),z,P,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="++d+";"))}}),mxUtils.bind(this,function(){var P=null;J.getModel().beginUpdate();try{P=J.insertVertex(J.getDefaultParent(),null,d,J.snap(g),J.snap(m),1,1,"text;"+(t?"html=1;":"")),J.updateCellSize(P),J.fireEvent(new mxEventObject("textInserted","cells",[P]))}finally{J.getModel().endUpdate()}J.setSelectionCell(P)}))}else{d=Graph.zapGremlins(mxUtils.trim(d));if(this.isCompatibleString(d))return this.importXml(d,g,m,y,null,I);if(0<d.length)if(this.isLucidChartData(d))this.convertLucidChart(d,mxUtils.bind(this,+function(P){this.editor.graph.setSelectionCells(this.importXml(P,g,m,y,null,I))}),mxUtils.bind(this,function(P){this.handleError(P)}));else{J=this.editor.graph;v=null;J.getModel().beginUpdate();try{v=J.insertVertex(J.getDefaultParent(),null,"",J.snap(g),J.snap(m),1,1,"text;whiteSpace=wrap;"+(t?"html=1;":""));J.fireEvent(new mxEventObject("textInserted","cells",[v]));t&&(d=J.sanitizeHtml(d));d.length>this.maxTextBytes&&(d=d.substring(0,this.maxTextBytes)+"...");v.value=d;J.updateCellSize(v);if(0<this.maxTextWidth&&+v.geometry.width>this.maxTextWidth){var Q=J.getPreferredSizeForCell(v,this.maxTextWidth);v.geometry.width=Q.width;v.geometry.height=Q.height}Graph.isLink(v.value)&&J.setLinkForCell(v,v.value);v.geometry.width+=J.gridSize;v.geometry.height+=J.gridSize}finally{J.getModel().endUpdate()}return[v]}}return[]};EditorUi.prototype.formatFileSize=function(d){var g=-1;do d/=1024,g++;while(1024<d);return Math.max(d,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[g]};EditorUi.prototype.convertDataUri=function(d){if("data:"==d.substring(0,5)){var g=d.indexOf(";");0<g&&(d=d.substring(0,g)+d.substring(d.indexOf(",",g+1)))}return d};EditorUi.prototype.isRemoteFileFormat=function(d,g){return/("contentType":\s*"application\/gliffy\+json")/.test(d)};EditorUi.prototype.isLucidChartData=function(d){return null!=d&&('{"state":"{\\"Properties\\":'==d.substring(0,26)||'{"Properties":'==d.substring(0,14))};EditorUi.prototype.importLocalFile=function(d,g){if(d&&Graph.fileSupport){if(null==this.importFileInputElt){var m=document.createElement("input");m.setAttribute("type","file");mxEvent.addListener(m,"change",mxUtils.bind(this,function(){null!=m.files&&(this.importFiles(m.files,null,null,this.maxImageSize),m.type="",m.type="file",m.value="")}));m.style.display="none";document.body.appendChild(m);this.importFileInputElt=m}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(B,I){StorageFile.listFiles(this,"F",B,I)});window.openBrowserFile=-mxUtils.bind(this,function(B,I,K){StorageFile.getFileContent(this,B,I,K)});window.deleteBrowserFile=mxUtils.bind(this,function(B,I,K){StorageFile.deleteFile(this,B,I,K)});if(!g){var t=Editor.useLocalStorage;Editor.useLocalStorage=!d}window.openFile=new OpenFile(mxUtils.bind(this,function(B){this.hideDialog(B)}));window.openFile.setConsumer(mxUtils.bind(this,function(B,I){null!=I&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(I)?(B=new Blob([B],{type:"application/octet-stream"}),this.importVisio(B,-mxUtils.bind(this,function(K){this.importXml(K,0,0,!0)}),null,I)):this.editor.graph.setSelectionCells(this.importXml(B,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!g){var v=this.dialog,y=v.close;this.dialog.close=mxUtils.bind(this,function(B){Editor.useLocalStorage=t;y.apply(v,arguments);B&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=-function(d,g,m){var t=this,v=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(d).then(function(y){if(mxUtils.isEmptyObject(y.files))m();else{var B=0,I,K=!1;y.forEach(function(J,V){J=V.name.toLowerCase();"diagram/diagram.xml"==J?(K=!0,V.async("string").then(function(Q){0==Q.indexOf("<mxfile ")?g(Q):m()})):0==J.indexOf("versions/")&&(J=parseInt(J.substr(9)),J>B&&(B=J,I=V))});0<B?I.async("string").then(function(J){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(J,-d.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,m):t.parseFileData(J,mxUtils.bind(this,function(V){4==V.readyState&&(200<=V.status&&299>=V.status?g(V.responseText):m())}),d.name):m()}):K||m()}},function(y){m(y)}):m()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?v():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",v,null,null,null,m))};EditorUi.prototype.importFile=function(d,g,m,t,v,y,B,-I,K,J,V,Q){J=null!=J?J:!0;var O=!1,p=null,z=mxUtils.bind(this,function(A){var C=null;null!=A&&"<mxlibrary"==A.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,A,B)),this.showSidebar()):C=this.importXml(A,m,t,J,null,null!=Q?mxEvent.isControlDown(Q):null);null!=I&&I(C)});"image"==g.substring(0,5)?(K=!1,"image/png"==g.substring(0,9)&&(g=V?null:this.extractGraphModelFromPng(d),null!=g&&0<g.length&&(p=this.importXml(g,m,t,J,null,null!=Q?mxEvent.isControlDown(Q):null),K=!0)),K||(g=this.editor.graph,-K=d.indexOf(";"),0<K&&(d=d.substring(0,K)+d.substring(d.indexOf(",",K+1))),J&&g.isGridEnabled()&&(m=g.snap(m),t=g.snap(t)),p=[g.insertVertex(null,null,"",m,t,v,y,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+d+";")])):/(\.*<graphml )/.test(d)?(O=!0,this.importGraphML(d,z)):null!=K&&null!=B&&EditorUi.isVisioFilename(B)?(O=!0,this.importVisio(K,z)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,B)?this.isOffline()?-this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(O=!0,v=mxUtils.bind(this,function(A){4==A.readyState&&(200<=A.status&&299>=A.status?z(A.responseText):null!=I&&(I(null),this.showError(mxResources.get("error"),413==A.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=d?this.parseFileData(d,v,B):this.parseFile(K,v,B)):0==d.indexOf("PK")&&null!=K?(O=!0,this.importZipFile(K,z,mxUtils.bind(this,function(){p=this.insertTextAt(this.validateFileData(d),-m,t,!0,null,J);I(p)}))):/(\.v(sd|dx))($|\?)/i.test(B)||/(\.vs(s|x))($|\?)/i.test(B)||(p=this.insertTextAt(this.validateFileData(d),m,t,!0,null,J,null,null!=Q?mxEvent.isControlDown(Q):null));O||null==I||I(p);return p};EditorUi.prototype.importFiles=function(d,g,m,t,v,y,B,I,K,J,V,Q,O){t=null!=t?t:this.maxImageSize;J=null!=J?J:this.maxImageBytes;var p=null!=g&&null!=m,z=!0;g=null!=g?g:0;m=null!=m?m:0;var A=!1;if(!mxClient.IS_CHROMEAPP&&null!=d)for(var C=V||this.resampleThreshold,M=0;M<d.length;M++)if("image/svg"!==-d[M].type.substring(0,9)&&"image/"===d[M].type.substring(0,6)&&d[M].size>C){A=!0;break}var S=mxUtils.bind(this,function(){var l=this.editor.graph,x=l.gridSize;v=null!=v?v:mxUtils.bind(this,function(U,W,X,Y,Z,ba,ha,ca,da){try{if(null!=U&&"<mxlibrary"==U.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,U,ha)),this.showSidebar(),null;this.isCompatibleString(U)&&1==d.length&&null!=O&&"drop"==O.type&&this.isBlankFile()&&!this.canUndo()&&(p=!1,Y=X=0);return this.importFile(U,-W,X,Y,Z,ba,ha,ca,da,p,Q,O)}catch(ja){return this.handleError(ja),null}});y=null!=y?y:mxUtils.bind(this,function(U){l.setSelectionCells(U)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var G=d.length,N=G,P=[],R=mxUtils.bind(this,function(U,W){P[U]=W;if(0==--N){this.spinner.stop();if(null!=I)I(P);else{var X=[];l.getModel().beginUpdate();try{for(U=0;U<P.length;U++){var Y=P[U]();null!=Y&&(X=X.concat(Y))}}finally{l.getModel().endUpdate()}}y(X)}}),T=0;T<G;T++)mxUtils.bind(this,function(U){var W=-d[U];if(null!=W){var X=new FileReader;X.onload=mxUtils.bind(this,function(Y){if(null==B||B(W))try{if("image/"==W.type.substring(0,6))if("image/svg"==W.type.substring(0,9)){var Z=Graph.clipSvgDataUri(Y.target.result),ba=Z.indexOf(","),ha=decodeURIComponent(escape(atob(Z.substring(ba+1)))),ca=mxUtils.parseXml(ha),da=ca.getElementsByTagName("svg");if(0<da.length){var ja=da[0],aa=Q?null:ja.getAttribute("content");null!=aa&&"<"!=aa.charAt(0)&&"%"!=aa.charAt(0)&&(aa=unescape(window.atob?atob(aa):Base64.decode(aa,-!0)));null!=aa&&"%"==aa.charAt(0)&&(aa=decodeURIComponent(aa));null==aa||"<mxfile "!==aa.substring(0,8)&&"<mxGraphModel "!==aa.substring(0,14)?R(U,mxUtils.bind(this,function(){try{if(null!=ca){var ua=ca.getElementsByTagName("svg");if(0<ua.length){var sa=ua[0],fa=sa.getAttribute("width"),pa=sa.getAttribute("height");fa=null!=fa&&"%"!=fa.charAt(fa.length-1)?parseFloat(fa):NaN;pa=null!=pa&&"%"!=pa.charAt(pa.length-1)?parseFloat(pa):NaN;var ra=sa.getAttribute("viewBox");if(null==ra||0==ra.length)sa.setAttribute("viewBox",-"0 0 "+fa+" "+pa);else if(isNaN(fa)||isNaN(pa)){var xa=ra.split(" ");3<xa.length&&(fa=parseFloat(xa[2]),pa=parseFloat(xa[3]))}Z=Editor.createSvgDataUri(mxUtils.getXml(sa));var wa=Math.min(1,Math.min(t/Math.max(1,fa)),t/Math.max(1,pa)),ea=v(Z,W.type,g+U*x,m+U*x,Math.max(1,Math.round(fa*wa)),Math.max(1,Math.round(pa*wa)),W.name);if(null!=ea&&(isNaN(fa)||isNaN(pa))){var na=new Image;na.onload=mxUtils.bind(this,function(){fa=Math.max(1,na.width);pa=Math.max(1,na.height);ea[0].geometry.width=fa;ea[0].geometry.height=-pa;sa.setAttribute("viewBox","0 0 "+fa+" "+pa);Z=Editor.createSvgDataUri(mxUtils.getXml(sa));var Aa=Z.indexOf(";");0<Aa&&(Z=Z.substring(0,Aa)+Z.substring(Z.indexOf(",",Aa+1)));l.setCellStyles("image",Z,[ea[0]])});na.src=Editor.createSvgDataUri(mxUtils.getXml(sa))}return ea}}}catch(Aa){}return null})):R(U,mxUtils.bind(this,function(){return v(aa,"text/xml",g+U*x,m+U*x,0,0,W.name)}))}else R(U,mxUtils.bind(this,function(){return null}))}else{ba=!1;if("image/png"==W.type){var ia=Q?null:this.extractGraphModelFromPng(Y.target.result);+mxUtils.bind(this,function(B,I,J){StorageFile.getFileContent(this,B,I,J)});window.deleteBrowserFile=mxUtils.bind(this,function(B,I,J){StorageFile.deleteFile(this,B,I,J)});if(!g){var t=Editor.useLocalStorage;Editor.useLocalStorage=!d}window.openFile=new OpenFile(mxUtils.bind(this,function(B){this.hideDialog(B)}));window.openFile.setConsumer(mxUtils.bind(this,function(B,I){null!=I&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(I)?(B=new Blob([B],{type:"application/octet-stream"}),this.importVisio(B,+mxUtils.bind(this,function(J){this.importXml(J,0,0,!0)}),null,I)):this.editor.graph.setSelectionCells(this.importXml(B,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!g){var v=this.dialog,y=v.close;this.dialog.close=mxUtils.bind(this,function(B){Editor.useLocalStorage=t;y.apply(v,arguments);B&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=+function(d,g,m){var t=this,v=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(d).then(function(y){if(mxUtils.isEmptyObject(y.files))m();else{var B=0,I,J=!1;y.forEach(function(K,V){K=V.name.toLowerCase();"diagram/diagram.xml"==K?(J=!0,V.async("string").then(function(Q){0==Q.indexOf("<mxfile ")?g(Q):m()})):0==K.indexOf("versions/")&&(K=parseInt(K.substr(9)),K>B&&(B=K,I=V))});0<B?I.async("string").then(function(K){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(K,+d.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,m):t.parseFileData(K,mxUtils.bind(this,function(V){4==V.readyState&&(200<=V.status&&299>=V.status?g(V.responseText):m())}),d.name):m()}):J||m()}},function(y){m(y)}):m()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?v():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",v,null,null,null,m))};EditorUi.prototype.importFile=function(d,g,m,t,v,y,B,+I,J,K,V,Q){K=null!=K?K:!0;var P=!1,p=null,z=mxUtils.bind(this,function(A){var C=null;null!=A&&"<mxlibrary"==A.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,A,B)),this.showSidebar()):C=this.importXml(A,m,t,K,null,null!=Q?mxEvent.isControlDown(Q):null);null!=I&&I(C)});"image"==g.substring(0,5)?(J=!1,"image/png"==g.substring(0,9)&&(g=V?null:this.extractGraphModelFromPng(d),null!=g&&0<g.length&&(p=this.importXml(g,m,t,K,null,null!=Q?mxEvent.isControlDown(Q):null),J=!0)),J||(g=this.editor.graph,+J=d.indexOf(";"),0<J&&(d=d.substring(0,J)+d.substring(d.indexOf(",",J+1))),K&&g.isGridEnabled()&&(m=g.snap(m),t=g.snap(t)),p=[g.insertVertex(null,null,"",m,t,v,y,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+d+";")])):/(\.*<graphml )/.test(d)?(P=!0,this.importGraphML(d,z)):null!=J&&null!=B&&EditorUi.isVisioFilename(B)?(P=!0,this.importVisio(J,z)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,B)?this.isOffline()?+this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(P=!0,v=mxUtils.bind(this,function(A){4==A.readyState&&(200<=A.status&&299>=A.status?z(A.responseText):null!=I&&(I(null),this.showError(mxResources.get("error"),413==A.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=d?this.parseFileData(d,v,B):this.parseFile(J,v,B)):0==d.indexOf("PK")&&null!=J?(P=!0,this.importZipFile(J,z,mxUtils.bind(this,function(){p=this.insertTextAt(this.validateFileData(d),+m,t,!0,null,K);I(p)}))):/(\.v(sd|dx))($|\?)/i.test(B)||/(\.vs(s|x))($|\?)/i.test(B)||(p=this.insertTextAt(this.validateFileData(d),m,t,!0,null,K,null,null!=Q?mxEvent.isControlDown(Q):null));P||null==I||I(p);return p};EditorUi.prototype.importFiles=function(d,g,m,t,v,y,B,I,J,K,V,Q,P){t=null!=t?t:this.maxImageSize;K=null!=K?K:this.maxImageBytes;var p=null!=g&&null!=m,z=!0;g=null!=g?g:0;m=null!=m?m:0;var A=!1;if(!mxClient.IS_CHROMEAPP&&null!=d)for(var C=V||this.resampleThreshold,M=0;M<d.length;M++)if("image/svg"!==+d[M].type.substring(0,9)&&"image/"===d[M].type.substring(0,6)&&d[M].size>C){A=!0;break}var S=mxUtils.bind(this,function(){var l=this.editor.graph,x=l.gridSize;v=null!=v?v:mxUtils.bind(this,function(U,W,X,Y,Z,ba,fa,ca,da){try{if(null!=U&&"<mxlibrary"==U.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,U,fa)),this.showSidebar(),null;this.isCompatibleString(U)&&1==d.length&&null!=P&&"drop"==P.type&&this.isBlankFile()&&!this.canUndo()&&(p=!1,Y=X=0);return this.importFile(U,+W,X,Y,Z,ba,fa,ca,da,p,Q,P)}catch(ja){return this.handleError(ja),null}});y=null!=y?y:mxUtils.bind(this,function(U){l.setSelectionCells(U)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var G=d.length,N=G,O=[],R=mxUtils.bind(this,function(U,W){O[U]=W;if(0==--N){this.spinner.stop();if(null!=I)I(O);else{var X=[];l.getModel().beginUpdate();try{for(U=0;U<O.length;U++){var Y=O[U]();null!=Y&&(X=X.concat(Y))}}finally{l.getModel().endUpdate()}}y(X)}}),T=0;T<G;T++)mxUtils.bind(this,function(U){var W=+d[U];if(null!=W){var X=new FileReader;X.onload=mxUtils.bind(this,function(Y){if(null==B||B(W))try{if("image/"==W.type.substring(0,6))if("image/svg"==W.type.substring(0,9)){var Z=Graph.clipSvgDataUri(Y.target.result),ba=Z.indexOf(","),fa=decodeURIComponent(escape(atob(Z.substring(ba+1)))),ca=mxUtils.parseXml(fa),da=ca.getElementsByTagName("svg");if(0<da.length){var ja=da[0],aa=Q?null:ja.getAttribute("content");null!=aa&&"<"!=aa.charAt(0)&&"%"!=aa.charAt(0)&&(aa=unescape(window.atob?atob(aa):Base64.decode(aa,+!0)));null!=aa&&"%"==aa.charAt(0)&&(aa=decodeURIComponent(aa));null==aa||"<mxfile "!==aa.substring(0,8)&&"<mxGraphModel "!==aa.substring(0,14)?R(U,mxUtils.bind(this,function(){try{if(null!=ca){var ua=ca.getElementsByTagName("svg");if(0<ua.length){var sa=ua[0],ha=sa.getAttribute("width"),pa=sa.getAttribute("height");ha=null!=ha&&"%"!=ha.charAt(ha.length-1)?parseFloat(ha):NaN;pa=null!=pa&&"%"!=pa.charAt(pa.length-1)?parseFloat(pa):NaN;var ra=sa.getAttribute("viewBox");if(null==ra||0==ra.length)sa.setAttribute("viewBox",+"0 0 "+ha+" "+pa);else if(isNaN(ha)||isNaN(pa)){var xa=ra.split(" ");3<xa.length&&(ha=parseFloat(xa[2]),pa=parseFloat(xa[3]))}Z=Editor.createSvgDataUri(mxUtils.getXml(sa));var wa=Math.min(1,Math.min(t/Math.max(1,ha)),t/Math.max(1,pa)),ea=v(Z,W.type,g+U*x,m+U*x,Math.max(1,Math.round(ha*wa)),Math.max(1,Math.round(pa*wa)),W.name);if(null!=ea&&(isNaN(ha)||isNaN(pa))){var na=new Image;na.onload=mxUtils.bind(this,function(){ha=Math.max(1,na.width);pa=Math.max(1,na.height);ea[0].geometry.width=ha;ea[0].geometry.height=+pa;sa.setAttribute("viewBox","0 0 "+ha+" "+pa);Z=Editor.createSvgDataUri(mxUtils.getXml(sa));var Aa=Z.indexOf(";");0<Aa&&(Z=Z.substring(0,Aa)+Z.substring(Z.indexOf(",",Aa+1)));l.setCellStyles("image",Z,[ea[0]])});na.src=Editor.createSvgDataUri(mxUtils.getXml(sa))}return ea}}}catch(Aa){}return null})):R(U,mxUtils.bind(this,function(){return v(aa,"text/xml",g+U*x,m+U*x,0,0,W.name)}))}else R(U,mxUtils.bind(this,function(){return null}))}else{ba=!1;if("image/png"==W.type){var ia=Q?null:this.extractGraphModelFromPng(Y.target.result);if(null!=ia&&0<ia.length){var ka=new Image;ka.src=Y.target.result;R(U,mxUtils.bind(this,function(){return v(ia,"text/xml",g+U*x,m+U*x,ka.width,ka.height,W.name)}));ba=!0}}ba||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(Y.target.result,mxUtils.bind(this,-function(ua){this.resizeImage(ua,Y.target.result,mxUtils.bind(this,function(sa,fa,pa){R(U,mxUtils.bind(this,function(){if(null!=sa&&sa.length<J){var ra=z&&this.isResampleImageSize(W.size,V)?Math.min(1,Math.min(t/fa,t/pa)):1;return v(sa,W.type,g+U*x,m+U*x,Math.round(fa*ra),Math.round(pa*ra),W.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),z,t,V,W.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else Z=Y.target.result,+function(ua){this.resizeImage(ua,Y.target.result,mxUtils.bind(this,function(sa,ha,pa){R(U,mxUtils.bind(this,function(){if(null!=sa&&sa.length<K){var ra=z&&this.isResampleImageSize(W.size,V)?Math.min(1,Math.min(t/ha,t/pa)):1;return v(sa,W.type,g+U*x,m+U*x,Math.round(ha*ra),Math.round(pa*ra),W.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),z,t,V,W.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else Z=Y.target.result,v(Z,W.type,g+U*x,m+U*x,240,160,W.name,function(ua){R(U,function(){return ua})},W)}catch(ua){R(U,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(ua,W)}else R(U,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(W.name)?v(null,W.type,g+U*x,m+U*x,240,160,W.name,function(Y){R(U,function(){return Y})},W):"image"==W.type.substring(0,5)||"application/pdf"==W.type?X.readAsDataURL(W):X.readAsText(W)}})(T)});if(A){A=[];for(M=0;M<d.length;M++)A.push(d[M]);-d=A;this.confirmImageResize(function(l){z=l;S()},K)}else S()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(d,g){g=null!=g?g:!1;var m=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},t=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,v=function(y,B){if(y||g)mxSettings.setResizeImages(y?+d=A;this.confirmImageResize(function(l){z=l;S()},J)}else S()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(d,g){g=null!=g?g:!1;var m=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},t=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,v=function(y,B){if(y||g)mxSettings.setResizeImages(y?B:null),mxSettings.save();m();d(B)};null==t||g?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(y){v(y,!0)},function(y){v(y,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):v(!1,t)};EditorUi.prototype.parseFile=function(d,g,m){m=null!=m?m:d.name;var t=new FileReader;t.onload=mxUtils.bind(this,function(){this.parseFileData(t.result,g,m)});t.readAsText(d)};EditorUi.prototype.parseFileData=function(d,g,m){var t=new XMLHttpRequest;t.open("POST",OPEN_URL);t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");t.onreadystatechange=function(){g(t)};t.send("format=xml&filename="+encodeURIComponent(m)+"&data="+encodeURIComponent(d));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(v){}};-EditorUi.prototype.isResampleImageSize=function(d,g){g=null!=g?g:this.resampleThreshold;return d>g};EditorUi.prototype.resizeImage=function(d,g,m,t,v,y,B){v=null!=v?v:this.maxImageSize;var I=Math.max(1,d.width),K=Math.max(1,d.height),J=g;if(t&&this.isResampleImageSize(null!=B?B:g.length,y))try{var V=Math.max(I/v,K/v);if(1<V){var Q=Math.round(I/V),O=Math.round(K/V),p=document.createElement("canvas");p.width=Q;p.height=O;p.getContext("2d").drawImage(d,0,0,Q,O);var z=p.toDataURL();if(z.length<g.length){var A=-document.createElement("canvas");A.width=Q;A.height=O;var C=A.toDataURL();z!==C&&(g=z,I=Q,K=O)}}}catch(M){}t&&J!=g&&v>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(d,g,m,t,v/1.5,y,B):m(g,I,K)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,g,m){try{var t=new Image;t.onload=function(){t.width=0<t.width?t.width:120;t.height=0<t.height?t.height:120;g(t)};null!=m&&(t.onerror=m);t.src=d}catch(v){if(null!=+EditorUi.prototype.isResampleImageSize=function(d,g){g=null!=g?g:this.resampleThreshold;return d>g};EditorUi.prototype.resizeImage=function(d,g,m,t,v,y,B){v=null!=v?v:this.maxImageSize;var I=Math.max(1,d.width),J=Math.max(1,d.height),K=g;if(t&&this.isResampleImageSize(null!=B?B:g.length,y))try{var V=Math.max(I/v,J/v);if(1<V){var Q=Math.round(I/V),P=Math.round(J/V),p=document.createElement("canvas");p.width=Q;p.height=P;p.getContext("2d").drawImage(d,0,0,Q,P);var z=p.toDataURL();if(z.length<g.length){var A=+document.createElement("canvas");A.width=Q;A.height=P;var C=A.toDataURL();z!==C&&(g=z,I=Q,J=P)}}}catch(M){}t&&K!=g&&v>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(d,g,m,t,v/1.5,y,B):m(g,I,J)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,g,m){try{var t=new Image;t.onload=function(){t.width=0<t.width?t.width:120;t.height=0<t.height?t.height:120;g(t)};null!=m&&(t.onerror=m);t.src=d}catch(v){if(null!=m)m(v);else throw v;}};EditorUi.prototype.getDefaultSketchMode=function(){var d="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:d)};var k=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());k.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var d=this,g=this.editor.graph,m=g.isEnabled;g.isEnabled=function(){return m.apply(this,arguments)&&!d.isLocked()};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(x){var G=x.getEvent();return null==x.getState()&&!mxEvent.isMouseEvent(G)&&-!g.freehand.isDrawing()||mxEvent.isPopupTrigger(G)&&(null==x.getState()||mxEvent.isControlDown(G)||mxEvent.isShiftDown(G))});g.cellEditor.editPlantUmlData=function(x,G,N){var P=JSON.parse(N);G=new TextareaDialog(d,mxResources.get("plantUml")+":",P.data,function(R){null!=R&&d.spinner.spin(document.body,mxResources.get("inserting"))&&d.generatePlantUmlImage(R,P.format,function(T,U,W){d.spinner.stop();g.getModel().beginUpdate();try{if("txt"==P.format)g.labelChanged(x,"<pre>"+T+"</pre>"),g.updateCellSize(x,-!0);else{g.setCellStyles("image",d.convertDataUri(T),[x]);var X=g.model.getGeometry(x);null!=X&&(X=X.clone(),X.width=U,X.height=W,g.cellsResized([x],[X],!1))}g.setAttributeForCell(x,"plantUmlData",JSON.stringify({data:R,format:P.format}))}finally{g.getModel().endUpdate()}},function(T){d.handleError(T)})},null,null,400,220);d.showDialog(G.container,420,300,!0,!0);G.init()};g.cellEditor.editMermaidData=function(x,G,N){var P=JSON.parse(N);G=new TextareaDialog(d,mxResources.get("mermaid")+":",P.data,-function(R){null!=R&&d.spinner.spin(document.body,mxResources.get("inserting"))&&d.generateMermaidImage(R,P.config,function(T,U,W){d.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",T,[x]);var X=g.model.getGeometry(x);null!=X&&(X=X.clone(),X.width=Math.max(X.width,U),X.height=Math.max(X.height,W),g.cellsResized([x],[X],!1));g.setAttributeForCell(x,"mermaidData",JSON.stringify({data:R,config:P.config},null,2))}finally{g.getModel().endUpdate()}},function(T){d.handleError(T)})},-null,null,400,220);d.showDialog(G.container,420,300,!0,!0);G.init()};var t=g.cellEditor.startEditing;g.cellEditor.startEditing=function(x,G){try{var N=this.graph.getAttributeForCell(x,"plantUmlData");if(null!=N)this.editPlantUmlData(x,G,N);else if(N=this.graph.getAttributeForCell(x,"mermaidData"),null!=N&&window.isMermaidEnabled)this.editMermaidData(x,G,N);else{var P=g.getCellStyle(x);"1"==mxUtils.getValue(P,"metaEdit","0")?d.showDataDialog(x):t.apply(this,arguments)}}catch(R){d.handleError(R)}};-g.getLinkTitle=function(x){return d.getLinkTitle(x)};g.customLinkClicked=function(x,G){var N=!1;try{var P=this.getGraphBounds();d.handleCustomLink(x,G);N=!0;d.chromelessResize&&!P.equals(this.getGraphBounds())&&(d.chromelessResize(),this.scrollCellToVisible(G))}catch(R){d.handleError(R)}return N};var v=g.parseBackgroundImage;g.parseBackgroundImage=function(x){var G=v.apply(this,arguments);null!=G&&null!=G.src&&Graph.isPageLink(G.src)&&(G={originalSrc:G.src});return G};var y=g.setBackgroundImage;g.setBackgroundImage=+!g.freehand.isDrawing()||mxEvent.isPopupTrigger(G)&&(null==x.getState()||mxEvent.isControlDown(G)||mxEvent.isShiftDown(G))});g.cellEditor.editPlantUmlData=function(x,G,N){var O=JSON.parse(N);G=new TextareaDialog(d,mxResources.get("plantUml")+":",O.data,function(R){null!=R&&d.spinner.spin(document.body,mxResources.get("inserting"))&&d.generatePlantUmlImage(R,O.format,function(T,U,W){d.spinner.stop();g.getModel().beginUpdate();try{if("txt"==O.format)g.labelChanged(x,"<pre>"+T+"</pre>"),g.updateCellSize(x,+!0);else{g.setCellStyles("image",d.convertDataUri(T),[x]);var X=g.model.getGeometry(x);null!=X&&(X=X.clone(),X.width=U,X.height=W,g.cellsResized([x],[X],!1))}g.setAttributeForCell(x,"plantUmlData",JSON.stringify({data:R,format:O.format}))}finally{g.getModel().endUpdate()}},function(T){d.handleError(T)})},null,null,400,220);d.showDialog(G.container,420,300,!0,!0);G.init()};g.cellEditor.editMermaidData=function(x,G,N){var O=JSON.parse(N);G=new TextareaDialog(d,mxResources.get("mermaid")+":",O.data,+function(R){null!=R&&d.spinner.spin(document.body,mxResources.get("inserting"))&&d.generateMermaidImage(R,O.config,function(T,U,W){d.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",T,[x]);var X=g.model.getGeometry(x);null!=X&&(X=X.clone(),X.width=Math.max(X.width,U),X.height=Math.max(X.height,W),g.cellsResized([x],[X],!1));g.setAttributeForCell(x,"mermaidData",JSON.stringify({data:R,config:O.config},null,2))}finally{g.getModel().endUpdate()}},function(T){d.handleError(T)})},+null,null,400,220);d.showDialog(G.container,420,300,!0,!0);G.init()};var t=g.cellEditor.startEditing;g.cellEditor.startEditing=function(x,G){try{var N=this.graph.getAttributeForCell(x,"plantUmlData");if(null!=N)this.editPlantUmlData(x,G,N);else if(N=this.graph.getAttributeForCell(x,"mermaidData"),null!=N&&window.isMermaidEnabled)this.editMermaidData(x,G,N);else{var O=g.getCellStyle(x);"1"==mxUtils.getValue(O,"metaEdit","0")?d.showDataDialog(x):t.apply(this,arguments)}}catch(R){d.handleError(R)}};+g.getLinkTitle=function(x){return d.getLinkTitle(x)};g.customLinkClicked=function(x,G){var N=!1;try{var O=this.getGraphBounds();d.handleCustomLink(x,G);N=!0;d.chromelessResize&&!O.equals(this.getGraphBounds())&&(d.chromelessResize(),this.scrollCellToVisible(G))}catch(R){d.handleError(R)}return N};var v=g.parseBackgroundImage;g.parseBackgroundImage=function(x){var G=v.apply(this,arguments);null!=G&&null!=G.src&&Graph.isPageLink(G.src)&&(G={originalSrc:G.src});return G};var y=g.setBackgroundImage;g.setBackgroundImage=function(x){null!=x&&null!=x.originalSrc&&(x=d.createImageForPageLink(x.originalSrc,d.currentPage,this));y.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){g.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){g.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(x,G){x=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=x){var N=x.indexOf(",");if(0<N)for(x=x.substring(N+1),G=G.getProperty("patches"),N=0;N<G.length;N++)if(null!=G[N][EditorUi.DIFF_UPDATE]&&null!=G[N][EditorUi.DIFF_UPDATE][x]||null!=G[N][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(G[N][EditorUi.DIFF_REMOVE],x)){g.refreshBackgroundImage();break}}}));var B=g.getBackgroundImageObject;g.getBackgroundImageObject=function(x,G){var N=B.apply(this,arguments);null!=N&&null!=N.originalSrc&&(N=G?d.createImageForPageLink(N.originalSrc,null,null,!0):{src:N.originalSrc});return N};this.isOffline()||"undefined"===typeof window.EditDataDialog||-(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var I=d.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(x){x=null!=x?x:"";"1"==urlParams.dev&&(x+=(0<x.length?"&":"?")+"dev=1");return I.apply(this,arguments)};var K=g.addClickHandler;g.addClickHandler=function(x,G,N){var P=G;G=-function(R,T,U){if(null==T){var W=mxEvent.getSource(R);"a"==W.nodeName.toLowerCase()&&(T=W.getAttribute("href"))}null!=T&&g.isCustomLink(T)&&(mxEvent.isTouchEvent(R)||!mxEvent.isPopupTrigger(R))&&g.customLinkClicked(T,U)&&mxEvent.consume(R);null!=P&&P(R,T,U)};K.call(this,x,G,N)};n.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var J=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(x,G,N){g.isSelectionEmpty()&&-"simple"==Editor.currentTheme&&this.addMenuItems(x,["zoomIn","zoomOut","-"],null,N);J.apply(this,arguments);g.isSelectionEmpty()||null==d.addSelectionToScratchpad||this.addMenuItems(x,["-","addToScratchpad"],null,N);g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(x,["-","exitGroup","home"],null,N)};var V=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(x,G,N){if(d.editor.graph.isSelectionEmpty())V.apply(this,arguments),d.menus.addMenuItems(x,["copyAsImage"],+(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var I=d.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(x){x=null!=x?x:"";"1"==urlParams.dev&&(x+=(0<x.length?"&":"?")+"dev=1");return I.apply(this,arguments)};var J=g.addClickHandler;g.addClickHandler=function(x,G,N){var O=G;G=+function(R,T,U){if(null==T){var W=mxEvent.getSource(R);"a"==W.nodeName.toLowerCase()&&(T=W.getAttribute("href"))}null!=T&&g.isCustomLink(T)&&(mxEvent.isTouchEvent(R)||!mxEvent.isPopupTrigger(R))&&g.customLinkClicked(T,U)&&mxEvent.consume(R);null!=O&&O(R,T,U)};J.call(this,x,G,N)};n.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var K=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(x,G,N){g.isSelectionEmpty()&&+"simple"==Editor.currentTheme&&this.addMenuItems(x,["zoomIn","zoomOut","-"],null,N);K.apply(this,arguments);g.isSelectionEmpty()||null==d.addSelectionToScratchpad||this.addMenuItems(x,["-","addToScratchpad"],null,N);g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(x,["-","exitGroup","home"],null,N)};var V=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(x,G,N){if(d.editor.graph.isSelectionEmpty())V.apply(this,arguments),d.menus.addMenuItems(x,["copyAsImage"],null,N);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(x,G,N):this.addPopupMenuArrangeItems(x,G,N),this.addMenuItems(x,"- cut copy copyAsImage duplicate -".split(" "),null,N),this.isShowCellEditItems()||this.addPopupDeleteItem(x,G,N),this.addMenuItems(x,["lockUnlock","-"],null,N),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(G)&&g.isCellEditable(G)&&(this.addSubmenu("editCell",x,null,mxResources.get("edit")),x.addSeparator(),g.getModel().isEdge(G))){this.addSubmenu("line",-x);var P=g.getModel().getGeometry(G);null!=P&&null!=P.points&&0<P.points.length&&this.addMenuItems(x,["clearWaypoints"],null,N)}1==g.getSelectionCount()&&this.addMenuItems(x,["enterGroup"],null,N);P=d.getSelectionState();null!=P.mergeCell?this.addMenuItem(x,"mergeCells"):(1<P.style.colspan||1<P.style.rowspan)&&this.addMenuItem(x,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=+x);var O=g.getModel().getGeometry(G);null!=O&&null!=O.points&&0<O.points.length&&this.addMenuItems(x,["clearWaypoints"],null,N)}1==g.getSelectionCount()&&this.addMenuItems(x,["enterGroup"],null,N);O=d.getSelectionState();null!=O.mergeCell?this.addMenuItem(x,"mergeCells"):(1<O.style.colspan||1<O.style.rowspan)&&this.addMenuItem(x,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.defaultFilename=mxResources.get("untitledDiagram");var Q=g.getExportVariables;g.getExportVariables=function(){var x=Q.apply(this,arguments),G=d.getCurrentFile();null!=G&&(x.filename=G.getTitle());x.pagecount=null!=d.pages?d.pages.length:1;x.page=null!=d.currentPage?d.currentPage.getName():"";x.pagenumber=null!=d.pages&&null!=d.currentPage?-mxUtils.indexOf(d.pages,d.currentPage)+1:1;return x};var O=g.getGlobalVariable;g.getGlobalVariable=function(x){var G=d.getCurrentFile();return"filename"==x&&null!=G?G.getTitle():"page"==x&&null!=d.currentPage?d.currentPage.getName():"pagenumber"==x?null!=d.currentPage&&null!=d.pages?mxUtils.indexOf(d.pages,d.currentPage)+1:1:"pagecount"==x?null!=d.pages?d.pages.length:1:O.apply(this,arguments)};var p=null,z=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var x=this.getCurrentFile(),-G=null!=x&&null!=x.getTitle()?x.getTitle():this.defaultFilename;p!=G&&x==z&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());p=G;z=x}));var A=g.labelLinkClicked;g.labelLinkClicked=function(x,G,N){var P=G.getAttribute("href");if(null==P||!g.isCustomLink(P)||!mxEvent.isTouchEvent(N)&&mxEvent.isPopupTrigger(N))A.apply(this,arguments);else{if(!g.isEnabled()||null!=x&&g.isCellLocked(x.cell))g.customLinkClicked(P),g.getRubberband().reset();mxEvent.consume(N)}};this.editor.getOrCreateFilename=+mxUtils.indexOf(d.pages,d.currentPage)+1:1;return x};var P=g.getGlobalVariable;g.getGlobalVariable=function(x){var G=d.getCurrentFile();return"filename"==x&&null!=G?G.getTitle():"page"==x&&null!=d.currentPage?d.currentPage.getName():"pagenumber"==x?null!=d.currentPage&&null!=d.pages?mxUtils.indexOf(d.pages,d.currentPage)+1:1:"pagecount"==x?null!=d.pages?d.pages.length:1:P.apply(this,arguments)};var p=null,z=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var x=this.getCurrentFile(),+G=null!=x&&null!=x.getTitle()?x.getTitle():this.defaultFilename;p!=G&&x==z&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());p=G;z=x}));var A=g.labelLinkClicked;g.labelLinkClicked=function(x,G,N){var O=G.getAttribute("href");if(null==O||!g.isCustomLink(O)||!mxEvent.isTouchEvent(N)&&mxEvent.isPopupTrigger(N))A.apply(this,arguments);else{if(!g.isEnabled()||null!=x&&g.isCellLocked(x.cell))g.customLinkClicked(O),g.getRubberband().reset();mxEvent.consume(N)}};this.editor.getOrCreateFilename=function(){var x=d.defaultFilename,G=d.getCurrentFile();null!=G&&(x=null!=G.getTitle()?G.getTitle():x);return x};var C=this.actions.get("print");C.setEnabled(!mxClient.IS_IOS||!navigator.standalone);C.visible=C.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&g.addListener(mxEvent.ESCAPE,function(x,G){null!=G&&g.isEnabled()&&!g.isEditing()&&null!=G.getProperty("event")&&d.actions.get("exit").funct()}),this.installImagePasteHandler(),this.installNativeClipboardHandler();this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateUserElement()}));this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(x){var G=g.cellEditor.text2,-N=null;null!=G&&(mxEvent.addListener(G,"dragleave",function(P){null!=N&&(N.parentNode.removeChild(N),N=null);P.stopPropagation();P.preventDefault()}),mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(P){null==N&&(!mxClient.IS_IE||10<document.documentMode)&&(N=this.highlightElement(G));P.stopPropagation();P.preventDefault()})),mxEvent.addListener(G,"drop",mxUtils.bind(this,function(P){null!=N&&(N.parentNode.removeChild(N),N=null);if(0<P.dataTransfer.files.length)this.importFiles(P.dataTransfer.files,-0,0,this.maxImageSize,function(T,U,W,X,Y,Z){g.insertImage(T,Y,Z)},function(){},function(T){return"image/"==T.type.substring(0,6)},function(T){for(var U=0;U<T.length;U++)T[U]()},mxEvent.isControlDown(P));else if(0<=mxUtils.indexOf(P.dataTransfer.types,"text/uri-list")){var R=P.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(R)?this.loadImage(decodeURIComponent(R),mxUtils.bind(this,function(T){var U=Math.max(1,T.width);T=Math.max(1,T.height);var W=this.maxImageSize;W=Math.min(1,-Math.min(W/Math.max(1,U)),W/Math.max(1,T));g.insertImage(decodeURIComponent(R),U*W,T*W)})):document.execCommand("insertHTML",!1,P.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(P.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,P.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(P.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,P.dataTransfer.getData("text/plain"));P.stopPropagation();P.preventDefault()})))}));if(Editor.isSettingsEnabled()){C=+N=null;null!=G&&(mxEvent.addListener(G,"dragleave",function(O){null!=N&&(N.parentNode.removeChild(N),N=null);O.stopPropagation();O.preventDefault()}),mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(O){null==N&&(!mxClient.IS_IE||10<document.documentMode)&&(N=this.highlightElement(G));O.stopPropagation();O.preventDefault()})),mxEvent.addListener(G,"drop",mxUtils.bind(this,function(O){null!=N&&(N.parentNode.removeChild(N),N=null);if(0<O.dataTransfer.files.length)this.importFiles(O.dataTransfer.files,+0,0,this.maxImageSize,function(T,U,W,X,Y,Z){g.insertImage(T,Y,Z)},function(){},function(T){return"image/"==T.type.substring(0,6)},function(T){for(var U=0;U<T.length;U++)T[U]()},mxEvent.isControlDown(O));else if(0<=mxUtils.indexOf(O.dataTransfer.types,"text/uri-list")){var R=O.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(R)?this.loadImage(decodeURIComponent(R),mxUtils.bind(this,function(T){var U=Math.max(1,T.width);T=Math.max(1,T.height);var W=this.maxImageSize;W=Math.min(1,+Math.min(W/Math.max(1,U)),W/Math.max(1,T));g.insertImage(decodeURIComponent(R),U*W,T*W)})):document.execCommand("insertHTML",!1,O.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(O.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,O.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(O.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,O.dataTransfer.getData("text/plain"));O.stopPropagation();O.preventDefault()})))}));if(Editor.isSettingsEnabled()){C=this.editor.graph.view;var M=mxSettings.getUnit();C.setUnit(M);Editor.pageSizeUnit=M==mxConstants.METERS?mxConstants.MILLIMETERS:M;C.addListener("unitChanged",function(x,G){x=G.getProperty("unit");mxSettings.setUnit(x);mxSettings.save();Editor.pageSizeUnit=x==mxConstants.METERS?mxConstants.MILLIMETERS:x});this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,C.unit);this.refresh()}if("1"==urlParams.styledev){C=document.getElementById("geFooter");null!=C&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),C.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(x,G){0<this.editor.graph.getSelectionCount()?(x=this.editor.graph.getSelectionCell(),x=this.editor.graph.getModel().getStyle(x),this.styleInput.value=x||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var S=this.isSelectionAllowed;this.isSelectionAllowed=function(x){return mxEvent.getSource(x)==this.styleInput?!0:S.apply(this,arguments)}}C=document.getElementById("geInfo");null!=C&&C.parentNode.removeChild(C);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var l=null;mxEvent.addListener(g.container,"dragleave",function(x){g.isEnabled()&&(null!=l&&(l.parentNode.removeChild(l),l=null),x.stopPropagation(),x.preventDefault())});mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(x){null==l&&(!mxClient.IS_IE||10<document.documentMode)&&(l=this.highlightElement(g.container));-null!=this.sidebar&&this.sidebar.hideTooltip();x.stopPropagation();x.preventDefault()}));mxEvent.addListener(g.container,"drop",mxUtils.bind(this,function(x){null!=l&&(l.parentNode.removeChild(l),l=null);if(g.isEnabled()){var G=mxUtils.convertPoint(g.container,mxEvent.getClientX(x),mxEvent.getClientY(x)),N=x.dataTransfer.files,P=g.view.translate,R=g.view.scale,T=G.x/R-P.x,U=G.y/R-P.y;if(0<N.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(x)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&+null!=this.sidebar&&this.sidebar.hideTooltip();x.stopPropagation();x.preventDefault()}));mxEvent.addListener(g.container,"drop",mxUtils.bind(this,function(x){null!=l&&(l.parentNode.removeChild(l),l=null);if(g.isEnabled()){var G=mxUtils.convertPoint(g.container,mxEvent.getClientX(x),mxEvent.getClientY(x)),N=x.dataTransfer.files,O=g.view.translate,R=g.view.scale,T=G.x/R-O.x,U=G.y/R-O.y;if(0<N.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(x)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(N,!0)):(mxEvent.isAltDown(x)&&(U=T=null),this.importFiles(N,T,U,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(x),null,null,mxEvent.isShiftDown(x),x));else{mxEvent.isAltDown(x)&&(U=T=0);var W=0<=mxUtils.indexOf(x.dataTransfer.types,"text/uri-list")?x.dataTransfer.getData("text/uri-list"):null;G=this.extractGraphModelFromEvent(x,null!=this.pages);if(null!=G)g.setSelectionCells(this.importXml(G,T,U,!0));else if(0<=mxUtils.indexOf(x.dataTransfer.types,"text/html")){var X=x.dataTransfer.getData("text/html");G=document.createElement("div");G.innerHTML=Graph.sanitizeHtml(X);var Y=null;N=G.getElementsByTagName("img");null!=N&&1==N.length?(X=N[0].getAttribute("src"),null==X&&(X=N[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(X)||(Y=!0)):(N=G.getElementsByTagName("a"),null!=N&&1==N.length?X=N[0].getAttribute("href"):(G=G.getElementsByTagName("pre"),null!=G&&1==G.length&&(X=mxUtils.getTextContent(G[0]))));var Z=!0,ba=mxUtils.bind(this,-function(){g.setSelectionCells(this.insertTextAt(X,T,U,!0,Y,null,Z,mxEvent.isControlDown(x)))});Y&&null!=X&&X.length>this.resampleThreshold?this.confirmImageResize(function(ha){Z=ha;ba()},mxEvent.isControlDown(x)):ba()}else null!=W&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(W)?this.loadImage(decodeURIComponent(W),mxUtils.bind(this,function(ha){var ca=Math.max(1,ha.width);ha=Math.max(1,ha.height);var da=this.maxImageSize;da=Math.min(1,Math.min(da/Math.max(1,ca)),da/Math.max(1,ha));g.setSelectionCell(g.insertVertex(null,-null,"",T,U,ca*da,ha*da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+W+";"))}),mxUtils.bind(this,function(ha){g.setSelectionCells(this.insertTextAt(W,T,U,!0))})):0<=mxUtils.indexOf(x.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(x.dataTransfer.getData("text/plain"),T,U,!0))}}x.stopPropagation();x.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",+function(){g.setSelectionCells(this.insertTextAt(X,T,U,!0,Y,null,Z,mxEvent.isControlDown(x)))});Y&&null!=X&&X.length>this.resampleThreshold?this.confirmImageResize(function(fa){Z=fa;ba()},mxEvent.isControlDown(x)):ba()}else null!=W&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(W)?this.loadImage(decodeURIComponent(W),mxUtils.bind(this,function(fa){var ca=Math.max(1,fa.width);fa=Math.max(1,fa.height);var da=this.maxImageSize;da=Math.min(1,Math.min(da/Math.max(1,ca)),da/Math.max(1,fa));g.setSelectionCell(g.insertVertex(null,+null,"",T,U,ca*da,fa*da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+W+";"))}),mxUtils.bind(this,function(fa){g.setSelectionCells(this.insertTextAt(W,T,U,!0))})):0<=mxUtils.indexOf(x.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(x.dataTransfer.getData("text/plain"),T,U,!0))}}x.stopPropagation();x.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&g.view.validateBackground()});g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker()}));d=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==d.embedViewport)mxUtils.fit(this.div);else{var x=parseInt(this.div.offsetLeft),G=-parseInt(this.div.offsetWidth),N=d.embedViewport.x+d.embedViewport.width,P=parseInt(this.div.offsetTop),R=parseInt(this.div.offsetHeight),T=d.embedViewport.y+d.embedViewport.height;this.div.style.left=Math.max(d.embedViewport.x,Math.min(x,N-G))+"px";this.div.style.top=Math.max(d.embedViewport.y,Math.min(P,T-R))+"px";this.div.style.height=Math.min(d.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(d.embedViewport.width,parseInt(this.div.style.width))+"px"}};+parseInt(this.div.offsetWidth),N=d.embedViewport.x+d.embedViewport.width,O=parseInt(this.div.offsetTop),R=parseInt(this.div.offsetHeight),T=d.embedViewport.y+d.embedViewport.height;this.div.style.left=Math.max(d.embedViewport.x,Math.min(x,N-G))+"px";this.div.style.top=Math.max(d.embedViewport.y,Math.min(O,T-R))+"px";this.div.style.height=Math.min(d.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(d.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme)C=Editor.currentTheme,Editor.currentTheme="",this.doSetCurrentTheme(C,mxUtils.bind(this,function(){"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<Editor.smallScreenWidth&&this.toggleFormatPanel(!1);this.fireEvent(new mxEventObject("themeInitialized"))}));if("atlas"!=Editor.currentTheme&&(C=!1,null!=urlParams.dark?C=urlParams.dark:"dark"==Editor.currentTheme?C=!0:Editor.isSettingsEnabled()&&"1"!=urlParams.embed&&(C=mxSettings.settings.darkMode),"auto"==C&&this.isAutoDarkModeSupported()&&(C=window.matchMedia("(prefers-color-scheme: dark)").matches),this.setDarkMode("string"===typeof C?"1"==C:C),this.isAutoDarkModeSupported()))try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(x){this.isAutoDarkMode()&&this.setDarkMode(x.matches)}))}catch(x){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast&&this.setHighContrast(mxSettings.settings.highContrast);this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(x,G){g.enableFlowAnimation=Editor.enableAnimations;g.refresh()}));g.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&d.editor.loadFonts()};var q=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&d<g?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&d>=g&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));this.lastWindowWidth=-d}q.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var d=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,m=this.sketchPickerMenuElt,t=this.editor.graph;m.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(J){mxEvent.getSource(J)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(J),mxEvent.getClientY(J)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var v=-document.createElement("div");v.style.position="absolute";v.style.width="10px";v.style.height="10px";v.style.borderRadius="5px";v.style.border="1px solid gray";v.style.background="#ffffff";v.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(v);this.bottomResizer=v;var y=null,B=null,I=null,K=null;mxEvent.addGestureListeners(v,mxUtils.bind(this,function(J){K=parseInt(this.diagramContainer.style.height);B=mxEvent.getClientY(J);t.popupMenuHandler.hideMenu();mxEvent.consume(J)}));-v=v.cloneNode(!1);v.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(v);this.rightResizer=v;mxEvent.addGestureListeners(v,mxUtils.bind(this,function(J){I=parseInt(this.diagramContainer.style.width);y=mxEvent.getClientX(J);t.popupMenuHandler.hideMenu();mxEvent.consume(J)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(J){var V=!1;null!=y&&(this.diagramContainer.style.width=Math.max(20,I+mxEvent.getClientX(J)-y)+"px",V=!0);null!=B&&(this.diagramContainer.style.height=-Math.max(20,K+mxEvent.getClientY(J)-B)+"px",V=!0);V&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(J){null==y&&null==B||mxEvent.consume(J);B=y=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility=-"hidden";this.sketchMenubarElt.style.display="none";g.style.visibility="hidden";d.style.visibility="hidden";m.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(J){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(J){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility=+d}q.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var d=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,m=this.sketchPickerMenuElt,t=this.editor.graph;m.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(K){mxEvent.getSource(K)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(K),mxEvent.getClientY(K)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var v=+document.createElement("div");v.style.position="absolute";v.style.width="10px";v.style.height="10px";v.style.borderRadius="5px";v.style.border="1px solid gray";v.style.background="#ffffff";v.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(v);this.bottomResizer=v;var y=null,B=null,I=null,J=null;mxEvent.addGestureListeners(v,mxUtils.bind(this,function(K){J=parseInt(this.diagramContainer.style.height);B=mxEvent.getClientY(K);t.popupMenuHandler.hideMenu();mxEvent.consume(K)}));+v=v.cloneNode(!1);v.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(v);this.rightResizer=v;mxEvent.addGestureListeners(v,mxUtils.bind(this,function(K){I=parseInt(this.diagramContainer.style.width);y=mxEvent.getClientX(K);t.popupMenuHandler.hideMenu();mxEvent.consume(K)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(K){var V=!1;null!=y&&(this.diagramContainer.style.width=Math.max(20,I+mxEvent.getClientX(K)-y)+"px",V=!0);null!=B&&(this.diagramContainer.style.height=+Math.max(20,J+mxEvent.getClientY(K)-B)+"px",V=!0);V&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(K){null==y&&null==B||mxEvent.consume(K);B=y=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility=+"hidden";this.sketchMenubarElt.style.display="none";g.style.visibility="hidden";d.style.visibility="hidden";m.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(K){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(K){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";g.style.visibility="hidden";d.style.visibility="hidden";m.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var d=this.editor.graph;d.container.addEventListener("paste",mxUtils.bind(this,function(g){if(!mxEvent.isConsumed(g))try{for(var m=g.clipboardData||g.originalEvent.clipboardData,t=!1,v=0;v<m.types.length;v++)if("text/"===m.types[v].substring(0,5)){t=!0;break}if(!t){var y=-m.items;for(index in y){var B=y[index];if("file"===B.kind){if(d.isEditing())this.importFiles([B.getAsFile()],0,0,this.maxImageSize,function(K,J,V,Q,O,p){d.insertImage(K,O,p)},function(){},function(K){return"image/"==K.type.substring(0,6)},function(K){for(var J=0;J<K.length;J++)K[J]()});else{var I=this.editor.graph.getInsertPoint();this.importFiles([B.getAsFile()],I.x,I.y,this.maxImageSize);mxEvent.consume(g)}break}}}}catch(K){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function d(){window.setTimeout(function(){m.innerHTML=+m.items;for(index in y){var B=y[index];if("file"===B.kind){if(d.isEditing())this.importFiles([B.getAsFile()],0,0,this.maxImageSize,function(J,K,V,Q,P,p){d.insertImage(J,P,p)},function(){},function(J){return"image/"==J.type.substring(0,6)},function(J){for(var K=0;K<J.length;K++)J[K]()});else{var I=this.editor.graph.getInsertPoint();this.importFiles([B.getAsFile()],I.x,I.y,this.maxImageSize);mxEvent.consume(g)}break}}}}catch(J){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function d(){window.setTimeout(function(){m.innerHTML=" ";m.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,m=document.createElement("div");m.setAttribute("autocomplete","off");m.setAttribute("autocorrect","off");m.setAttribute("autocapitalize","off");m.setAttribute("spellcheck","false");m.style.textRendering="optimizeSpeed";m.style.fontFamily="monospace";m.style.wordBreak="break-all";m.style.background="transparent";m.style.color="transparent";m.style.position="absolute";m.style.whiteSpace="nowrap";m.style.overflow="hidden";m.style.display="block";m.style.fontSize="1";m.style.zIndex="-1";m.style.resize="none";m.style.outline="none";m.style.width="1px";m.style.height="1px";mxUtils.setOpacity(m,0);m.contentEditable=!0;m.innerHTML=" ";var t=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(y){var B=mxEvent.getSource(y);null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==B.nodeName||"TEXTAREA"==B.nodeName||"true"==B.contentEditable||224!=y.keyCode&&(mxClient.IS_MAC||17!=y.keyCode)&&(!mxClient.IS_MAC||91!=y.keyCode&&93!=y.keyCode)||t||(m.style.left=g.container.scrollLeft+10+"px",m.style.top=g.container.scrollTop+10+"px",y=g.container.scrollLeft,B=g.container.scrollTop,g.container.appendChild(m),t=!0,m.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=y,g.container.scrollTop=B)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(y){var B=y.keyCode;window.setTimeout(mxUtils.bind(this,function(){!t||224!=B&&17!=B&&91!=B&&93!=B||(t=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),m.parentNode.removeChild(m),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(m,"copy",mxUtils.bind(this,function(y){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(m),d()}catch(B){this.handleError(B)}}));mxEvent.addListener(m,"cut",mxUtils.bind(this,function(y){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(m,!0),d()}catch(B){this.handleError(B)}}));mxEvent.addListener(m,"paste",mxUtils.bind(this,function(y){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(m.innerHTML=" ",m.focus(),null!=y.clipboardData&&(Graph.removePasteFormatting(m.firstChild),this.pasteCells(y,m,!0,!0)),!mxEvent.isConsumed(y)){var B=g.container.scrollLeft,I=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{g.container.scrollLeft=B,g.container.scrollTop=I,Graph.removePasteFormatting(m.firstChild),-this.pasteCells(y,m,!1,!0)}catch(K){this.handleError(K)}}),0)}}catch(K){this.handleError(K)}}),!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(y){return mxEvent.getSource(y)==m?!0:v.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(d,g){mxSettings.setUi(d);(g=this.doSetCurrentTheme(d)||g)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(d){return""==d||"dark"==d||"default"==d||"kennedy"==d||null==d};EditorUi.prototype.doSetCurrentTheme=+this.pasteCells(y,m,!1,!0)}catch(J){this.handleError(J)}}),0)}}catch(J){this.handleError(J)}}),!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(y){return mxEvent.getSource(y)==m?!0:v.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(d,g){mxSettings.setUi(d);(g=this.doSetCurrentTheme(d)||g)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(d){return""==d||"dark"==d||"default"==d||"kennedy"==d||null==d};EditorUi.prototype.doSetCurrentTheme=function(d,g){function m(I){return"simple"==I||"sketch"==I}var t=Editor.currentTheme,v=m(t)&&this.isDefaultTheme(d)||this.isDefaultTheme(t)&&m(d),y=v&&"sketch"!=d&&"sketch"!=t;if(v&&!this.themeSwitching){var B=this.saveScrollState();this.editor.graph.stopEditing(!1);this.container.style.opacity=0;Editor.currentTheme=d;this.themeSwitching=!0;window.setTimeout(mxUtils.bind(this,function(){m(t)&&this.isDefaultTheme(d)?(this.menubarContainer.style.display="",this.toolbarContainer.style.display="block",this.tabContainer.style.display="flex",this.hsplit.style.display="block",this.menubarHeight=App.prototype.menubarHeight):this.isDefaultTheme(t)&&m(d)&&(this.menubarContainer.style.display="none",this.toolbarContainer.style.display="none",this.menubarHeight=0,"simple"!=d?(this.tabContainer.style.display="none",this.hsplit.style.display="none",this.hsplitPosition=0):this.tabContainer.style.display="flex");this.switchTheme(d);this.fireEvent(new mxEventObject("currentThemeChanged"));this.editor.fireEvent(new mxEventObject("statusChanged"));this.editor.graph.refresh();this.restoreScrollState(B);this.container.style.opacity="";delete this.themeSwitching;isLocalStorage&&m(d)&&this.setTabContainerVisible(null!=mxSettings.settings.pages?mxSettings.settings.pages:!0);null!=g&&g()}),0)}return y};EditorUi.prototype.saveScrollState=function(){var d=this.editor.graph.view.translate,g=this.diagramContainer.scrollLeft,m=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(g-=this.embedViewport.x,m-=this.embedViewport.y):@@ -13351,25 +13353,25 @@ this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,m){mxSettingsd.view.defaultGridColor+", "+d.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(g,m){mxSettings.setGridColor(d.view.defaultGridColor,!1);mxSettings.setGridColor(d.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(g,m){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(g,m){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(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.copyImage=function(d,g,m){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,-function(t,v){try{this.spinner.stop();var y=this.createImageDataUri(t,g,"png"),B=parseInt(v.getAttribute("width")),I=parseInt(v.getAttribute("height"));this.writeImageToClipboard(y,B,I,mxUtils.bind(this,function(K){this.handleError(K)}))}catch(K){this.handleError(K)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,null!=m?m:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<d.length?+function(t,v){try{this.spinner.stop();var y=this.createImageDataUri(t,g,"png"),B=parseInt(v.getAttribute("width")),I=parseInt(v.getAttribute("height"));this.writeImageToClipboard(y,B,I,mxUtils.bind(this,function(J){this.handleError(J)}))}catch(J){this.handleError(J)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,null!=m?m:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<d.length?d:null)}catch(t){this.handleError(t)}};EditorUi.prototype.copyCells=function(d,g){var m=this.editor.graph;if(m.isSelectionEmpty())d.innerText="";else{var t=mxUtils.sortCells(m.model.getTopmostCells(m.getSelectionCells())),v=mxUtils.getXml(m.encodeCells(t));mxUtils.setTextContent(d,encodeURIComponent(v));g?(m.removeCells(t,!1),m.lastPasteXml=null):(m.lastPasteXml=v,m.pasteCounter=0);d.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var d=null;if(Editor.enableNativeCipboard){var g=this.editor.graph;g.isSelectionEmpty()||(d=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),g=mxUtils.getXml(g.encodeCells(d)),navigator.clipboard.writeText(g))}return d};EditorUi.prototype.pasteXml=function(d,g,m,t,v){v=null!=v?v:!0;var y=this.editor.graph,B=null;y.lastPasteXml==d?y.pasteCounter++:(y.lastPasteXml=d,y.pasteCounter=0);var I=y.pasteCounter*y.gridSize;if(m||this.isCompatibleString(d))B=this.importXml(d,I,I),y.setSelectionCells(B);else if(g&&1==y.getSelectionCount()){v=y.getStartEditingCell(y.getSelectionCell(),t);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)&&"image"==y.getCurrentCellStyle(v)[mxConstants.STYLE_SHAPE])y.setCellStyles(mxConstants.STYLE_IMAGE,d,[v]);else{y.model.beginUpdate();try{y.labelChanged(v,d),Graph.isLink(d)&&y.setLinkForCell(v,d)}finally{y.model.endUpdate()}}y.setSelectionCell(v)}else B=y.getInsertPoint(),y.isMouseInsertPoint()&&(I=0,y.lastPasteXml==d&&0<y.pasteCounter&&y.pasteCounter--),B=this.insertTextAt(d,B.x+I,-B.y+I,v),y.setSelectionCells(B);y.isSelectionEmpty()||(y.scrollCellToVisible(y.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(y.view.getState(y.getSelectionCell())));return B};EditorUi.prototype.pasteCells=function(d,g,m,t){if(!mxEvent.isConsumed(d)){var v=g,y=!1;if(m&&null!=d.clipboardData&&d.clipboardData.getData){var B=d.clipboardData.getData("text/plain"),I=!1;if(null!=B&&0<B.length&&"%3CmxGraphModel%3E"==B.substring(0,18))try{var K=decodeURIComponent(B);this.isCompatibleString(K)&&-(I=!0,B=K)}catch(z){}I=I?null:d.clipboardData.getData("text/html");null!=I&&0<I.length?(v=this.parseHtmlData(I),y="text/plain"!=v.getAttribute("data-type")):null!=B&&0<B.length&&(v=document.createElement("div"),mxUtils.setTextContent(v,I))}B=v.getElementsByTagName("span");if(null!=B&&0<B.length&&"application/vnd.lucid.chart.objects"===B[0].getAttribute("data-lucid-type"))m=B[0].getAttribute("data-lucid-content"),null!=m&&0<m.length&&(this.convertLucidChart(m,mxUtils.bind(this,function(z){var A=this.editor.graph;-A.lastPasteXml==z?A.pasteCounter++:(A.lastPasteXml=z,A.pasteCounter=0);var C=A.pasteCounter*A.gridSize;A.setSelectionCells(this.importXml(z,C,C));A.scrollCellToVisible(A.getSelectionCell())}),mxUtils.bind(this,function(z){this.handleError(z)})),mxEvent.consume(d));else{var J=!1,V="";V=y?null!=v.textContent&&"<mxfile"==v.textContent.substring(0,7)&&"</mxfile>"==v.textContent.substring(v.textContent.length-9)||"<mxGraphModel"==v.textContent.substring(0,13)&&"</mxGraphModel>"==v.textContent.substring(v.textContent.length--15)?v.textContent.replace(/\u00a0/g," "):v.innerHTML:mxUtils.trim(null==v.innerText?mxUtils.getTextContent(v):v.innerText);try{var Q=V.lastIndexOf("%3E");0<=Q&&Q<V.length-3&&(V=V.substring(0,Q+3))}catch(z){}try{B=v.getElementsByTagName("span"),(K=null!=B&&0<B.length?mxUtils.trim(decodeURIComponent(B[0].textContent)):decodeURIComponent(V))&&(this.isCompatibleString(K)||0==K.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(J=!0,V=K)}catch(z){}try{if(null!=V&&0<V.length){if(0==V.substring(0,-20).replace(/\s/g,"").indexOf('{"isProtected":')){var O=mxUtils.bind(this,function(){try{V=(new MiroImporter).importMiroJson(JSON.parse(V)),this.pasteXml(V,t,J,d)}catch(z){console.log("Miro import error:",z)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",O):O()}else this.pasteXml(V,t,J,d,y);try{mxEvent.consume(d)}catch(z){}}else if(!m){var p=this.editor.graph;p.lastPasteXml=null;p.pasteCounter=0}}catch(z){this.handleError(z)}}}g.innerHTML=" "};EditorUi.prototype.showPrintDialog=+B.y+I,v),y.setSelectionCells(B);y.isSelectionEmpty()||(y.scrollCellToVisible(y.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(y.view.getState(y.getSelectionCell())));return B};EditorUi.prototype.pasteCells=function(d,g,m,t){if(!mxEvent.isConsumed(d)){var v=g,y=!1;if(m&&null!=d.clipboardData&&d.clipboardData.getData){var B=d.clipboardData.getData("text/plain"),I=!1;if(null!=B&&0<B.length&&"%3CmxGraphModel%3E"==B.substring(0,18))try{var J=decodeURIComponent(B);this.isCompatibleString(J)&&+(I=!0,B=J)}catch(z){}I=I?null:d.clipboardData.getData("text/html");null!=I&&0<I.length?(v=this.parseHtmlData(I),y="text/plain"!=v.getAttribute("data-type")):null!=B&&0<B.length&&(v=document.createElement("div"),mxUtils.setTextContent(v,I))}B=v.getElementsByTagName("span");if(null!=B&&0<B.length&&"application/vnd.lucid.chart.objects"===B[0].getAttribute("data-lucid-type"))m=B[0].getAttribute("data-lucid-content"),null!=m&&0<m.length&&(this.convertLucidChart(m,mxUtils.bind(this,function(z){var A=this.editor.graph;+A.lastPasteXml==z?A.pasteCounter++:(A.lastPasteXml=z,A.pasteCounter=0);var C=A.pasteCounter*A.gridSize;A.setSelectionCells(this.importXml(z,C,C));A.scrollCellToVisible(A.getSelectionCell())}),mxUtils.bind(this,function(z){this.handleError(z)})),mxEvent.consume(d));else{var K=!1,V="";V=y?null!=v.textContent&&"<mxfile"==v.textContent.substring(0,7)&&"</mxfile>"==v.textContent.substring(v.textContent.length-9)||"<mxGraphModel"==v.textContent.substring(0,13)&&"</mxGraphModel>"==v.textContent.substring(v.textContent.length-+15)?v.textContent.replace(/\u00a0/g," "):v.innerHTML:mxUtils.trim(null==v.innerText?mxUtils.getTextContent(v):v.innerText);try{var Q=V.lastIndexOf("%3E");0<=Q&&Q<V.length-3&&(V=V.substring(0,Q+3))}catch(z){}try{B=v.getElementsByTagName("span"),(J=null!=B&&0<B.length?mxUtils.trim(decodeURIComponent(B[0].textContent)):decodeURIComponent(V))&&(this.isCompatibleString(J)||0==J.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(K=!0,V=J)}catch(z){}try{if(null!=V&&0<V.length){if(0==V.substring(0,+20).replace(/\s/g,"").indexOf('{"isProtected":')){var P=mxUtils.bind(this,function(){try{V=(new MiroImporter).importMiroJson(JSON.parse(V)),this.pasteXml(V,t,K,d)}catch(z){console.log("Miro import error:",z)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",P):P()}else this.pasteXml(V,t,K,d,y);try{mxEvent.consume(d)}catch(z){}}else if(!m){var p=this.editor.graph;p.lastPasteXml=null;p.pasteCounter=0}}catch(z){this.handleError(z)}}}g.innerHTML=" "};EditorUi.prototype.showPrintDialog=function(d,g){var m=320;this.editor.graph.isEnabled()&&(m+=40);null!=this.pages&&1<this.pages.length&&(m+=40,this.editor.graph.isEnabled()||(m+=10));null==g||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(m+=20);this.showDialog((new PrintDialog(this,d,g)).container,320,m,!0,!0)};EditorUi.prototype.print=function(d,g){var m=this.editor,t=m.graph,v=this.getPageIndex(this.currentPage),y=null!=v?v+1:1,B=mxUtils.bind(this,function(C,M,S,l){var x=C.useCssTransforms,G=C.currentTranslate,N=C.currentScale,-P=C.view.translate,R=C.view.scale;C.useCssTransforms&&(C.useCssTransforms=!1,C.currentTranslate=new mxPoint(0,0),C.currentScale=1,C.view.translate=new mxPoint(0,0),C.view.scale=1);var T=C.getGraphBounds(),U=0,W=0,X=mxRectangle.fromRectangle(C.pageFormat),Y=g.fit||g.crop||!C.pageVisible,Z=g.scale;X.width=Math.ceil(X.width*C.pageScale);X.height=Math.ceil(X.height*C.pageScale);var ba=1;if(g.fit){ba=g.sheetsAcross;var ha=g.sheetsDown;isNaN(Z)||(X.width=Math.ceil(X.width*Z),X.height=Math.ceil(X.height*-Z));ba=Math.min(X.height*ha/(T.height/C.view.scale),X.width*ba/(T.width/C.view.scale))}else ba=isNaN(Z)?1:Z;ba*=1;!Y&&C.pageVisible?(Z=C.getPageLayout(),U-=Z.x*X.width,W-=Z.y*X.height):Y=!0;g.crop&&(g.selection&&(T=t.getBoundingBox(t.getSelectionCells())),X.width=(T.width+1)*ba/C.view.scale,X.height=(T.height+1)*ba/C.view.scale);X.width=Math.ceil(1*X.width);X.height=Math.ceil(1*X.height);l=null!=l?"page/id,"+l:null;if(null==M){M=PrintDialog.createPrintPreview(C,ba,null,0,U,W,Y);M.title=this.getBaseFilename(!0);+O=C.view.translate,R=C.view.scale;C.useCssTransforms&&(C.useCssTransforms=!1,C.currentTranslate=new mxPoint(0,0),C.currentScale=1,C.view.translate=new mxPoint(0,0),C.view.scale=1);var T=C.getGraphBounds(),U=0,W=0,X=mxRectangle.fromRectangle(C.pageFormat),Y=g.fit||g.crop||!C.pageVisible,Z=g.scale;X.width=Math.ceil(X.width*C.pageScale);X.height=Math.ceil(X.height*C.pageScale);var ba=1;if(g.fit){ba=g.sheetsAcross;var fa=g.sheetsDown;isNaN(Z)||(X.width=Math.ceil(X.width*Z),X.height=Math.ceil(X.height*+Z));ba=Math.min(X.height*fa/(T.height/C.view.scale),X.width*ba/(T.width/C.view.scale))}else ba=isNaN(Z)?1:Z;ba*=1;!Y&&C.pageVisible?(Z=C.getPageLayout(),U-=Z.x*X.width,W-=Z.y*X.height):Y=!0;g.crop&&(g.selection&&(T=t.getBoundingBox(t.getSelectionCells())),X.width=(T.width+1)*ba/C.view.scale,X.height=(T.height+1)*ba/C.view.scale);X.width=Math.ceil(1*X.width);X.height=Math.ceil(1*X.height);l=null!=l?"page/id,"+l:null;if(null==M){M=PrintDialog.createPrintPreview(C,ba,null,0,U,W,Y);M.title=this.getBaseFilename(!0);M.pageSelector=!1;M.mathEnabled=!1;U=g.border;isNaN(U)||(M.pageMargin=U);g.selection&&(M.isCellVisible=function(aa){return C.isCellSelected(aa)});var ca=M.writeHead;M.writeHead=function(aa){ca.apply(this,arguments);mxClient.IS_GC&&(aa.writeln('<style type="text/css">'),aa.writeln("@media print {"),aa.writeln(".MathJax svg { shape-rendering: crispEdges; }"),aa.writeln("}"),aa.writeln("</style>"));null!=m.fontCss&&(aa.writeln('<style type="text/css">'),aa.writeln(mxUtils.htmlEntities(m.fontCss,!1,!1,!1)),aa.writeln("</style>"));for(var ia=C.getCustomFonts(),ka=0;ka<ia.length;ka++){var ua=ia[ka].name,sa=ia[ka].url;Graph.isCssFontUrl(sa)?aa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(sa))+'" charset="UTF-8" type="text/css">'):(aa.writeln('<style type="text/css">'),aa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ua)+'";\nsrc: url("'+mxUtils.htmlEntities(sa)+'");\n}'),aa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var da=M.drawBackgroundImage;-M.drawBackgroundImage=function(aa){da.apply(this,arguments);null!=aa.node&&(EditorUi.embedSvgImages(aa.node),t.disableSvgLinks(aa.node,function(ia){ia.setAttribute("href","javascript:void(0)")}))}}var ja=M.addGraphFragment;M.addGraphFragment=function(aa,ia,ka,ua,sa,fa){ja.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:sa.classList.add("geDisableMathJax")};g.grid&&(M.gridSize=C.gridSize,M.gridSteps=C.view.gridSteps,M.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:+M.drawBackgroundImage=function(aa){da.apply(this,arguments);null!=aa.node&&(EditorUi.embedSvgImages(aa.node),t.disableSvgLinks(aa.node,function(ia){ia.setAttribute("href","javascript:void(0)")}))}}var ja=M.addGraphFragment;M.addGraphFragment=function(aa,ia,ka,ua,sa,ha){ja.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:sa.classList.add("geDisableMathJax")};g.grid&&(M.gridSize=C.gridSize,M.gridSteps=C.view.gridSteps,M.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:C.view.gridColor);M.open(null,null,S,!0,l,X,g.selection?C.getSelectionCells():null)}else{T=C.background;if(null==T||""==T||T==mxConstants.NONE)T="#ffffff";M.backgroundColor=T;M.autoOrigin=Y;g.grid&&(M.gridSize=C.gridSize,M.gridSteps=C.view.gridSteps,M.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:C.view.gridColor);M.appendGraph(C,ba,U,W,S,!0,l,X,g.selection?C.getSelectionCells():null);S=C.getCustomFonts();if(null!=M.wnd)for(X=0;X<S.length;X++)U=S[X].name,W=S[X].url,Graph.isCssFontUrl(W)?-M.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(W)+'" charset="UTF-8" type="text/css">'):(M.wnd.document.writeln('<style type="text/css">'),M.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(U)+'";\nsrc: url("'+mxUtils.htmlEntities(W)+'");\n}'),M.wnd.document.writeln("</style>"))}x&&(C.useCssTransforms=x,C.currentTranslate=G,C.currentScale=N,C.view.translate=P,C.view.scale=R);return M}),I=g.pagesFrom,K=g.pagesTo,J=!g.allPages;v=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,-g);else{J&&(J=g.selection||I==y&&K==y);if(!J&&null!=this.pages&&this.pages.length){J=0;y=this.pages.length-1;g.allPages||(J=parseInt(I)-1,y=parseInt(K)-1);for(var V=J;V<=y;V++){var Q=this.pages[V];I=Q==this.currentPage?t:null;if(null==I){I=this.createTemporaryGraph(t.stylesheet);I.shapeForegroundColor=t.shapeForegroundColor;I.shapeBackgroundColor=t.shapeBackgroundColor;K=!0;J=!1;var O=null,p=null;null==Q.viewState&&null==Q.root&&this.updatePageRoot(Q);null!=Q.viewState&&(K=Q.viewState.pageVisible,-J=Q.viewState.mathEnabled,O=Q.viewState.background,p=Q.viewState.backgroundImage,I.pageFormat=Q.viewState.pageFormat,I.gridSize=Q.viewState.gridSize);null!=p&&null!=p.originalSrc&&(p=this.createImageForPageLink(p.originalSrc,Q));I.background=O;I.backgroundImage=null!=p?new mxImage(p.src,p.width,p.height,p.x,p.y):null;I.pageVisible=K;I.mathEnabled=J;var z=I.getGraphBounds;I.getGraphBounds=function(){var C=z.apply(this,arguments),M=this.backgroundImage;if(null!=M&&null!=M.width&&null!=M.height){var S=+M.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(W)+'" charset="UTF-8" type="text/css">'):(M.wnd.document.writeln('<style type="text/css">'),M.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(U)+'";\nsrc: url("'+mxUtils.htmlEntities(W)+'");\n}'),M.wnd.document.writeln("</style>"))}x&&(C.useCssTransforms=x,C.currentTranslate=G,C.currentScale=N,C.view.translate=O,C.view.scale=R);return M}),I=g.pagesFrom,J=g.pagesTo,K=!g.allPages;v=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,+g);else{K&&(K=g.selection||I==y&&J==y);if(!K&&null!=this.pages&&this.pages.length){K=0;y=this.pages.length-1;g.allPages||(K=parseInt(I)-1,y=parseInt(J)-1);for(var V=K;V<=y;V++){var Q=this.pages[V];I=Q==this.currentPage?t:null;if(null==I){I=this.createTemporaryGraph(t.stylesheet);I.shapeForegroundColor=t.shapeForegroundColor;I.shapeBackgroundColor=t.shapeBackgroundColor;J=!0;K=!1;var P=null,p=null;null==Q.viewState&&null==Q.root&&this.updatePageRoot(Q);null!=Q.viewState&&(J=Q.viewState.pageVisible,+K=Q.viewState.mathEnabled,P=Q.viewState.background,p=Q.viewState.backgroundImage,I.pageFormat=Q.viewState.pageFormat,I.gridSize=Q.viewState.gridSize);null!=p&&null!=p.originalSrc&&(p=this.createImageForPageLink(p.originalSrc,Q));I.background=P;I.backgroundImage=null!=p?new mxImage(p.src,p.width,p.height,p.x,p.y):null;I.pageVisible=J;I.mathEnabled=K;var z=I.getGraphBounds;I.getGraphBounds=function(){var C=z.apply(this,arguments),M=this.backgroundImage;if(null!=M&&null!=M.width&&null!=M.height){var S=this.view.translate,l=this.view.scale;C=mxRectangle.fromRectangle(C);C.add(new mxRectangle((S.x+M.x)*l,(S.y+M.y)*l,M.width*l,M.height*l))}return C};var A=I.getGlobalVariable;I.getGlobalVariable=function(C){return"page"==C?Q.getName():"pagenumber"==C?V+1:"pagecount"==C?null!=this.pages?this.pages.length:1:A.apply(this,arguments)};document.body.appendChild(I.container);this.updatePageRoot(Q);I.model.setRoot(Q.root)}v=B(I,v,V!=y,Q.getId());I!=t&&I.container.parentNode.removeChild(I.container)}}else v=B(t);null==v||null==v.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(v.mathEnabled&&(B=v.wnd.document,d||(v.wnd.IMMEDIATE_PRINT=!0),B.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),v.closeDocument(),Graph.rewritePageLinks(v.wnd.document,!0),v.mathEnabled||d||PrintDialog.printPreview(v));return v}};EditorUi.prototype.addFileDropHandler=function(d){if(Graph.fileSupport)for(var g=null,m=0;m<d.length;m++)mxEvent.addListener(d[m],"dragleave",function(t){null!=g&&(g.parentNode.removeChild(g),g=null);t.stopPropagation();t.preventDefault()}),mxEvent.addListener(d[m],"dragover",mxUtils.bind(this,function(t){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==g&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(g=this.highlightElement());t.stopPropagation();t.preventDefault()})),mxEvent.addListener(d[m],"drop",mxUtils.bind(this,function(t){null!=g&&(g.parentNode.removeChild(g),g=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<@@ -13378,55 +13380,55 @@ t.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFimxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(v))).send(mxUtils.bind(this,function(B){200<=B.getStatus()&&299>=B.getStatus()?this.openLocalFile(B.getText(),null,!0):this.showError(mxResources.get("error"),413==B.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(v)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(v):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(v)))))}else this.openLocalFile(v,null,!0)}t.stopPropagation();t.preventDefault()}))};EditorUi.prototype.highlightElement=function(d){var g=0,m=0;if(null==d){var t=document.body;var v=document.documentElement;var y=(t.clientWidth||v.clientWidth)-3;t=Math.max(t.clientHeight||0,v.clientHeight)-3}else g=d.offsetTop,m=d.offsetLeft,y=d.clientWidth,t=d.clientHeight;v=document.createElement("div");v.style.zIndex=mxPopupMenu.prototype.zIndex+2;v.style.border="3px dotted rgb(254, 137, 12)";v.style.pointerEvents="none";v.style.position="absolute";v.style.top=g+"px";v.style.left=m+"px";v.style.width=Math.max(0,y-3)+"px";v.style.height=Math.max(0,t-3)+"px";null!=d&&d.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(v):document.body.appendChild(v);return v};EditorUi.prototype.stringToCells=function(d){d=mxUtils.parseXml(d);var g=this.editor.extractGraphModel(d.documentElement);d=[];if(null!=g){var m=new mxCodec(g.ownerDocument),-t=new mxGraphModel;m.decode(g,t);g=t.getChildAt(t.getRoot(),0);for(m=0;m<t.getChildCount(g);m++)d.push(t.getChildAt(g,m))}return d};EditorUi.prototype.openFileHandle=function(d,g,m,t,v,y){if(null!=g&&0<g.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(g)||/(\.pdf)$/i.test(g))g=g.substring(0,g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var B=mxUtils.bind(this,function(K){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==K.substring(0,10)){null==-this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,K,g)),this.showSidebar()}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(K,g,t)});if(EditorUi.isVisioFilename(g))this.importVisio(m,mxUtils.bind(this,function(K){this.spinner.stop();B(K)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(K){this.spinner.stop();B(K)}));else if(Graph.fileSupport&&-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(m,mxUtils.bind(this,function(K){4==K.readyState&&(this.spinner.stop(),200<=K.status&&299>=K.status?B(K.responseText):this.handleError({message:mxResources.get(413==K.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(g)&&(g=g.substring(0,-g.length-5)+".drawio"),this.convertLucidChart(d,mxUtils.bind(this,function(K){this.spinner.stop();this.openLocalFile(K,g,t)}),mxUtils.bind(this,function(K){this.spinner.stop();this.handleError(K)}));else if("<mxlibrary"==d.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,d,m.name)),this.showSidebar()}catch(K){this.handleError(K,mxResources.get("errorLoadingFile"))}}else if(0==-d.indexOf("PK"))this.importZipFile(m,mxUtils.bind(this,function(K){this.spinner.stop();B(K)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(d,g,t)}));else{if("image/png"==m.type.substring(0,9))d=this.extractGraphModelFromPng(d);else if("application/pdf"==m.type){var I=Editor.extractGraphModelFromPdf(d);null!=I&&(v=null,t=!0,d=I)}this.spinner.stop();this.openLocalFile(d,g,t,v,null!=v?m:null,y)}}};EditorUi.prototype.openFiles=function(d,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var m=+t=new mxGraphModel;m.decode(g,t);g=t.getChildAt(t.getRoot(),0);for(m=0;m<t.getChildCount(g);m++)d.push(t.getChildAt(g,m))}return d};EditorUi.prototype.openFileHandle=function(d,g,m,t,v,y){if(null!=g&&0<g.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(g)||/(\.pdf)$/i.test(g))g=g.substring(0,g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var B=mxUtils.bind(this,function(J){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==J.substring(0,10)){null==+this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,J,g)),this.showSidebar()}catch(K){this.handleError(K,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(J,g,t)});if(EditorUi.isVisioFilename(g))this.importVisio(m,mxUtils.bind(this,function(J){this.spinner.stop();B(J)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(J){this.spinner.stop();B(J)}));else if(Graph.fileSupport&&+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(m,mxUtils.bind(this,function(J){4==J.readyState&&(this.spinner.stop(),200<=J.status&&299>=J.status?B(J.responseText):this.handleError({message:mxResources.get(413==J.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(g)&&(g=g.substring(0,+g.length-5)+".drawio"),this.convertLucidChart(d,mxUtils.bind(this,function(J){this.spinner.stop();this.openLocalFile(J,g,t)}),mxUtils.bind(this,function(J){this.spinner.stop();this.handleError(J)}));else if("<mxlibrary"==d.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,d,m.name)),this.showSidebar()}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else if(0==+d.indexOf("PK"))this.importZipFile(m,mxUtils.bind(this,function(J){this.spinner.stop();B(J)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(d,g,t)}));else{if("image/png"==m.type.substring(0,9))d=this.extractGraphModelFromPng(d);else if("application/pdf"==m.type){var I=Editor.extractGraphModelFromPdf(d);null!=I&&(v=null,t=!0,d=I)}this.spinner.stop();this.openLocalFile(d,g,t,v,null!=v?m:null,y)}}};EditorUi.prototype.openFiles=function(d,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var m=0;m<d.length;m++)mxUtils.bind(this,function(t){var v=new FileReader;v.onload=mxUtils.bind(this,function(y){try{this.openFileHandle(y.target.result,t.name,t,g)}catch(B){this.handleError(B)}});v.onerror=mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y);window.openFile=null});"image"!==t.type.substring(0,5)&&"application/pdf"!==t.type||"image/svg"===t.type.substring(0,9)?v.readAsText(t):v.readAsDataURL(t)})(d[m])};EditorUi.prototype.openLocalFile=function(d,g,m,t,v,y){var B=this.getCurrentFile(),-I=mxUtils.bind(this,function(){window.openFile=null;if(null==g&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var K=mxUtils.parseXml(d);null!=K&&(this.editor.setGraphXml(K.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,d,g||this.defaultFilename,m,t,v,y))});if(null!=d&&0<d.length)null==B||!B.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?I():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),+I=mxUtils.bind(this,function(){window.openFile=null;if(null==g&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var J=mxUtils.parseXml(d);null!=J&&(this.editor.setGraphXml(J.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,d,g||this.defaultFilename,m,t,v,y))});if(null!=d&&0<d.length)null==B||!B.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?I():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(d,g),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):I()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var d={};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)this.updatePageRoot(this.pages[g]),this.addBasenamesForCell(this.pages[g].root,d);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),d);g=[];for(var m in d)g.push(m);return g};EditorUi.prototype.addBasenamesForCell=function(d,g){function m(B){if(null!=B){var I=B.lastIndexOf(".");0<I&&(B=B.substring(I+1,B.length));null==g[B]&&(g[B]=!0)}}var t=this.editor.graph,v=t.getCellStyle(d);m(mxStencilRegistry.getBasenameForStencil(v[mxConstants.STYLE_SHAPE]));t.model.isEdge(d)&&(m(mxMarker.getPackageForType(v[mxConstants.STYLE_STARTARROW])),m(mxMarker.getPackageForType(v[mxConstants.STYLE_ENDARROW])));v=t.model.getChildCount(d);for(var y=0;y<v;y++)this.addBasenamesForCell(t.model.getChildAt(d,y),g)};EditorUi.prototype.setGraphEnabled=function(d){this.diagramContainer.style.visibility=d?"":"hidden";this.formatContainer.style.visibility=d?"":"hidden";this.sidebarContainer.style.display=d?"":"none";this.hsplit.style.display=d&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme?"":"none";this.editor.graph.setEnabled(d);null!=this.tabContainer&&(this.tabContainer.style.visibility=d&&0<parseInt(this.tabContainer.style.height)?"":"hidden");null!=this.ruler&&(this.ruler.hRuler.container.style.visibility=d?"":"hidden",this.ruler.vRuler.container.style.visibility=d?"":"hidden");d||this.hideWindows()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var d=-!1;this.installMessageHandler(mxUtils.bind(this,function(g,m,t,v){d||(d=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==g||0==g.length)g=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,g,{}));this.mode=App.MODE_EMBED;this.setFileData(g);if(v)try{var y=this.editor.graph;y.setGridEnabled(!1);y.pageVisible=!1;var B=y.model.cells,I;for(I in B){var K=B[I];null!=K&&null!=K.style&&(K.style+=";sketch=1;"+(-1==K.style.indexOf("fontFamily=")||-1<K.style.indexOf("fontFamily=Helvetica;")?-"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(J){console.log(J)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=t?t:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=+!1;this.installMessageHandler(mxUtils.bind(this,function(g,m,t,v){d||(d=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==g||0==g.length)g=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,g,{}));this.mode=App.MODE_EMBED;this.setFileData(g);if(v)try{var y=this.editor.graph;y.setGridEnabled(!1);y.pageVisible=!1;var B=y.model.cells,I;for(I in B){var J=B[I];null!=J&&null!=J.style&&(J.style+=";sketch=1;"+(-1==J.style.indexOf("fontFamily=")||-1<J.style.indexOf("fontFamily=Helvetica;")?+"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(K){console.log(K)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=t?t:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(d,g){null!=d?this.spinner.spin(document.body,mxResources.get("loading"))&&d.getPublicUrl(mxUtils.bind(this,function(m){this.spinner.stop();g(m)})):g(null)};EditorUi.prototype.createLoadMessage=function(d){var g=this.editor.graph;return{event:d,pageVisible:g.pageVisible,translate:g.view.translate,bounds:g.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:g.view.scale,page:g.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(d){try{var g=this.editor.graph;g.isEditing()&&g.stopEditing(!g.isInvokesStopCellEditing());var m=window.opener||window.parent;if(this.editor.modified){var t=g.background;if(null==t||t==mxConstants.NONE)t=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),g,null,!0,mxUtils.bind(this,function(v){m.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=d?!d:!0,data:Editor.createSvgDataUri(v)}),"*")}),null,null,!0,t,1,this.embedExportBorder,null,this.embedExportTheme)}else d||m.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");d||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,g.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=-!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(v){d||this.handleError(v)}};EditorUi.prototype.installMessageHandler=function(d){var g=null,m=!1,t=!1,v=null,y=mxUtils.bind(this,function(K,J){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,y);mxEvent.addListener(window,"message",mxUtils.bind(this,-function(K){if(K.source==(window.opener||window.parent)){var J=K.data,V=null,Q=mxUtils.bind(this,function(aa){if(null!=aa&&"function"===typeof aa.charAt&&"<"!=aa.charAt(0))try{Editor.isPngDataUrl(aa)?aa=Editor.extractGraphModelFromPng(aa):"data:image/svg+xml;base64,"==aa.substring(0,26)?aa=atob(aa.substring(26)):"data:image/svg+xml;utf8,"==aa.substring(0,24)&&(aa=aa.substring(24)),null!=aa&&(""==aa.trim()?aa=null:"%"==aa.charAt(0)?aa=decodeURIComponent(aa):"<"!=aa.charAt(0)&&(aa=Graph.decompress(aa)))}catch(ia){}return aa});-if("json"==urlParams.proto){var O=!1;try{J=JSON.parse(J),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[K],"data",[J])}catch(aa){J=null}try{if(null==J)return;if("dialog"==J.action){this.showError(null!=J.titleKey?mxResources.get(J.titleKey):J.title,null!=J.messageKey?mxResources.get(J.messageKey):mxUtils.htmlEntities(J.message),null!=J.buttonKey?mxResources.get(J.buttonKey):J.button);null!=J.modified&&(this.editor.modified=J.modified);return}if("layout"==J.action){this.executeLayouts(this.editor.graph.createLayouts(J.layouts));-return}if("prompt"==J.action){this.spinner.stop();var p=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(aa){null!=aa?B.postMessage(JSON.stringify({event:"prompt",value:aa,message:J}),"*"):B.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){B.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(p.container,300,80,!0,!1);-p.init();return}if("draft"==J.action){var z=Q(J.xml);this.spinner.stop();p=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),z,mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"discard",message:J}),"*")}),J.editKey?mxResources.get(J.editKey):null,J.discardKey?mxResources.get(J.discardKey):null,J.ignore?-mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(p.container,640,480,!0,!1,mxUtils.bind(this,function(aa){aa&&this.actions.get("exit").funct()}));try{p.init()}catch(aa){B.postMessage(JSON.stringify({event:"draft",error:aa.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var A=1==J.enableRecent,C=1==J.enableSearch,M=1==J.enableCustomTemp;p=new NewDialog(this,!1,J.templatesOnly?-!1:null!=J.callback,mxUtils.bind(this,function(aa,ia,ka,ua){aa=aa||this.emptyDiagramXml;null!=J.callback?B.postMessage(JSON.stringify({event:"template",xml:aa,blank:aa==this.emptyDiagramXml,name:ia,tempUrl:ka,libs:ua,builtIn:!0,message:J}),"*"):(d(aa,K,aa!=this.emptyDiagramXml,J.toSketch),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,A?mxUtils.bind(this,function(aa){this.remoteInvoke("getRecentDiagrams",[null],null,aa,function(){aa(null,"Network Error!")})}):-null,C?mxUtils.bind(this,function(aa,ia){this.remoteInvoke("searchDiagrams",[aa,null],null,ia,function(){ia(null,"Network Error!")})}):null,mxUtils.bind(this,function(aa,ia,ka){B.postMessage(JSON.stringify({event:"template",docUrl:aa,info:ia,name:ka}),"*")}),null,null,M?mxUtils.bind(this,function(aa){this.remoteInvoke("getCustomTemplates",null,null,aa,function(){aa({},0)})}):null,1==J.withoutType);this.showDialog(p.container,620,460,!0,!1,mxUtils.bind(this,function(aa){null!=this.sidebar&&this.sidebar.hideTooltip();-aa&&this.actions.get("exit").funct()}));p.init();return}if("textContent"==J.action){var S=this.getDiagramTextContent();B.postMessage(JSON.stringify({event:"textContent",data:S,message:J}),"*");return}if("status"==J.action){null!=J.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(J.messageKey))):null!=J.message&&this.editor.setStatus(mxUtils.htmlEntities(J.message));null!=J.modified&&(this.editor.modified=J.modified);return}if("spinner"==J.action){var l=null!=J.messageKey?mxResources.get(J.messageKey):-J.message;null==J.show||J.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("exit"==J.action){this.actions.get("exit").funct();return}if("viewport"==J.action){null!=J.viewport&&(this.embedViewport=J.viewport,this.editor.graph.refresh(),this.fireEvent(new mxEventObject("embedViewportChanged")));return}if("fullscreenChanged"==J.action){p=null;try{var x=this.diagramContainer.getAttribute("data-scrollState");null!=x&&(this.diagramContainer.removeAttribute("data-scrollState"),p=JSON.parse(x))}catch(aa){}Editor.inlineFullscreen=-J.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=p&&this.restoreScrollState(p);return}if("snapshot"==J.action){this.sendEmbeddedSvgExport(!0);return}if("export"==J.action){if("png"==J.format||"xmlpng"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){var G=null!=J.xml?J.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var N=this.editor.graph,P=mxUtils.bind(this,function(aa,ia){if(J.withSvg)J.withSvg=-!1,this.getEmbeddedSvg(G,this.editor.graph,null,!0,function(ua){P(aa,ua)},null,null,J.embedImages,this.editor.graph.background,J.scale,J.border,J.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ka=this.createLoadMessage("export");ka.format=J.format;ka.message=J;ka.data=aa;ka.svg=ia;ka.xml=G;B.postMessage(JSON.stringify(ka),"*")}}),R=mxUtils.bind(this,function(aa){null==aa&&(aa=Editor.blankImage);"xmlpng"==J.format&&(aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(G)));-N!=this.editor.graph&&N.container.parentNode.removeChild(N.container);P(aa)}),T=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var U=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=T){var aa=N.getGlobalVariable;N=this.createTemporaryGraph(N.getStylesheet());for(var ia,ka=0;ka<this.pages.length;ka++)if(this.pages[ka].getId()==T){ia=this.updatePageRoot(this.pages[ka]);break}null==ia&&(ia=this.currentPage);-N.getGlobalVariable=function(pa){return"page"==pa?ia.getName():"pagenumber"==pa?1:aa.apply(this,arguments)};document.body.appendChild(N.container);N.model.setRoot(ia.root)}if(null!=J.layerIds){var ua=N.model,sa=ua.getChildCells(ua.getRoot()),fa={};for(ka=0;ka<J.layerIds.length;ka++)fa[J.layerIds[ka]]=!0;for(ka=0;ka<sa.length;ka++)ua.setVisible(sa[ka],fa[sa[ka].id]||!1)}ka=null;J.keepTheme&&(ka=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(pa){R(pa.toDataURL("image/png"))}),-J.width,null,J.background,mxUtils.bind(this,function(){R(null)}),null,null,J.scale,J.transparent,J.shadow,null,N,J.border,null,J.grid,ka)});null!=J.xml&&0<J.xml.length&&(m=!0,this.setFileData(G),m=!1);U()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==J.format?"1":"0")+(null!=T?"&pageId="+T:"")+(null!=J.layerIds&&0<J.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:J.layerIds})):"")+(null!=J.scale?"&scale="+J.scale:"")+"&base64=1&xml="+encodeURIComponent(G))).send(mxUtils.bind(this,-function(aa){200<=aa.getStatus()&&299>=aa.getStatus()?P("data:image/png;base64,"+aa.getText()):R(null)}),mxUtils.bind(this,function(){R(null)}))}}else if(U=mxUtils.bind(this,function(){var aa=this.createLoadMessage("export");aa.message=J;if("html2"==J.format||"html"==J.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ia=this.getXmlFileData();aa.xml=mxUtils.getXml(ia);aa.data=this.getFileData(null,null,!0,null,null,null,ia);aa.format=J.format}else if("html"==J.format)ia=this.editor.getGraphXml(),-aa.data=this.getHtml(ia,this.editor.graph),aa.xml=mxUtils.getXml(ia),aa.format=J.format;else{mxSvgCanvas2D.prototype.foAltText=null;ia=null!=J.background?J.background:this.editor.graph.background;ia==mxConstants.NONE&&(ia=null);aa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);aa.format="svg";var ka=mxUtils.bind(this,function(sa){this.editor.graph.setEnabled(!0);this.spinner.stop();aa.data=Editor.createSvgDataUri(sa);B.postMessage(JSON.stringify(aa),"*")}),ua="auto";J.keepTheme&&-(ua=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(ua=J.theme);if("xmlsvg"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){ua=null;if(this.isAutoDarkMode()||Editor.isDarkMode())ua="auto";null!=J.theme&&(ua=J.theme);this.getEmbeddedSvg(aa.xml,this.editor.graph,null,!0,ka,null,null,J.embedImages,ia,J.scale,J.border,J.shadow,ua)}}else if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?-mxResources.get(J.spinKey):J.spin))this.editor.graph.setEnabled(!1),ia=this.editor.graph.getSvg(ia,J.scale,J.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||J.shadow,null,ua),(this.editor.graph.shadowVisible||J.shadow)&&this.editor.graph.addSvgShadow(ia),this.embedFonts(ia,mxUtils.bind(this,function(sa){J.embedImages||null==J.embedImages?this.editor.convertImages(sa,mxUtils.bind(this,function(fa){ka(mxUtils.getXml(fa))})):ka(mxUtils.getXml(sa))}));return}B.postMessage(JSON.stringify(aa),-"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var W=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){W.apply(this,arguments);U()}}m=!0;this.setFileData(J.xml);m=!1;this.editor.graph.mathEnabled||U()}else U();return}if("load"==J.action){O=J.toSketch;t=1==J.autosave;this.hideDialog();null!=J.modified&&null==urlParams.modified&&(urlParams.modified=J.modified);null!=J.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=J.saveAndExit);if("1"==urlParams.saveAndExit||-"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+Shift+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=J.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=J.noSaveBtn);if(null!=J.rough){var X=Editor.sketchMode;this.doSetSketchMode(J.rough);X!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=-J.dark&&this.setDarkMode(J.dark);null!=J.border&&(this.embedExportBorder=J.border);null!=J.theme&&(this.embedExportTheme=J.theme);null!=J.background&&(this.embedExportBackground=J.background);null!=J.viewport&&(this.embedViewport=J.viewport);this.embedExitPoint=null;if(null!=J.rect){var Y=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,J.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,J.rect.top)+"px";this.minInlineWidth=J.minWidth;this.minInlineHeight=J.minHeight;-this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Z=J.maxFitScale,ba=J.rect.width+2*Y,ha=J.rect.height+2*Y;V=mxUtils.bind(this,function(){var aa=mxUtils.getDocumentSize();ba=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ba):ba,aa.width-80);aa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ha):ha,aa.height-80);this.diagramContainer.style.width=ba+"px";this.diagramContainer.style.height=-aa+"px";var ia=this.editor.graph;aa=ia.maxFitScale;ia.maxFitScale=Z;ia.fit(2*Y,null,null,null,null,null,ha);this.setPageVisible(!1);if(null!=this.minInlineWidth&&ia.getGraphBounds().width<this.minInlineWidth){var ka=ia.container.scrollTop;this.resetScrollbars();ia.container.scrollTop=ka}ia.maxFitScale=aa;ia.container.scrollTop-=Y;ia.container.scrollLeft-=Y;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[J]));ia.container.focus();null!=this.formatWindow&&-null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=ia.container.style.top);var ua=ia.getGraphBounds();ia.container.clientWidth>ua.width+2*Y&&(ia.container.scrollLeft=ua.x+(ua.width+Y-ia.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&(z=this.createStatusDiv(""),mxUtils.write(z,J.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),-this.buttonContainer.appendChild(z),this.embedFilenameSpan=z);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(aa){}J=null!=J.xmlpng?this.extractGraphModelFromPng(J.xmlpng):null!=J.descriptor?J.descriptor:J.xml}else{if("merge"==J.action){var ca=this.getCurrentFile();null!=ca&&(z=Q(J.xml),null!=z&&""!=z&&ca.mergeFile(new LocalFile(this,z),function(){B.postMessage(JSON.stringify({event:"merge",message:J}),"*")},function(aa){B.postMessage(JSON.stringify({event:"merge",message:J,error:aa}),"*")}))}else"remoteInvokeReady"==-J.action?this.handleRemoteInvokeReady(B):"remoteInvoke"==J.action?this.handleRemoteInvoke(J,K.origin):"remoteInvokeResponse"==J.action?this.handleRemoteInvokeResponse(J):B.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(J)}),"*");return}}catch(aa){this.handleError(aa)}}var da=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ja=mxUtils.bind(this,function(aa,ia){m=!0;-try{d(aa,ia,null,O)}catch(ka){this.handleError(ka)}m=!1;null!=urlParams.modified&&this.editor.setStatus("");v=da();t&&null==g&&(g=mxUtils.bind(this,function(ka,ua){ka=da();ka==v||m||(ua=this.createLoadMessage("autosave"),ua.xml=ka,(window.opener||window.parent).postMessage(JSON.stringify(ua),"*"));v=ka}),this.editor.graph.model.addListener(mxEvent.CHANGE,g),this.editor.graph.addListener("gridSizeChanged",g),this.editor.graph.addListener("shadowVisibleChanged",g),this.addListener("pageFormatChanged",-g),this.addListener("pageScaleChanged",g),this.addListener("backgroundColorChanged",g),this.addListener("backgroundImageChanged",g),this.addListener("foldingEnabledChanged",g),this.addListener("mathEnabledChanged",g),this.addListener("gridEnabledChanged",g),this.addListener("guidesEnabledChanged",g),this.addListener("pageViewChanged",g));if("1"==urlParams.returnbounds||"json"==urlParams.proto)ia=this.createLoadMessage("load"),ia.xml=aa,B.postMessage(JSON.stringify(ia),"*");null!=V&&V()});null!=J&&-"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,34)?(Q="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(aa){ja(aa,K)},mxUtils.bind(this,function(aa){this.handleError(aa)}),Q)):null!=J&&"function"===typeof J.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(J,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(J,-mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status&&"<mxGraphModel"==aa.responseText.substring(0,13)?ja(aa.responseText,K):this.handleError({message:413==aa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=J&&"function"===typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(aa){ja(aa)}),mxUtils.bind(this,function(aa){this.handleError(aa)})):null==J||"object"!==typeof J||null==J.format||-null==J.data&&null==J.url?(J=Q(J),ja(J,K)):this.loadDescriptor(J,mxUtils.bind(this,function(aa){ja(da(),K)}),mxUtils.bind(this,function(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}))}}));var B=window.opener||window.parent;y="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";B.postMessage(y,"*");if("json"==urlParams.proto){var I=this.editor.graph.openLink;this.editor.graph.openLink=function(K,J,V){I.apply(this,arguments);B.postMessage(JSON.stringify({event:"openLink",-href:K,target:J,allowOpener:V}),"*")}}};EditorUi.prototype.createEmbedButton=function(d,g,m,t){var v="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme,y=document.createElement("button");y.setAttribute("title",d+(null!=m?" ("+m+")":""));y.style.marginLeft="6px";mxUtils.write(y,d);v?(y.className=t?"gePrimaryBtn":"",y.style.marginLeft="8px",y.style.padding="6px"):y.className="geBigButton"+(t?"":" geBigStandardButton");mxEvent.addListener(y,"click",g);return y};+!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(v){d||this.handleError(v)}};EditorUi.prototype.installMessageHandler=function(d){var g=null,m=!1,t=!1,v=null,y=mxUtils.bind(this,function(J,K){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,y);mxEvent.addListener(window,"message",mxUtils.bind(this,+function(J){if(J.source==(window.opener||window.parent)){var K=J.data,V=null,Q=mxUtils.bind(this,function(aa){if(null!=aa&&"function"===typeof aa.charAt&&"<"!=aa.charAt(0))try{Editor.isPngDataUrl(aa)?aa=Editor.extractGraphModelFromPng(aa):"data:image/svg+xml;base64,"==aa.substring(0,26)?aa=atob(aa.substring(26)):"data:image/svg+xml;utf8,"==aa.substring(0,24)&&(aa=aa.substring(24)),null!=aa&&(""==aa.trim()?aa=null:"%"==aa.charAt(0)?aa=decodeURIComponent(aa):"<"!=aa.charAt(0)&&(aa=Graph.decompress(aa)))}catch(ia){}return aa});+if("json"==urlParams.proto){var P=!1;try{K=JSON.parse(K),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[J],"data",[K])}catch(aa){K=null}try{if(null==K)return;if("dialog"==K.action){this.showError(null!=K.titleKey?mxResources.get(K.titleKey):K.title,null!=K.messageKey?mxResources.get(K.messageKey):mxUtils.htmlEntities(K.message),null!=K.buttonKey?mxResources.get(K.buttonKey):K.button);null!=K.modified&&(this.editor.modified=K.modified);return}if("layout"==K.action){this.executeLayouts(this.editor.graph.createLayouts(K.layouts));+return}if("prompt"==K.action){this.spinner.stop();var p=new FilenameDialog(this,K.defaultValue||"",null!=K.okKey?mxResources.get(K.okKey):K.ok,function(aa){null!=aa?B.postMessage(JSON.stringify({event:"prompt",value:aa,message:K}),"*"):B.postMessage(JSON.stringify({event:"prompt-cancel",message:K}),"*")},null!=K.titleKey?mxResources.get(K.titleKey):K.title,null,null,null,null,function(){B.postMessage(JSON.stringify({event:"prompt-cancel",message:K}),"*")});this.showDialog(p.container,300,80,!0,!1);+p.init();return}if("draft"==K.action){var z=Q(K.xml);this.spinner.stop();p=new DraftDialog(this,mxResources.get("draftFound",[K.name||this.defaultFilename]),z,mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"edit",message:K}),"*")}),mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"discard",message:K}),"*")}),K.editKey?mxResources.get(K.editKey):null,K.discardKey?mxResources.get(K.discardKey):null,K.ignore?+mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"ignore",message:K}),"*")}):null);this.showDialog(p.container,640,480,!0,!1,mxUtils.bind(this,function(aa){aa&&this.actions.get("exit").funct()}));try{p.init()}catch(aa){B.postMessage(JSON.stringify({event:"draft",error:aa.toString(),message:K}),"*")}return}if("template"==K.action){this.spinner.stop();var A=1==K.enableRecent,C=1==K.enableSearch,M=1==K.enableCustomTemp;p=new NewDialog(this,!1,K.templatesOnly?+!1:null!=K.callback,mxUtils.bind(this,function(aa,ia,ka,ua){aa=aa||this.emptyDiagramXml;null!=K.callback?B.postMessage(JSON.stringify({event:"template",xml:aa,blank:aa==this.emptyDiagramXml,name:ia,tempUrl:ka,libs:ua,builtIn:!0,message:K}),"*"):(d(aa,J,aa!=this.emptyDiagramXml,K.toSketch),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,A?mxUtils.bind(this,function(aa){this.remoteInvoke("getRecentDiagrams",[null],null,aa,function(){aa(null,"Network Error!")})}):+null,C?mxUtils.bind(this,function(aa,ia){this.remoteInvoke("searchDiagrams",[aa,null],null,ia,function(){ia(null,"Network Error!")})}):null,mxUtils.bind(this,function(aa,ia,ka){B.postMessage(JSON.stringify({event:"template",docUrl:aa,info:ia,name:ka}),"*")}),null,null,M?mxUtils.bind(this,function(aa){this.remoteInvoke("getCustomTemplates",null,null,aa,function(){aa({},0)})}):null,1==K.withoutType);this.showDialog(p.container,620,460,!0,!1,mxUtils.bind(this,function(aa){null!=this.sidebar&&this.sidebar.hideTooltip();+aa&&this.actions.get("exit").funct()}));p.init();return}if("textContent"==K.action){var S=this.getDiagramTextContent();B.postMessage(JSON.stringify({event:"textContent",data:S,message:K}),"*");return}if("status"==K.action){null!=K.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(K.messageKey))):null!=K.message&&this.editor.setStatus(mxUtils.htmlEntities(K.message));null!=K.modified&&(this.editor.modified=K.modified);return}if("spinner"==K.action){var l=null!=K.messageKey?mxResources.get(K.messageKey):+K.message;null==K.show||K.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("exit"==K.action){this.actions.get("exit").funct();return}if("viewport"==K.action){null!=K.viewport&&(this.embedViewport=K.viewport,this.editor.graph.refresh(),this.fireEvent(new mxEventObject("embedViewportChanged")));return}if("fullscreenChanged"==K.action){p=null;try{var x=this.diagramContainer.getAttribute("data-scrollState");null!=x&&(this.diagramContainer.removeAttribute("data-scrollState"),p=JSON.parse(x))}catch(aa){}Editor.inlineFullscreen=+K.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=p&&this.restoreScrollState(p);return}if("snapshot"==K.action){this.sendEmbeddedSvgExport(!0);return}if("export"==K.action){if("png"==K.format||"xmlpng"==K.format){if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){var G=null!=K.xml?K.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var N=this.editor.graph,O=mxUtils.bind(this,function(aa,ia){if(K.withSvg)K.withSvg=+!1,this.getEmbeddedSvg(G,this.editor.graph,null,!0,function(ua){O(aa,ua)},null,null,K.embedImages,this.editor.graph.background,K.scale,K.border,K.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ka=this.createLoadMessage("export");ka.format=K.format;ka.message=K;ka.data=aa;ka.svg=ia;ka.xml=G;B.postMessage(JSON.stringify(ka),"*")}}),R=mxUtils.bind(this,function(aa){null==aa&&(aa=Editor.blankImage);"xmlpng"==K.format&&(aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(G)));+N!=this.editor.graph&&N.container.parentNode.removeChild(N.container);O(aa)}),T=K.pageId||(null!=this.pages?K.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var U=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=T){var aa=N.getGlobalVariable;N=this.createTemporaryGraph(N.getStylesheet());for(var ia,ka=0;ka<this.pages.length;ka++)if(this.pages[ka].getId()==T){ia=this.updatePageRoot(this.pages[ka]);break}null==ia&&(ia=this.currentPage);+N.getGlobalVariable=function(pa){return"page"==pa?ia.getName():"pagenumber"==pa?1:aa.apply(this,arguments)};document.body.appendChild(N.container);N.model.setRoot(ia.root)}if(null!=K.layerIds){var ua=N.model,sa=ua.getChildCells(ua.getRoot()),ha={};for(ka=0;ka<K.layerIds.length;ka++)ha[K.layerIds[ka]]=!0;for(ka=0;ka<sa.length;ka++)ua.setVisible(sa[ka],ha[sa[ka].id]||!1)}ka=null;K.keepTheme&&(ka=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(pa){R(pa.toDataURL("image/png"))}),+K.width,null,K.background,mxUtils.bind(this,function(){R(null)}),null,null,K.scale,K.transparent,K.shadow,null,N,K.border,null,K.grid,ka)});null!=K.xml&&0<K.xml.length&&(m=!0,this.setFileData(G),m=!1);U()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==K.format?"1":"0")+(null!=T?"&pageId="+T:"")+(null!=K.layerIds&&0<K.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:K.layerIds})):"")+(null!=K.scale?"&scale="+K.scale:"")+"&base64=1&xml="+encodeURIComponent(G))).send(mxUtils.bind(this,+function(aa){200<=aa.getStatus()&&299>=aa.getStatus()?O("data:image/png;base64,"+aa.getText()):R(null)}),mxUtils.bind(this,function(){R(null)}))}}else if(U=mxUtils.bind(this,function(){var aa=this.createLoadMessage("export");aa.message=K;if("html2"==K.format||"html"==K.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ia=this.getXmlFileData();aa.xml=mxUtils.getXml(ia);aa.data=this.getFileData(null,null,!0,null,null,null,ia);aa.format=K.format}else if("html"==K.format)ia=this.editor.getGraphXml(),+aa.data=this.getHtml(ia,this.editor.graph),aa.xml=mxUtils.getXml(ia),aa.format=K.format;else{mxSvgCanvas2D.prototype.foAltText=null;ia=null!=K.background?K.background:this.editor.graph.background;ia==mxConstants.NONE&&(ia=null);aa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);aa.format="svg";var ka=mxUtils.bind(this,function(sa){this.editor.graph.setEnabled(!0);this.spinner.stop();aa.data=Editor.createSvgDataUri(sa);B.postMessage(JSON.stringify(aa),"*")}),ua="auto";K.keepTheme&&+(ua=Editor.isDarkMode()?"dark":"light");null!=K.theme&&(ua=K.theme);if("xmlsvg"==K.format){if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){ua=null;if(this.isAutoDarkMode()||Editor.isDarkMode())ua="auto";null!=K.theme&&(ua=K.theme);this.getEmbeddedSvg(aa.xml,this.editor.graph,null,!0,ka,null,null,K.embedImages,ia,K.scale,K.border,K.shadow,ua)}}else if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?+mxResources.get(K.spinKey):K.spin))this.editor.graph.setEnabled(!1),ia=this.editor.graph.getSvg(ia,K.scale,K.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||K.shadow,null,ua),(this.editor.graph.shadowVisible||K.shadow)&&this.editor.graph.addSvgShadow(ia),this.embedFonts(ia,mxUtils.bind(this,function(sa){K.embedImages||null==K.embedImages?this.editor.convertImages(sa,mxUtils.bind(this,function(ha){ka(mxUtils.getXml(ha))})):ka(mxUtils.getXml(sa))}));return}B.postMessage(JSON.stringify(aa),+"*")}),null!=K.xml&&0<K.xml.length){if(this.editor.graph.mathEnabled){var W=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){W.apply(this,arguments);U()}}m=!0;this.setFileData(K.xml);m=!1;this.editor.graph.mathEnabled||U()}else U();return}if("load"==K.action){P=K.toSketch;t=1==K.autosave;this.hideDialog();null!=K.modified&&null==urlParams.modified&&(urlParams.modified=K.modified);null!=K.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=K.saveAndExit);if("1"==urlParams.saveAndExit||+"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+Shift+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=K.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=K.noSaveBtn);if(null!=K.rough){var X=Editor.sketchMode;this.doSetSketchMode(K.rough);X!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=+K.dark&&this.setDarkMode(K.dark);null!=K.border&&(this.embedExportBorder=K.border);null!=K.theme&&(this.embedExportTheme=K.theme);null!=K.background&&(this.embedExportBackground=K.background);null!=K.viewport&&(this.embedViewport=K.viewport);this.embedExitPoint=null;if(null!=K.rect){var Y=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,K.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,K.rect.top)+"px";this.minInlineWidth=K.minWidth;this.minInlineHeight=K.minHeight;+this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Z=K.maxFitScale,ba=K.rect.width+2*Y,fa=K.rect.height+2*Y;V=mxUtils.bind(this,function(){var aa=mxUtils.getDocumentSize();ba=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ba):ba,aa.width-80);aa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,fa):fa,aa.height-80);this.diagramContainer.style.width=ba+"px";this.diagramContainer.style.height=+aa+"px";var ia=this.editor.graph;aa=ia.maxFitScale;ia.maxFitScale=Z;ia.fit(2*Y,null,null,null,null,null,fa);this.setPageVisible(!1);if(null!=this.minInlineWidth&&ia.getGraphBounds().width<this.minInlineWidth){var ka=ia.container.scrollTop;this.resetScrollbars();ia.container.scrollTop=ka}ia.maxFitScale=aa;ia.container.scrollTop-=Y;ia.container.scrollLeft-=Y;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[K]));ia.container.focus();null!=this.formatWindow&&+null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=ia.container.style.top);var ua=ia.getGraphBounds();ia.container.clientWidth>ua.width+2*Y&&(ia.container.scrollLeft=ua.x+(ua.width+Y-ia.container.clientWidth)/2)}),10)})}null!=K.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=K.noExitBtn);null!=K.title&&null!=this.buttonContainer&&(z=this.createStatusDiv(""),mxUtils.write(z,K.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),+this.buttonContainer.appendChild(z),this.embedFilenameSpan=z);try{K.libs&&this.sidebar.showEntries(K.libs)}catch(aa){}K=null!=K.xmlpng?this.extractGraphModelFromPng(K.xmlpng):null!=K.descriptor?K.descriptor:K.xml}else{if("merge"==K.action){var ca=this.getCurrentFile();null!=ca&&(z=Q(K.xml),null!=z&&""!=z&&ca.mergeFile(new LocalFile(this,z),function(){B.postMessage(JSON.stringify({event:"merge",message:K}),"*")},function(aa){B.postMessage(JSON.stringify({event:"merge",message:K,error:aa}),"*")}))}else"remoteInvokeReady"==+K.action?this.handleRemoteInvokeReady(B):"remoteInvoke"==K.action?this.handleRemoteInvoke(K,J.origin):"remoteInvokeResponse"==K.action?this.handleRemoteInvokeResponse(K):B.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(K)}),"*");return}}catch(aa){this.handleError(aa)}}var da=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ja=mxUtils.bind(this,function(aa,ia){m=!0;+try{d(aa,ia,null,P)}catch(ka){this.handleError(ka)}m=!1;null!=urlParams.modified&&this.editor.setStatus("");v=da();t&&null==g&&(g=mxUtils.bind(this,function(ka,ua){ka=da();ka==v||m||(ua=this.createLoadMessage("autosave"),ua.xml=ka,(window.opener||window.parent).postMessage(JSON.stringify(ua),"*"));v=ka}),this.editor.graph.model.addListener(mxEvent.CHANGE,g),this.editor.graph.addListener("gridSizeChanged",g),this.editor.graph.addListener("shadowVisibleChanged",g),this.addListener("pageFormatChanged",+g),this.addListener("pageScaleChanged",g),this.addListener("backgroundColorChanged",g),this.addListener("backgroundImageChanged",g),this.addListener("foldingEnabledChanged",g),this.addListener("mathEnabledChanged",g),this.addListener("gridEnabledChanged",g),this.addListener("guidesEnabledChanged",g),this.addListener("pageViewChanged",g));if("1"==urlParams.returnbounds||"json"==urlParams.proto)ia=this.createLoadMessage("load"),ia.xml=aa,B.postMessage(JSON.stringify(ia),"*");null!=V&&V()});null!=K&&+"function"===typeof K.substring&&"data:application/vnd.visio;base64,"==K.substring(0,34)?(Q="0M8R4KGxGuE"==K.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(aa){ja(aa,J)},mxUtils.bind(this,function(aa){this.handleError(aa)}),Q)):null!=K&&"function"===typeof K.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(K,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(K,+mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status&&"<mxGraphModel"==aa.responseText.substring(0,13)?ja(aa.responseText,J):this.handleError({message:413==aa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=K&&"function"===typeof K.substring&&this.isLucidChartData(K)?this.convertLucidChart(K,mxUtils.bind(this,function(aa){ja(aa)}),mxUtils.bind(this,function(aa){this.handleError(aa)})):null==K||"object"!==typeof K||null==K.format||+null==K.data&&null==K.url?(K=Q(K),ja(K,J)):this.loadDescriptor(K,mxUtils.bind(this,function(aa){ja(da(),J)}),mxUtils.bind(this,function(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}))}}));var B=window.opener||window.parent;y="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";B.postMessage(y,"*");if("json"==urlParams.proto){var I=this.editor.graph.openLink;this.editor.graph.openLink=function(J,K,V){I.apply(this,arguments);B.postMessage(JSON.stringify({event:"openLink",+href:J,target:K,allowOpener:V}),"*")}}};EditorUi.prototype.createEmbedButton=function(d,g,m,t){var v="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme,y=document.createElement("button");y.setAttribute("title",d+(null!=m?" ("+m+")":""));y.style.marginLeft="6px";mxUtils.write(y,d);v?(y.className=t?"gePrimaryBtn":"",y.style.marginLeft="8px",y.style.padding="6px"):y.className="geBigButton"+(t?"":" geBigStandardButton");mxEvent.addListener(y,"click",g);return y};EditorUi.prototype.addEmbedButtons=function(){var d=document.createElement("div");d.style.display="inline-flex";d.style.alignItems="center";d.style.marginLeft="auto";"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme&&(d.style.marginRight="66px",d.style["float"]="right","atlas"==Editor.currentTheme&&(d.style.marginTop="2px"));document.createElement("button").className="geBigButton";"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&d.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(d.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&d.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&d.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct));"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||null==this.buttonContainer?null!=this.menubar&&(this.toolbar.container.appendChild(d),this.toolbar.staticElements.push(d)):(this.buttonContainer.appendChild(d),this.editor.fireEvent(new mxEventObject("statusChanged")))};EditorUi.prototype.showImportCsvDialog=@@ -13434,25 +13436,25 @@ function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(function(){var g=new TextareaDialog(this,mxResources.get("layout"),d,mxUtils.bind(this,function(m){if(0<m.length)try{var t=JSON.parse(m);this.executeLayouts(this.editor.graph.createLayouts(t));this.customLayoutConfig=t;this.hideDialog()}catch(v){this.handleError(v)}}),null,null,null,null,mxUtils.bind(this,function(m,t){var v=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var y=t.value;t.value=JSON.stringify(JSON.parse(y));t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?t.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));t.value=y}catch(B){this.handleError(B)}}));v.setAttribute("title","copy");v.className="geBtn";m.appendChild(v)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(g.container,620,460,!0,!0);g.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(d){this.createTimeout(null,mxUtils.bind(this,function(g){var m=mxUtils.bind(this,function(){this.loadingOrgChart=!1;g.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),d())}),t=mxUtils.bind(this,function(v){this.loadingOrgChart=!1;g.clear()&&this.handleError(v)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?m():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",-function(){mxscript("js/orgchart/mxOrgChartLayout.js",m,null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,null,t):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",m,null,null,null,t))}),onerror)};EditorUi.prototype.importCsv=function(d,g){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(d,g)}))};EditorUi.prototype.doImportCsv=function(d,g){try{var m=d.split("\n"),t=[],v=[],y=[],B={};if(0<m.length){var I={},K=this.editor.graph,J=null,V=null,Q=null,O=null,-p=null,z=null,A=null,C="whiteSpace=wrap;html=1;",M=null,S=null,l="",x="auto",G="auto",N=!1,P=null,R=null,T=40,U=40,W=100,X=0,Y=mxUtils.bind(this,function(){null!=g?g(Da):(K.setSelectionCells(Da),K.scrollCellToVisible(K.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Z=K.getFreeInsertPoint(),ba=Z.x,ha=Z.y;Z=ha;var ca=null,da="auto";S=null;for(var ja=[],aa=null,ia=null,ka=0;ka<m.length&&"#"==m[ka].charAt(0);){d=m[ka].replace(/\r$/,-"");for(ka++;ka<m.length&&"\\"==d.charAt(d.length-1)&&"#"==m[ka].charAt(0);)d=d.substring(0,d.length-1)+mxUtils.trim(m[ka].substring(1)),ka++;if("#"!=d.charAt(1)){var ua=d.indexOf(":");if(0<ua){var sa=mxUtils.trim(d.substring(1,ua)),fa=mxUtils.trim(d.substring(ua+1));"label"==sa?ca=Graph.sanitizeHtml(fa):"labelname"==sa&&0<fa.length&&"-"!=fa?p=fa:"labels"==sa&&0<fa.length&&"-"!=fa?A=JSON.parse(fa):"style"==sa?V=fa:"parentstyle"==sa?C=fa:"unknownStyle"==sa&&"-"!=fa?z=fa:"stylename"==sa&&0<fa.length&&-"-"!=fa?O=fa:"styles"==sa&&0<fa.length&&"-"!=fa?Q=JSON.parse(fa):"vars"==sa&&0<fa.length&&"-"!=fa?J=JSON.parse(fa):"identity"==sa&&0<fa.length&&"-"!=fa?M=fa:"parent"==sa&&0<fa.length&&"-"!=fa?S=fa:"namespace"==sa&&0<fa.length&&"-"!=fa?l=fa:"width"==sa?x=fa:"height"==sa?G=fa:"collapsed"==sa&&"-"!=fa?N="true"==fa:"left"==sa&&0<fa.length?P=fa:"top"==sa&&0<fa.length?R=fa:"ignore"==sa?ia=fa.split(","):"connect"==sa?ja.push(JSON.parse(fa)):"link"==sa?aa=fa:"padding"==sa?X=parseFloat(fa):"edgespacing"==-sa?T=parseFloat(fa):"nodespacing"==sa?U=parseFloat(fa):"levelspacing"==sa?W=parseFloat(fa):"layout"==sa&&(da=fa)}}}if(null==m[ka])throw Error(mxResources.get("invalidOrMissingFile"));var pa=this.editor.csvToArray(m[ka].replace(/\r$/,""));ua=d=null;sa=[];for(fa=0;fa<pa.length;fa++)M==pa[fa]&&(d=fa),S==pa[fa]&&(ua=fa),sa.push(mxUtils.trim(pa[fa]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ca&&(ca="%"+sa[0]+"%");if(null!=ja)for(var ra=0;ra<ja.length;ra++)null==I[ja[ra].to]&&-(I[ja[ra].to]={});M=[];for(fa=ka+1;fa<m.length;fa++){var xa=this.editor.csvToArray(m[fa].replace(/\r$/,""));if(null==xa){var wa=40<m[fa].length?m[fa].substring(0,40)+"...":m[fa];throw Error(wa+" ("+fa+"):\n"+mxResources.get("containsValidationErrors"));}0<xa.length&&M.push(xa)}K.model.beginUpdate();try{for(fa=0;fa<M.length;fa++){xa=M[fa];var ea=null,na=null!=d?l+xa[d]:null;m=!1;null!=na&&(ea=K.model.getCell(na),m=null==ea||0<=mxUtils.indexOf(t,ea));var Aa=new mxCell(ca,new mxGeometry(ba,Z,0,0),V||-"whiteSpace=wrap;html=1;");Aa.collapsed=N;Aa.vertex=!0;Aa.id=na;null==ea||m||K.model.setCollapsed(ea,N);for(var oa=0;oa<xa.length;oa++)K.setAttributeForCell(Aa,sa[oa],xa[oa]),null==ea||m||K.setAttributeForCell(ea,sa[oa],xa[oa]);if(null!=p&&null!=A){var Ea=A[Aa.getAttribute(p)];null!=Ea&&(K.labelChanged(Aa,Ea),null==ea||m||K.cellLabelChanged(ea,Ea))}if(null!=O&&null!=Q){var va=Q[Aa.getAttribute(O)];null!=va&&(Aa.style=va)}K.setAttributeForCell(Aa,"placeholders","1");Aa.style=K.replacePlaceholders(Aa,-Aa.style,J);null==ea||m?K.fireEvent(new mxEventObject("cellsInserted","cells",[Aa])):(K.model.setStyle(ea,Aa.style),0>mxUtils.indexOf(y,ea)&&y.push(ea),K.fireEvent(new mxEventObject("cellsInserted","cells",[ea])));m=null!=ea;ea=Aa;if(!m)for(ra=0;ra<ja.length;ra++)I[ja[ra].to][ea.getAttribute(ja[ra].to)]=ea;null!=aa&&"link"!=aa&&(K.setLinkForCell(ea,ea.getAttribute(aa)),K.setAttributeForCell(ea,aa,null));var Ca=this.editor.graph.getPreferredSizeForCell(ea);S=null!=ua?K.model.getCell(l+xa[ua]):null;-if(ea.vertex){wa=null!=S?0:ba;ka=null!=S?0:ha;null!=P&&null!=ea.getAttribute(P)&&(ea.geometry.x=wa+parseFloat(ea.getAttribute(P)));null!=R&&null!=ea.getAttribute(R)&&(ea.geometry.y=ka+parseFloat(ea.getAttribute(R)));var Fa="@"==x.charAt(0)?ea.getAttribute(x.substring(1)):null;ea.geometry.width=null!=Fa&&"auto"!=Fa?parseFloat(ea.getAttribute(x.substring(1))):"auto"==x||"auto"==Fa?Ca.width+X:parseFloat(x);var Ma="@"==G.charAt(0)?ea.getAttribute(G.substring(1)):null;ea.geometry.height=null!=Ma&&"auto"!=-Ma&&"width"!=G?parseFloat(Ma):"auto"==G||"auto"==Ma?Ca.height+X:"width"==G?ea.geometry.width:parseFloat(G);Z+=ea.geometry.height+U}m?(null==B[na]&&(B[na]=[]),B[na].push(ea)):(t.push(ea),null!=S?(S.style=K.replacePlaceholders(S,C,J),K.addCell(ea,S),v.push(S)):y.push(K.addCell(ea)))}for(fa=0;fa<v.length;fa++)Fa="@"==x.charAt(0)?v[fa].getAttribute(x.substring(1)):null,Ma="@"==G.charAt(0)?v[fa].getAttribute(G.substring(1)):null,"auto"!=x&&"auto"!=Fa||"auto"!=G&&"auto"!=Ma||K.updateGroupBounds([v[fa]],-X,!0);var Ba=y.slice(),Da=y.slice();for(ra=0;ra<ja.length;ra++){var Ia=ja[ra];for(fa=0;fa<t.length;fa++){ea=t[fa];var Va=mxUtils.bind(this,function(ta,qa,ma){var za=qa.getAttribute(ma.from);if(null!=za&&""!=za){za=za.split(",");for(var Ja=0;Ja<za.length;Ja++){var Ga=I[ma.to][za[Ja]];if(null==Ga&&null!=z){Ga=new mxCell(za[Ja],new mxGeometry(ba,ha,0,0),z);Ga.style=K.replacePlaceholders(qa,Ga.style,J);var La=this.editor.graph.getPreferredSizeForCell(Ga);Ga.geometry.width=La.width+X;Ga.geometry.height=-La.height+X;I[ma.to][za[Ja]]=Ga;Ga.vertex=!0;Ga.id=za[Ja];y.push(K.addCell(Ga))}if(null!=Ga){La=ma.label;null!=ma.fromlabel&&(La=(qa.getAttribute(ma.fromlabel)||"")+(La||""));null!=ma.sourcelabel&&(La=K.replacePlaceholders(qa,ma.sourcelabel,J)+(La||""));null!=ma.tolabel&&(La=(La||"")+(Ga.getAttribute(ma.tolabel)||""));null!=ma.targetlabel&&(La=(La||"")+K.replacePlaceholders(Ga,ma.targetlabel,J));var Pa="target"==ma.placeholders==!ma.invert?Ga:ta;Pa=null!=ma.style?K.replacePlaceholders(Pa,ma.style,-J):K.createCurrentEdgeStyle();La=K.insertEdge(null,null,La||"",ma.invert?Ga:ta,ma.invert?ta:Ga,Pa);if(null!=ma.labels)for(Pa=0;Pa<ma.labels.length;Pa++){var Ka=ma.labels[Pa],Ra=new mxCell(Ka.label||Pa,new mxGeometry(null!=Ka.x?Ka.x:0,null!=Ka.y?Ka.y:0,0,0),"resizable=0;html=1;");Ra.vertex=!0;Ra.connectable=!1;Ra.geometry.relative=!0;null!=Ka.placeholders&&(Ra.value=K.replacePlaceholders("target"==Ka.placeholders==!ma.invert?Ga:ta,Ra.value,J));if(null!=Ka.dx||null!=Ka.dy)Ra.geometry.offset=new mxPoint(null!=-Ka.dx?Ka.dx:0,null!=Ka.dy?Ka.dy:0);La.insert(Ra)}if(null!=ma.data)for(var Na in ma.data)K.setAttributeForCell(La,Na,ma.data[Na]);Da.push(La);mxUtils.remove(ma.invert?ta:Ga,Ba)}}}});Va(ea,ea,Ia);if(null!=B[ea.id])for(oa=0;oa<B[ea.id].length;oa++)Va(ea,B[ea.id][oa],Ia)}}if(null!=ia)for(fa=0;fa<t.length;fa++)for(ea=t[fa],oa=0;oa<ia.length;oa++)K.setAttributeForCell(ea,mxUtils.trim(ia[oa]),null);if(0<y.length){var Ta=new mxParallelEdgeLayout(K);Ta.spacing=T;Ta.checkOverlap=!0;var Xa=function(){0<Ta.spacing&&-Ta.execute(K.getDefaultParent());for(var ta=0;ta<y.length;ta++){var qa=K.getCellGeometry(y[ta]);qa.x=Math.round(K.snap(qa.x));qa.y=Math.round(K.snap(qa.y));"auto"==x&&(qa.width=Math.round(K.snap(qa.width)));"auto"==G&&(qa.height=Math.round(K.snap(qa.height)))}};if("["==da.charAt(0)){var jb=Y;K.view.validate();this.executeLayouts(K.createLayouts(JSON.parse(da)),function(){Xa();jb()});Y=null}else if("circle"==da){var Sa=new mxCircleLayout(K);Sa.disableEdgeStyle=!1;Sa.resetEdges=!1;var bb=Sa.isVertexIgnored;-Sa.isVertexIgnored=function(ta){return bb.apply(this,arguments)||0>mxUtils.indexOf(y,ta)};this.executeLayout(function(){Sa.execute(K.getDefaultParent());Xa()},!0,Y);Y=null}else if("horizontaltree"==da||"verticaltree"==da||"auto"==da&&Da.length==2*y.length-1&&1==Ba.length){K.view.validate();var Wa=new mxCompactTreeLayout(K,"horizontaltree"==da);Wa.levelDistance=U;Wa.edgeRouting=!1;Wa.resetEdges=!1;Wa.sortEdges=!0;this.executeLayout(function(){Wa.execute(K.getDefaultParent(),0<Ba.length?Ba[0]:null)},-!0,Y);Y=null}else if("horizontalflow"==da||"verticalflow"==da||"auto"==da&&1==Ba.length){K.view.validate();var cb=new mxHierarchicalLayout(K,"horizontalflow"==da?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);cb.intraCellSpacing=U;cb.parallelEdgeSpacing=T;cb.interRankCellSpacing=W;cb.disableEdgeStyle=!1;this.executeLayout(function(){cb.execute(K.getDefaultParent(),Da);K.moveCells(Da,ba,ha)},!0,Y);Y=null}else if("orgchart"==da){K.view.validate();var hb=new mxOrgChartLayout(K,2,W,U),db=hb.isVertexIgnored;-hb.isVertexIgnored=function(ta){return db.apply(this,arguments)||0>mxUtils.indexOf(y,ta)};this.executeLayout(function(){hb.execute(K.getDefaultParent());Xa()},!0,Y);Y=null}else if("organic"==da||"auto"==da&&Da.length>y.length){K.view.validate();var la=new mxFastOrganicLayout(K);la.forceConstant=3*U;la.disableEdgeStyle=!1;la.resetEdges=!1;var ya=la.isVertexIgnored;la.isVertexIgnored=function(ta){return ya.apply(this,arguments)||0>mxUtils.indexOf(y,ta)};this.executeLayout(function(){la.execute(K.getDefaultParent());-Xa()},!0,Y);Y=null}}this.hideDialog()}finally{K.model.endUpdate()}null!=Y&&Y()}}catch(ta){this.handleError(ta)}};EditorUi.prototype.getSearch=function(d){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0<window.location.search.length){var m="?",t;for(t in urlParams)0>mxUtils.indexOf(d,t)&&null!=urlParams[t]&&(g+=m+t+"="+urlParams[t],m="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var g=0<d.indexOf("?")?1:0;+function(){mxscript("js/orgchart/mxOrgChartLayout.js",m,null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,null,t):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",m,null,null,null,t))}),onerror)};EditorUi.prototype.importCsv=function(d,g){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(d,g)}))};EditorUi.prototype.doImportCsv=function(d,g){try{var m=d.split("\n"),t=[],v=[],y=[],B={};if(0<m.length){var I={},J=this.editor.graph,K=null,V=null,Q=null,P=null,+p=null,z=null,A=null,C="whiteSpace=wrap;html=1;",M=null,S=null,l="",x="auto",G="auto",N=!1,O=null,R=null,T=40,U=40,W=100,X=0,Y=mxUtils.bind(this,function(){null!=g?g(Da):(J.setSelectionCells(Da),J.scrollCellToVisible(J.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Z=J.getFreeInsertPoint(),ba=Z.x,fa=Z.y;Z=fa;var ca=null,da="auto";S=null;for(var ja=[],aa=null,ia=null,ka=0;ka<m.length&&"#"==m[ka].charAt(0);){d=m[ka].replace(/\r$/,+"");for(ka++;ka<m.length&&"\\"==d.charAt(d.length-1)&&"#"==m[ka].charAt(0);)d=d.substring(0,d.length-1)+mxUtils.trim(m[ka].substring(1)),ka++;if("#"!=d.charAt(1)){var ua=d.indexOf(":");if(0<ua){var sa=mxUtils.trim(d.substring(1,ua)),ha=mxUtils.trim(d.substring(ua+1));"label"==sa?ca=Graph.sanitizeHtml(ha):"labelname"==sa&&0<ha.length&&"-"!=ha?p=ha:"labels"==sa&&0<ha.length&&"-"!=ha?A=JSON.parse(ha):"style"==sa?V=ha:"parentstyle"==sa?C=ha:"unknownStyle"==sa&&"-"!=ha?z=ha:"stylename"==sa&&0<ha.length&&+"-"!=ha?P=ha:"styles"==sa&&0<ha.length&&"-"!=ha?Q=JSON.parse(ha):"vars"==sa&&0<ha.length&&"-"!=ha?K=JSON.parse(ha):"identity"==sa&&0<ha.length&&"-"!=ha?M=ha:"parent"==sa&&0<ha.length&&"-"!=ha?S=ha:"namespace"==sa&&0<ha.length&&"-"!=ha?l=ha:"width"==sa?x=ha:"height"==sa?G=ha:"collapsed"==sa&&"-"!=ha?N="true"==ha:"left"==sa&&0<ha.length?O=ha:"top"==sa&&0<ha.length?R=ha:"ignore"==sa?ia=ha.split(","):"connect"==sa?ja.push(JSON.parse(ha)):"link"==sa?aa=ha:"padding"==sa?X=parseFloat(ha):"edgespacing"==+sa?T=parseFloat(ha):"nodespacing"==sa?U=parseFloat(ha):"levelspacing"==sa?W=parseFloat(ha):"layout"==sa&&(da=ha)}}}if(null==m[ka])throw Error(mxResources.get("invalidOrMissingFile"));var pa=this.editor.csvToArray(m[ka].replace(/\r$/,""));ua=d=null;sa=[];for(ha=0;ha<pa.length;ha++)M==pa[ha]&&(d=ha),S==pa[ha]&&(ua=ha),sa.push(mxUtils.trim(pa[ha]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ca&&(ca="%"+sa[0]+"%");if(null!=ja)for(var ra=0;ra<ja.length;ra++)null==I[ja[ra].to]&&+(I[ja[ra].to]={});M=[];for(ha=ka+1;ha<m.length;ha++){var xa=this.editor.csvToArray(m[ha].replace(/\r$/,""));if(null==xa){var wa=40<m[ha].length?m[ha].substring(0,40)+"...":m[ha];throw Error(wa+" ("+ha+"):\n"+mxResources.get("containsValidationErrors"));}0<xa.length&&M.push(xa)}J.model.beginUpdate();try{for(ha=0;ha<M.length;ha++){xa=M[ha];var ea=null,na=null!=d?l+xa[d]:null;m=!1;null!=na&&(ea=J.model.getCell(na),m=null==ea||0<=mxUtils.indexOf(t,ea));var Aa=new mxCell(ca,new mxGeometry(ba,Z,0,0),V||+"whiteSpace=wrap;html=1;");Aa.collapsed=N;Aa.vertex=!0;Aa.id=na;null==ea||m||J.model.setCollapsed(ea,N);for(var oa=0;oa<xa.length;oa++)J.setAttributeForCell(Aa,sa[oa],xa[oa]),null==ea||m||J.setAttributeForCell(ea,sa[oa],xa[oa]);if(null!=p&&null!=A){var Ea=A[Aa.getAttribute(p)];null!=Ea&&(J.labelChanged(Aa,Ea),null==ea||m||J.cellLabelChanged(ea,Ea))}if(null!=P&&null!=Q){var va=Q[Aa.getAttribute(P)];null!=va&&(Aa.style=va)}J.setAttributeForCell(Aa,"placeholders","1");Aa.style=J.replacePlaceholders(Aa,+Aa.style,K);null==ea||m?J.fireEvent(new mxEventObject("cellsInserted","cells",[Aa])):(J.model.setStyle(ea,Aa.style),0>mxUtils.indexOf(y,ea)&&y.push(ea),J.fireEvent(new mxEventObject("cellsInserted","cells",[ea])));m=null!=ea;ea=Aa;if(!m)for(ra=0;ra<ja.length;ra++)I[ja[ra].to][ea.getAttribute(ja[ra].to)]=ea;null!=aa&&"link"!=aa&&(J.setLinkForCell(ea,ea.getAttribute(aa)),J.setAttributeForCell(ea,aa,null));var Ca=this.editor.graph.getPreferredSizeForCell(ea);S=null!=ua?J.model.getCell(l+xa[ua]):null;+if(ea.vertex){wa=null!=S?0:ba;ka=null!=S?0:fa;null!=O&&null!=ea.getAttribute(O)&&(ea.geometry.x=wa+parseFloat(ea.getAttribute(O)));null!=R&&null!=ea.getAttribute(R)&&(ea.geometry.y=ka+parseFloat(ea.getAttribute(R)));var Fa="@"==x.charAt(0)?ea.getAttribute(x.substring(1)):null;ea.geometry.width=null!=Fa&&"auto"!=Fa?parseFloat(ea.getAttribute(x.substring(1))):"auto"==x||"auto"==Fa?Ca.width+X:parseFloat(x);var Ma="@"==G.charAt(0)?ea.getAttribute(G.substring(1)):null;ea.geometry.height=null!=Ma&&"auto"!=+Ma&&"width"!=G?parseFloat(Ma):"auto"==G||"auto"==Ma?Ca.height+X:"width"==G?ea.geometry.width:parseFloat(G);Z+=ea.geometry.height+U}m?(null==B[na]&&(B[na]=[]),B[na].push(ea)):(t.push(ea),null!=S?(S.style=J.replacePlaceholders(S,C,K),J.addCell(ea,S),v.push(S)):y.push(J.addCell(ea)))}for(ha=0;ha<v.length;ha++)Fa="@"==x.charAt(0)?v[ha].getAttribute(x.substring(1)):null,Ma="@"==G.charAt(0)?v[ha].getAttribute(G.substring(1)):null,"auto"!=x&&"auto"!=Fa||"auto"!=G&&"auto"!=Ma||J.updateGroupBounds([v[ha]],+X,!0);var Ba=y.slice(),Da=y.slice();for(ra=0;ra<ja.length;ra++){var Ia=ja[ra];for(ha=0;ha<t.length;ha++){ea=t[ha];var Va=mxUtils.bind(this,function(ta,qa,ma){var za=qa.getAttribute(ma.from);if(null!=za&&""!=za){za=za.split(",");for(var Ja=0;Ja<za.length;Ja++){var Ga=I[ma.to][za[Ja]];if(null==Ga&&null!=z){Ga=new mxCell(za[Ja],new mxGeometry(ba,fa,0,0),z);Ga.style=J.replacePlaceholders(qa,Ga.style,K);var La=this.editor.graph.getPreferredSizeForCell(Ga);Ga.geometry.width=La.width+X;Ga.geometry.height=+La.height+X;I[ma.to][za[Ja]]=Ga;Ga.vertex=!0;Ga.id=za[Ja];y.push(J.addCell(Ga))}if(null!=Ga){La=ma.label;null!=ma.fromlabel&&(La=(qa.getAttribute(ma.fromlabel)||"")+(La||""));null!=ma.sourcelabel&&(La=J.replacePlaceholders(qa,ma.sourcelabel,K)+(La||""));null!=ma.tolabel&&(La=(La||"")+(Ga.getAttribute(ma.tolabel)||""));null!=ma.targetlabel&&(La=(La||"")+J.replacePlaceholders(Ga,ma.targetlabel,K));var Pa="target"==ma.placeholders==!ma.invert?Ga:ta;Pa=null!=ma.style?J.replacePlaceholders(Pa,ma.style,+K):J.createCurrentEdgeStyle();La=J.insertEdge(null,null,La||"",ma.invert?Ga:ta,ma.invert?ta:Ga,Pa);if(null!=ma.labels)for(Pa=0;Pa<ma.labels.length;Pa++){var Ka=ma.labels[Pa],Ra=new mxCell(Ka.label||Pa,new mxGeometry(null!=Ka.x?Ka.x:0,null!=Ka.y?Ka.y:0,0,0),"resizable=0;html=1;");Ra.vertex=!0;Ra.connectable=!1;Ra.geometry.relative=!0;null!=Ka.placeholders&&(Ra.value=J.replacePlaceholders("target"==Ka.placeholders==!ma.invert?Ga:ta,Ra.value,K));if(null!=Ka.dx||null!=Ka.dy)Ra.geometry.offset=new mxPoint(null!=+Ka.dx?Ka.dx:0,null!=Ka.dy?Ka.dy:0);La.insert(Ra)}if(null!=ma.data)for(var Na in ma.data)J.setAttributeForCell(La,Na,ma.data[Na]);Da.push(La);mxUtils.remove(ma.invert?ta:Ga,Ba)}}}});Va(ea,ea,Ia);if(null!=B[ea.id])for(oa=0;oa<B[ea.id].length;oa++)Va(ea,B[ea.id][oa],Ia)}}if(null!=ia)for(ha=0;ha<t.length;ha++)for(ea=t[ha],oa=0;oa<ia.length;oa++)J.setAttributeForCell(ea,mxUtils.trim(ia[oa]),null);if(0<y.length){var Ta=new mxParallelEdgeLayout(J);Ta.spacing=T;Ta.checkOverlap=!0;var Xa=function(){0<Ta.spacing&&+Ta.execute(J.getDefaultParent());for(var ta=0;ta<y.length;ta++){var qa=J.getCellGeometry(y[ta]);qa.x=Math.round(J.snap(qa.x));qa.y=Math.round(J.snap(qa.y));"auto"==x&&(qa.width=Math.round(J.snap(qa.width)));"auto"==G&&(qa.height=Math.round(J.snap(qa.height)))}};if("["==da.charAt(0)){var jb=Y;J.view.validate();this.executeLayouts(J.createLayouts(JSON.parse(da)),function(){Xa();jb()});Y=null}else if("circle"==da){var Sa=new mxCircleLayout(J);Sa.disableEdgeStyle=!1;Sa.resetEdges=!1;var bb=Sa.isVertexIgnored;+Sa.isVertexIgnored=function(ta){return bb.apply(this,arguments)||0>mxUtils.indexOf(y,ta)};this.executeLayout(function(){Sa.execute(J.getDefaultParent());Xa()},!0,Y);Y=null}else if("horizontaltree"==da||"verticaltree"==da||"auto"==da&&Da.length==2*y.length-1&&1==Ba.length){J.view.validate();var Wa=new mxCompactTreeLayout(J,"horizontaltree"==da);Wa.levelDistance=U;Wa.edgeRouting=!1;Wa.resetEdges=!1;Wa.sortEdges=!0;this.executeLayout(function(){Wa.execute(J.getDefaultParent(),0<Ba.length?Ba[0]:null)},+!0,Y);Y=null}else if("horizontalflow"==da||"verticalflow"==da||"auto"==da&&1==Ba.length){J.view.validate();var cb=new mxHierarchicalLayout(J,"horizontalflow"==da?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);cb.intraCellSpacing=U;cb.parallelEdgeSpacing=T;cb.interRankCellSpacing=W;cb.disableEdgeStyle=!1;this.executeLayout(function(){cb.execute(J.getDefaultParent(),Da);J.moveCells(Da,ba,fa)},!0,Y);Y=null}else if("orgchart"==da){J.view.validate();var hb=new mxOrgChartLayout(J,2,W,U),db=hb.isVertexIgnored;+hb.isVertexIgnored=function(ta){return db.apply(this,arguments)||0>mxUtils.indexOf(y,ta)};this.executeLayout(function(){hb.execute(J.getDefaultParent());Xa()},!0,Y);Y=null}else if("organic"==da||"auto"==da&&Da.length>y.length){J.view.validate();var la=new mxFastOrganicLayout(J);la.forceConstant=3*U;la.disableEdgeStyle=!1;la.resetEdges=!1;var ya=la.isVertexIgnored;la.isVertexIgnored=function(ta){return ya.apply(this,arguments)||0>mxUtils.indexOf(y,ta)};this.executeLayout(function(){la.execute(J.getDefaultParent());+Xa()},!0,Y);Y=null}}this.hideDialog()}finally{J.model.endUpdate()}null!=Y&&Y()}}catch(ta){this.handleError(ta)}};EditorUi.prototype.getSearch=function(d){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0<window.location.search.length){var m="?",t;for(t in urlParams)0>mxUtils.indexOf(d,t)&&null!=urlParams[t]&&(g+=m+t+"="+urlParams[t],m="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var g=0<d.indexOf("?")?1:0;if("1"==urlParams.offline)d+=window.location.search;else{var m="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),t;for(t in urlParams)0>mxUtils.indexOf(m,t)&&(d=0==g?d+"?":d+"&",null!=urlParams[t]&&(d+=t+"="+urlParams[t],g++))}return d};EditorUi.prototype.showLinkDialog=function(d,g,m,t,v){d=new LinkDialog(this,d,g,m,!0,t,v);this.showDialog(d.container,440,120,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var g=1;null==this.drive&&"function"!==typeof window.DriveClient||g++;null==this.dropbox&&"function"!==typeof window.DropboxClient||g++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||g++;null!=this.gitHub&&g++;null!=this.gitLab&&g++;d&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var d=this.getCurrentFile(),g=null!=d||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);this.menus.get("viewZoom").setEnabled(g);var m=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==d||d.isRestricted());this.actions.get("makeCopy").setEnabled(!m);this.actions.get("print").setEnabled(!m);this.menus.get("exportAs").setEnabled(!m);this.menus.get("embed").setEnabled(!m);m="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(m);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(m),this.menus.get("newLibrary").setEnabled(m));@@ -13464,24 +13466,24 @@ this.actions.get("undo").setEnabled(this.canUndo()&&v);this.actions.get("redo").m.image&&0<m.cells.length);this.actions.get("pageSetup").setEnabled(t);this.actions.get("shadowVisible").setEnabled(t);this.actions.get("connectionArrows").setEnabled(t);this.actions.get("connectionPoints").setEnabled(t);this.actions.get("copyStyle").setEnabled(t&&!d.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&t&&0<m.cells.length);this.actions.get("editGeometry").setEnabled(0<m.vertices.length);this.actions.get("createShape").setEnabled(t);this.actions.get("createRevision").setEnabled(t);this.actions.get("moveToFolder").setEnabled(null!=g);this.actions.get("makeCopy").setEnabled(null!=g&&!g.isRestricted());this.actions.get("editDiagram").setEnabled(t&&(null==g||!g.isRestricted()));this.actions.get("publishLink").setEnabled(null!=g&&!g.isRestricted());this.actions.get("removeFormat").setEnabled(d.isEnabled()&&!d.isSelectionEmpty()&&!d.isEditing());this.actions.get("tags").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=g&&g.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=g);this.actions.get("properties").setEnabled(null!=g);this.menus.get("publish").setEnabled(null!=g&&!g.isRestricted());g=this.actions.get("findReplace");g.setEnabled("hidden"!=this.diagramContainer.style.visibility);g.label=mxResources.get("find")+(d.isEnabled()?"/"+mxResources.get("replace"):-"");d=d.view.getState(d.getSelectionCell());this.actions.get("editShape").setEnabled(t&&null!=d&&null!=d.shape&&null!=d.shape.stencil)};var F=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);F.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(d,g,m,t,v,y,B,I){var K=d.editor.graph;-if("xml"==m)d.hideDialog(),d.saveData(g,"xml",mxUtils.getXml(d.editor.getGraphXml()),"text/xml");else if("svg"==m)d.hideDialog(),d.saveData(g,"svg",mxUtils.getXml(K.getSvg(t,v,y)),"image/svg+xml");else{var J=d.getFileData(!0,null,null,null,null,!0),V=K.getGraphBounds(),Q=Math.floor(V.width*v/K.view.scale),O=Math.floor(V.height*v/K.view.scale);if(J.length<=MAX_REQUEST_SIZE&&Q*O<MAX_AREA)if(d.hideDialog(),"png"!=m&&"jpg"!=m&&"jpeg"!=m||!d.isExportToCanvas()){var p={globalVars:K.getExportVariables()};-I&&(p.grid={size:K.gridSize,steps:K.view.gridSteps,color:K.view.gridColor});d.saveRequest(g,m,function(z,A){return new mxXmlRequest(EXPORT_URL,"format="+m+"&base64="+(A||"0")+(null!=z?"&filename="+encodeURIComponent(z):"")+"&extras="+encodeURIComponent(JSON.stringify(p))+(0<B?"&dpi="+B:"")+"&bg="+(null!=t?t:"none")+"&w="+Q+"&h="+O+"&border="+y+"&xml="+encodeURIComponent(J))})}else"png"==m?d.exportImage(v,null==t||"none"==t,!0,!1,!1,y,!0,!1,null,I,B):d.exportImage(v,!1,!0,!1,!1,y,!0,!1,"jpeg",I);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});+"");d=d.view.getState(d.getSelectionCell());this.actions.get("editShape").setEnabled(t&&null!=d&&null!=d.shape&&null!=d.shape.stencil)};var F=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);F.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(d,g,m,t,v,y,B,I){var J=d.editor.graph;+if("xml"==m)d.hideDialog(),d.saveData(g,"xml",mxUtils.getXml(d.editor.getGraphXml()),"text/xml");else if("svg"==m)d.hideDialog(),d.saveData(g,"svg",mxUtils.getXml(J.getSvg(t,v,y)),"image/svg+xml");else{var K=d.getFileData(!0,null,null,null,null,!0),V=J.getGraphBounds(),Q=Math.floor(V.width*v/J.view.scale),P=Math.floor(V.height*v/J.view.scale);if(K.length<=MAX_REQUEST_SIZE&&Q*P<MAX_AREA)if(d.hideDialog(),"png"!=m&&"jpg"!=m&&"jpeg"!=m||!d.isExportToCanvas()){var p={globalVars:J.getExportVariables()};+I&&(p.grid={size:J.gridSize,steps:J.view.gridSteps,color:J.view.gridColor});d.saveRequest(g,m,function(z,A){return new mxXmlRequest(EXPORT_URL,"format="+m+"&base64="+(A||"0")+(null!=z?"&filename="+encodeURIComponent(z):"")+"&extras="+encodeURIComponent(JSON.stringify(p))+(0<B?"&dpi="+B:"")+"&bg="+(null!=t?t:"none")+"&w="+Q+"&h="+P+"&border="+y+"&xml="+encodeURIComponent(K))})}else"png"==m?d.exportImage(v,null==t||"none"==t,!0,!1,!1,y,!0,!1,null,I,B):d.exportImage(v,!1,!0,!1,!1,y,!0,!1,"jpeg",I);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var d=this.editor.graph,g="";if(null!=this.pages)for(var m=0;m<this.pages.length;m++){var t=d;this.currentPage!=this.pages[m]&&(t=this.createTemporaryGraph(d.getStylesheet()),this.updatePageRoot(this.pages[m]),t.model.setRoot(this.pages[m].root));g+=this.pages[m].getName()+" "+t.getIndexableText()+" "}else g=d.getIndexableText();this.editor.graph.setEnabled(!0);return g};EditorUi.prototype.showRemotelyStoredLibrary=function(d){var g={},m=document.createElement("div");m.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,mxUtils.htmlEntities(d));t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";m.appendChild(t);var v=document.createElement("div");v.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";v.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var y={};try{var B=mxSettings.getCustomLibraries();-for(d=0;d<B.length;d++){var I=B[d];if("R"==I.substring(0,1)){var K=JSON.parse(decodeURIComponent(I.substring(1)));y[K[0]]={id:K[0],title:K[1],downloadUrl:K[2]}}}}catch(J){}this.remoteInvoke("getCustomLibraries",null,null,function(J){v.innerText="";if(0==J.length)v.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var V=0;V<J.length;V++){var Q=J[V];y[Q.id]&&(g[Q.id]=Q);var O=this.addCheckbox(v,Q.title,y[Q.id]);-(function(p,z){mxEvent.addListener(z,"change",function(){this.checked?g[p.id]=p:delete g[p.id]})})(Q,O)}},mxUtils.bind(this,function(J){v.innerText="";var V=document.createElement("div");V.style.padding="8px";V.style.textAlign="center";mxUtils.write(V,mxResources.get("error")+": ");mxUtils.write(V,null!=J&&null!=J.message?J.message:mxResources.get("unknownError"));v.appendChild(V)}));m.appendChild(v);m=new CustomDialog(this,m,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));-var J=0,V;for(V in g)null==y[V]&&(J++,mxUtils.bind(this,function(Q){this.remoteInvoke("getFileContent",[Q.downloadUrl],null,mxUtils.bind(this,function(O){J--;0==J&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,O,Q)),this.showSidebar()}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){J--;0==J&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[V]));for(V in y)g[V]||this.closeLibrary(new RemoteLibrary(this,-null,y[V]));0==J&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(m.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=+for(d=0;d<B.length;d++){var I=B[d];if("R"==I.substring(0,1)){var J=JSON.parse(decodeURIComponent(I.substring(1)));y[J[0]]={id:J[0],title:J[1],downloadUrl:J[2]}}}}catch(K){}this.remoteInvoke("getCustomLibraries",null,null,function(K){v.innerText="";if(0==K.length)v.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var V=0;V<K.length;V++){var Q=K[V];y[Q.id]&&(g[Q.id]=Q);var P=this.addCheckbox(v,Q.title,y[Q.id]);+(function(p,z){mxEvent.addListener(z,"change",function(){this.checked?g[p.id]=p:delete g[p.id]})})(Q,P)}},mxUtils.bind(this,function(K){v.innerText="";var V=document.createElement("div");V.style.padding="8px";V.style.textAlign="center";mxUtils.write(V,mxResources.get("error")+": ");mxUtils.write(V,null!=K&&null!=K.message?K.message:mxResources.get("unknownError"));v.appendChild(V)}));m.appendChild(v);m=new CustomDialog(this,m,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));+var K=0,V;for(V in g)null==y[V]&&(K++,mxUtils.bind(this,function(Q){this.remoteInvoke("getFileContent",[Q.downloadUrl],null,mxUtils.bind(this,function(P){K--;0==K&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,P,Q)),this.showSidebar()}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){K--;0==K&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[V]));for(V in y)g[V]||this.closeLibrary(new RemoteLibrary(this,+null,y[V]));0==K&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(m.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(d){this.remoteWin=d;for(var g=0;g<this.remoteInvokeQueue.length;g++)d.postMessage(this.remoteInvokeQueue[g],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(d){var g=d.msgMarkers,m=this.remoteInvokeCallbacks[g.callbackId];if(null==m)throw Error("No callback for "+(null!=g?g.callbackId:"null"));d.error?m.error&&m.error(d.error.errResp):m.callback&&m.callback.apply(this,-d.resp);this.remoteInvokeCallbacks[g.callbackId]=null};EditorUi.prototype.remoteInvoke=function(d,g,m,t,v){var y=!0,B=window.setTimeout(mxUtils.bind(this,function(){y=!1;v({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),I=mxUtils.bind(this,function(){window.clearTimeout(B);y&&t.apply(this,arguments)}),K=mxUtils.bind(this,function(){window.clearTimeout(B);y&&v.apply(this,arguments)});m=m||{};m.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:I,-error:K});d=JSON.stringify({event:"remoteInvoke",funtionName:d,functionArgs:g,msgMarkers:m});null!=this.remoteWin?this.remoteWin.postMessage(d,"*"):this.remoteInvokeQueue.push(d)};EditorUi.prototype.handleRemoteInvoke=function(d,g){var m=mxUtils.bind(this,function(J,V){var Q={event:"remoteInvokeResponse",msgMarkers:d.msgMarkers};null!=V?Q.error={errResp:V}:null!=J&&(Q.resp=J);this.remoteWin.postMessage(JSON.stringify(Q),"*")});try{var t=d.funtionName,v=this.remoteInvokableFns[t];if(null!=v&&"function"===-typeof this[t]){if(v.allowedDomains){for(var y=!1,B=0;B<v.allowedDomains.length;B++)if(g=="https://"+v.allowedDomains[B]){y=!0;break}if(!y){m(null,"Invalid Call: "+t+" is not allowed.");return}}var I=d.functionArgs;Array.isArray(I)||(I=[]);if(v.isAsync)I.push(function(){m(Array.prototype.slice.apply(arguments))}),I.push(function(J){m(null,J||"Unkown Error")}),this[t].apply(this,I);else{var K=this[t].apply(this,I);m([K])}}else m(null,"Invalid Call: "+t+" is not found.")}catch(J){m(null,"Invalid Call: An error occurred, "+-J.message)}};EditorUi.prototype.openDatabase=function(d,g){if(null==this.database){var m=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=m)try{var t=m.open("database",2);t.onupgradeneeded=function(v){try{var y=t.result;1>v.oldVersion&&y.createObjectStore("objects",{keyPath:"key"});2>v.oldVersion&&(y.createObjectStore("files",{keyPath:"title"}),y.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(B){null!=g&&g(B)}};t.onsuccess=+d.resp);this.remoteInvokeCallbacks[g.callbackId]=null};EditorUi.prototype.remoteInvoke=function(d,g,m,t,v){var y=!0,B=window.setTimeout(mxUtils.bind(this,function(){y=!1;v({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),I=mxUtils.bind(this,function(){window.clearTimeout(B);y&&t.apply(this,arguments)}),J=mxUtils.bind(this,function(){window.clearTimeout(B);y&&v.apply(this,arguments)});m=m||{};m.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:I,+error:J});d=JSON.stringify({event:"remoteInvoke",funtionName:d,functionArgs:g,msgMarkers:m});null!=this.remoteWin?this.remoteWin.postMessage(d,"*"):this.remoteInvokeQueue.push(d)};EditorUi.prototype.handleRemoteInvoke=function(d,g){var m=mxUtils.bind(this,function(K,V){var Q={event:"remoteInvokeResponse",msgMarkers:d.msgMarkers};null!=V?Q.error={errResp:V}:null!=K&&(Q.resp=K);this.remoteWin.postMessage(JSON.stringify(Q),"*")});try{var t=d.funtionName,v=this.remoteInvokableFns[t];if(null!=v&&"function"===+typeof this[t]){if(v.allowedDomains){for(var y=!1,B=0;B<v.allowedDomains.length;B++)if(g=="https://"+v.allowedDomains[B]){y=!0;break}if(!y){m(null,"Invalid Call: "+t+" is not allowed.");return}}var I=d.functionArgs;Array.isArray(I)||(I=[]);if(v.isAsync)I.push(function(){m(Array.prototype.slice.apply(arguments))}),I.push(function(K){m(null,K||"Unkown Error")}),this[t].apply(this,I);else{var J=this[t].apply(this,I);m([J])}}else m(null,"Invalid Call: "+t+" is not found.")}catch(K){m(null,"Invalid Call: An error occurred, "++K.message)}};EditorUi.prototype.openDatabase=function(d,g){if(null==this.database){var m=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=m)try{var t=m.open("database",2);t.onupgradeneeded=function(v){try{var y=t.result;1>v.oldVersion&&y.createObjectStore("objects",{keyPath:"key"});2>v.oldVersion&&(y.createObjectStore("files",{keyPath:"title"}),y.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(B){null!=g&&g(B)}};t.onsuccess=mxUtils.bind(this,function(v){try{var y=t.result;this.database=y;EditorUi.migrateStorageFiles&&(StorageFile.migrate(y),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(B){if(!B||"1"==urlParams.forceMigration){var I=document.createElement("iframe");I.style.display="none";I.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);-document.body.appendChild(I);var K=!0,J=!1,V,Q=0,O=mxUtils.bind(this,function(){J=!0;this.setDatabaseItem(".drawioMigrated3",!0);I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),p=mxUtils.bind(this,function(){Q++;z()}),z=mxUtils.bind(this,function(){try{if(Q>=V.length)O();else{var C=V[Q];StorageFile.getFileContent(this,C,mxUtils.bind(this,function(M){null==M||".scratchpad"==C&&M==this.emptyLibraryXml?I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",+document.body.appendChild(I);var J=!0,K=!1,V,Q=0,P=mxUtils.bind(this,function(){K=!0;this.setDatabaseItem(".drawioMigrated3",!0);I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),p=mxUtils.bind(this,function(){Q++;z()}),z=mxUtils.bind(this,function(){try{if(Q>=V.length)P();else{var C=V[Q];StorageFile.getFileContent(this,C,mxUtils.bind(this,function(M){null==M||".scratchpad"==C&&M==this.emptyLibraryXml?I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[C]}),"*"):p()}),p)}}catch(M){console.log(M)}}),A=mxUtils.bind(this,function(C){try{this.setDatabaseItem(null,[{title:C.title,size:C.data.length,lastModified:Date.now(),type:C.isLib?"L":"F"},{title:C.title,data:C.data}],p,p,["filesInfo","files"])}catch(M){console.log(M)}});B=mxUtils.bind(this,function(C){try{if(C.source==I.contentWindow){var M={};try{M=JSON.parse(C.data)}catch(S){}"init"==M.event?(I.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),-"*"),I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=M.event||J||(K?null!=M.resp&&0<M.resp.length&&null!=M.resp[0]?(V=M.resp[0],K=!1,z()):O():null!=M.resp&&0<M.resp.length&&null!=M.resp[0]?A(M.resp[0]):p())}}catch(S){console.log(S)}});window.addEventListener("message",B)}})));d(y);y.onversionchange=function(){y.close()}}catch(B){null!=g?g(B):null!=window.console&&console.warn(B)}});t.onerror=g;t.onblocked=function(){}}catch(v){null!=+"*"),I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=M.event||K||(J?null!=M.resp&&0<M.resp.length&&null!=M.resp[0]?(V=M.resp[0],J=!1,z()):P():null!=M.resp&&0<M.resp.length&&null!=M.resp[0]?A(M.resp[0]):p())}}catch(S){console.log(S)}});window.addEventListener("message",B)}})));d(y);y.onversionchange=function(){y.close()}}catch(B){null!=g?g(B):null!=window.console&&console.warn(B)}});t.onerror=g;t.onblocked=function(){}}catch(v){null!=g?g(v):null!=window.console&&console.error(v)}else null!=g&&g(Error("IndexedDB not supported"))}else d(this.database)};EditorUi.prototype.setDatabaseItem=function(d,g,m,t,v){this.openDatabase(mxUtils.bind(this,function(y){try{v=v||"objects";Array.isArray(v)||(v=[v],d=[d],g=[g]);var B=y.transaction(v,"readwrite");B.oncomplete=m;B.onerror=t;for(y=0;y<v.length;y++)B.objectStore(v[y]).put(null!=d&&null!=d[y]?{key:d[y],data:g[y]}:g[y])}catch(I){null!=t&&t(I)}}),t)};EditorUi.prototype.removeDatabaseItem=function(d,g,m,t){this.openDatabase(mxUtils.bind(this,function(v){try{t=t||"objects";Array.isArray(t)||(t=[t],d=[d]);var y=v.transaction(t,"readwrite");y.oncomplete=g;y.onerror=m;for(v=0;v<t.length;v++)y.objectStore(t[v]).delete(d[v])}catch(B){null!=m&&m(B)}}),m)};EditorUi.prototype.getDatabaseItem=function(d,g,m,t){this.openDatabase(mxUtils.bind(this,function(v){try{t=t||"objects";var y=v.transaction([t],"readonly").objectStore(t).get(d);y.onsuccess=function(){g(y.result)};y.onerror=m}catch(B){null!=m&&m(B)}}),m)};EditorUi.prototype.getDatabaseItems=function(d,g,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";var v=t.transaction([m],"readonly").objectStore(m).openCursor(IDBKeyRange.lowerBound(0)),y=[];v.onsuccess=function(B){null==B.target.result?d(y):(y.push(B.target.result.value),B.target.result.continue())};v.onerror=g}catch(B){null!=g&&g(B)}}),g)};EditorUi.prototype.getDatabaseItemKeys=function(d,g,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";@@ -13489,31 +13491,31 @@ var v=t.transaction([m],"readonly").objectStore(m).getAllKeys();v.onsuccess=funcEditorUi.prototype.getComments=function(d,g){var m=this.getCurrentFile();null!=m?m.getComments(d,g):d([])};EditorUi.prototype.addComment=function(d,g,m){var t=this.getCurrentFile();null!=t?t.addComment(d,g,m):g(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var d=this.getCurrentFile();return null!=d?d.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var d=this.getCurrentFile();return null!=d?d.canComment():!0};EditorUi.prototype.newComment=function(d,g){var m=this.getCurrentFile();return null!=m?m.newComment(d,g):new DrawioComment(this,null,d,Date.now(),Date.now(),!1,g)};EditorUi.prototype.isRevisionHistorySupported=function(){var d=this.getCurrentFile();return null!=d&&d.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(d,g){var m=this.getCurrentFile();null!=m&&m.getRevisions?m.getRevisions(d,g):g({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var d=this.getCurrentFile();return null!=d&&(d.constructor==DriveFile&&d.isEditable()||d.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(d){d.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(d,g,m,t,v,y,B,I){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(d,g,m,t,v,y,B,I)};EditorUi.prototype.loadFonts=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(d)};-EditorUi.prototype.createSvgDataUri=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(d)};EditorUi.prototype.embedCssFonts=function(d,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(d,g)};EditorUi.prototype.embedExtFonts=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(d)};EditorUi.prototype.exportToCanvas=function(d,g,m,t,v,y,B,I,K,J,V,Q,O,p,z,A){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");-return this.editor.exportToCanvas(d,g,m,t,v,y,B,I,K,J,V,Q,O,p,z,A)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(d,g,m,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(d,g,m,t)};EditorUi.prototype.convertImageToDataUri=function(d,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");+EditorUi.prototype.createSvgDataUri=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(d)};EditorUi.prototype.embedCssFonts=function(d,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(d,g)};EditorUi.prototype.embedExtFonts=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(d)};EditorUi.prototype.exportToCanvas=function(d,g,m,t,v,y,B,I,J,K,V,Q,P,p,z,A){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");+return this.editor.exportToCanvas(d,g,m,t,v,y,B,I,J,K,V,Q,P,p,z,A)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(d,g,m,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(d,g,m,t)};EditorUi.prototype.convertImageToDataUri=function(d,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(d,g)};EditorUi.prototype.base64Encode=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(d)};EditorUi.prototype.updateCRC=function(d,g,m,t){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(d,g,m,t)};EditorUi.prototype.crc32=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(d)};EditorUi.prototype.writeGraphModelToPng=function(d,g,m,t,v){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(d,g,m,t,v)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var d=[],g=0;g<localStorage.length;g++){var m=localStorage.key(g),t=localStorage.getItem(m);if(0<m.length&&(".scratchpad"==m||"."!=m.charAt(0))&&0<t.length){var v="<mxfile "===t.substring(0,8)||"<?xml"===t.substring(0,5)||"\x3c!--[if IE]>"===t.substring(0,12);t="<mxlibrary>"===t.substring(0,11);(v||t)&&d.push(m)}}return d};EditorUi.prototype.getLocalStorageFile=function(d){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var g=localStorage.getItem(d);return{title:d,data:g,isLib:"<mxlibrary>"===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,e,f,c,k,n){function q(){for(var O=y.getElementsByTagName("div"),p=0,z=0;z<O.length;z++)"none"!=O[z].style.display&&O[z].parentNode==y&&p++;B.style.display=0==p?"block":"none"}function u(O,p,z,A){function C(){p.removeChild(l);p.removeChild(x);S.style.display="block";M.style.display="block"}m={div:p,comment:O,saveCallback:z,deleteOnCancel:A};var M=p.querySelector(".geCommentTxt"),S=p.querySelector(".geCommentActionsList"),l=document.createElement("textarea");l.className=-"geCommentEditTxtArea";l.style.minHeight=M.offsetHeight+"px";l.value=O.content;p.insertBefore(l,M);var x=document.createElement("div");x.className="geCommentEditBtns";var G=mxUtils.button(mxResources.get("cancel"),function(){A?(p.parentNode.removeChild(p),q()):C();m=null});G.className="geCommentEditBtn";x.appendChild(G);var N=mxUtils.button(mxResources.get("save"),function(){M.innerText="";O.content=l.value;mxUtils.write(M,O.content);C();z(O);m=null});mxEvent.addListener(l,"keydown",mxUtils.bind(this,-function(P){mxEvent.isConsumed(P)||((mxEvent.isControlDown(P)||mxClient.IS_MAC&&mxEvent.isMetaDown(P))&&13==P.keyCode?(N.click(),mxEvent.consume(P)):27==P.keyCode&&(G.click(),mxEvent.consume(P)))}));N.focus();N.className="geCommentEditBtn gePrimaryBtn";x.appendChild(N);p.insertBefore(x,M);S.style.display="none";M.style.display="none";l.focus()}function E(O,p){p.innerText="";O=new Date(O.modifiedDate);var z=b.timeSince(O);null==z&&(z=mxResources.get("lessThanAMinute"));mxUtils.write(p,mxResources.get("timeAgo",-[z],"{1} ago"));p.setAttribute("title",O.toLocaleDateString()+" "+O.toLocaleTimeString())}function H(O){var p=document.createElement("img");p.className="geCommentBusyImg";p.src=IMAGE_PATH+"/spin.gif";O.appendChild(p);O.busyImg=p}function D(O){O.style.border="1px solid red";O.busyImg.parentNode==O&&O.removeChild(O.busyImg)}function L(O){O.style.border="";O.busyImg.parentNode==O&&O.removeChild(O.busyImg)}function F(O,p,z,A,C){function M(T,U,W){var X=document.createElement("li");X.className="geCommentAction";-var Y=document.createElement("a");Y.className="geCommentActionLnk";mxUtils.write(Y,T);X.appendChild(Y);mxEvent.addListener(Y,"click",function(Z){U(Z,O);Z.preventDefault();mxEvent.consume(Z)});R.appendChild(X);W&&(X.style.display="none")}function S(){function T(X){U.push(W);if(null!=X.replies)for(var Y=0;Y<X.replies.length;Y++)W=W.nextSibling,T(X.replies[Y])}var U=[],W=x;T(O);return{pdiv:W,replies:U}}function l(T,U,W,X,Y){function Z(){H(da);O.addReply(ca,function(ja){ca.id=ja;O.replies.push(ca);L(da);-W&&W()},function(ja){ba();D(da);b.handleError(ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},X,Y)}function ba(){u(ca,da,function(ja){Z()},!0)}var ha=S().pdiv,ca=b.newComment(T,b.getCurrentUser());ca.pCommentId=O.id;null==O.replies&&(O.replies=[]);var da=F(ca,O.replies,ha,A+1);U?ba():Z()}if(C||!O.isResolved){B.style.display="none";var x=document.createElement("div");x.className="geCommentContainer";x.setAttribute("data-commentId",O.id);x.style.marginLeft=20*A+5+"px";O.isResolved&&-(x.style.backgroundColor="light-dark(ghostWhite, transparent)");var G=document.createElement("div");G.className="geCommentHeader";var N=document.createElement("img");N.className="geCommentUserImg";N.src=null!=O.user&&null!=O.user.pictureUrl?O.user.pictureUrl:Editor.userImage;G.appendChild(N);N=document.createElement("div");N.className="geCommentHeaderTxt";G.appendChild(N);var P=document.createElement("div");P.className="geCommentUsername";mxUtils.write(P,null!=O.user?O.user.displayName:mxResources.get("unknownUser"));-N.appendChild(P);P=document.createElement("div");P.className="geCommentDate";P.setAttribute("data-commentId",O.id);E(O,P);N.appendChild(P);x.appendChild(G);G=document.createElement("div");G.className="geCommentTxt";mxUtils.write(G,O.content||"");x.appendChild(G);O.isLocked&&(x.style.opacity="0.5");G=document.createElement("div");G.className="geCommentActions";var R=document.createElement("ul");R.className="geCommentActionsList";G.appendChild(R);d||O.isLocked||0!=A&&!g||M(mxResources.get("reply"),-function(){l("",!0)},O.isResolved);N=b.getCurrentUser();null==N||null==O.user||N.id!=O.user.id||d||O.isLocked||(M(mxResources.get("edit"),function(){function T(){u(O,x,function(){H(x);O.editComment(O.content,function(){L(x)},function(U){D(x);T();b.handleError(U,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}T()},O.isResolved),M(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){H(x);O.deleteComment(function(T){if(!0===T){T=x.querySelector(".geCommentTxt");-T.innerText="";mxUtils.write(T,mxResources.get("msgDeleted"));var U=x.querySelectorAll(".geCommentAction");for(T=0;T<U.length;T++)U[T].parentNode.removeChild(U[T]);L(x);x.style.opacity="0.5"}else{U=S(O).replies;for(T=0;T<U.length;T++)y.removeChild(U[T]);for(T=0;T<p.length;T++)if(p[T]==O){p.splice(T,1);break}B.style.display=0==y.getElementsByTagName("div").length?"block":"none"}},function(T){D(x);b.handleError(T,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},O.isResolved));-d||O.isLocked||0!=A||M(O.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(T){function U(){var W=T.target;W.innerText="";O.isResolved=!O.isResolved;mxUtils.write(W,O.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var X=O.isResolved?"none":"",Y=S(O).replies,Z="light-dark("+(O.isResolved?"ghostWhite":"white")+", transparent)",ba=0;ba<Y.length;ba++){Y[ba].style.backgroundColor=Z;for(var ha=Y[ba].querySelectorAll(".geCommentAction"),ca=0;ca<ha.length;ca++)ha[ca]!=-W.parentNode&&(ha[ca].style.display=X);J||(Y[ba].style.display="none")}q()}O.isResolved?l(mxResources.get("reOpened")+": ",!0,U,!1,!0):l(mxResources.get("markedAsResolved"),!1,U,!0)});x.appendChild(G);null!=z?y.insertBefore(x,z.nextSibling):y.appendChild(x);for(z=0;null!=O.replies&&z<O.replies.length;z++)G=O.replies[z],G.isResolved=O.isResolved,F(G,O.replies,null,A+1,C);null!=m&&(m.comment.id==O.id?(C=O.content,O.content=m.comment.content,u(O,x,m.saveCallback,m.deleteOnCancel),O.content=C):null==-m.comment.id&&m.comment.pCommentId==O.id&&(y.appendChild(m.div),u(m.comment,m.div,m.saveCallback,m.deleteOnCancel)));return x}}var d=!b.canComment(),g=b.canReplyToReplies(),m=null,t=document.createElement("div");t.className="geCommentsWin";t.style.background="light-dark(whiteSmoke, "+Editor.darkColor+")";var v=EditorUi.compactUi?"26px":"30px",y=document.createElement("div");y.className="geCommentsList";y.style.backgroundColor="light-dark(whiteSmoke, "+Editor.darkColor+")";y.style.bottom=parseInt(v)+-7+"px";t.appendChild(y);var B=document.createElement("span");B.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(B,mxResources.get("noCommentsFound"));var I=document.createElement("div");I.className="geToolbarContainer geCommentsToolbar";I.style.height=v;I.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";v=document.createElement("a");v.className="geButton";if(!d){var K=v.cloneNode();K.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';-K.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(K,"click",function(O){function p(){u(z,A,function(C){H(A);b.addComment(C,function(M){C.id=M;V.push(C);L(A)},function(M){D(A);p();b.handleError(M,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var z=b.newComment("",b.getCurrentUser()),A=F(z,V,null,0);p();O.preventDefault();mxEvent.consume(O)});I.appendChild(K)}K=v.cloneNode();K.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';-K.setAttribute("title",mxResources.get("showResolved"));K.className="geButton";var J=!1;mxEvent.addListener(K,"click",function(O){this.className=(J=!J)?"geButton geCheckedBtn":"geButton";Q();O.preventDefault();mxEvent.consume(O)});I.appendChild(K);b.commentsRefreshNeeded()&&(K=v.cloneNode(),K.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',K.setAttribute("title",mxResources.get("refresh")),K.className="geButton",mxEvent.addListener(K,-"click",function(O){Q();O.preventDefault();mxEvent.consume(O)}),I.appendChild(K));b.commentsSaveNeeded()&&(v=v.cloneNode(),v.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',v.setAttribute("title",mxResources.get("save")),v.className="geButton geAdaptiveAsset",mxEvent.addListener(v,"click",function(O){n();O.preventDefault();mxEvent.consume(O)}),I.appendChild(v));t.appendChild(I);var V=[],Q=mxUtils.bind(this,function(){this.hasError=!1;if(null!=m)try{m.div=m.div.cloneNode(!0);-var O=m.div.querySelector(".geCommentEditTxtArea"),p=m.div.querySelector(".geCommentEditBtns");m.comment.content=O.value;O.parentNode.removeChild(O);p.parentNode.removeChild(p)}catch(z){b.handleError(z)}y.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";g=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(z){function A(C){if(null!=C){C.sort(function(S,l){return new Date(S.modifiedDate)--new Date(l.modifiedDate)});for(var M=0;M<C.length;M++)A(C[M].replies)}}z.sort(function(C,M){return new Date(C.modifiedDate)-new Date(M.modifiedDate)});y.innerText="";y.appendChild(B);B.style.display="block";V=z;for(z=0;z<V.length;z++)A(V[z].replies),F(V[z],V,null,0,J);null!=m&&null==m.comment.id&&null==m.comment.pCommentId&&(y.appendChild(m.div),u(m.comment,m.div,m.saveCallback,m.deleteOnCancel))},mxUtils.bind(this,function(z){y.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(z&&z.message?-": "+z.message:""));this.hasError=!0})):y.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});Q();this.refreshComments=Q;I=mxUtils.bind(this,function(){function O(M){var S=z[M.id];if(null!=S)for(E(M,S),S=0;null!=M.replies&&S<M.replies.length;S++)O(M.replies[S])}if(this.window.isVisible()){for(var p=y.querySelectorAll(".geCommentDate"),z={},A=0;A<p.length;A++){var C=p[A];z[C.getAttribute("data-commentId")]=C}for(A=0;A<V.length;A++)O(V[A])}});setInterval(I,6E4);this.refreshCommentsTime=I;this.window=+var CommentsWindow=function(b,e,f,c,k,n){function q(){for(var P=y.getElementsByTagName("div"),p=0,z=0;z<P.length;z++)"none"!=P[z].style.display&&P[z].parentNode==y&&p++;B.style.display=0==p?"block":"none"}function u(P,p,z,A){function C(){p.removeChild(l);p.removeChild(x);S.style.display="block";M.style.display="block"}m={div:p,comment:P,saveCallback:z,deleteOnCancel:A};var M=p.querySelector(".geCommentTxt"),S=p.querySelector(".geCommentActionsList"),l=document.createElement("textarea");l.className=+"geCommentEditTxtArea";l.style.minHeight=M.offsetHeight+"px";l.value=P.content;p.insertBefore(l,M);var x=document.createElement("div");x.className="geCommentEditBtns";var G=mxUtils.button(mxResources.get("cancel"),function(){A?(p.parentNode.removeChild(p),q()):C();m=null});G.className="geCommentEditBtn";x.appendChild(G);var N=mxUtils.button(mxResources.get("save"),function(){M.innerText="";P.content=l.value;mxUtils.write(M,P.content);C();z(P);m=null});mxEvent.addListener(l,"keydown",mxUtils.bind(this,+function(O){mxEvent.isConsumed(O)||((mxEvent.isControlDown(O)||mxClient.IS_MAC&&mxEvent.isMetaDown(O))&&13==O.keyCode?(N.click(),mxEvent.consume(O)):27==O.keyCode&&(G.click(),mxEvent.consume(O)))}));N.focus();N.className="geCommentEditBtn gePrimaryBtn";x.appendChild(N);p.insertBefore(x,M);S.style.display="none";M.style.display="none";l.focus()}function E(P,p){p.innerText="";P=new Date(P.modifiedDate);var z=b.timeSince(P);null==z&&(z=mxResources.get("lessThanAMinute"));mxUtils.write(p,mxResources.get("timeAgo",+[z],"{1} ago"));p.setAttribute("title",P.toLocaleDateString()+" "+P.toLocaleTimeString())}function H(P){var p=document.createElement("img");p.className="geCommentBusyImg";p.src=IMAGE_PATH+"/spin.gif";P.appendChild(p);P.busyImg=p}function D(P){P.style.border="1px solid red";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function L(P){P.style.border="";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function F(P,p,z,A,C){function M(T,U,W){var X=document.createElement("li");X.className="geCommentAction";+var Y=document.createElement("a");Y.className="geCommentActionLnk";mxUtils.write(Y,T);X.appendChild(Y);mxEvent.addListener(Y,"click",function(Z){U(Z,P);Z.preventDefault();mxEvent.consume(Z)});R.appendChild(X);W&&(X.style.display="none")}function S(){function T(X){U.push(W);if(null!=X.replies)for(var Y=0;Y<X.replies.length;Y++)W=W.nextSibling,T(X.replies[Y])}var U=[],W=x;T(P);return{pdiv:W,replies:U}}function l(T,U,W,X,Y){function Z(){H(da);P.addReply(ca,function(ja){ca.id=ja;P.replies.push(ca);L(da);+W&&W()},function(ja){ba();D(da);b.handleError(ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},X,Y)}function ba(){u(ca,da,function(ja){Z()},!0)}var fa=S().pdiv,ca=b.newComment(T,b.getCurrentUser());ca.pCommentId=P.id;null==P.replies&&(P.replies=[]);var da=F(ca,P.replies,fa,A+1);U?ba():Z()}if(C||!P.isResolved){B.style.display="none";var x=document.createElement("div");x.className="geCommentContainer";x.setAttribute("data-commentId",P.id);x.style.marginLeft=20*A+5+"px";P.isResolved&&+(x.style.backgroundColor="light-dark(ghostWhite, transparent)");var G=document.createElement("div");G.className="geCommentHeader";var N=document.createElement("img");N.className="geCommentUserImg";N.src=null!=P.user&&null!=P.user.pictureUrl?P.user.pictureUrl:Editor.userImage;G.appendChild(N);N=document.createElement("div");N.className="geCommentHeaderTxt";G.appendChild(N);var O=document.createElement("div");O.className="geCommentUsername";mxUtils.write(O,null!=P.user?P.user.displayName:mxResources.get("unknownUser"));+N.appendChild(O);O=document.createElement("div");O.className="geCommentDate";O.setAttribute("data-commentId",P.id);E(P,O);N.appendChild(O);x.appendChild(G);G=document.createElement("div");G.className="geCommentTxt";mxUtils.write(G,P.content||"");x.appendChild(G);P.isLocked&&(x.style.opacity="0.5");G=document.createElement("div");G.className="geCommentActions";var R=document.createElement("ul");R.className="geCommentActionsList";G.appendChild(R);d||P.isLocked||0!=A&&!g||M(mxResources.get("reply"),+function(){l("",!0)},P.isResolved);N=b.getCurrentUser();null==N||null==P.user||N.id!=P.user.id||d||P.isLocked||(M(mxResources.get("edit"),function(){function T(){u(P,x,function(){H(x);P.editComment(P.content,function(){L(x)},function(U){D(x);T();b.handleError(U,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}T()},P.isResolved),M(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){H(x);P.deleteComment(function(T){if(!0===T){T=x.querySelector(".geCommentTxt");+T.innerText="";mxUtils.write(T,mxResources.get("msgDeleted"));var U=x.querySelectorAll(".geCommentAction");for(T=0;T<U.length;T++)U[T].parentNode.removeChild(U[T]);L(x);x.style.opacity="0.5"}else{U=S(P).replies;for(T=0;T<U.length;T++)y.removeChild(U[T]);for(T=0;T<p.length;T++)if(p[T]==P){p.splice(T,1);break}B.style.display=0==y.getElementsByTagName("div").length?"block":"none"}},function(T){D(x);b.handleError(T,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},P.isResolved));+d||P.isLocked||0!=A||M(P.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(T){function U(){var W=T.target;W.innerText="";P.isResolved=!P.isResolved;mxUtils.write(W,P.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var X=P.isResolved?"none":"",Y=S(P).replies,Z="light-dark("+(P.isResolved?"ghostWhite":"white")+", transparent)",ba=0;ba<Y.length;ba++){Y[ba].style.backgroundColor=Z;for(var fa=Y[ba].querySelectorAll(".geCommentAction"),ca=0;ca<fa.length;ca++)fa[ca]!=+W.parentNode&&(fa[ca].style.display=X);K||(Y[ba].style.display="none")}q()}P.isResolved?l(mxResources.get("reOpened")+": ",!0,U,!1,!0):l(mxResources.get("markedAsResolved"),!1,U,!0)});x.appendChild(G);null!=z?y.insertBefore(x,z.nextSibling):y.appendChild(x);for(z=0;null!=P.replies&&z<P.replies.length;z++)G=P.replies[z],G.isResolved=P.isResolved,F(G,P.replies,null,A+1,C);null!=m&&(m.comment.id==P.id?(C=P.content,P.content=m.comment.content,u(P,x,m.saveCallback,m.deleteOnCancel),P.content=C):null==+m.comment.id&&m.comment.pCommentId==P.id&&(y.appendChild(m.div),u(m.comment,m.div,m.saveCallback,m.deleteOnCancel)));return x}}var d=!b.canComment(),g=b.canReplyToReplies(),m=null,t=document.createElement("div");t.className="geCommentsWin";t.style.background="light-dark(whiteSmoke, "+Editor.darkColor+")";var v=EditorUi.compactUi?"26px":"30px",y=document.createElement("div");y.className="geCommentsList";y.style.backgroundColor="light-dark(whiteSmoke, "+Editor.darkColor+")";y.style.bottom=parseInt(v)++7+"px";t.appendChild(y);var B=document.createElement("span");B.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(B,mxResources.get("noCommentsFound"));var I=document.createElement("div");I.className="geToolbarContainer geCommentsToolbar";I.style.height=v;I.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";v=document.createElement("a");v.className="geButton";if(!d){var J=v.cloneNode();J.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';+J.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(J,"click",function(P){function p(){u(z,A,function(C){H(A);b.addComment(C,function(M){C.id=M;V.push(C);L(A)},function(M){D(A);p();b.handleError(M,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var z=b.newComment("",b.getCurrentUser()),A=F(z,V,null,0);p();P.preventDefault();mxEvent.consume(P)});I.appendChild(J)}J=v.cloneNode();J.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';+J.setAttribute("title",mxResources.get("showResolved"));J.className="geButton";var K=!1;mxEvent.addListener(J,"click",function(P){this.className=(K=!K)?"geButton geCheckedBtn":"geButton";Q();P.preventDefault();mxEvent.consume(P)});I.appendChild(J);b.commentsRefreshNeeded()&&(J=v.cloneNode(),J.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',J.setAttribute("title",mxResources.get("refresh")),J.className="geButton",mxEvent.addListener(J,+"click",function(P){Q();P.preventDefault();mxEvent.consume(P)}),I.appendChild(J));b.commentsSaveNeeded()&&(v=v.cloneNode(),v.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',v.setAttribute("title",mxResources.get("save")),v.className="geButton geAdaptiveAsset",mxEvent.addListener(v,"click",function(P){n();P.preventDefault();mxEvent.consume(P)}),I.appendChild(v));t.appendChild(I);var V=[],Q=mxUtils.bind(this,function(){this.hasError=!1;if(null!=m)try{m.div=m.div.cloneNode(!0);+var P=m.div.querySelector(".geCommentEditTxtArea"),p=m.div.querySelector(".geCommentEditBtns");m.comment.content=P.value;P.parentNode.removeChild(P);p.parentNode.removeChild(p)}catch(z){b.handleError(z)}y.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";g=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(z){function A(C){if(null!=C){C.sort(function(S,l){return new Date(S.modifiedDate)-+new Date(l.modifiedDate)});for(var M=0;M<C.length;M++)A(C[M].replies)}}z.sort(function(C,M){return new Date(C.modifiedDate)-new Date(M.modifiedDate)});y.innerText="";y.appendChild(B);B.style.display="block";V=z;for(z=0;z<V.length;z++)A(V[z].replies),F(V[z],V,null,0,K);null!=m&&null==m.comment.id&&null==m.comment.pCommentId&&(y.appendChild(m.div),u(m.comment,m.div,m.saveCallback,m.deleteOnCancel))},mxUtils.bind(this,function(z){y.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(z&&z.message?+": "+z.message:""));this.hasError=!0})):y.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});Q();this.refreshComments=Q;I=mxUtils.bind(this,function(){function P(M){var S=z[M.id];if(null!=S)for(E(M,S),S=0;null!=M.replies&&S<M.replies.length;S++)P(M.replies[S])}if(this.window.isVisible()){for(var p=y.querySelectorAll(".geCommentDate"),z={},A=0;A<p.length;A++){var C=p[A];z[C.getAttribute("data-commentId")]=C}for(A=0;A<V.length;A++)P(V[A])}});setInterval(I,6E4);this.refreshCommentsTime=I;this.window=new mxWindow(mxResources.get("comments"),t,e,f,c,k,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,f,c,k,n,q,u,E,H,D){var L=document.createElement("div");L.style.textAlign="center";D=null!=D?D:44;var F=document.createElement("div");F.style.padding="6px";F.style.overflow="auto";F.style.maxHeight=D+"px";F.style.lineHeight="1.2em";mxUtils.write(F,e);L.appendChild(F);null!=H&&(F=document.createElement("div"),F.style.padding="6px 0 6px 0",e=document.createElement("img"),e.setAttribute("src",H),F.appendChild(e),L.appendChild(F));H=document.createElement("div");H.style.textAlign="center";H.style.whiteSpace="nowrap";var d=document.createElement("input");d.setAttribute("type","checkbox");n=mxUtils.button(n||mxResources.get("cancel"),function(){b.hideDialog();null!=c&&c(d.checked)});n.className="geBtn";null!=u&&(n.innerHTML=u+"<br>"+n.innerHTML,n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");b.editor.cancelFirst&&H.appendChild(n);var g=mxUtils.button(k||mxResources.get("ok"),function(){b.hideDialog();null!=f&&f(d.checked)});H.appendChild(g);null!=q?(g.innerHTML=q+"<br>"+g.innerHTML+"<br>",g.style.paddingBottom="8px",g.style.paddingTop="8px",g.style.height=@@ -13733,19 +13735,19 @@ mxUtils.bind(this,function(L){try{if(null==L)k({message:mxResources.get("invalidatob(g),t=this.ui.editor.extractGraphModel(mxUtils.parseXml(m).documentElement,!0);null==t||0<t.getElementsByTagName("parsererror").length?F=!0:L=m}catch(v){F=!0}}}else/\.pdf$/i.test(f.title)?(g=Editor.extractGraphModelFromPdf(L),null!=g&&0<g.length&&(F=!0,L=g)):"data:image/png;base64,PG14ZmlsZS"==L.substring(0,32)&&(m=L.substring(22),L=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(L,E)?this.ui.parseFileData(L,mxUtils.bind(this,function(v){try{4==v.readyState&&(200<=v.status&&299>=v.status?c(new LocalFile(this.ui,v.responseText,f.title+this.extension,!0)):null!=k&&k({message:mxResources.get("errorLoadingFile")}))}catch(y){if(null!=k)k(y);else throw y;}}),f.title):c(F?new LocalFile(this.ui,L,f.title,!0):new DriveFile(this.ui,L,f))}}catch(v){if(null!=k)k(v);else throw v;}}),mxUtils.bind(this,function(L,F){if(H<this.maxRetries&&null!=F&&403==F.getStatus())H++,window.setTimeout(D,2*H*this.coolOff*(1+.1*(Math.random()-.5)));else if(null!=k)k(L);else throw L;}),null!=f.mimeType&&"image/"==f.mimeType.substring(0,6)&&"image/svg"!=f.mimeType.substring(0,9)||/\.png$/i.test(f.title)||/\.jpe?g$/i.test(f.title)||/\.pdf$/i.test(f.title),null,null,null,u)});D()}}catch(L){if(null!=k)k(L);else throw L;}};DriveClient.prototype.saveFile=function(f,c,k,n,q,u,E,H,D){try{var L=0;f.saveLevel=1;var F=mxUtils.bind(this,function(V){if(null!=n)n(V);else throw V;}),d=mxUtils.bind(this,function(V){F(V);try{EditorUi.logError(V.message,null,-null,null,V)}catch(Q){}});if(f.isEditable()&&null!=f.desc){var g=Date.now(),m=f.desc.etag,t=f.desc.modifiedDate,v=f.desc.headRevisionId,y=this.ui.useCanvasForExport&&/(\.png)$/i.test(f.getTitle());u=null!=u?u:!1;var B=null,I=!1,K={mimeType:f.desc.mimeType,title:f.getTitle()};if(this.isGoogleRealtimeMimeType(K.mimeType))K.mimeType=this.xmlMimeType,B=f.desc,I=c=!0;else if("application/octet-stream"==K.mimeType||"1"==urlParams["override-mime"]&&K.mimeType!=this.xmlMimeType)K.mimeType=this.xmlMimeType;-var J=mxUtils.bind(this,function(V,Q,O){try{f.saveLevel=3;var p=f.getData(),z=null,A=null;f.constructor==DriveFile&&(null==H&&(H=[]),null==f.getChannelId()&&H.push({key:"channel",value:Editor.guid(32)}),null==f.getChannelKey()&&H.push({key:"key",value:Editor.guid(32)}),D=null!=D?D:Editor.guid(32),H.push({key:"secret",value:D}),A=this.ui.getPagesForXml(p),z=this.ui.getHashValueForPages(A),H.push({key:"checksum",value:D+":"+z}));O||(null!=V||u||(V=this.placeholderThumbnail,Q=this.placeholderMimeType),-null!=V&&null!=Q&&(K.thumbnail={image:V,mimeType:Q}));var C=mxUtils.bind(this,function(l){try{if(f.saveDelay=Date.now()-g,f.saveLevel=null,k(l,p,A,z),null!=B){this.executeRequest({url:"/files/"+B.id+"/revisions/"+B.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(x){x.pinned=!0;this.executeRequest({url:"/files/"+B.id+"/revisions/"+B.headRevisionId,method:"PUT",params:x})})));try{EditorUi.logEvent({category:f.convertedFrom+"-CONVERT-FILE-"+f.getHash(),action:"from_"+-B.id+"."+B.headRevisionId+"-to_"+f.desc.id+"."+f.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=f.sync?"-client_"+f.sync.clientId:"nosync")})}catch(x){}}}catch(x){d(x)}}),M=mxUtils.bind(this,function(l,x){f.saveLevel=4;try{null!=H&&(K.properties=H);var G=E||f.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:f.getCurrentEtag(),N=mxUtils.bind(this,function(T){f.saveLevel=5;try{var U=f.desc.mimeType!=this.xmlMimeType&&f.desc.mimeType!=this.mimeType&&-f.desc.mimeType!=this.libraryMimeType,W=!0,X=null;try{X=window.setTimeout(mxUtils.bind(this,function(){W=!1;F({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Y){}this.executeRequest(this.createUploadRequest(f.getId(),K,l,c||T||U,x,T?null:G,I),mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){var Z=null!=Y?(new Date(Y.modifiedDate)).getTime()-(new Date(t)).getTime():0;if(0>=Z||m==Y.etag||c&&v==Y.headRevisionId){var ba=[];null==Y?ba.push("Empty response"):(0>=Z&&ba.push("Invalid modified time"),+null,null,V)}catch(Q){}});if(f.isEditable()&&null!=f.desc){var g=Date.now(),m=f.desc.etag,t=f.desc.modifiedDate,v=f.desc.headRevisionId,y=this.ui.useCanvasForExport&&/(\.png)$/i.test(f.getTitle());u=null!=u?u:!1;var B=null,I=!1,J={mimeType:f.desc.mimeType,title:f.getTitle()};if(this.isGoogleRealtimeMimeType(J.mimeType))J.mimeType=this.xmlMimeType,B=f.desc,I=c=!0;else if("application/octet-stream"==J.mimeType||"1"==urlParams["override-mime"]&&J.mimeType!=this.xmlMimeType)J.mimeType=this.xmlMimeType;+var K=mxUtils.bind(this,function(V,Q,P){try{f.saveLevel=3;var p=f.getData(),z=null,A=null;f.constructor==DriveFile&&(null==H&&(H=[]),null==f.getChannelId()&&H.push({key:"channel",value:Editor.guid(32)}),null==f.getChannelKey()&&H.push({key:"key",value:Editor.guid(32)}),D=null!=D?D:Editor.guid(32),H.push({key:"secret",value:D}),A=this.ui.getPagesForXml(p),z=this.ui.getHashValueForPages(A),H.push({key:"checksum",value:D+":"+z}));P||(null!=V||u||(V=this.placeholderThumbnail,Q=this.placeholderMimeType),+null!=V&&null!=Q&&(J.thumbnail={image:V,mimeType:Q}));var C=mxUtils.bind(this,function(l){try{if(f.saveDelay=Date.now()-g,f.saveLevel=null,k(l,p,A,z),null!=B){this.executeRequest({url:"/files/"+B.id+"/revisions/"+B.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(x){x.pinned=!0;this.executeRequest({url:"/files/"+B.id+"/revisions/"+B.headRevisionId,method:"PUT",params:x})})));try{EditorUi.logEvent({category:f.convertedFrom+"-CONVERT-FILE-"+f.getHash(),action:"from_"++B.id+"."+B.headRevisionId+"-to_"+f.desc.id+"."+f.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=f.sync?"-client_"+f.sync.clientId:"nosync")})}catch(x){}}}catch(x){d(x)}}),M=mxUtils.bind(this,function(l,x){f.saveLevel=4;try{null!=H&&(J.properties=H);var G=E||f.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:f.getCurrentEtag(),N=mxUtils.bind(this,function(T){f.saveLevel=5;try{var U=f.desc.mimeType!=this.xmlMimeType&&f.desc.mimeType!=this.mimeType&&+f.desc.mimeType!=this.libraryMimeType,W=!0,X=null;try{X=window.setTimeout(mxUtils.bind(this,function(){W=!1;F({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Y){}this.executeRequest(this.createUploadRequest(f.getId(),J,l,c||T||U,x,T?null:G,I),mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){var Z=null!=Y?(new Date(Y.modifiedDate)).getTime()-(new Date(t)).getTime():0;if(0>=Z||m==Y.etag||c&&v==Y.headRevisionId){var ba=[];null==Y?ba.push("Empty response"):(0>=Z&&ba.push("Invalid modified time"),m==Y.etag&&ba.push("Stale etag"),c&&v==Y.headRevisionId&&ba.push("Stale revision"),G=Y.etag);0==ba.length&&ba.push(mxResources.get("unknownError"));Z=ba.join(", ");if(L<this.staleEtagMaxRetries)L++,ba=Math.round(Math.pow(2,L)*this.coolOff*(1+.1*(Math.random()-.5))),window.setTimeout(N,ba),"1"==urlParams.test&&EditorUi.debug("DriveClient: Invalid response","retry",L,"delay",ba,"rev",null!=Y?Y.headRevisionId:"null","errors",Z);else{f.saveLevel=12;F({message:mxResources.get("error")+": "+Z},Y);try{EditorUi.logError("Saving to Google Drive failed",-null,"id-"+f.desc.id+"-from-"+v+"."+t+"-"+this.ui.hashValue(m)+"-to-"+Y.headRevisionId+"."+Y.modifiedDate+"-"+this.ui.hashValue(Y.etag)+(0<Z.length?"-errors-"+Z:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=f.sync?"-client_"+f.sync.clientId:"-nosync")+"-retries-"+L+"-delay-"+(Date.now()-g))}catch(ha){}}}else C(Y)}}),mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){f.saveLevel=6;try{f.isConflict(Y)?this.executeRequest({url:"/files/"+f.getId()+"?supportsAllDrives=true&fields="+-this.catchupFields},mxUtils.bind(this,function(Z){f.saveLevel=7;try{if(null!=Z&&Z.etag==G)if(L<this.staleEtagMaxRetries){L++;var ba=Math.round(2*L*this.coolOff*(1+.1*(Math.random()-.5)));window.setTimeout(P,ba);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",L,"delay",ba)}else{P(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+f.getHash(),action:"rev_"+f.desc.headRevisionId+"-mod_"+f.desc.modifiedDate+"-size_"+f.getSize()+"-mime_"+f.desc.mimeType+(this.ui.editor.autosave?-"":"-nosave")+(f.isAutosave()?"":"-noauto")+(f.changeListenerEnabled?"":"-nolisten")+(f.inConflictState?"-conflict":"")+(f.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=f.sync?"-client_"+f.sync.clientId:"-nosync")})}catch(ha){}}else"1"==urlParams.test&&Z.headRevisionId==v&&EditorUi.debug("DriveClient: Remote Etag Changed","local",G,"remote",Z.etag,"rev",f.desc.headRevisionId,"response",[Z],"file",[f]),F(Y,Z)}catch(ha){d(ha)}}),mxUtils.bind(this,function(){F(Y)})):-F(Y)}catch(Z){d(Z)}}}))}catch(Y){d(Y)}}),P=mxUtils.bind(this,function(T){f.saveLevel=9;if(T||null==G)N(T);else{var U=!0,W=null;try{W=window.setTimeout(mxUtils.bind(this,function(){U=!1;F({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(X){}this.executeRequest({url:"/files/"+f.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(X){window.clearTimeout(W);if(U){f.saveLevel=10;try{null!=X&&X.headRevisionId==v?("1"==urlParams.test&&G!=X.etag&&EditorUi.debug("DriveClient: Preflight Etag Update",+null,"id-"+f.desc.id+"-from-"+v+"."+t+"-"+this.ui.hashValue(m)+"-to-"+Y.headRevisionId+"."+Y.modifiedDate+"-"+this.ui.hashValue(Y.etag)+(0<Z.length?"-errors-"+Z:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=f.sync?"-client_"+f.sync.clientId:"-nosync")+"-retries-"+L+"-delay-"+(Date.now()-g))}catch(fa){}}}else C(Y)}}),mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){f.saveLevel=6;try{f.isConflict(Y)?this.executeRequest({url:"/files/"+f.getId()+"?supportsAllDrives=true&fields="++this.catchupFields},mxUtils.bind(this,function(Z){f.saveLevel=7;try{if(null!=Z&&Z.etag==G)if(L<this.staleEtagMaxRetries){L++;var ba=Math.round(2*L*this.coolOff*(1+.1*(Math.random()-.5)));window.setTimeout(O,ba);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",L,"delay",ba)}else{O(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+f.getHash(),action:"rev_"+f.desc.headRevisionId+"-mod_"+f.desc.modifiedDate+"-size_"+f.getSize()+"-mime_"+f.desc.mimeType+(this.ui.editor.autosave?+"":"-nosave")+(f.isAutosave()?"":"-noauto")+(f.changeListenerEnabled?"":"-nolisten")+(f.inConflictState?"-conflict":"")+(f.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=f.sync?"-client_"+f.sync.clientId:"-nosync")})}catch(fa){}}else"1"==urlParams.test&&Z.headRevisionId==v&&EditorUi.debug("DriveClient: Remote Etag Changed","local",G,"remote",Z.etag,"rev",f.desc.headRevisionId,"response",[Z],"file",[f]),F(Y,Z)}catch(fa){d(fa)}}),mxUtils.bind(this,function(){F(Y)})):+F(Y)}catch(Z){d(Z)}}}))}catch(Y){d(Y)}}),O=mxUtils.bind(this,function(T){f.saveLevel=9;if(T||null==G)N(T);else{var U=!0,W=null;try{W=window.setTimeout(mxUtils.bind(this,function(){U=!1;F({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(X){}this.executeRequest({url:"/files/"+f.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(X){window.clearTimeout(W);if(U){f.saveLevel=10;try{null!=X&&X.headRevisionId==v?("1"==urlParams.test&&G!=X.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",G,"to",X.etag,"rev",f.desc.headRevisionId,"response",[X],"file",[f]),G=X.etag,N(T)):F({error:{code:412}},X)}catch(Y){d(Y)}}}),mxUtils.bind(this,function(X){window.clearTimeout(W);U&&(f.saveLevel=11,F(X))}))}});if(y&&null==V){f.saveLevel=8;var R=new Image;R.onload=mxUtils.bind(this,function(){try{var T=this.thumbnailWidth/R.width,U=document.createElement("canvas");U.width=this.thumbnailWidth;U.height=Math.floor(R.height*T);U.getContext("2d").drawImage(R,0,0,U.width,U.height);var W=U.toDataURL();-W=W.substring(W.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");K.thumbnail={image:W,mimeType:"image/png"};P(!1)}catch(X){try{P(!1)}catch(Y){d(Y)}}});R.src="data:image/png;base64,"+l}else P(!1)}catch(T){d(T)}});if(y){var S=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(l){M(l,!0)}),F,this.ui.getCurrentFile()!=f?p:null,S.scale,S.border)}else M(p,!1)}catch(l){d(l)}});try{f.saveLevel=2,(u||y||f.constructor==DriveLibrary||!this.enableThumbnails||-"0"==urlParams.thumb||null!=K.mimeType&&"application/vnd.jgraph.mxfile"!=K.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(V){try{var Q=null;try{null!=V&&(Q=V.toDataURL("image/png")),null!=Q&&(Q=Q.length>this.maxThumbnailSize?null:Q.substring(Q.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(O){Q=null}J(Q,"image/png")}catch(O){d(O)}}),20))&&J(null,null,f.constructor!=DriveLibrary)}catch(V){d(V)}}else this.ui.editor.graph.reset(),F({message:mxResources.get("readOnly")})}catch(V){d(V)}};+W=W.substring(W.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");J.thumbnail={image:W,mimeType:"image/png"};O(!1)}catch(X){try{O(!1)}catch(Y){d(Y)}}});R.src="data:image/png;base64,"+l}else O(!1)}catch(T){d(T)}});if(y){var S=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(l){M(l,!0)}),F,this.ui.getCurrentFile()!=f?p:null,S.scale,S.border)}else M(p,!1)}catch(l){d(l)}});try{f.saveLevel=2,(u||y||f.constructor==DriveLibrary||!this.enableThumbnails||+"0"==urlParams.thumb||null!=J.mimeType&&"application/vnd.jgraph.mxfile"!=J.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(V){try{var Q=null;try{null!=V&&(Q=V.toDataURL("image/png")),null!=Q&&(Q=Q.length>this.maxThumbnailSize?null:Q.substring(Q.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(P){Q=null}K(Q,"image/png")}catch(P){d(P)}}),20))&&K(null,null,f.constructor!=DriveLibrary)}catch(V){d(V)}}else this.ui.editor.graph.reset(),F({message:mxResources.get("readOnly")})}catch(V){d(V)}};DriveClient.prototype.insertFile=function(f,c,k,n,q,u,E){u=null!=u?u:this.xmlMimeType;f={mimeType:u,title:f};null!=k&&(f.parents=[{kind:"drive#fileLink",id:k}]);this.executeRequest(this.createUploadRequest(null,f,c,!1,E),mxUtils.bind(this,function(H){u==this.libraryMimeType?n(new DriveLibrary(this.ui,c,H)):0==H?null!=q&&q({message:mxResources.get("errorSavingFile")}):n(new DriveFile(this.ui,c,H))}),q)};DriveClient.prototype.createUploadRequest=function(f,c,k,n,q,u,E){q=null!=q?q:!1;var H={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=u&&(H["If-Match"]=u);f={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=f?"/"+f:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=f?"PUT":"POST",headers:H,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=k?q?k:!window.btoa||mxClient.IS_IE||mxClient.IS_IE11?Base64.encode(k):Graph.base64EncodeUnicode(k):"")+"\r\n---------314159265358979323846--"};n||(f.fullUrl+="&newRevision=false");E&&(f.fullUrl+="&pinned=true");return f};DriveClient.prototype.createLinkPicker=function(){var f=e.linkPicker;if(null==f||e.linkPickerToken!=b){e.linkPickerToken=b;f=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0);var c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),@@ -13877,19 +13879,19 @@ d){this.writeFile(q,u,E,H,n,d,F,mxUtils.bind(this,function(g){delete e.meta.isNeH,E,mxUtils.bind(this,function(F){e.meta.sha=F;L()}),c):L()};GitHubClient.prototype.pickLibrary=function(e){this.pickFile(e)};GitHubClient.prototype.pickFolder=function(e){this.showGitHubDialog(!1,e,!0)};GitHubClient.prototype.pickFile=function(e){e=null!=e?e:mxUtils.bind(this,function(f){this.ui.loadFile("H"+encodeURIComponent(f))});this.showGitHubDialog(!0,e)};GitHubClient.prototype.showGitHubDialog=function(e,f,c){var k=null,n=null,q=null,u=null,E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.overflow="hidden";E.style.height="320px";var H=document.createElement("h3");mxUtils.write(H,mxResources.get(e?"selectFile":"selectFolder"));H.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";E.appendChild(H);H=this.ui.createToolbarButton(Editor.refreshImage,mxResources.get("refresh"),mxUtils.bind(this,function(){I()}));H.style.position="absolute";H.style.right="40px";H.style.top="26px";E.appendChild(H);var D=document.createElement("div");D.style.whiteSpace="nowrap";D.style.border="1px solid lightgray";D.style.boxSizing="border-box";D.style.padding="4px";D.style.overflow="auto";D.style.lineHeight="1.2em";D.style.height="290px";E.appendChild(D);var L=document.createElement("div");L.style.textOverflow="ellipsis";L.style.boxSizing="border-box";L.style.overflow="hidden";L.style.padding="4px";L.style.width="100%";var F=new CustomDialog(this.ui,E,mxUtils.bind(this,function(){f(k+"/"+n+"/"+encodeURIComponent(q)+"/"+u)}),null,null,"https://www.drawio.com/blog/single-repository-diagrams",-null,null,null,null,[[mxResources.get("authorize"),mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")})]],"16px");this.ui.showDialog(F.container,420,370,!0,!0);e&&F.okButton.parentNode.removeChild(F.okButton);var d=mxUtils.bind(this,function(K,J,V,Q){var O=document.createElement("a");O.setAttribute("title",K);O.style.cursor="pointer";mxUtils.write(O,K);mxEvent.addListener(O,"click",-J);Q&&(O.style.textDecoration="underline");null!=V&&(K=L.cloneNode(),K.style.padding=V,K.appendChild(O),O=K);return O}),g=mxUtils.bind(this,function(K){var J=document.createElement("div");J.style.marginBottom="8px";J.appendChild(d(k+"/"+n,mxUtils.bind(this,function(){u=null;I()}),null,!0));K||(mxUtils.write(J," / "),J.appendChild(d(decodeURIComponent(q),mxUtils.bind(this,function(){u=null;B()}),null,!0)));if(null!=u&&0<u.length){var V=u.split("/");for(K=0;K<V.length;K++)(function(Q){mxUtils.write(J,-" / ");J.appendChild(d(V[Q],mxUtils.bind(this,function(){u=V.slice(0,Q+1).join("/");y()}),null,!0))})(K)}D.appendChild(J)}),m=mxUtils.bind(this,function(K){this.ui.handleError(K,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(u=q=n=k=null,I()):this.ui.hideDialog()}),null,{})}),t=null,v=null,y=mxUtils.bind(this,function(K){null==K&&(D.innerText="",K=1);var J=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+n+"/contents/"+u+"?ref="+encodeURIComponent(q)+"&per_page=100&page="+-K,null,"GET");this.ui.spinner.spin(D,mxResources.get("loading"));F.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){y(K+1)});mxEvent.addListener(t,"click",V);this.executeRequest(J,mxUtils.bind(this,function(Q){this.ui.tryAndHandle(mxUtils.bind(this,-function(){this.ui.spinner.stop();1==K&&(g(),D.appendChild(d("../ [Up]",mxUtils.bind(this,function(){if(""==u)u=null,I();else{var C=u.split("/");u=C.slice(0,C.length-1).join("/");y()}}),"4px")));var O=JSON.parse(Q.getText());if(null==O||0==O.length)c||(mxUtils.br(D),mxUtils.write(D,mxResources.get("noFiles")));else{var p=!0,z=0,A=mxUtils.bind(this,function(C){for(var M=0;M<O.length;M++)mxUtils.bind(this,function(S,l){if(C==("dir"==S.type)){l=L.cloneNode();l.style.backgroundColor=p?Editor.isDarkMode()?-"#000000":"#eeeeee":"";p=!p;var x=document.createElement("img");x.src=IMAGE_PATH+"/"+("dir"==S.type?"folder.png":"file.png");x.setAttribute("align","absmiddle");x.style.marginRight="4px";x.style.marginTop="-4px";x.width=20;l.appendChild(x);l.appendChild(d(S.name+("dir"==S.type?"/":""),mxUtils.bind(this,function(){"dir"==S.type?(u=S.path,y()):e&&"file"==S.type&&(this.ui.hideDialog(),f(k+"/"+n+"/"+encodeURIComponent(q)+"/"+S.path))})));D.appendChild(l);z++}})(O[M],M)});A(!0);e&&A(!1)}}))}),m,!0)}),-B=mxUtils.bind(this,function(K,J){null==K&&(D.innerText="",K=1);var V=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+n+"/branches?per_page=100&page="+K,null,"GET");F.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(D,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var Q=-mxUtils.bind(this,function(){B(K+1)});mxEvent.addListener(t,"click",Q);this.executeRequest(V,mxUtils.bind(this,function(O){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==K&&(g(!0),D.appendChild(d("../ [Up]",mxUtils.bind(this,function(){u=null;I()}),"4px")));var p=JSON.parse(O.getText());if(null==p||0==p.length)mxUtils.br(D),mxUtils.write(D,mxResources.get("repositoryNotFound"));else if(1==p.length&&J)q=p[0].name,u="",y();else{for(var z=0;z<p.length;z++)mxUtils.bind(this,-function(A,C){var M=L.cloneNode();M.style.backgroundColor=0==C%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";M.appendChild(d(A.name,mxUtils.bind(this,function(){q=A.name;u="";y()})));D.appendChild(M)})(p[z],z);100==p.length&&(D.appendChild(t),v=function(){D.scrollTop>=D.scrollHeight-D.offsetHeight&&Q()},mxEvent.addListener(D,"scroll",v))}}))}),m)}),I=mxUtils.bind(this,function(K){null==K&&(D.innerText="",K=1);var J=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+K,null,"GET");F.okButton.setAttribute("disabled",-"disabled");this.ui.spinner.spin(D,mxResources.get("loading"));null!=v&&mxEvent.removeListener(D,"scroll",v);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){I(K+1)});mxEvent.addListener(t,"click",V);this.executeRequest(J,mxUtils.bind(this,function(Q){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();var O=JSON.parse(Q.getText());-if(null==O||0==O.length)mxUtils.br(D),mxUtils.write(D,mxResources.get("repositoryNotFound"));else{1==K&&(D.appendChild(d(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var z=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(A){if(null!=A){var C=A.split("/");if(1<C.length){A=C[0];var M=C[1];3>C.length?(k=A,n=M,u=q=null,B()):this.ui.spinner.spin(D,mxResources.get("loading"))&&(C=encodeURIComponent(C.slice(2,C.length).join("/")),this.getFile(A+-"/"+M+"/"+C,mxUtils.bind(this,function(S){this.ui.spinner.stop();k=S.meta.org;n=S.meta.repo;q=decodeURIComponent(S.meta.ref);u="";y()}),mxUtils.bind(this,function(S){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(z.container,300,80,!0,!1);z.init()}))),mxUtils.br(D),mxUtils.br(D));for(var p=0;p<O.length;p++)mxUtils.bind(this,-function(z,A){var C=L.cloneNode();C.style.backgroundColor=0==A%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";C.appendChild(d(z.full_name,mxUtils.bind(this,function(){k=z.owner.login;n=z.name;u="";B(null,!0)})));D.appendChild(C)})(O[p],p)}100==O.length&&(D.appendChild(t),v=function(){D.scrollTop>=D.scrollHeight-D.offsetHeight&&V()},mxEvent.addListener(D,"scroll",v))}))}),m)});I()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);b=null}})();TrelloFile=function(b,e,f){DrawioFile.call(this,b,e);this.meta=f;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};+null,null,null,null,[[mxResources.get("authorize"),mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")})]],"16px");this.ui.showDialog(F.container,420,370,!0,!0);e&&F.okButton.parentNode.removeChild(F.okButton);var d=mxUtils.bind(this,function(J,K,V,Q){var P=document.createElement("a");P.setAttribute("title",J);P.style.cursor="pointer";mxUtils.write(P,J);mxEvent.addListener(P,"click",+K);Q&&(P.style.textDecoration="underline");null!=V&&(J=L.cloneNode(),J.style.padding=V,J.appendChild(P),P=J);return P}),g=mxUtils.bind(this,function(J){var K=document.createElement("div");K.style.marginBottom="8px";K.appendChild(d(k+"/"+n,mxUtils.bind(this,function(){u=null;I()}),null,!0));J||(mxUtils.write(K," / "),K.appendChild(d(decodeURIComponent(q),mxUtils.bind(this,function(){u=null;B()}),null,!0)));if(null!=u&&0<u.length){var V=u.split("/");for(J=0;J<V.length;J++)(function(Q){mxUtils.write(K,+" / ");K.appendChild(d(V[Q],mxUtils.bind(this,function(){u=V.slice(0,Q+1).join("/");y()}),null,!0))})(J)}D.appendChild(K)}),m=mxUtils.bind(this,function(J){this.ui.handleError(J,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(u=q=n=k=null,I()):this.ui.hideDialog()}),null,{})}),t=null,v=null,y=mxUtils.bind(this,function(J){null==J&&(D.innerText="",J=1);var K=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+n+"/contents/"+u+"?ref="+encodeURIComponent(q)+"&per_page=100&page="++J,null,"GET");this.ui.spinner.spin(D,mxResources.get("loading"));F.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){y(J+1)});mxEvent.addListener(t,"click",V);this.executeRequest(K,mxUtils.bind(this,function(Q){this.ui.tryAndHandle(mxUtils.bind(this,+function(){this.ui.spinner.stop();1==J&&(g(),D.appendChild(d("../ [Up]",mxUtils.bind(this,function(){if(""==u)u=null,I();else{var C=u.split("/");u=C.slice(0,C.length-1).join("/");y()}}),"4px")));var P=JSON.parse(Q.getText());if(null==P||0==P.length)c||(mxUtils.br(D),mxUtils.write(D,mxResources.get("noFiles")));else{var p=!0,z=0,A=mxUtils.bind(this,function(C){for(var M=0;M<P.length;M++)mxUtils.bind(this,function(S,l){if(C==("dir"==S.type)){l=L.cloneNode();l.style.backgroundColor=p?Editor.isDarkMode()?+"#000000":"#eeeeee":"";p=!p;var x=document.createElement("img");x.src=IMAGE_PATH+"/"+("dir"==S.type?"folder.png":"file.png");x.setAttribute("align","absmiddle");x.style.marginRight="4px";x.style.marginTop="-4px";x.width=20;l.appendChild(x);l.appendChild(d(S.name+("dir"==S.type?"/":""),mxUtils.bind(this,function(){"dir"==S.type?(u=S.path,y()):e&&"file"==S.type&&(this.ui.hideDialog(),f(k+"/"+n+"/"+encodeURIComponent(q)+"/"+S.path))})));D.appendChild(l);z++}})(P[M],M)});A(!0);e&&A(!1)}}))}),m,!0)}),+B=mxUtils.bind(this,function(J,K){null==J&&(D.innerText="",J=1);var V=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+n+"/branches?per_page=100&page="+J,null,"GET");F.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(D,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var Q=+mxUtils.bind(this,function(){B(J+1)});mxEvent.addListener(t,"click",Q);this.executeRequest(V,mxUtils.bind(this,function(P){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==J&&(g(!0),D.appendChild(d("../ [Up]",mxUtils.bind(this,function(){u=null;I()}),"4px")));var p=JSON.parse(P.getText());if(null==p||0==p.length)mxUtils.br(D),mxUtils.write(D,mxResources.get("repositoryNotFound"));else if(1==p.length&&K)q=p[0].name,u="",y();else{for(var z=0;z<p.length;z++)mxUtils.bind(this,+function(A,C){var M=L.cloneNode();M.style.backgroundColor=0==C%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";M.appendChild(d(A.name,mxUtils.bind(this,function(){q=A.name;u="";y()})));D.appendChild(M)})(p[z],z);100==p.length&&(D.appendChild(t),v=function(){D.scrollTop>=D.scrollHeight-D.offsetHeight&&Q()},mxEvent.addListener(D,"scroll",v))}}))}),m)}),I=mxUtils.bind(this,function(J){null==J&&(D.innerText="",J=1);var K=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+J,null,"GET");F.okButton.setAttribute("disabled",+"disabled");this.ui.spinner.spin(D,mxResources.get("loading"));null!=v&&mxEvent.removeListener(D,"scroll",v);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){I(J+1)});mxEvent.addListener(t,"click",V);this.executeRequest(K,mxUtils.bind(this,function(Q){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();var P=JSON.parse(Q.getText());+if(null==P||0==P.length)mxUtils.br(D),mxUtils.write(D,mxResources.get("repositoryNotFound"));else{1==J&&(D.appendChild(d(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var z=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(A){if(null!=A){var C=A.split("/");if(1<C.length){A=C[0];var M=C[1];3>C.length?(k=A,n=M,u=q=null,B()):this.ui.spinner.spin(D,mxResources.get("loading"))&&(C=encodeURIComponent(C.slice(2,C.length).join("/")),this.getFile(A++"/"+M+"/"+C,mxUtils.bind(this,function(S){this.ui.spinner.stop();k=S.meta.org;n=S.meta.repo;q=decodeURIComponent(S.meta.ref);u="";y()}),mxUtils.bind(this,function(S){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(z.container,300,80,!0,!1);z.init()}))),mxUtils.br(D),mxUtils.br(D));for(var p=0;p<P.length;p++)mxUtils.bind(this,+function(z,A){var C=L.cloneNode();C.style.backgroundColor=0==A%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";C.appendChild(d(z.full_name,mxUtils.bind(this,function(){k=z.owner.login;n=z.name;u="";B(null,!0)})));D.appendChild(C)})(P[p],p)}100==P.length&&(D.appendChild(t),v=function(){D.scrollTop>=D.scrollHeight-D.offsetHeight&&V()},mxEvent.addListener(D,"scroll",v))}))}),m)});I()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);b=null}})();TrelloFile=function(b,e,f){DrawioFile.call(this,b,e);this.meta=f;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};TrelloFile.prototype.save=function(b,e,f){this.doSave(this.getTitle(),e,f)};TrelloFile.prototype.saveAs=function(b,e,f){this.doSave(b,e,f)};TrelloFile.prototype.doSave=function(b,e,f){var c=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=c;this.saveFile(b,!1,e,f)}),f])};TrelloFile.prototype.saveFile=function(b,e,f,c){this.isEditable()?this.savingFile?null!=c&&(this.saveNeededCounter++,c({code:App.ERROR_BUSY})):(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.getTitle()==b?this.ui.trello.saveFile(this,mxUtils.bind(this,function(k){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=k;this.contentChanged();null!=f&&f();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(b,e,f,c))}),mxUtils.bind(this,function(k){this.savingFile=!1;null!=c&&c(k)})):this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(k){this.ui.trello.insertFile(b,this.getData(),mxUtils.bind(this,function(n){this.savingFile=!1;null!=f&&f();this.ui.fileLoaded(n);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(b,e,f,c))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}),!1,k)}))):null!=f&&f()};TrelloLibrary=function(b,e,f){TrelloFile.call(this,b,e,f)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(b,e,f){this.saveFile(b,!1,e,f)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(b){DrawioClient.call(this,b,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e89d109082298ce91f6576f82f458551";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml";@@ -13933,44 +13935,44 @@ encodeURIComponent(k);D=new mxXmlRequest(e,JSON.stringify(c),D);this.executeRequnull,e.meta.refPos)}),c)}),L=mxUtils.bind(this,function(){if(this.ui.useCanvasForExport&&/(\.png)$/i.test(H)){var F=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(d){D(e.meta.last_commit_id,d)}),c,this.ui.getCurrentFile()!=e?e.getData():null,F.scale,F.border)}else D(e.meta.last_commit_id,Base64.encode(e.getData()))});k?this.getFile(q+"/"+u+"/"+E+"/"+H,mxUtils.bind(this,function(F){e.meta.last_commit_id=F.meta.last_commit_id;L()}),c):L()};GitLabClient.prototype.pickFolder=function(e){this.showGitLabDialog(!1,e,!0)};GitLabClient.prototype.pickFile=function(e){e=null!=e?e:mxUtils.bind(this,function(f){this.ui.loadFile("A"+encodeURIComponent(f))});this.showGitLabDialog(!0,e)};GitLabClient.prototype.showGitLabDialog=function(e,f,c){var k=null,n=null,q=null,u=null,E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.overflow="hidden";E.style.height="304px";var H=document.createElement("h3");mxUtils.write(H,mxResources.get(e?"selectFile":"selectFolder"));H.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";E.appendChild(H);var D=document.createElement("div");D.style.whiteSpace="nowrap";D.style.border="1px solid lightgray";D.style.boxSizing="border-box";D.style.padding="4px";D.style.overflow="auto";D.style.lineHeight="1.2em";D.style.height="274px";E.appendChild(D);var L=document.createElement("div");L.style.textOverflow="ellipsis";L.style.boxSizing="border-box";L.style.overflow="hidden";L.style.padding="4px";L.style.width=-"100%";var F=new CustomDialog(this.ui,E,mxUtils.bind(this,function(){f(k+"/"+n+"/"+encodeURIComponent(q)+"/"+u)}));this.ui.showDialog(F.container,420,370,!0,!0);e&&F.okButton.parentNode.removeChild(F.okButton);var d=mxUtils.bind(this,function(K,J,V,Q){var O=document.createElement("a");O.setAttribute("title",K);O.style.cursor="pointer";mxUtils.write(O,K);mxEvent.addListener(O,"click",J);Q&&(O.style.textDecoration="underline");null!=V&&(K=L.cloneNode(),K.style.padding=V,K.appendChild(O),O=K);return O}),-g=mxUtils.bind(this,function(K){var J=document.createElement("div");J.style.marginBottom="8px";J.appendChild(d(k+"/"+n,mxUtils.bind(this,function(){u=null;I()}),null,!0));K||(mxUtils.write(J," / "),J.appendChild(d(decodeURIComponent(q),mxUtils.bind(this,function(){u=null;B()}),null,!0)));if(null!=u&&0<u.length){var V=u.split("/");for(K=0;K<V.length;K++)(function(Q){mxUtils.write(J," / ");J.appendChild(d(V[Q],mxUtils.bind(this,function(){u=V.slice(0,Q+1).join("/");y()}),null,!0))})(K)}D.appendChild(J)}),-m=mxUtils.bind(this,function(K){this.ui.handleError(K,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(u=q=n=k=null,I()):this.ui.hideDialog()}))}),t=null,v=null,y=mxUtils.bind(this,function(K){null==K&&(D.innerText="",K=1);var J=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+n)+"/repository/tree?path="+u+"&ref="+q+"&per_page=100&page="+K,null,"GET");this.ui.spinner.spin(D,mxResources.get("loading"));F.okButton.removeAttribute("disabled");null!=v&&-(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){y(K+1)});mxEvent.addListener(t,"click",V);this.executeRequest(J,mxUtils.bind(this,function(Q){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==K&&(g(!q),D.appendChild(d("../ [Up]",mxUtils.bind(this,function(){if(""==-u||null==u)u=null,I();else{var C=u.split("/");u=C.slice(0,C.length-1).join("/");y()}}),"4px")));var O=JSON.parse(Q.getText());if(null==O||0==O.length)c||(mxUtils.br(D),mxUtils.write(D,mxResources.get("noFiles")));else{var p=!0,z=0,A=mxUtils.bind(this,function(C){for(var M=0;M<O.length;M++)mxUtils.bind(this,function(S){if(C==("tree"==S.type)){var l=L.cloneNode();l.style.backgroundColor=p?Editor.isDarkMode()?"#000000":"#eeeeee":"";p=!p;var x=document.createElement("img");x.src=IMAGE_PATH+"/"+("tree"==-S.type?"folder.png":"file.png");x.setAttribute("align","absmiddle");x.style.marginRight="4px";x.style.marginTop="-4px";x.width=20;l.appendChild(x);l.appendChild(d(S.name+("tree"==S.type?"/":""),mxUtils.bind(this,function(){"tree"==S.type?(u=S.path,y()):e&&"blob"==S.type&&(this.ui.hideDialog(),f(k+"/"+n+"/"+q+"/"+S.path))})));D.appendChild(l);z++}})(O[M])});A(!0);e&&A(!1);100==z&&(D.appendChild(t),v=function(){D.scrollTop>=D.scrollHeight-D.offsetHeight&&V()},mxEvent.addListener(D,"scroll",v))}}))}),-m,!0)}),B=mxUtils.bind(this,function(K,J){null==K&&(D.innerText="",K=1);var V=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+n)+"/repository/branches?per_page=100&page="+K,null,"GET");F.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(D,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,-mxResources.get("more")+"...");var Q=mxUtils.bind(this,function(){B(K+1)});mxEvent.addListener(t,"click",Q);this.executeRequest(V,mxUtils.bind(this,function(O){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==K&&(g(!0),D.appendChild(d("../ [Up]",mxUtils.bind(this,function(){u=null;I()}),"4px")));var p=JSON.parse(O.getText());if(null==p||0==p.length)mxUtils.br(D),mxUtils.write(D,mxResources.get("repositoryNotFound"));else if(1==p.length&&J)q=p[0].name,u="",y();else{for(var z=+"100%";var F=new CustomDialog(this.ui,E,mxUtils.bind(this,function(){f(k+"/"+n+"/"+encodeURIComponent(q)+"/"+u)}));this.ui.showDialog(F.container,420,370,!0,!0);e&&F.okButton.parentNode.removeChild(F.okButton);var d=mxUtils.bind(this,function(J,K,V,Q){var P=document.createElement("a");P.setAttribute("title",J);P.style.cursor="pointer";mxUtils.write(P,J);mxEvent.addListener(P,"click",K);Q&&(P.style.textDecoration="underline");null!=V&&(J=L.cloneNode(),J.style.padding=V,J.appendChild(P),P=J);return P}),+g=mxUtils.bind(this,function(J){var K=document.createElement("div");K.style.marginBottom="8px";K.appendChild(d(k+"/"+n,mxUtils.bind(this,function(){u=null;I()}),null,!0));J||(mxUtils.write(K," / "),K.appendChild(d(decodeURIComponent(q),mxUtils.bind(this,function(){u=null;B()}),null,!0)));if(null!=u&&0<u.length){var V=u.split("/");for(J=0;J<V.length;J++)(function(Q){mxUtils.write(K," / ");K.appendChild(d(V[Q],mxUtils.bind(this,function(){u=V.slice(0,Q+1).join("/");y()}),null,!0))})(J)}D.appendChild(K)}),+m=mxUtils.bind(this,function(J){this.ui.handleError(J,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(u=q=n=k=null,I()):this.ui.hideDialog()}))}),t=null,v=null,y=mxUtils.bind(this,function(J){null==J&&(D.innerText="",J=1);var K=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+n)+"/repository/tree?path="+u+"&ref="+q+"&per_page=100&page="+J,null,"GET");this.ui.spinner.spin(D,mxResources.get("loading"));F.okButton.removeAttribute("disabled");null!=v&&+(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){y(J+1)});mxEvent.addListener(t,"click",V);this.executeRequest(K,mxUtils.bind(this,function(Q){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==J&&(g(!q),D.appendChild(d("../ [Up]",mxUtils.bind(this,function(){if(""==+u||null==u)u=null,I();else{var C=u.split("/");u=C.slice(0,C.length-1).join("/");y()}}),"4px")));var P=JSON.parse(Q.getText());if(null==P||0==P.length)c||(mxUtils.br(D),mxUtils.write(D,mxResources.get("noFiles")));else{var p=!0,z=0,A=mxUtils.bind(this,function(C){for(var M=0;M<P.length;M++)mxUtils.bind(this,function(S){if(C==("tree"==S.type)){var l=L.cloneNode();l.style.backgroundColor=p?Editor.isDarkMode()?"#000000":"#eeeeee":"";p=!p;var x=document.createElement("img");x.src=IMAGE_PATH+"/"+("tree"==+S.type?"folder.png":"file.png");x.setAttribute("align","absmiddle");x.style.marginRight="4px";x.style.marginTop="-4px";x.width=20;l.appendChild(x);l.appendChild(d(S.name+("tree"==S.type?"/":""),mxUtils.bind(this,function(){"tree"==S.type?(u=S.path,y()):e&&"blob"==S.type&&(this.ui.hideDialog(),f(k+"/"+n+"/"+q+"/"+S.path))})));D.appendChild(l);z++}})(P[M])});A(!0);e&&A(!1);100==z&&(D.appendChild(t),v=function(){D.scrollTop>=D.scrollHeight-D.offsetHeight&&V()},mxEvent.addListener(D,"scroll",v))}}))}),+m,!0)}),B=mxUtils.bind(this,function(J,K){null==J&&(D.innerText="",J=1);var V=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+n)+"/repository/branches?per_page=100&page="+J,null,"GET");F.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(D,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,+mxResources.get("more")+"...");var Q=mxUtils.bind(this,function(){B(J+1)});mxEvent.addListener(t,"click",Q);this.executeRequest(V,mxUtils.bind(this,function(P){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==J&&(g(!0),D.appendChild(d("../ [Up]",mxUtils.bind(this,function(){u=null;I()}),"4px")));var p=JSON.parse(P.getText());if(null==p||0==p.length)mxUtils.br(D),mxUtils.write(D,mxResources.get("repositoryNotFound"));else if(1==p.length&&K)q=p[0].name,u="",y();else{for(var z=0;z<p.length;z++)mxUtils.bind(this,function(A,C){var M=L.cloneNode();M.style.backgroundColor=0==C%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";M.appendChild(d(A.name,mxUtils.bind(this,function(){q=encodeURIComponent(A.name);u="";y()})));D.appendChild(M)})(p[z],z);100==p.length&&(D.appendChild(t),v=function(){D.scrollTop>=D.scrollHeight-D.offsetHeight&&Q()},mxEvent.addListener(D,"scroll",v))}}))}),m)});F.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(D,mxResources.get("loading"));-var I=mxUtils.bind(this,function(K){var J=this.ui.spinner,V=0;this.ui.spinner.stop();var Q=function(){J.spin(D,mxResources.get("loading"));V+=1},O=function(){--V;0===V&&J.stop()};null==K&&(D.innerText="",K=1);null!=v&&(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var p=mxUtils.bind(this,function(){0===V&&I(K+1)});mxEvent.addListener(t,-"click",p);var z=mxUtils.bind(this,function(C){Q();var M=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(M,mxUtils.bind(this,function(S){this.ui.tryAndHandle(mxUtils.bind(this,function(){C(JSON.parse(S.getText()));O()}))}),m)}),A=mxUtils.bind(this,function(C,M){Q();var S=new mxXmlRequest(this.baseUrl+"/groups/"+C.id+"/projects?per_page=100",null,"GET");this.executeRequest(S,mxUtils.bind(this,function(l){this.ui.tryAndHandle(mxUtils.bind(this,function(){M(C,JSON.parse(l.getText()));-O()}))}),m)});z(mxUtils.bind(this,function(C){if(null==this.user)mxUtils.write(D,mxResources.get("loggedOut"));else{Q();var M=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+K,null,"GET");this.executeRequest(M,mxUtils.bind(this,function(S){S=JSON.parse(S.getText());if(null!=S&&0!=S.length||null!=C&&0!=C.length){1==K&&(D.appendChild(d(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){if(0===V){var G=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),+var I=mxUtils.bind(this,function(J){var K=this.ui.spinner,V=0;this.ui.spinner.stop();var Q=function(){K.spin(D,mxResources.get("loading"));V+=1},P=function(){--V;0===V&&K.stop()};null==J&&(D.innerText="",J=1);null!=v&&(mxEvent.removeListener(D,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var p=mxUtils.bind(this,function(){0===V&&I(J+1)});mxEvent.addListener(t,+"click",p);var z=mxUtils.bind(this,function(C){Q();var M=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(M,mxUtils.bind(this,function(S){this.ui.tryAndHandle(mxUtils.bind(this,function(){C(JSON.parse(S.getText()));P()}))}),m)}),A=mxUtils.bind(this,function(C,M){Q();var S=new mxXmlRequest(this.baseUrl+"/groups/"+C.id+"/projects?per_page=100",null,"GET");this.executeRequest(S,mxUtils.bind(this,function(l){this.ui.tryAndHandle(mxUtils.bind(this,function(){M(C,JSON.parse(l.getText()));+P()}))}),m)});z(mxUtils.bind(this,function(C){if(null==this.user)mxUtils.write(D,mxResources.get("loggedOut"));else{Q();var M=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+J,null,"GET");this.executeRequest(M,mxUtils.bind(this,function(S){S=JSON.parse(S.getText());if(null!=S&&0!=S.length||null!=C&&0!=C.length){1==J&&(D.appendChild(d(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){if(0===V){var G=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(N){null!=N&&(N=N.split("/"),1<N.length?(k=N[0],n=N[1],q=u=null,2<N.length?(q=encodeURIComponent(N.slice(2,N.length).join("/")),y()):B(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(G.container,300,80,!0,!1);G.init()}}))),mxUtils.br(D),mxUtils.br(D));for(var l=!0,x=0;x<S.length;x++)mxUtils.bind(this,function(G){var N=L.cloneNode();N.style.backgroundColor=l?Editor.isDarkMode()?-"#000000":"#eeeeee":"";l=!l;N.appendChild(d(G.name_with_namespace,mxUtils.bind(this,function(){0===V&&(k=G.owner.username,n=G.path,u="",B(null,!0))})));D.appendChild(N)})(S[x]);for(x=0;x<C.length;x++)Q(),A(C[x],mxUtils.bind(this,function(G,N){O();for(var P=0;P<N.length;P++){var R=L.cloneNode();R.style.backgroundColor=l?Editor.isDarkMode()?"#000000":"#eeeeee":"";l=!l;mxUtils.bind(this,function(T){R.appendChild(d(T.name_with_namespace,mxUtils.bind(this,function(){0===V&&(k=G.full_path,n=T.path,u="",-B(null,!0))})));D.appendChild(R)})(N[P])}}));O()}else O(),mxUtils.br(D),mxUtils.write(D,mxResources.get("repositoryNotFound"));100==S.length&&(D.appendChild(t),v=function(){D.scrollTop>=D.scrollHeight-D.offsetHeight&&p()},mxEvent.addListener(D,"scroll",v))}),m)}}))});b?this.user?I():this.updateUser(function(){I()},m,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){I()},m,!0)}),m)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="++"#000000":"#eeeeee":"";l=!l;N.appendChild(d(G.name_with_namespace,mxUtils.bind(this,function(){0===V&&(k=G.owner.username,n=G.path,u="",B(null,!0))})));D.appendChild(N)})(S[x]);for(x=0;x<C.length;x++)Q(),A(C[x],mxUtils.bind(this,function(G,N){P();for(var O=0;O<N.length;O++){var R=L.cloneNode();R.style.backgroundColor=l?Editor.isDarkMode()?"#000000":"#eeeeee":"";l=!l;mxUtils.bind(this,function(T){R.appendChild(d(T.name_with_namespace,mxUtils.bind(this,function(){0===V&&(k=G.full_path,n=T.path,u="",+B(null,!0))})));D.appendChild(R)})(N[O])}}));P()}else P(),mxUtils.br(D),mxUtils.write(D,mxResources.get("repositoryNotFound"));100==S.length&&(D.appendChild(t),v=function(){D.scrollTop>=D.scrollHeight-D.offsetHeight&&p()},mxEvent.addListener(D,"scroll",v))}),m)}}))});b?this.user?I():this.updateUser(function(){I()},m,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){I()},m,!0)}),m)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();this.setUser(null);b=null;this.setToken(null)}})();DrawioComment=function(b,e,f,c,k,n,q){this.file=b;this.id=e;this.content=f;this.modifiedDate=c;this.createdDate=k;this.isResolved=n;this.user=q;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,e,f,c,k){e()};DrawioComment.prototype.editComment=function(b,e,f){e()};DrawioComment.prototype.deleteComment=function(b,e){b()};DriveComment=function(b,e,f,c,k,n,q,u){DrawioComment.call(this,b,e,f,c,k,n,q);this.pCommentId=u};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(b,e,f,c,k){b={content:b.content};c?b.verb="resolve":k&&(b.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:b,method:"POST"},mxUtils.bind(this,function(n){e(n.replyId)}),f)};DriveComment.prototype.editComment=function(b,e,f){this.content=b;b={content:b};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:b,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:b,method:"PATCH"},e,f)};DriveComment.prototype.deleteComment=function(b,e){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},b,e)};function mxODPicker(b,e,f,c,k,n,q,u,E,H,D,L,F,d){function g(U,W){W=W||document;return W.querySelector(U)}function m(U,W,X){if(null==U["@microsoft.graph.downloadUrl"])if(null==U.parentReference)X();else{c(U.id,U.parentReference.driveId,function(ba){m(ba,W,X)},X);return}var Y=new XMLHttpRequest;Y.open("GET",U["@microsoft.graph.downloadUrl"]);var Z=U.file?"image/png"==U.file.mimeType:!1;Y.onreadystatechange=function(){if(4==this.readyState){if(200<=this.status&&299>=this.status)try{var ba=Y.responseText;-Z?(ba="data:image/png;base64,"+Editor.base64Encode(ba),ba=Editor.extractGraphModelFromPng(ba)):/\.pdf$/.test(U.name)&&(ba="data:application/pdf;base64,"+Editor.base64Encode(ba),ba=Editor.extractGraphModelFromPdf(ba));var ha=mxUtils.parseXml(ba),ca="mxlibrary"==ha.documentElement.nodeName?ha.documentElement:Editor.extractGraphModel(ha.documentElement);if(null!=ca){W(ca.ownerDocument);return}}catch(da){}X()}};(Z||/\.pdf$/.test(U.name))&&Y.overrideMimeType&&Y.overrideMimeType("text/plain; charset=x-user-defined");-Y.send()}function t(){L&&null!=z?p.exportToCanvas(function(U){U=EditorUi.prototype.createImageDataUri(U,null,"png");q(A,U);n(A)},400,null,null,function(U){console.log(U)},600,null,null,null,null,null,z):(q(A,void 0),n(A))}function v(U){function W(X){P.style.background="transparent";P.innerText="";var Y=document.createElement("div");Y.className="odPreviewStatus";mxUtils.write(Y,X);P.appendChild(Y);O.stop()}if(null!=P)if(P.style.background="transparent",P.innerText="",null==U||U.folder||/\.drawiolib$/.test(U.name))W(mxResources.get("noPreview"));-else try{null!=U.remoteItem&&(U=U.remoteItem),x=U,O.spin(P),m(U,function(X){O.stop();if(x==U)if("mxlibrary"==X.documentElement.nodeName)W(mxResources.get("noPreview"));else{var Y=X.getElementsByTagName("diagram");z=AspectDialog.prototype.createViewer(P,0==Y.length?X.documentElement:Y[0],null,"transparent")}},function(){A=null;W(mxResources.get("notADiagramFile"))})}catch(X){A=null,W(mxResources.get("notADiagramFile"))}}function y(){var U=g(".odFilesBreadcrumb");if(null!=U){U.innerText="";for(var W=+Z?(ba="data:image/png;base64,"+Editor.base64Encode(ba),ba=Editor.extractGraphModelFromPng(ba)):/\.pdf$/.test(U.name)&&(ba="data:application/pdf;base64,"+Editor.base64Encode(ba),ba=Editor.extractGraphModelFromPdf(ba));var fa=mxUtils.parseXml(ba),ca="mxlibrary"==fa.documentElement.nodeName?fa.documentElement:Editor.extractGraphModel(fa.documentElement);if(null!=ca){W(ca.ownerDocument);return}}catch(da){}X()}};(Z||/\.pdf$/.test(U.name))&&Y.overrideMimeType&&Y.overrideMimeType("text/plain; charset=x-user-defined");+Y.send()}function t(){L&&null!=z?p.exportToCanvas(function(U){U=EditorUi.prototype.createImageDataUri(U,null,"png");q(A,U);n(A)},400,null,null,function(U){console.log(U)},600,null,null,null,null,null,z):(q(A,void 0),n(A))}function v(U){function W(X){O.style.background="transparent";O.innerText="";var Y=document.createElement("div");Y.className="odPreviewStatus";mxUtils.write(Y,X);O.appendChild(Y);P.stop()}if(null!=O)if(O.style.background="transparent",O.innerText="",null==U||U.folder||/\.drawiolib$/.test(U.name))W(mxResources.get("noPreview"));+else try{null!=U.remoteItem&&(U=U.remoteItem),x=U,P.spin(O),m(U,function(X){P.stop();if(x==U)if("mxlibrary"==X.documentElement.nodeName)W(mxResources.get("noPreview"));else{var Y=X.getElementsByTagName("diagram");z=AspectDialog.prototype.createViewer(O,0==Y.length?X.documentElement:Y[0],null,"transparent")}},function(){A=null;W(mxResources.get("notADiagramFile"))})}catch(X){A=null,W(mxResources.get("notADiagramFile"))}}function y(){var U=g(".odFilesBreadcrumb");if(null!=U){U.innerText="";for(var W=0;W<S.length-1;W++){var X=document.createElement("span");X.className="odBCFolder";X.innerHTML=mxUtils.htmlEntities(S[W].name||mxResources.get("home"));U.appendChild(X);(function(Z,ba){X.addEventListener("click",function(){e(null);S=S.slice(0,ba);I(Z.driveId,Z.folderId,Z.siteId,Z.name)})})(S[W],W);var Y=document.createElement("span");Y.innerHTML=" > ";U.appendChild(Y)}null!=S[S.length-1]&&(W=document.createElement("span"),W.innerHTML=mxUtils.htmlEntities(1==S.length?mxResources.get(E?"selectFolder":-"officeSelDiag"):S[S.length-1].name||mxResources.get("home")),U.appendChild(W))}}function B(){if(null!=A&&!M)if("sharepoint"==C)I("site",null,A.id,A.displayName);else if("site"==C)I("subsite",null,A.id,A.name);else{var U=A.folder;A=A.remoteItem?A.remoteItem:A;var W=(A.parentReference?A.parentReference.driveId:null)||C,X=A.id;U?I(W,X,null,A.name):t()}}function I(U,W,X,Y,Z){function ba(pa){O.stop();var ra=document.createElement("table");ra.className="odFileListGrid";for(var xa=null,wa=0,ea=0;null!=+"officeSelDiag"):S[S.length-1].name||mxResources.get("home")),U.appendChild(W))}}function B(){if(null!=A&&!M)if("sharepoint"==C)I("site",null,A.id,A.displayName);else if("site"==C)I("subsite",null,A.id,A.name);else{var U=A.folder;A=A.remoteItem?A.remoteItem:A;var W=(A.parentReference?A.parentReference.driveId:null)||C,X=A.id;U?I(W,X,null,A.name):t()}}function I(U,W,X,Y,Z){function ba(pa){P.stop();var ra=document.createElement("table");ra.className="odFileListGrid";for(var xa=null,wa=0,ea=0;null!=pa&&ea<pa.length;ea++){var na=pa[ea];if(1!=da||!na.webUrl||0<na.webUrl.indexOf("sharepoint.com/sites/")||0>na.webUrl.indexOf("sharepoint.com/")){var Aa=na.displayName||na.name,oa=mxUtils.htmlEntities(na.description||Aa);da&&(na.folder=2==da?{isRoot:!0}:!0);var Ea=null!=na.folder;if(!E||Ea){var va=document.createElement("tr");va.className=wa++%2?"odOddRow":"odEvenRow";var Ca=document.createElement("td");Ca.style.width="36px";var Fa=document.createElement("img");Fa.src="/images/"+(Ea?"folder.png":"file.png");Fa.className="odFileImg";Ca.appendChild(Fa);va.appendChild(Ca);Ca=document.createElement("td");Ea=document.createElement("div");Ea.className="odFileTitle";Ea.innerHTML=mxUtils.htmlEntities(Aa);Ea.setAttribute("title",oa);Ca.appendChild(Ea);va.appendChild(Ca);ra.appendChild(va);null==xa&&(xa=va,xa.className+=" odRowSelected",A=na,C=U,d||e(A));(function(Ma,Ba){va.addEventListener("dblclick",B);va.addEventListener("click",function(){xa!=Ba&&(xa.className=xa.className.replace("odRowSelected",""),xa=Ba,-xa.className+=" odRowSelected",A=Ma,C=U,d||e(A))})})(na,va)}}}0==wa?(pa=document.createElement("div"),pa.className="odEmptyFolder",pa.innerHTML=mxUtils.htmlEntities(mxResources.get("folderEmpty",null,"Folder is empty!")),aa.appendChild(pa)):aa.appendChild(ra);y();M=!1}function ha(pa){f(pa?pa:sa,function(ra){if(ca){var xa=ra.value||[];if(d||da)Array.prototype.push.apply(fa,xa);else{for(var wa=0;wa<xa.length;wa++){var ea=xa[wa],na=ea.file?ea.file.mimeType:null;(ea.folder||"text/html"==na||"text/xml"==-na||"application/xml"==na||"image/png"==na||/\.svg$/.test(ea.name)||/\.html$/.test(ea.name)||/\.xml$/.test(ea.name)||/\.png$/.test(ea.name)||/\.drawio$/.test(ea.name)||/\.drawiolib$/.test(ea.name)||/\.pdf$/.test(ea.name))&&fa.push(ea)}fa.sort(function(Aa,oa){var Ea=Aa.name.toLowerCase(),va=oa.name.toLowerCase();return Aa.folder&&!oa.folder?-1:!Aa.folder&&oa.folder?1:Ea<va?-1:Ea>va?1:0})}ra["@odata.nextLink"]&&1E3>fa.length?ha(ra["@odata.nextLink"]):(clearTimeout(ja),ba(fa))}},function(ra){if(ca){clearTimeout(ja);-var xa=null;try{xa=JSON.parse(ra.responseText).error.message}catch(wa){}u(mxResources.get("errorFetchingFolder",null,"Error fetching folder items")+(null!=xa?" ("+xa+")":""));M=!1;O.stop()}},null!=pa)}if(!M){g(".odCatsList").style.display="block";g(".odFilesSec").style.display="block";null!=P&&(P.innerText="",P.style.top="50%");var ca=M=!0,da=0;l=arguments;var ja=setTimeout(function(){M=ca=!1;O.stop();u(mxResources.get("timeout"))},2E4),aa=g(".odFilesList");aa.innerText="";O.spin(aa);switch(U){case "recent":S=+xa.className+=" odRowSelected",A=Ma,C=U,d||e(A))})})(na,va)}}}0==wa?(pa=document.createElement("div"),pa.className="odEmptyFolder",pa.innerHTML=mxUtils.htmlEntities(mxResources.get("folderEmpty",null,"Folder is empty!")),aa.appendChild(pa)):aa.appendChild(ra);y();M=!1}function fa(pa){f(pa?pa:sa,function(ra){if(ca){var xa=ra.value||[];if(d||da)Array.prototype.push.apply(ha,xa);else{for(var wa=0;wa<xa.length;wa++){var ea=xa[wa],na=ea.file?ea.file.mimeType:null;(ea.folder||"text/html"==na||"text/xml"==+na||"application/xml"==na||"image/png"==na||/\.svg$/.test(ea.name)||/\.html$/.test(ea.name)||/\.xml$/.test(ea.name)||/\.png$/.test(ea.name)||/\.drawio$/.test(ea.name)||/\.drawiolib$/.test(ea.name)||/\.pdf$/.test(ea.name))&&ha.push(ea)}ha.sort(function(Aa,oa){var Ea=Aa.name.toLowerCase(),va=oa.name.toLowerCase();return Aa.folder&&!oa.folder?-1:!Aa.folder&&oa.folder?1:Ea<va?-1:Ea>va?1:0})}ra["@odata.nextLink"]&&1E3>ha.length?fa(ra["@odata.nextLink"]):(clearTimeout(ja),ba(ha))}},function(ra){if(ca){clearTimeout(ja);+var xa=null;try{xa=JSON.parse(ra.responseText).error.message}catch(wa){}u(mxResources.get("errorFetchingFolder",null,"Error fetching folder items")+(null!=xa?" ("+xa+")":""));M=!1;P.stop()}},null!=pa)}if(!M){g(".odCatsList").style.display="block";g(".odFilesSec").style.display="block";null!=O&&(O.innerText="",O.style.top="50%");var ca=M=!0,da=0;l=arguments;var ja=setTimeout(function(){M=ca=!1;P.stop();u(mxResources.get("timeout"))},2E4),aa=g(".odFilesList");aa.innerText="";P.spin(aa);switch(U){case "recent":S=[{name:mxResources.get("recent",null,"Recent"),driveId:U}];var ia=k()||{},ka=[],ua;for(ua in ia)ka.push(ia[ua]);clearTimeout(ja);ba(ka);return;case "shared":var sa="/me/drive/sharedWithMe";S=[{name:mxResources.get("sharedWithMe",null,"Shared With Me"),driveId:U}];break;case "sharepoint":sa="/sites?search=";S=[{name:mxResources.get("sharepointSites",null,"Sharepoint Sites"),driveId:U}];da=1;break;case "site":S.push({name:Y,driveId:U,folderId:W,siteId:X});sa="/sites/"+X+"/drives";da=2;break;case "subsite":S.push({name:Y,driveId:U,folderId:W,siteId:X});sa="/drives/"+X+(W?"/items/"+W:"/root")+"/children";break;case "search":U=C;S=[{driveId:U,name:mxResources.get("back",null,"Back")}];Z=encodeURIComponent(Z.replace(/'/g,"\\'"));sa=U?"/drives/"+U+"/root/search(q='"+Z+"')":"/me/drive/root/search(q='"+Z+"')";break;default:null==W?S=[{driveId:U}]:S.push({name:Y,driveId:U,folderId:W}),sa=(U?"/drives/"+U:"/me/drive")+(W?"/items/"+W:"/root")+"/children"}da||(sa+=(0<sa.indexOf("?")?"&":"?")+"select=id,name,description,parentReference,file,createdBy,lastModifiedBy,lastModifiedDateTime,size,folder,remoteItem,@microsoft.graph.downloadUrl");-var fa=[];ha()}}function K(U){R.className=R.className.replace("odCatSelected","");R=U;R.className+=" odCatSelected"}function J(U){M||(T=null,I("search",null,null,null,U))}var V="";null==e&&(e=v,V='<div style="text-align: center;" class="odPreview"></div>');null==k&&(k=function(){var U=null;try{U=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(W){}return U});null==n&&(n=function(U){if(null!=U){var W=k()||{};delete U["@microsoft.graph.downloadUrl"];W[U.id]=U;localStorage.setItem("mxODPickerRecentList",+var ha=[];fa()}}function J(U){R.className=R.className.replace("odCatSelected","");R=U;R.className+=" odCatSelected"}function K(U){M||(T=null,I("search",null,null,null,U))}var V="";null==e&&(e=v,V='<div style="text-align: center;" class="odPreview"></div>');null==k&&(k=function(){var U=null;try{U=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(W){}return U});null==n&&(n=function(U){if(null!=U){var W=k()||{};delete U["@microsoft.graph.downloadUrl"];W[U.id]=U;localStorage.setItem("mxODPickerRecentList",JSON.stringify(W))}});V='<div class="odCatsList"><div class="odCatsListLbl">OneDrive</div><div id="odFiles" class="odCatListTitle odCatSelected">'+mxUtils.htmlEntities(mxResources.get("files"))+'</div><div id="odRecent" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("recent"))+'</div><div id="odShared" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("shared"))+'</div><div id="odSharepoint" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("sharepoint"))+'</div></div><div class="odFilesSec"><div class="searchBar" style="display:none"><input type="search" id="odSearchBox" placeholder="'+mxUtils.htmlEntities(mxResources.get("search"))+'"></div><div class="odFilesBreadcrumb"></div><div id="refreshOD" class="odRefreshButton"><img class="geAdaptiveAsset" src="/images/update32.png" width="16" height="16" title="'+mxUtils.htmlEntities(mxResources.get("refresh"))+'Refresh" border="0"/></div><div class="odFilesList"></div></div>'+V+(H?'<div id="odBackBtn" class="odLinkBtn">< '+mxUtils.htmlEntities(mxResources.get("back"))+"</div>":"")+(D?'<button id="odSubmitBtn" class="odSubmitBtn">'+mxUtils.htmlEntities(mxResources.get(E?"select":"open"))+"</button>":"");var Q=null!=window.Editor&&null!=Editor.isDarkMode&&Editor.isDarkMode();Q=".odCatsList *, .odFilesSec * { user-select: none; }.odCatsList {\tbox-sizing: border-box;\tposition:absolute;\ttop:0px;\tbottom:50%;\twidth:30%;\tborder: 1px solid #CCCCCC;\tborder-bottom:none;\tdisplay: inline-block;\toverflow-x: hidden;\toverflow-y: auto;}.odCatsListLbl {\theight: 17px;\tcolor: #6D6D6D;\tfont-size: 14px;\tfont-weight: bold;\tline-height: 17px;\tmargin: 10px 0 3px 5px;}.odFilesSec {\tbox-sizing: border-box;\tposition:absolute;\tleft:30%;\ttop:0px;\tbottom:50%;\twidth: 70%;\tborder: 1px solid #CCCCCC;\tborder-left:none;\tborder-bottom:none;\tdisplay: inline-block;\toverflow: hidden;}.odFilesBreadcrumb {\tbox-sizing: border-box;\tposition:absolute;\tmin-height: 32px;\tleft:0px;\tright:20px;\ttext-overflow:ellipsis;\toverflow:hidden;\tfont-size: 13px;\tcolor: #6D6D6D;\tpadding: 5px;}.odRefreshButton {\tbox-sizing: border-box;\tposition:absolute;\tright:0px;\ttop:0px;\tpadding: 4px;\tmargin: 1px;\theight:24px;\tcursor:default;}.odRefreshButton>img {\topacity:0.5;}.odRefreshButton:hover {\tbackground-color:#ddd;\tborder-radius:50%;}.odRefreshButton:active {\topacity:0.7;}.odFilesList {\tbox-sizing: border-box;\tposition:absolute;\ttop:32px;\tbottom:0px;\twidth: 100%;\toverflow-x: hidden;\toverflow-y: auto;}.odFileImg {\twidth: 24px;\tpadding-left: 5px;\tpadding-right: 5px;}.odFileTitle {\tcursor: default;\tfont-weight: normal;\tcolor: #666666 !important;\twidth: calc(100% - 20px);\twhite-space: nowrap;\toverflow: hidden;\ttext-overflow: ellipsis;}.odFileListGrid {\twidth: 100%;\twhite-space: nowrap;\tfont-size: 13px; box-sizing: border-box; border-spacing: 0;}.odOddRow {"+(Q?"":"\tbackground-color: #eeeeee;")+"}.odEvenRow {"+(Q?"":"\tbackground-color: #FFFFFF;")+"}.odRowSelected {\tbackground-color: #cadfff;}.odCatListTitle {\tbox-sizing: border-box;\theight: 17px;\tcursor: default;\tcolor: #666666;\tfont-size: 14px;\tline-height: 17px;\tmargin: 5px 0 5px 0px; padding-left: 10px;}.odCatSelected {\tfont-weight: bold;\tbackground-color: #cadfff;}.odEmptyFolder {\theight: 17px;\tcolor: #6D6D6D;\tfont-size: 14px;\tfont-weight: bold;\tline-height: 17px;\tmargin: 10px 0 3px 5px;\twidth: 100%; text-align: center;}.odBCFolder {\tcursor: pointer;\tcolor: #0432ff;}.odPreviewStatus {\tposition:absolute;\ttext-align:center;\twidth:100%;\ttop:50%;\ttransform: translateY(-50%);\tfont-size:13px;\topacity:0.5;}.odPreview { position:absolute;\t overflow:hidden;\t border: 1px solid #CCCCCC; bottom:0px; top: 50%; left:0px; right:0px;}.odLinkBtn { position: absolute;\tfont-size: 12px;\tcursor: pointer;\tcolor: #6D6D6D;\tleft: 5px;\tbottom: 3px;}.odSubmitBtn { position: absolute;\tcolor: #333;\tright: 5px;\tbottom: 5px;}";-var O=new Spinner({left:"50%",lines:12,length:8,width:3,radius:5,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9}),p=new Editor,z=null,A=null,C=null,M=!1,S=[],l=null,x=null;this.getSelectedItem=function(){null!=A&&n(A);return A};if(null==g("#mxODPickerCss")){var G=document.head||document.getElementsByTagName("head")[0],N=document.createElement("style");G.appendChild(N);N.type="text/css";N.id="mxODPickerCss";N.appendChild(document.createTextNode(Q))}b.innerHTML=-V;var P=g(".odPreview"),R=g("#odFiles");b=function(U,W){W=W||document;return W.querySelectorAll(U)}(".odCatListTitle");for(V=0;V<b.length;V++)b[V].addEventListener("click",function(){A=x=null;if(!M)switch(K(this),this.id){case "odFiles":I();break;case "odRecent":I("recent");break;case "odShared":I("shared");break;case "odSharepoint":I("sharepoint")}});var T=null;g("#odSearchBox").addEventListener("keyup",function(U){var W=this;null!=T&&clearTimeout(T);13==U.keyCode?J(W.value):T=setTimeout(function(){J(W.value)},-500)});g("#refreshOD").addEventListener("click",function(){if(null!=l){e(null);var U=S.slice();I.apply(this,l);S=U}});H&&g("#odBackBtn").addEventListener("click",H);D&&g("#odSubmitBtn").addEventListener("click",t);null!=F?(H=F.pop(),"sharepoint"==F[0].driveId&&K(g("#odSharepoint")),S=F,I(H.driveId,H.folderId,H.siteId,H.name)):I()};App=function(b,e,f){EditorUi.call(this,b,e,null!=f?f:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&c.isModified()&&(c.getHash(),c.savingFile&&null!=c.savingFileTime&&(Date.now(),c.savingFileTime.getTime()),null!=c.ageStart&&(Date.now(),c.ageStart.getTime()),c.isAutosave(),null!=c.opened&&(Date.now(),c.opened.getTime()),null!=c.lastSaved&&(Date.now(),c.lastSaved.getTime()),+var P=new Spinner({left:"50%",lines:12,length:8,width:3,radius:5,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9}),p=new Editor,z=null,A=null,C=null,M=!1,S=[],l=null,x=null;this.getSelectedItem=function(){null!=A&&n(A);return A};if(null==g("#mxODPickerCss")){var G=document.head||document.getElementsByTagName("head")[0],N=document.createElement("style");G.appendChild(N);N.type="text/css";N.id="mxODPickerCss";N.appendChild(document.createTextNode(Q))}b.innerHTML=+V;var O=g(".odPreview"),R=g("#odFiles");b=function(U,W){W=W||document;return W.querySelectorAll(U)}(".odCatListTitle");for(V=0;V<b.length;V++)b[V].addEventListener("click",function(){A=x=null;if(!M)switch(J(this),this.id){case "odFiles":I();break;case "odRecent":I("recent");break;case "odShared":I("shared");break;case "odSharepoint":I("sharepoint")}});var T=null;g("#odSearchBox").addEventListener("keyup",function(U){var W=this;null!=T&&clearTimeout(T);13==U.keyCode?K(W.value):T=setTimeout(function(){K(W.value)},+500)});g("#refreshOD").addEventListener("click",function(){if(null!=l){e(null);var U=S.slice();I.apply(this,l);S=U}});H&&g("#odBackBtn").addEventListener("click",H);D&&g("#odSubmitBtn").addEventListener("click",t);null!=F?(H=F.pop(),"sharepoint"==F[0].driveId&&J(g("#odSharepoint")),S=F,I(H.driveId,H.folderId,H.siteId,H.name)):I()};App=function(b,e,f){EditorUi.call(this,b,e,null!=f?f:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&c.isModified()&&(c.getHash(),c.savingFile&&null!=c.savingFileTime&&(Date.now(),c.savingFileTime.getTime()),null!=c.ageStart&&(Date.now(),c.ageStart.getTime()),c.isAutosave(),null!=c.opened&&(Date.now(),c.opened.getTime()),null!=c.lastSaved&&(Date.now(),c.lastSaved.getTime()),null!=c.lastChanged&&(Date.now(),c.lastChanged.getTime()),Date.now(),App.startTime.getTime(),c.constructor==DriveFile&&null!=c.desc&&null!=this.drive&&c.getSize())}));this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+c.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?"on":"off")})}));mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":(new Image).src=mxGraph.prototype.warningImage.src;window.geOpenWindow=mxUtils.bind(this,function(c,k,n){if("1"==urlParams.openInSameWin||navigator.standalone)null!=n&&n();else{var q=null;try{q=window.open(c)}catch(u){}null==q||void 0===q?this.showDialog((new PopupDialog(this,c,k,n)).container,320,160,!0,!0):null!=k&&k()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(c){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(c)});this.editor.chromeless&&!this.editor.editable||this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(b=0;b<App.DrawPlugins.length;b++)try{App.DrawPlugins[b](this)}catch(c){null!=window.console&&console.log("Plugin Error:",c,App.DrawPlugins[b])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(c){try{c(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=@@ -13991,9 +13993,9 @@ mxLanguage))}catch(m){document.body.innerHTML="",g=document.createElement("pre")null,"0"!=urlParams.chrome));null!=window.mxscript&&("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)}):"undefined"===typeof window.Dropbox&&(window.DropboxClient=null),"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null),"function"===typeof window.TrelloClient&&!mxClient.IS_IE11&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null));null!=b&&b(I);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,I,(new Date).getTime()-t0.getTime()+"ms"]),null!=-urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(K){EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(K.stack)):(EditorUi.logError(K.message,null,null,null,K),window.setTimeout(function(){alert(K.message)},1))}}mxResources.parse(g[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var t=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=t){EditorUi.debug("Setting configuration",+urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(J){EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(J.stack)):(EditorUi.logError(J.message,null,null,null,J),window.setTimeout(function(){alert(J.message)},1))}}mxResources.parse(g[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var t=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=t){EditorUi.debug("Setting configuration",JSON.stringify(t));if(null!=t.merge){var v=localStorage.getItem(Editor.configurationKey);if(null!=v)try{var y=JSON.parse(v),B;for(B in t.merge)y[B]=t.merge[B];t=y}catch(I){window.location.hash="",alert(I)}else t=t.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(t)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(I){window.location.hash="",alert(I)}1<g.length&&-(Graph.prototype.defaultThemes["default-style2"]=g[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=g[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?m():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],m,function(I){document.body.innerHTML="";var K=document.createElement("pre");mxUtils.write(K,I.stack);document.body.appendChild(K)}))},function(g){g=document.getElementById("geStatus");null!=g&&+(Graph.prototype.defaultThemes["default-style2"]=g[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=g[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?m():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],m,function(I){document.body.innerHTML="";var J=document.createElement("pre");mxUtils.write(J,I.stack);document.body.appendChild(J)}))},function(g){g=document.getElementById("geStatus");null!=g&&(g.innerHTML="Error loading page. <a>Please try refreshing.</a>",g.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})};if(!App.isMainCalled)if(mxIsElectron&&"undefined"===typeof electron)alert("Runtime Environment not found."),document.body.innerHTML='<div style="margin-top:10%;text-align:center;"><img src="mxgraph/images/warning.png" align="top" style="padding-right:6px;"/>Runtime Environment not found.</div>';else if(App.isMainCalled=!0,window.onerror=function(d,g,m,t,v){EditorUi.logError("Global: "+(null!=d?d:""),g,m,t,v,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",d,"\nURL:",g,"\nLine:",m,"\nColumn:",t,"\nError:",v)):console.error("Message:",d,"\nURL:",g,"\nLine:",m,"\nColumn:",t,"\nError:",v);window.setTimeout(function(){alert("Error: "+(null!=d?d:""))},100)},window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var k=document.getElementById("geInfo");null!=k&&k.parentNode.removeChild(k)}null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){if("1"==urlParams.dev&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&null!=CryptoJS&&App.mode!=App.MODE_DROPBOX&&App.mode!=App.MODE_TRELLO){var n=document.getElementById("geBootstrap");@@ -14050,9 +14052,9 @@ App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modApp.prototype.updateDocumentTitle=function(){var b=this.editor.appName,e=this.getCurrentFile();null==e||!this.editor.graph.isLightboxView()&&"simple"!=Editor.currentTheme||null==this.pages||null==this.currentPage?this.isOfflineApp()&&(b+=" app"):b=this.getShortPageName(this.currentPage);null!=e&&(b=(null!=e.getTitle()?e.getTitle():this.defaultFilename)+" - "+b);document.title!=b&&(document.title=b)};App.prototype.getThumbnail=function(b,e,f){f=null!=f?f:0;var c=!1;try{var k=!0,n=window.setTimeout(mxUtils.bind(this,function(){k=!1;e(null)}),this.timeout),q=mxUtils.bind(this,function(Q){window.clearTimeout(n);k&&e(Q)});null==this.thumbImageCache&&(this.thumbImageCache={});var u=this.editor.graph,E=u.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var H=u.getGlobalVariable;u=this.createTemporaryGraph(u.getStylesheet());u.setBackgroundImage=this.editor.graph.setBackgroundImage;var D=this.pages[0];this.currentPage==D?u.setBackgroundImage(E):null!=D.viewState&&null!=D.viewState&&(E=D.viewState.backgroundImage,u.setBackgroundImage(E));u.getGlobalVariable=function(Q){return"page"==Q?D.getName():"pagenumber"==Q?1:H.apply(this,arguments)};u.getGlobalVariable=H;document.body.appendChild(u.container);u.model.setRoot(D.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(Q){try{u!=this.editor.graph&&null!=u.container.parentNode&&-u.container.parentNode.removeChild(u.container)}catch(O){Q=null}q(Q)}),b,this.thumbImageCache,"#ffffff",function(){q()},null,null,null,null,null,null,u,f,null,null,null,"diagram",null),c=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var L=document.createElement("canvas"),F=u.getGraphBounds(),d=u.view.translate,g=u.view.scale;null!=E&&(F=mxRectangle.fromRectangle(F),F.add(new mxRectangle((d.x+E.x)*g,(d.y+E.y)*g,E.width*g,E.height*g)));var m=b/F.width;m=Math.min(1,Math.min(3*b/(4*F.height),-m));var t=Math.floor(F.x),v=Math.floor(F.y);L.setAttribute("width",Math.ceil(m*(F.width+4)));L.setAttribute("height",Math.ceil(m*(F.height+4)));var y=L.getContext("2d");y.scale(m,m);y.translate(-t,-v);var B=u.background;if(null==B||""==B||B==mxConstants.NONE)B="#ffffff";y.save();y.fillStyle=B;y.fillRect(t,v,Math.ceil(F.width+4),Math.ceil(F.height+4));y.restore();if(null!=E){var I=new Image;I.src=E.src;y.drawImage(I,E.x*m,E.y*m,E.width*m,E.height*m)}var K=new mxJsCanvas(L),J=new mxAsyncCanvas(this.thumbImageCache);-K.images=this.thumbImageCache.images;var V=new mxImageExport;V.drawShape=function(Q,O){Q.shape instanceof mxShape&&Q.shape.checkBounds()&&(O.save(),O.translate(.5,.5),Q.shape.paint(O),O.translate(-.5,-.5),O.restore())};V.drawText=function(Q,O){};V.drawState(u.getView().getState(u.model.root),J);J.finish(mxUtils.bind(this,function(){try{V.drawState(u.getView().getState(u.model.root),K),u!=this.editor.graph&&null!=u.container.parentNode&&u.container.parentNode.removeChild(u.container)}catch(Q){L=null}q(L)}));+u.container.parentNode.removeChild(u.container)}catch(P){Q=null}q(Q)}),b,this.thumbImageCache,"#ffffff",function(){q()},null,null,null,null,null,null,u,f,null,null,null,"diagram",null),c=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var L=document.createElement("canvas"),F=u.getGraphBounds(),d=u.view.translate,g=u.view.scale;null!=E&&(F=mxRectangle.fromRectangle(F),F.add(new mxRectangle((d.x+E.x)*g,(d.y+E.y)*g,E.width*g,E.height*g)));var m=b/F.width;m=Math.min(1,Math.min(3*b/(4*F.height),+m));var t=Math.floor(F.x),v=Math.floor(F.y);L.setAttribute("width",Math.ceil(m*(F.width+4)));L.setAttribute("height",Math.ceil(m*(F.height+4)));var y=L.getContext("2d");y.scale(m,m);y.translate(-t,-v);var B=u.background;if(null==B||""==B||B==mxConstants.NONE)B="#ffffff";y.save();y.fillStyle=B;y.fillRect(t,v,Math.ceil(F.width+4),Math.ceil(F.height+4));y.restore();if(null!=E){var I=new Image;I.src=E.src;y.drawImage(I,E.x*m,E.y*m,E.width*m,E.height*m)}var J=new mxJsCanvas(L),K=new mxAsyncCanvas(this.thumbImageCache);+J.images=this.thumbImageCache.images;var V=new mxImageExport;V.drawShape=function(Q,P){Q.shape instanceof mxShape&&Q.shape.checkBounds()&&(P.save(),P.translate(.5,.5),Q.shape.paint(P),P.translate(-.5,-.5),P.restore())};V.drawText=function(Q,P){};V.drawState(u.getView().getState(u.model.root),K);K.finish(mxUtils.bind(this,function(){try{V.drawState(u.getView().getState(u.model.root),J),u!=this.editor.graph&&null!=u.container.parentNode&&u.container.parentNode.removeChild(u.container)}catch(Q){L=null}q(L)}));c=!0}}catch(Q){c=!1,null!=u&&u!=this.editor.graph&&null!=u.container.parentNode&&u.container.parentNode.removeChild(u.container)}c||window.clearTimeout(n);return c};(function(){var b=EditorUi.prototype.setMode;App.prototype.setMode=function(e,f){b.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var c=this.getCurrentFile();e=null!=c?c.getMode():e;e==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):e==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):e==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor=e==App.MODE_DEVICE?"pointer":"default")}if(f)try{if(isLocalStorage)localStorage.setItem(".mode",e);else if("undefined"!=typeof Storage){var k=new Date;k.setYear(k.getFullYear()+1);document.cookie="MODE="+e+"; expires="+k.toUTCString()}}catch(n){}}})();@@ -14232,7 +14234,7 @@ Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);nuc.style.marginLeft="4px";c.style.cursor="help";c.style.color="blue";var k=document.createElement("img");k.setAttribute("src",Editor.helpImage);k.setAttribute("valign","bottom");k.setAttribute("border","0");k.className="geAdaptiveAsset";mxUtils.setOpacity(k,60);k.style.height="16px";k.style.width="16px";c.appendChild(k);mxEvent.addGestureListeners(c,mxUtils.bind(this,function(n){this.editorUi.hideCurrentMenu();this.editorUi.openLink(f);mxEvent.consume(n)}));return c};Menus.prototype.addLinkToItem=function(f,c){null!=f&&(c=this.createHelpLink(c),c.style.display="inline",c.style.marginLeft="8px",f.firstChild.nextSibling.appendChild(c))};Menus.prototype.removeCustomFont=function(f,c){for(var k=0;k<this.customFonts.length;k++)if(this.customFonts[k].name==f&&this.customFonts[k].url==c){this.customFonts.splice(k,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(f,c){for(var k=0;k<this.customFonts.length;k++)if(this.customFonts[k].name==f&&this.customFonts[k].url==c)return!0;for(k=0;k<this.defaultFonts.length;k++){var n=this.defaultFonts[k];if("string"!==typeof n&&n.fontFamily==f&&n.fontUrl==c||"string"===typeof n&&n==f&&null==c)return!0}return!1};Menus.prototype.addCustomFont=function(f,c){null==f||this.containsFont(f,c)||(this.customFonts.push({name:f,url:c}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var e=Menus.prototype.init;Menus.prototype.init=function(){function f(p,-z,A){c.isExportToCanvas()?c.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(C,M,S,l,x,G,N,P,R,T,U,W,X){var Y=parseInt(C);!isNaN(Y)&&0<Y&&(c.exportImage(Y/100,M&&"png"==p,S,l,x&&"png"==p,N,!P,R,p,U,null,W,X),null!=A&&A(C,M,S,l,x,G,N,P,R,T,U,W,X))}),!0,z,p,!0):c.isOffline()||mxClient.IS_IOS&&navigator.standalone||c.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(C,M,S,l,+z,A){c.isExportToCanvas()?c.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(C,M,S,l,x,G,N,O,R,T,U,W,X){var Y=parseInt(C);!isNaN(Y)&&0<Y&&(c.exportImage(Y/100,M&&"png"==p,S,l,x&&"png"==p,N,!O,R,p,U,null,W,X),null!=A&&A(C,M,S,l,x,G,N,O,R,T,U,W,X))}),!0,z,p,!0):c.isOffline()||mxClient.IS_IOS&&navigator.standalone||c.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(C,M,S,l,x){c.downloadFile(M&&"png"==p?"xmlpng":p,null,null,C,null,null,S,l,x)}),!1,!0)}e.apply(this,arguments);var c=this.editorUi,k=c.editor.graph,n=mxUtils.bind(k,k.isEnabled);mxClient.IS_SVG||c.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(p){return"file"!=p}));c.actions.addAction("new...",function(){var p=c.isOffline(),z=new NewDialog(c,p,!(c.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));c.showDialog(z.container,p?350:620,p?70:460,!0,!0,function(A){c.sidebar.hideTooltip();A&&null==c.getCurrentFile()&&c.showSplash()});z.init()});c.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",function(){if(k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())){var p=new NewDialog(c,null,!1,function(z){c.hideDialog();if(null!=z){var A=c.editor.graph.getFreeInsertPoint();k.setSelectionCells(c.importXml(z,Math.max(A.x,20),Math.max(A.y,20),!0,null,null,!0));k.scrollCellToVisible(k.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));c.showDialog(p.container,620,460,!0,!0,function(){c.sidebar.hideTooltip()});p.init()}})).isEnabled=n;var q=c.actions.addAction("shareCursor",function(){c.setShareCursorPosition(!c.isShareCursorPosition())});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isShareCursorPosition()});q=c.actions.addAction("showRemoteCursors",function(){c.setShowRemoteCursors(!c.isShowRemoteCursors())});q.setToggleAction(!0);@@ -14246,8 +14248,8 @@ q=c.actions.put("toggleSketchMode",new Action(mxResources.get("sketch"),functionc.freehandWindow){var p=!mxClient.IS_IE&&!mxClient.IS_IE11;c.freehandWindow=new FreehandWindow(c,document.body.offsetWidth-420,102,176,p?126:90,p)}k.freehand.isDrawing()?k.freehand.stopDrawing():k.freehand.startDrawing();c.freehandWindow.window.setVisible(k.freehand.isDrawing())}},null,null,"X")).isEnabled=function(){return n()&&mxClient.IS_SVG});c.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var p=document.createElement("div");p.style.whiteSpace="nowrap";var z=null==c.pages||1>=c.pages.length,A=document.createElement("h3");mxUtils.write(A,mxResources.get("formatXml"));A.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";p.appendChild(A);var C=c.addCheckbox(p,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),M=c.addCheckbox(p,mxResources.get("compressed"),Editor.defaultCompressed),S=c.addCheckbox(p,mxResources.get("allPages"),!z,z);S.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?S.setAttribute("disabled","disabled"):S.removeAttribute("disabled")});p=new CustomDialog(c,p,mxUtils.bind(this,function(){c.downloadFile("xml",!M.checked,null,!C.checked,z||!S.checked)}),null,mxResources.get("export"));c.showDialog(p.container,300,200,!0,!0)}));Editor.enableExportUrl&&c.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){c.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(p,z,A,C,M,S,l,x,G){l=[];C&&G&&l.push("tags=%7B%7D");p=new EmbedDialog(c,c.createLink(p,-z,!0,C,M,S,null,!0,l,null,A));c.showDialog(p.container,450,240,!0,!0);p.init()})}));c.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){c.getPublicUrl(c.getCurrentFile(),function(p){c.showHtmlDialog(mxResources.get("export"),null,p,function(z,A,C,M,S,l,x,G,N,P,R){c.createHtml(z,A,C,M,S,l,x,G,N,P,R,mxUtils.bind(this,function(T,U){var W=c.getBaseFilename(x);T='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+-mxUtils.htmlEntities(W)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+T+"\n"+U+"\n</body>\n</html>";c.saveData(W+(".drawio"==W.substring(W.lenth-7)?"":".drawio")+".html","html",T,"text/html")}))})})}));c.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){EditorUi.isElectronApp||!c.isOffline()&&!c.printPdfExport?c.showPrintDialog(mxResources.get("formatPdf"),mxUtils.bind(this,function(p,z){p=null!=c.pages?c.pages.length:1;var A=null==c.pages||1>=c.pages.length,+z,!0,C,M,S,null,!0,l,null,A));c.showDialog(p.container,450,240,!0,!0);p.init()})}));c.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){c.getPublicUrl(c.getCurrentFile(),function(p){c.showHtmlDialog(mxResources.get("export"),null,p,function(z,A,C,M,S,l,x,G,N,O,R,T){c.createHtml(z,A,C,M,S,l,x,G,N,O,R,mxUtils.bind(this,function(U,W){var X=c.getBaseFilename(x);U='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'++mxUtils.htmlEntities(X)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+U+"\n"+W+"\n</body>\n</html>";c.saveData(X+(".drawio"==X.substring(X.lenth-7)?"":".drawio")+".html","html",U,"text/html")}),T)})})}));c.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){EditorUi.isElectronApp||!c.isOffline()&&!c.printPdfExport?c.showPrintDialog(mxResources.get("formatPdf"),mxUtils.bind(this,function(p,z){p=null!=c.pages?c.pages.length:1;var A=null==c.pages||1>=c.pages.length,C=c.getPageIndex(c.currentPage);C=null!=C?C+1:1;c.downloadFile("pdf",null,null,!z.selection,A||!z.allPages&&z.pagesFrom==C&&z.pagesTo==C,!z.crop,z.transparent,z.scale,null,z.grid,z.includeCopy,z.allPages||z.pagesFrom==C&&z.pagesTo==C?null:{from:Math.max(0,Math.min(p-1,z.pagesFrom-1)),to:Math.max(0,Math.min(p-1,z.pagesTo-1))},z.border,z.fit,z.sheetsAcross,z.sheetsDown)})):c.showDialog((new PrintDialog(c,mxResources.get("formatPdf"))).container,320,null!=c.pages&&1<c.pages.length&&(c.editor.editable||"1"!=urlParams["hide-pages"])?350:280,!0,!0)}));c.actions.addAction("open...",function(){c.pickFile()});c.actions.addAction("close",function(){function p(){null!=z&&z.removeDraft();c.fileLoaded(null)}var z=c.getCurrentFile();null!=z&&z.isModified()?c.confirm(mxResources.get("allChangesLost"),null,p,mxResources.get("cancel"),mxResources.get("discardChanges")):p()});c.actions.addAction("editShape...",mxUtils.bind(this,function(){k.getSelectionCells();if(1==k.getSelectionCount()){var p=k.getSelectionCell(),z=k.view.getState(p);null!=z&&null!=z.shape&&null!=z.shape.stencil&&(p=new EditShapeDialog(c,p,mxResources.get("editShape")+":",630,400),c.showDialog(p.container,640,480,!0,!1),p.init())}}));c.actions.addAction("revisionHistory...",function(){c.isRevisionHistorySupported()?c.spinner.spin(document.body,mxResources.get("loading"))&&c.getRevisions(mxUtils.bind(this,function(p,z){c.spinner.stop();p=new RevisionDialog(c,p,z);c.showDialog(p.container,640,480,!0,!0);p.init()}),mxUtils.bind(this,function(p){c.handleError(null!=@@ -14258,7 +14260,7 @@ q.isEnabled=n);q=c.actions.put("defaultAdaptiveColors",new Action(mxResources.gefunction(){var p=new ChangePageSetup(c);p.ignoreColor=!0;p.ignoreImage=!0;p.adaptiveColors="none";k.model.execute(p)}));q.setToggleAction(!0);q.setSelectedCallback(function(){return"none"==k.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(p,z){this.addMenuItems(p,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],z)})));isLocalStorage&&(q=c.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),q.setToggleAction(!0),q.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var u=c.actions.addAction("autosave",function(){c.editor.setAutosave(!c.editor.autosave)});u.setToggleAction(!0);u.setSelectedCallback(function(){return u.isEnabled()&&c.editor.autosave});c.actions.addAction("editGeometry...",function(){for(var p=k.getSelectionCells(),z=[],A=0;A<p.length;A++)k.getModel().isVertex(p[A])&&z.push(p[A]);0<z.length&&(p=new EditGeometryDialog(c,z),c.showDialog(p.container,200,270,!0,!0),p.init())},null,null,Editor.ctrlKey+"+Shift+M");c.actions.addAction("copyStyle",function(){if(k.isEnabled()&&1==k.getSelectionCount()){var p=k.getSelectionCell(),z=k.getCellStyle(p,!1);c.copiedStyle={};var A=[],C=[],M;for(M in z)A.push(z[M]),C.push(M);k.copyCellStyles([p],C,A,c.copiedStyle,c.copiedStyle,null,null,null,!0)}},null,null,"Alt+C");c.actions.addAction("pasteStyle",function(){k.isEnabled()&&!k.isSelectionEmpty()&&null!=c.copiedStyle&&k.pasteCellStyles(k.includeDescendants(k.getSelectionCells()),-c.copiedStyle,c.copiedStyle,!0)},null,null,"Alt+V");c.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){c.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(p,z,A,C,M,S,l,x,G,N,P,R,T,U){p=parseInt(p);c.lastExportSvgEditable=M;!isNaN(p)&&0<p&&c.exportSvg(p/100,z,A,C,M,S,l,!x,G,N,R,T,U)}),!0,c.lastExportSvgEditable,"svg",!0)}));c.actions.put("exportPng",new Action(mxResources.get("formatPng")++c.copiedStyle,c.copiedStyle,!0)},null,null,"Alt+V");c.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){c.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(p,z,A,C,M,S,l,x,G,N,O,R,T,U){p=parseInt(p);c.lastExportSvgEditable=M;!isNaN(p)&&0<p&&c.exportSvg(p/100,z,A,C,M,S,l,!x,G,N,R,T,U)}),!0,c.lastExportSvgEditable,"svg",!0)}));c.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){f("png",c.lastExportPngEditable,function(p,z,A,C,M){c.lastExportPngEditable=M})}));c.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){f("jpeg")}));c.actions.put("exportWebp",new Action(mxResources.get("formatWebp")+"...",function(){f("webp")}));q=c.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var p=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),z=mxUtils.getXml(0==p.length?c.editor.getGraphXml():k.encodeCells(p));c.copyImage(p,z)}),null,null,"Ctrl+Alt+X");q.visible=Editor.enableNativeCipboard&&c.isExportToCanvas()&&!mxClient.IS_SF;q=c.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){k.setShadowVisible(!k.shadowVisible)}));q.setToggleAction(!0);q.setSelectedCallback(function(){return k.shadowVisible});c.actions.put("about",new Action("v"+EditorUi.VERSION,function(p,z){}));c.actions.addAction("support...",function(){EditorUi.isElectronApp?c.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):c.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});c.actions.addAction("exportOptionsDisabled...",function(){c.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});c.actions.addAction("keyboardShortcuts...",function(){!mxClient.IS_SVG||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.openLink("https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg"):c.openLink("shortcuts.svg")});c.actions.addAction("feedback...",@@ -14280,7 +14282,7 @@ C.style.display="atlas"==Editor.currentTheme||"min"==Editor.currentTheme||"sketcA);A()}}return z}}c.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];c.actions.addAction("runLayout",function(){c.showCustomLayoutDialog(JSON.stringify(c.customLayoutConfig,null,2))});c.actions.put("adaptiveColors",new Action("adaptiveColors",function(p){null==c.adaptiveColorsWindow&&(c.adaptiveColorsWindow=new AdaptiveColorsWindow(c,document.body.offsetWidth-520,80,200,160));c.adaptiveColorsWindow.window.setVisible(!0)}));q=this.get("viewZoom");var H=q.funct;q.funct=mxUtils.bind(this,function(p,z){H.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(p,["-","outline","fullscreen"],z)});q=this.get("layout");var D=q.funct;q.funct=function(p,z){D.apply(this,arguments);p.addItem(mxResources.get("orgChart"),null,function(){var A=null,C=20,M=20,S=function(){"undefined"!==typeof mxOrgChartLayout&&null!=A&&c.tryAndHandle(mxUtils.bind(this,function(){var U=c.editor.graph,W=new mxOrgChartLayout(U,A,C,M),X=U.getDefaultParent();1<U.model.getChildCount(U.getSelectionCell())&&(X=U.getSelectionCell());W.execute(X)}))},l=document.createElement("div"),x=document.createElement("div");x.style.marginTop="6px";x.style.display="inline-block";x.style.width="180px";mxUtils.write(x,mxResources.get("orgChartType")+": ");l.appendChild(x);var G=document.createElement("select");G.style.width="160px";G.style.boxSizing="border-box";x=[mxResources.get("linear"),-mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")];for(var N=0;N<x.length;N++){var P=document.createElement("option");mxUtils.write(P,x[N]);P.value=N;2==N&&P.setAttribute("selected","selected");G.appendChild(P)}mxEvent.addListener(G,"change",function(){A=G.value});l.appendChild(G);x=document.createElement("div");x.style.marginTop="6px";x.style.display=+mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")];for(var N=0;N<x.length;N++){var O=document.createElement("option");mxUtils.write(O,x[N]);O.value=N;2==N&&O.setAttribute("selected","selected");G.appendChild(O)}mxEvent.addListener(G,"change",function(){A=G.value});l.appendChild(G);x=document.createElement("div");x.style.marginTop="6px";x.style.display="inline-block";x.style.width="180px";mxUtils.write(x,mxResources.get("parentChildSpacing")+": ");l.appendChild(x);var R=document.createElement("input");R.type="number";R.value=C;R.style.width="160px";R.style.boxSizing="border-box";l.appendChild(R);mxEvent.addListener(R,"change",function(){C=R.value});x=document.createElement("div");x.style.marginTop="6px";x.style.display="inline-block";x.style.width="180px";mxUtils.write(x,mxResources.get("siblingSpacing")+": ");l.appendChild(x);var T=document.createElement("input");T.type="number";T.value=M;T.style.width="160px";T.style.boxSizing="border-box";l.appendChild(T);mxEvent.addListener(T,"change",function(){M=T.value});x=mxUtils.button(mxResources.get("custom")+"...",function(){var U=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(G.value),parentChildSpacing:parseInt(R.value),siblingSpacing:parseInt(T.value)}}];c.hideDialog();c.showCustomLayoutDialog(JSON.stringify(U,null,2))});x.className="geBtn";l=new CustomDialog(c,l,function(){null==A&&(A=2);c.loadOrgChartLayouts(S)},null,null,null,x);c.showDialog(l.container,355,140,!0,!0)},z,null,n());p.addSeparator(z);p.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){c.tryAndHandle(mxUtils.bind(this,function(){var A=new mxParallelEdgeLayout(k);A.checkOverlap=!0;c.prompt(mxResources.get("spacing"),A.spacing,mxUtils.bind(this,function(C){c.tryAndHandle(mxUtils.bind(this,function(){A.spacing=C;c.executeLayout(function(){A.execute(k.getDefaultParent(),k.isSelectionEmpty()?null:k.getSelectionCells())},!1)}))}))}))}),@@ -14293,8 +14295,8 @@ z){this.addMenuItems(p,["languageCode","-"],z);z=p.addItem(mxResources.get("disamxResources.parse("testCheckPages=Check Pages");mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");mxResources.parse("testOptimize=Remove Inline Images");mxResources.parse("testPerformance=Performance");c.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!k.isSelectionEmpty()){var p=k.cloneCells(k.getSelectionCells()),z=k.getBoundingBoxFromGeometry(p,!0);p=k.moveCells(p,-z.x,-z.y);c.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+z.width+", "+z.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(k.encodeCells(p)))+"'),")}}));c.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function p(l){return null==l||null==l.boundingBox||!isNaN(l.boundingBox.x)&&!isNaN(l.boundingBox.y)&&!isNaN(l.boundingBox.width)&&!isNaN(l.boundingBox.height)}var z=k.getGraphBounds(),A=k.view.translate,C=k.view.scale;k.insertVertex(k.getDefaultParent(),null,"",z.x/C-A.x,z.y/C-A.y,z.width/C,z.height/C,"fillColor=none;strokeColor=red;");var M=0,S=0;k.view.states.visit(function(l,x){l=!0;p(x.shape)||(console.log("invalid shape",x.cell.id,x.shape),l=!1);p(x.text)||(console.log("invalid text",x.cell.id,x.text),l=!1);l||M++;S++});console.log("states checked",S,"invalid",M)}));c.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var p=null!=c.pages&&null!=c.getCurrentFile()?c.getCurrentFile().getAnonymizedXmlForPages(c.pages):"";p=new TextareaDialog(c,-"Paste Data:",p,function(z){if(0<z.length)try{var A=function(x){function G(ba){if(null==Z[ba]){if(Z[ba]=!0,null!=R[ba]){for(;0<R[ba].length;){var ha=R[ba].pop();G(ha)}delete R[ba]}}else mxLog.debug(N+": Visited: "+ba)}var N=x.parentNode.id,P=x.childNodes;x={};for(var R={},T=null,U={},W=0;W<P.length;W++){var X=P[W];if(null!=X.id&&0<X.id.length)if(null==x[X.id]){x[X.id]=X.id;var Y=X.getAttribute("parent");null==Y?null!=T?mxLog.debug(N+": Multiple roots: "+X.id):T=X.id:(null==R[Y]&&(R[Y]=[]),R[Y].push(X.id))}else U[X.id]=-X.id}P=Object.keys(U);0<P.length?(P=N+": "+P.length+" Duplicates: "+P.join(", "),mxLog.debug(P+" (see console)")):mxLog.debug(N+": Checked");var Z={};null==T?mxLog.debug(N+": No root"):(G(T),Object.keys(Z).length!=Object.keys(x).length&&(mxLog.debug(N+": Invalid tree: (see console)"),console.log(N+": Invalid tree",R)))};"<"!=z.charAt(0)&&(z=Graph.decompress(z),mxLog.debug("See console for uncompressed XML"),console.log("xml",z));var C=mxUtils.parseXml(z),M=c.getPagesForNode(C.documentElement,"mxGraphModel");+"Paste Data:",p,function(z){if(0<z.length)try{var A=function(x){function G(ba){if(null==Z[ba]){if(Z[ba]=!0,null!=R[ba]){for(;0<R[ba].length;){var fa=R[ba].pop();G(fa)}delete R[ba]}}else mxLog.debug(N+": Visited: "+ba)}var N=x.parentNode.id,O=x.childNodes;x={};for(var R={},T=null,U={},W=0;W<O.length;W++){var X=O[W];if(null!=X.id&&0<X.id.length)if(null==x[X.id]){x[X.id]=X.id;var Y=X.getAttribute("parent");null==Y?null!=T?mxLog.debug(N+": Multiple roots: "+X.id):T=X.id:(null==R[Y]&&(R[Y]=[]),R[Y].push(X.id))}else U[X.id]=+X.id}O=Object.keys(U);0<O.length?(O=N+": "+O.length+" Duplicates: "+O.join(", "),mxLog.debug(O+" (see console)")):mxLog.debug(N+": Checked");var Z={};null==T?mxLog.debug(N+": No root"):(G(T),Object.keys(Z).length!=Object.keys(x).length&&(mxLog.debug(N+": Invalid tree: (see console)"),console.log(N+": Invalid tree",R)))};"<"!=z.charAt(0)&&(z=Graph.decompress(z),mxLog.debug("See console for uncompressed XML"),console.log("xml",z));var C=mxUtils.parseXml(z),M=c.getPagesForNode(C.documentElement,"mxGraphModel");if(null!=M&&0<M.length)try{var S=c.getHashValueForPages(M);mxLog.debug("Checksum: ",S)}catch(x){mxLog.debug("Error: ",x.message)}else mxLog.debug("No pages found for checksum");var l=C.getElementsByTagName("root");for(z=0;z<l.length;z++)A(l[z]);mxLog.show()}catch(x){c.handleError(x),null!=window.console&&console.error(x)}});c.showDialog(p.container,620,460,!0,!0);p.init()}));var L=null;c.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=c.pages){var p=new TextareaDialog(c,"Diff/Sync:","",function(z){var A=c.getCurrentFile();if(0<z.length&&null!=A)try{var C=JSON.parse(z);A.patch([C],null,!0,!0);c.hideDialog()}catch(M){c.handleError(M)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(z,A){L=c.getPagesForXml(c.getFileData(!0));p.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+c.getHashValueForPages(L)}],["Diff",function(z,A){try{p.textarea.value=JSON.stringify(c.diffPages(L,c.pages),null,2)}catch(C){c.handleError(C)}}]]);null==L?(L=c.getPagesForXml(c.getFileData(!0)),p.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+c.getHashValueForPages(L)):p.textarea.value=JSON.stringify(c.diffPages(L,c.pages),null,2);c.showDialog(p.container,620,460,!0,!0);p.init()}else c.alert("No pages")}));c.actions.addAction("testChecksum",mxUtils.bind(this,function(){var p=c.getCurrentFile();null!=c.pages&&null!=p?c.spinner.spin(document.body,mxResources.get("loading"))&&p.getLatestVersion(function(z){c.spinner.stop();@@ -14311,17 +14313,17 @@ arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date"time",Date.now()-p+" ms","args",arguments);return z});null!=B?(c.resolveCrossReferences=B,B=null):(B=c.resolveCrossReferences,c.resolveCrossReferences=function(){var p=Date.now(),z=B.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-p+" ms","args",arguments);return z});null!=v?(c.getFileData=v,v=null):(v=c.getFileData,c.getFileData=function(){var p=Date.now(),z=v.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-p+" ms","args",arguments);return z});EditorUi.debug("[Performance]",null!=F?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(p,z){this.addMenuItems(p,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),z);var A=p.addItem(mxResources.get("testPerformance"),null,function(){c.actions.get("testPerformance").funct()},z);null!=F&&p.addCheckmark(A,Editor.checkmarkImage);this.addMenuItems(p,["-","testShowConsole"],z)})))}c.actions.put("shapes",new Action(mxResources.get("moreShapes")+"...",function(p){mxClient.IS_CHROMEAPP||!c.isOffline()?c.showDialog((new MoreShapesDialog(c,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):c.showDialog((new MoreShapesDialog(c,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)}));c.actions.put("createShape",new Action(mxResources.get("shape")+"...",function(p){k.isEnabled()&&-(p=new mxCell("",new mxGeometry(0,0,120,120),c.defaultCustomShapeStyle),p.vertex=!0,p=new EditShapeDialog(c,p,mxResources.get("editShape")+":",630,400),c.showDialog(p.container,640,480,!0,!1),p.init())})).isEnabled=n;c.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){c.getPublicUrl(c.getCurrentFile(),function(p){c.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",p,function(z,A,C,M,S,l,x,G,N,P,R){c.createHtml(z,A,C,M,S,l,x,G,N,-P,R,mxUtils.bind(this,function(T,U){var W=new EmbedDialog(c,"\x3c!-- "+c.editor.appName+" diagram --\x3e\n"+T+"\n"+U+"\n",null,null,function(){var X=window.open(),Y=X.document;if(null!=Y){"CSS1Compat"===document.compatMode&&Y.writeln("<!DOCTYPE html>");Y.writeln("<html>");Y.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');Y.writeln("<body>");Y.writeln(T);var Z=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;Z&&Y.writeln(U);-Y.writeln("</body>");Y.writeln("</html>");Y.close();if(!Z){var ba=X.document.createElement("div");ba.marginLeft="26px";ba.marginTop="26px";mxUtils.write(ba,mxResources.get("updatingDocument"));Z=X.document.createElement("img");Z.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");Z.style.marginLeft="6px";ba.appendChild(Z);X.document.body.insertBefore(ba,X.document.body.firstChild);window.setTimeout(function(){var ha=document.createElement("script");-ha.type="text/javascript";ha.src=/<script.*?src="(.*?)"/.exec(U)[1];Y.body.appendChild(ha);ba.parentNode.removeChild(ba)},20)}}else c.handleError({message:mxResources.get("errorUpdatingPreview")})});c.showDialog(W.container,450,240,!0,!0);W.init()}))})})}));c.actions.put("liveImage",new Action("Live image...",function(){var p=c.getCurrentFile();null!=p&&c.getPublicUrl(p,function(z){null!=z?(z=new EmbedDialog(c,'<img src="'+(p.constructor!=DriveFile?z:"https://drive.google.com/uc?id="+p.getId())+'"/>'),-c.showDialog(z.container,450,240,!0,!0),z.init()):c.handleError({message:mxResources.get("invalidPublicUrl")})})}));c.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){c.showEmbedImageDialog(function(p,z,A,C,M,S){c.spinner.spin(document.body,mxResources.get("loading"))&&c.createEmbedImage(p,z,A,C,M,S,function(l){c.spinner.stop();l=new EmbedDialog(c,l);c.showDialog(l.container,450,240,!0,!0);l.init()},function(l){c.spinner.stop();c.handleError(l)})},mxResources.get("image"),+(p=new mxCell("",new mxGeometry(0,0,120,120),c.defaultCustomShapeStyle),p.vertex=!0,p=new EditShapeDialog(c,p,mxResources.get("editShape")+":",630,400),c.showDialog(p.container,640,480,!0,!1),p.init())})).isEnabled=n;c.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){c.getPublicUrl(c.getCurrentFile(),function(p){c.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",p,function(z,A,C,M,S,l,x,G,N,O,R,T){c.createHtml(z,A,C,M,S,l,x,G,+N,O,R,mxUtils.bind(this,function(U,W){var X=new EmbedDialog(c,"\x3c!-- "+c.editor.appName+" diagram --\x3e\n"+U+"\n"+W+"\n",null,null,function(){var Y=window.open(),Z=Y.document;if(null!=Z){"CSS1Compat"===document.compatMode&&Z.writeln("<!DOCTYPE html>");Z.writeln("<html>");Z.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');Z.writeln("<body>");Z.writeln(U);var ba=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;ba&&Z.writeln(W);+Z.writeln("</body>");Z.writeln("</html>");Z.close();if(!ba){var fa=Y.document.createElement("div");fa.marginLeft="26px";fa.marginTop="26px";mxUtils.write(fa,mxResources.get("updatingDocument"));ba=Y.document.createElement("img");ba.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");ba.style.marginLeft="6px";fa.appendChild(ba);Y.document.body.insertBefore(fa,Y.document.body.firstChild);window.setTimeout(function(){var ca=document.createElement("script");+ca.type="text/javascript";ca.src=/<script.*?src="(.*?)"/.exec(W)[1];Z.body.appendChild(ca);fa.parentNode.removeChild(fa)},20)}}else c.handleError({message:mxResources.get("errorUpdatingPreview")})});c.showDialog(X.container,450,240,!0,!0);X.init()}),T)})})}));c.actions.put("liveImage",new Action("Live image...",function(){var p=c.getCurrentFile();null!=p&&c.getPublicUrl(p,function(z){null!=z?(z=new EmbedDialog(c,'<img src="'+(p.constructor!=DriveFile?z:"https://drive.google.com/uc?id="+p.getId())++'"/>'),c.showDialog(z.container,450,240,!0,!0),z.init()):c.handleError({message:mxResources.get("invalidPublicUrl")})})}));c.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){c.showEmbedImageDialog(function(p,z,A,C,M,S){c.spinner.spin(document.body,mxResources.get("loading"))&&c.createEmbedImage(p,z,A,C,M,S,function(l){c.spinner.stop();l=new EmbedDialog(c,l);c.showDialog(l.container,450,240,!0,!0);l.init()},function(l){c.spinner.stop();c.handleError(l)})},mxResources.get("image"),mxResources.get("retina"),c.isExportToCanvas())}));c.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){c.showEmbedImageDialog(function(p,z,A,C,M,S){c.spinner.spin(document.body,mxResources.get("loading"))&&c.createEmbedSvg(p,z,A,C,M,S,function(l){c.spinner.stop();l=new EmbedDialog(c,l);c.showDialog(l.container,450,240,!0,!0);l.init()},function(l){c.spinner.stop();c.handleError(l)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")}));-c.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){c.getPublicUrl(c.getCurrentFile(),function(p){var z=k.getGraphBounds();c.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,z.height/k.view.scale))+2,null,null,null,p,c.getCurrentFile(),function(A,C,M,S,l,x,G,N,P,R){var T=[];P&&T.push("tags=%7B%7D");A=new EmbedDialog(c,'<iframe frameborder="0" style="width:'+G+";height:"+N+';" src="'+c.createLink(A,C,!0,S,l,x,"public"==R?p:null,null,T,null,+c.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){c.getPublicUrl(c.getCurrentFile(),function(p){var z=k.getGraphBounds();c.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,z.height/k.view.scale))+2,null,null,null,p,c.getCurrentFile(),function(A,C,M,S,l,x,G,N,O,R){var T=[];O&&T.push("tags=%7B%7D");A=new EmbedDialog(c,'<iframe frameborder="0" style="width:'+G+";height:"+N+';" src="'+c.createLink(A,C,!0,S,l,x,"public"==R?p:null,null,T,null,M)+'"></iframe>');c.showDialog(A.container,450,240,!0,!0);A.init()},!0)})}));c.actions.put("embedNotion",new Action(mxResources.get("notion")+"...",function(){var p=document.createElement("div");p.style.position="absolute";p.style.bottom="30px";p.style.textAlign="center";p.style.width="100%";p.style.left="0px";var z=document.createElement("a");z.setAttribute("href","javascript:void(0);");z.setAttribute("target","_blank");z.style.cursor="pointer";mxUtils.write(z,mxResources.get("getNotionChromeExtension"));p.appendChild(z);mxUtils.setPrefixedStyle(z.style,"transition","all 1s ease");mxUtils.setOpacity(z,0);window.setTimeout(function(){mxUtils.setOpacity(z,100)},300);mxEvent.addListener(z,"click",function(A){c.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");mxEvent.consume(A)});c.getPublicUrl(c.getCurrentFile(),function(A){c.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",p,A,c.getCurrentFile(),-function(C,M,S,l,x,G,N,P,R,T){N=["border=0"];R&&N.push("tags=%7B%7D");C=new EmbedDialog(c,c.createLink(C,M,!0,l,x,G,"public"==T?A:null,null,N,null,S));c.showDialog(C.container,450,240,!0,!0);C.init()})})}));c.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){c.getPublicUrl(c.getCurrentFile(),function(p){c.showPublishLinkDialog(null,null,null,null,null,null,p,c.getCurrentFile(),function(z,A,C,M,S,l,x,G,N,P){x=[];M&&N&&x.push("tags=%7B%7D");z=new EmbedDialog(c,c.createLink(z,-A,!0,M,S,l,"public"==P?p:null,null,x,null,C));c.showDialog(z.container,450,240,!0,!0);z.init()})})}));c.actions.addAction("microsoftOffice...",function(){c.openLink("https://office.draw.io")});c.actions.addAction("googleDocs...",function(){c.openLink("http://docsaddon.draw.io")});c.actions.addAction("googleSlides...",function(){c.openLink("https://slidesaddon.draw.io")});c.actions.addAction("googleSheets...",function(){c.openLink("https://sheetsaddon.draw.io")});c.actions.addAction("googleSites...",+function(C,M,S,l,x,G,N,O,R,T){N=["border=0"];R&&N.push("tags=%7B%7D");C=new EmbedDialog(c,c.createLink(C,M,!0,l,x,G,"public"==T?A:null,null,N,null,S));c.showDialog(C.container,450,240,!0,!0);C.init()})})}));c.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){c.getPublicUrl(c.getCurrentFile(),function(p){c.showPublishLinkDialog(null,null,null,null,null,null,p,c.getCurrentFile(),function(z,A,C,M,S,l,x,G,N,O){x=[];M&&N&&x.push("tags=%7B%7D");z=new EmbedDialog(c,c.createLink(z,+A,!0,M,S,l,"public"==O?p:null,null,x,null,C));c.showDialog(z.container,450,240,!0,!0);z.init()})})}));c.actions.addAction("microsoftOffice...",function(){c.openLink("https://office.draw.io")});c.actions.addAction("googleDocs...",function(){c.openLink("http://docsaddon.draw.io")});c.actions.addAction("googleSlides...",function(){c.openLink("https://slidesaddon.draw.io")});c.actions.addAction("googleSheets...",function(){c.openLink("https://sheetsaddon.draw.io")});c.actions.addAction("googleSites...",function(){c.getPublicUrl(c.getCurrentFile(),function(p){p=new GoogleSitesDialog(c,p);c.showDialog(p.container,420,256,!0,!0);p.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)q=c.actions.addAction("scratchpad",function(){c.toggleScratchpad()}),q.setToggleAction(!0),q.setSelectedCallback(function(){return null!=c.scratchpad}),"0"!=urlParams.plugins&&c.actions.addAction("plugins...",function(){c.showDialog((new PluginsDialog(c)).container,380,240,!0,!1)});window.matchMedia&&null!=document.getElementById("high-contrast-stylesheet")&&(q=c.actions.addAction("highContrast",function(){c.setAndPersistHighContrast(!c.isHighContrast())}),q.setToggleAction(!0),q.setSelectedCallback(function(){return c.isHighContrast()}));q=c.actions.addAction("search",function(){if(null!=c.sidebar){var p=c.sidebar.isEntryVisible("search");c.sidebar.showPalette("search",!p);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!p,mxSettings.save())}});q.label=mxResources.get("searchShapes");q.setToggleAction(!0);q.setSelectedCallback(function(){return null!=c.sidebar&&c.sidebar.isEntryVisible("search")});c.actions.get("clearDefaultStyle").funct=function(p){k.isEnabled()&&(c.clearDefaultStyle(),Editor.sketchMode&&c.setSketchMode(!1))};"1"==urlParams.embed&&(c.actions.get("saveAs").setEnabled(!1),c.actions.get("save").funct=function(p){k.isEditing()&&k.stopEditing();var z="0"!=urlParams.pages||null!=c.pages&&1<c.pages.length?c.getFileData(!0):mxUtils.getXml(c.editor.getGraphXml());if("json"==urlParams.proto){var A=c.createLoadMessage("save");A.xml=z;!0!==@@ -14330,8 +14332,8 @@ p||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||(A.exit=!0);z=JSON.sp()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",new Menu(mxUtils.bind(this,function(p,z){c.isExportToCanvas()?(this.addMenuItems(p,["exportPng"],z),c.jpgSupported&&this.addMenuItems(p,["exportJpg"],z),c.webpSupported&&this.addMenuItems(p,["exportWebp"],z)):c.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(p,["exportPng","exportJpg"],z);this.addMenuItems(p,["exportSvg","-"],z);c.isOffline()||c.printPdfExport?this.addMenuItems(p,["exportPdf"],z):c.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(p,["exportPdf"],z);mxClient.IS_IE||"undefined"===typeof VsdxExport&&c.isOffline()||this.addMenuItems(p,["exportVsdx"],z);this.addMenuItems(p,["-","exportHtml","exportXml","exportUrl"],z);c.isOffline()||(p.addSeparator(z),this.addMenuItem(p,"export",z).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"min"!=Editor.currentTheme||this.addMenuItems(p,["publishLink"],z);c.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||(p.addSeparator(z),c.menus.addSubmenu("embed",p,z))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(p,z){function A(S){S.pickFile(function(l){c.spinner.spin(document.body,mxResources.get("loading"))&&S.getFile(l,function(x){var G="data:image/"==x.getData().substring(0,11)?M(x.getTitle()):"text/xml";/\.svg$/i.test(x.getTitle())&&!c.editor.isDataSvg(x.getData())&&-(x.setData(Editor.createSvgDataUri(x.getData())),G="image/svg+xml");C(x.getData(),G,x.getTitle())},function(x){c.handleError(x,null!=x?mxResources.get("errorLoadingFile"):null)},S==c.drive)},!0)}var C=mxUtils.bind(this,function(S,l,x){var G=k.view,N=k.getGraphBounds(),P=k.snap(Math.ceil(Math.max(0,N.x/G.scale-G.translate.x)+4*k.gridSize)),R=k.snap(Math.ceil(Math.max(0,(N.y+N.height)/G.scale-G.translate.y)+4*k.gridSize));"data:image/"==S.substring(0,11)?c.loadImage(S,mxUtils.bind(this,function(T){var U=-!0,W=mxUtils.bind(this,function(){c.resizeImage(T,S,mxUtils.bind(this,function(X,Y,Z){X=U?Math.min(1,Math.min(c.maxImageSize/Y,c.maxImageSize/Z)):1;c.importFile(S,l,P,R,Math.round(Y*X),Math.round(Z*X),x,function(ba){c.spinner.stop();k.setSelectionCells(ba);k.scrollCellToVisible(k.getSelectionCell())})}),U)});S.length>c.resampleThreshold?c.confirmImageResize(function(X){U=X;W()}):W()}),mxUtils.bind(this,function(){c.handleError({message:mxResources.get("cannotOpenFile")})})):c.importFile(S,l,P,R,0,+(x.setData(Editor.createSvgDataUri(x.getData())),G="image/svg+xml");C(x.getData(),G,x.getTitle())},function(x){c.handleError(x,null!=x?mxResources.get("errorLoadingFile"):null)},S==c.drive)},!0)}var C=mxUtils.bind(this,function(S,l,x){var G=k.view,N=k.getGraphBounds(),O=k.snap(Math.ceil(Math.max(0,N.x/G.scale-G.translate.x)+4*k.gridSize)),R=k.snap(Math.ceil(Math.max(0,(N.y+N.height)/G.scale-G.translate.y)+4*k.gridSize));"data:image/"==S.substring(0,11)?c.loadImage(S,mxUtils.bind(this,function(T){var U=+!0,W=mxUtils.bind(this,function(){c.resizeImage(T,S,mxUtils.bind(this,function(X,Y,Z){X=U?Math.min(1,Math.min(c.maxImageSize/Y,c.maxImageSize/Z)):1;c.importFile(S,l,O,R,Math.round(Y*X),Math.round(Z*X),x,function(ba){c.spinner.stop();k.setSelectionCells(ba);k.scrollCellToVisible(k.getSelectionCell())})}),U)});S.length>c.resampleThreshold?c.confirmImageResize(function(X){U=X;W()}):W()}),mxUtils.bind(this,function(){c.handleError({message:mxResources.get("cannotOpenFile")})})):c.importFile(S,l,O,R,0,0,x,function(T){c.spinner.stop();k.setSelectionCells(T);k.scrollCellToVisible(k.getSelectionCell())})}),M=mxUtils.bind(this,function(S){var l="text/xml";/\.png$/i.test(S)?l="image/png":/\.jpe?g$/i.test(S)?l="image/jpg":/\.gif$/i.test(S)?l="image/gif":/\.pdf$/i.test(S)&&(l="application/pdf");return l});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=c.drive?p.addItem(mxResources.get("googleDrive")+"...",null,function(){A(c.drive)},z):c.isModeEnabled(App.MODE_GOOGLE)&&p.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},z,null,!1));c.isModeReady(App.MODE_ONEDRIVE)?p.addItem(mxResources.get("oneDrive")+"...",null,function(){A(c.oneDrive)},z):c.isModeEnabled(App.MODE_ONEDRIVE)&&p.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},z,null,!1);c.isModeReady(App.MODE_DROPBOX)?p.addItem(mxResources.get("dropbox")+"...",null,function(){A(c.dropbox)},z):c.isModeEnabled(App.MODE_DROPBOX)&&p.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},z,null,!1);p.addSeparator(z);c.isModeReady(App.MODE_GITHUB)&&p.addItem(mxResources.get("github")+"...",null,function(){A(c.gitHub)},z);c.isModeReady(App.MODE_GITLAB)&&p.addItem(mxResources.get("gitlab")+"...",null,function(){A(c.gitLab)},z);c.isModeReady(App.MODE_TRELLO)?p.addItem(mxResources.get("trello")+"...",null,function(){A(c.trello)},z):c.isModeEnabled(App.MODE_TRELLO)&&p.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+@@ -14350,11 +14352,11 @@ mxUtils.bind(this,function(){var p=c.getCurrentFile();if(p.getMode()==App.MODE_Gnew Menu(mxUtils.bind(this,function(p,z){this.addMenuItems(p,["publishLink"],z)})));c.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){c.openLink("https://app.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var p=c.getCurrentFile();null!=p&&p.share()}catch(z){c.handleError(z)}})).isEnabled=n;this.put("embed",new Menu(mxUtils.bind(this,function(p,z){var A=c.getCurrentFile();null==A||A.getMode()!=App.MODE_GOOGLE&&A.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(A.getTitle())||this.addMenuItems(p,["liveImage","-"],z);this.addMenuItems(p,["embedImage","embedSvg","-","embedHtml"],z);navigator.standalone||c.isOffline()||this.addMenuItems(p,["embedIframe"],z);"1"==urlParams.embed||c.isOffline()||this.addMenuItems(p,"- googleDocs googleSlides googleSheets - microsoftOffice - embedNotion".split(" "),z)})));c.addInsertItem=function(p,z,A,C){("plantUml"!=C||EditorUi.enablePlantUml&&!c.isOffline())&&p.addItem(A,null,mxUtils.bind(this,function(){if("fromText"==C||"formatSql"==C||"plantUml"==C||"mermaid"==C){var M=new ParseDialog(c,A,C);c.showDialog(M.container,620,420,!0,!1);c.dialog.container.style.overflow="auto"}else M=new CreateGraphDialog(c,A,C),c.showDialog(M.container,620,420,!0,!1,function(S,l){if(l)return c.confirm(mxResources.get("areYouSure"),function(){c.hideDialog()}),!1;null!=M.graph&&(null!=M.graph.container.parentNode&&M.graph.container.parentNode.removeChild(M.graph.container),M.graph.destroy(),M.graph=null)});-M.init()}),z,null,n())};var I=function(p){k.getModel().beginUpdate();try{p=k.addCell(p),k.fireEvent(new mxEventObject("cellsInserted","cells",[p])),k.model.isVertex(p)&&k.isAutoSizeCell(p)&&k.updateCellSize(p)}finally{k.getModel().endUpdate()}k.scrollCellToVisible(p);k.setSelectionCell(p);k.container.focus();k.editAfterInsert&&k.startEditing(p);window.setTimeout(function(){null!=c.hoverIcons&&c.hoverIcons.update(k.view.getState(p))},0);return p},K=function(p,z,A,C,M){p=new mxCell(p,new mxGeometry(0,-0,z,A),C);p.vertex=!0;null==M&&(M=k.getCenterInsertPoint(k.getBoundingBoxFromGeometry([p],!0)));p.geometry.x=M.x;p.geometry.y=M.y;return I(p)};c.actions.put("insertText",new Action(mxResources.get("text"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&k.startEditingAtCell(K("Text",60,30,k.appendFontSize("text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;",k.vertexFontSize),null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||-!k.isMouseInsertPoint()?null:k.getInsertPoint()))},null,null,"A")).isEnabled=n;c.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&K("",120,60,"whiteSpace=wrap;html=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!k.isMouseInsertPoint()?null:k.getInsertPoint())},null,null,"D")).isEnabled=n;c.actions.put("insertNote",new Action(mxResources.get("note"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&-K("",140,160,"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!k.isMouseInsertPoint()?null:k.getInsertPoint())},null,null,"S")).isEnabled=n;c.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&-K("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!k.isMouseInsertPoint()?null:k.getInsertPoint())},null,null,"F")).isEnabled=n;c.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&K("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!k.isMouseInsertPoint()?null:k.getInsertPoint())},null,null,"R")).isEnabled=n;c.actions.put("insertEdge",+M.init()}),z,null,n())};var I=function(p){k.getModel().beginUpdate();try{p=k.addCell(p),k.fireEvent(new mxEventObject("cellsInserted","cells",[p])),k.model.isVertex(p)&&k.isAutoSizeCell(p)&&k.updateCellSize(p)}finally{k.getModel().endUpdate()}k.scrollCellToVisible(p);k.setSelectionCell(p);k.container.focus();k.editAfterInsert&&k.startEditing(p);window.setTimeout(function(){null!=c.hoverIcons&&c.hoverIcons.update(k.view.getState(p))},0);return p},J=function(p,z,A,C,M){p=new mxCell(p,new mxGeometry(0,+0,z,A),C);p.vertex=!0;null==M&&(M=k.getCenterInsertPoint(k.getBoundingBoxFromGeometry([p],!0)));p.geometry.x=M.x;p.geometry.y=M.y;return I(p)};c.actions.put("insertText",new Action(mxResources.get("text"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&k.startEditingAtCell(J("Text",60,30,k.appendFontSize("text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;",k.vertexFontSize),null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||+!k.isMouseInsertPoint()?null:k.getInsertPoint()))},null,null,"A")).isEnabled=n;c.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&J("",120,60,"whiteSpace=wrap;html=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!k.isMouseInsertPoint()?null:k.getInsertPoint())},null,null,"D")).isEnabled=n;c.actions.put("insertNote",new Action(mxResources.get("note"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&+J("",140,160,"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!k.isMouseInsertPoint()?null:k.getInsertPoint())},null,null,"S")).isEnabled=n;c.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&+J("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!k.isMouseInsertPoint()?null:k.getInsertPoint())},null,null,"F")).isEnabled=n;c.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(p){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&J("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!k.isMouseInsertPoint()?null:k.getInsertPoint())},null,null,"R")).isEnabled=n;c.actions.put("insertEdge",new Action(mxResources.get("line"),function(p){if(k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())){var z=k.defaultEdgeLength;p=null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!k.isMouseInsertPoint()?null:k.getInsertPoint();null==p&&(p=k.getCenterInsertPoint(k.getBoundingBoxFromGeometry([A],!0)));var A=new mxCell("",new mxGeometry(0,0,z,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");A.geometry.setTerminalPoint(p,!0);A.geometry.setTerminalPoint(new mxPoint(p.x+A.geometry.width,p.y),!1);A.geometry.points=[];A.geometry.relative=!0;A.edge=!0;I(A)}},null,null,"C")).isEnabled=n;q=c.actions.put("toggleShapes",new Action(mxResources.get("shapes"),function(){null!=c.sidebarWindow?c.sidebarWindow.window.setVisible(!c.sidebarWindow.window.isVisible()):c.toggleShapesPanel(!c.isShapesPanelVisible())},null,null,Editor.ctrlKey+"+Shift+K"));q.setToggleAction(!0);q.setSelectedCallback(mxUtils.bind(this,function(){return null!=c.sidebarWindow&&c.sidebarWindow.window.isVisible()||null==c.sidebarWindow&&0<c.hsplitPosition}));c.addInsertMenuItems=mxUtils.bind(this,function(p,z,A){for(var C=0;C<A.length;C++)"-"==A[C]?p.addSeparator(z):c.addInsertItem(p,z,mxResources.get(A[C])+"...",A[C])});this.put("insert",new Menu(mxUtils.bind(this,function(p,z){"sketch"==Editor.currentTheme?(c.menus.addMenuItems(p,["toggleShapes"],z),c.menus.addSubmenu("table",p,z),p.addSeparator(z),c.insertTemplateEnabled&&!c.isOffline()&&c.menus.addMenuItems(p,["insertTemplate"],z),c.menus.addMenuItems(p,["insertImage",@@ -14384,10 +14386,10 @@ mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&c.menus.addLinkToItem(C,"https:/z);"1"!=urlParams.sketch&&this.addMenuItems(p,["-","fullscreen"],z)}})));this.put("editCell",new Menu(mxUtils.bind(this,function(p,z){this.addMenuItems(p,"editLink editShape editImage crop - editData copyData pasteData - editConnectionPoints editGeometry - editTooltip editStyle - edit".split(" "),z)})));this.put("currentPage",new Menu(mxUtils.bind(this,function(p,z){var A=c.currentPage;null!=A&&(p.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){c.renamePage(A,A.getName())}),z),p.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){c.removePage(A)}),z),1<c.pages.length&&(c.menus.addSubmenu("movePage",p,z,mxResources.get("move")),p.addSeparator(z)),p.addSeparator(z),p.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){c.duplicatePage(A,mxResources.get("copyOf",[A.getName()]))}),z),1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=c.getServiceName()||p.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){c.editor.editAsNew(c.getFileData(!0,null,null,null,!0,!0))}),z)))})));this.put("pages",new Menu(mxUtils.bind(this,function(p,z){var A=c.currentPage;c.editor.graph.isLightboxView()||(p.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){try{c.insertPage()}catch(M){c.handleError(M)}}),z,null,c.editor.graph.isEnabled()),p.addSeparator(z));if(null!=c.pages)for(var C=0;C<c.pages.length;C++)mxUtils.bind(this,function(M){var S=null;S=c.pages[M]!=A||c.editor.graph.isLightboxView()?-p.addItem(c.getShortPageName(c.pages[M]),null,mxUtils.bind(this,function(){c.selectPage(c.pages[M])}),z):c.menus.addSubmenu("currentPage",p,z,c.getShortPageName(A));var l=c.pages[M].getId();S.setAttribute("title",c.pages[M].getName()+" ("+(M+1)+"/"+c.pages.length+")"+(null!=l?" ["+l+"]":""));c.pages[M]==A&&p.addCheckmark(S,Editor.checkmarkImage)})(C)})));if(EditorUi.isElectronApp){var J="1"==urlParams.enableSpellCheck;q=c.actions.addAction("spellCheck",function(){c.toggleSpellCheck();J=!J;c.alert(mxResources.get("restartForChangeRequired"))});-q.setToggleAction(!0);q.setSelectedCallback(function(){return J});var V="1"==urlParams.enableStoreBkp;q=c.actions.addAction("autoBkp",function(){c.toggleStoreBkp();V=!V});q.setToggleAction(!0);q.setSelectedCallback(function(){return V});var Q="1"==urlParams.isGoogleFontsEnabled;q=c.actions.addAction("googleFonts",function(){c.toggleGoogleFonts();Q=!Q;c.alert(mxResources.get("restartForChangeRequired"))});q.setToggleAction(!0);q.setSelectedCallback(function(){return Q});c.actions.addAction("openDevTools",-function(){c.openDevTools()});c.actions.addAction("drafts...",function(){var p=new FilenameDialog(c,EditorUi.draftSaveDelay/1E3+"",mxResources.get("apply"),mxUtils.bind(this,function(z){z=parseInt(z);0<=z&&(EditorUi.draftSaveDelay=1E3*z,EditorUi.enableDrafts=0<z,mxSettings.setDraftSaveDelay(z),mxSettings.save())}),mxResources.get("draftSaveInt"));c.showDialog(p.container,320,80,!0,!0);p.init()})}var O=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(p,z){if("simple"==Editor.currentTheme||-"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||c.mode==App.MODE_ATLAS||"1"==urlParams.embedInline||!Editor.isDarkMode()&&(mxClient.IS_IE||mxClient.IS_IE11)||c.menus.addSubmenu("appearance",p,z);"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&c.mode!=App.MODE_ATLAS&&c.menus.addSubmenu("theme",p,z);p.addSeparator(z);null==O||"1"==urlParams.embed&&null!=urlParams.lang||c.menus.addSubmenu("language",p,z);c.menus.addSubmenu("units",+p.addItem(c.getShortPageName(c.pages[M]),null,mxUtils.bind(this,function(){c.selectPage(c.pages[M])}),z):c.menus.addSubmenu("currentPage",p,z,c.getShortPageName(A));var l=c.pages[M].getId();S.setAttribute("title",c.pages[M].getName()+" ("+(M+1)+"/"+c.pages.length+")"+(null!=l?" ["+l+"]":""));c.pages[M]==A&&p.addCheckmark(S,Editor.checkmarkImage)})(C)})));if(EditorUi.isElectronApp){var K="1"==urlParams.enableSpellCheck;q=c.actions.addAction("spellCheck",function(){c.toggleSpellCheck();K=!K;c.alert(mxResources.get("restartForChangeRequired"))});+q.setToggleAction(!0);q.setSelectedCallback(function(){return K});var V="1"==urlParams.enableStoreBkp;q=c.actions.addAction("autoBkp",function(){c.toggleStoreBkp();V=!V});q.setToggleAction(!0);q.setSelectedCallback(function(){return V});var Q="1"==urlParams.isGoogleFontsEnabled;q=c.actions.addAction("googleFonts",function(){c.toggleGoogleFonts();Q=!Q;c.alert(mxResources.get("restartForChangeRequired"))});q.setToggleAction(!0);q.setSelectedCallback(function(){return Q});c.actions.addAction("openDevTools",+function(){c.openDevTools()});c.actions.addAction("drafts...",function(){var p=new FilenameDialog(c,EditorUi.draftSaveDelay/1E3+"",mxResources.get("apply"),mxUtils.bind(this,function(z){z=parseInt(z);0<=z&&(EditorUi.draftSaveDelay=1E3*z,EditorUi.enableDrafts=0<z,mxSettings.setDraftSaveDelay(z),mxSettings.save())}),mxResources.get("draftSaveInt"));c.showDialog(p.container,320,80,!0,!0);p.init()})}var P=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(p,z){if("simple"==Editor.currentTheme||+"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||c.mode==App.MODE_ATLAS||"1"==urlParams.embedInline||!Editor.isDarkMode()&&(mxClient.IS_IE||mxClient.IS_IE11)||c.menus.addSubmenu("appearance",p,z);"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&c.mode!=App.MODE_ATLAS&&c.menus.addSubmenu("theme",p,z);p.addSeparator(z);null==P||"1"==urlParams.embed&&null!=urlParams.lang||c.menus.addSubmenu("language",p,z);c.menus.addSubmenu("units",p,z);c.menus.addMenuItems(p,"- copyConnect collapseExpand - tooltips animations -".split(" "),z);var A=c.getCurrentFile();"simple"!=Editor.currentTheme&&(null!=A&&A.isRealtimeEnabled()&&A.isRealtimeSupported()&&this.addMenuItems(p,["showRemoteCursors"],z),c.menus.addMenuItems(p,["ruler","-"],z));EditorUi.isElectronApp&&c.menus.addMenuItems(p,"- googleFonts spellCheck autoBkp drafts -".split(" "),z);this.addSubmenu("diagramLanguage",p,z);p.addSeparator(z);c.mode!=App.MODE_ATLAS&&c.menus.addMenuItem(p,"configuration",z);p.addSeparator(z)}else"1"==urlParams.embed&&null!=urlParams.lang||this.addSubmenu("language",p,z),"1"==urlParams.embed&&"1"!=urlParams.atlas||"atlas"==Editor.currentTheme||!Editor.isDarkMode()&&(mxClient.IS_IE||mxClient.IS_IE11)||c.menus.addSubmenu("appearance",p,z),"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&c.mode!=App.MODE_ATLAS&&this.addSubmenu("theme",p,z),p.addSeparator(z),A=this.addSubmenu("adaptiveColors",p,z),(!c.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&c.menus.addLinkToItem(A,"https://github.com/jgraph/drawio/discussions/4713"),"undefined"!==typeof MathJax&&(A=this.addMenuItem(p,"mathematicalTypesetting",z),(!c.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(A,"https://www.drawio.com/doc/faq/math-typesetting")),EditorUi.isElectronApp&&this.addMenuItems(p,["googleFonts","spellCheck","autoBkp","drafts","-"],z),this.addMenuItems(p,["copyConnect","collapseExpand","-"],z),"1"!=urlParams.embed&&(A=c.getCurrentFile(),null!=@@ -14409,14 +14411,14 @@ OneDriveFile||c.menus.addMenuItems(p,["share"],z));p.addSeparator(z);null!=A&&A.z):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==A||A.constructor==LocalFile&&null==A.fileHandle||(p.addSeparator(z),C=this.addMenuItem(p,"synchronize",z),(!c.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(C,"https://www.drawio.com/doc/faq/synchronize")),this.addMenuItems(p,["-","save","saveAs","-"],z),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=c.getServiceName()||c.isOfflineApp()||null==A||this.addMenuItems(p,["share","-"],z),null!=A&&A.isRenamable()&&this.addMenuItems(p,["rename"],z),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&this.addMenuItems(p,["upload"],z):(this.addMenuItems(p,["makeCopy"],z),null!=A&&(A.constructor==OneDriveFile&&this.addMenuItems(p,["moveToFolder"],z),null!=A.getFolderUrl()&&c.menus.addMenuItems(p,["openFolder"],z)))),p.addSeparator(z),this.addSubmenu("importFrom",p,z),this.addSubmenu("exportAs",p,z),p.addSeparator(z),this.addSubmenu("embed",p,z),this.addSubmenu("publish",p,z),p.addSeparator(z),this.addSubmenu("newLibrary",p,z),this.addSubmenu("openLibraryFrom",p,z),c.isRevisionHistorySupported()&&this.addMenuItems(p,["-","revisionHistory"],z),null!=A&&null!=c.fileNode&&"1"!=urlParams.embedInline&&(C=null!=A.getTitle()?A.getTitle():c.defaultFilename,(A.constructor==DriveFile&&null!=A.sync&&A.sync.isConnected()||!/(\.html)$/i.test(C))&&this.addMenuItems(p,["-","properties"])),this.addMenuItems(p,["-","pageSetup"],z),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(p,["print"],z),-this.addMenuItems(p,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(p,z){function A(P){var R=encodeURIComponent(P.name)+(null==P.url?"":"@"+encodeURIComponent(P.url));if(!M[R]){for(var T=P.name,U=0;null!=G[T.toLowerCase()];)T=P.name+" ("+ ++U+")";null==x[R]&&(N.push({name:P.name,url:P.url,label:T,title:P.url}),G[T.toLowerCase()]=P,x[R]=P)}}for(var C=mxUtils.bind(this,function(P,R,T,U,W){var X=c.editor.graph,Y=this.styleChange(p,null!=U?U:P,[mxConstants.STYLE_FONTFAMILY,-"fontSource","FType"],[P,null!=R?encodeURIComponent(R):null,null],null,z,function(){X.setFont(P,R);c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[P,null!=R?encodeURIComponent(R):null,null],"cells",[X.cellEditor.getEditingCell()]))},function(){X.updateLabelElements(X.getSelectionCells(),function(Z){Z.removeAttribute("face");Z.style.fontFamily=null;"PRE"==Z.nodeName&&X.replaceElement(Z,"div")})});T&&(T=document.createElement("img"),-T.className="geAdaptiveAsset",T.setAttribute("src",Editor.crossImage),T.setAttribute("title",mxResources.get("delete")),T.setAttribute("valign","absmiddle"),T.setAttribute("border","0"),T.style.position="relative",T.style.top="2px",T.style.width="14px",T.style.cursor="default",T.style.margin="0 3px",Y.firstChild.nextSibling.nextSibling.appendChild(T),mxEvent.addListener(T,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Z){this.removeCustomFont(P,R);this.editorUi.hideCurrentMenu();-mxEvent.consume(Z)})));Graph.addFont(P,R);Y.firstChild.nextSibling.style.fontFamily=P;W=null!=U?U:P;null!=R&&(W+=" ("+R+")");Y.setAttribute("title",W)}),M={},S=0;S<this.defaultFonts.length;S++){var l=this.defaultFonts[S];"string"===typeof l?C(l):null!=l.fontFamily&&null!=l.fontUrl&&(M[encodeURIComponent(l.fontFamily)+"@"+encodeURIComponent(l.fontUrl)]=!0,C(l.fontFamily,l.fontUrl))}p.addSeparator(z);var x={},G={},N=[];for(S=0;S<this.customFonts.length;S++)A(this.customFonts[S]);N.sort(function(P,R){return P.label<-R.label?-1:P.label>R.label?1:0});if(0<N.length){for(S=0;S<N.length;S++)C(N[S].name,N[S].url,!0,N[S].label);p.addSeparator(z)}p.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[];c.fireEvent(new mxEventObject("customFontsChanged"))}),z);p.addSeparator(z);p.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var P=this.editorUi.editor.graph,R=P.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],T="s",U=null;if(P.isEditing()){var W=-P.getSelectedEditingElement();if(null!=W){var X=mxUtils.getCurrentStyle(W);if(null!=X){R=mxUtils.getCssFontFamily(X.fontFamily);X=P.getView().getState(P.cellEditor.getEditingCell());U=null!=X?X.style.fontSource:null;for(null!=U&&(U=decodeURIComponent(U));null!=W&&W!=P.cellEditor.textarea;){if(W.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=W.getAttribute("data-font-src")){U=W.getAttribute("data-font-src");break}else if(W.getAttribute("face")==R){U=null;break}W=W.parentNode}null!=U&&(Graph.isGoogleFontUrl(U)?-(U=null,T="g"):T="w")}}}else X=P.getView().getState(P.getSelectionCell()),null!=X&&(R=X.style[mxConstants.STYLE_FONTFAMILY]||R,W=X.style.fontSource,null!=W&&(W=decodeURIComponent(W),Graph.isGoogleFontUrl(W)?T="g":(T="w",U=W)));null!=U&&U.substring(0,PROXY_URL.length)==PROXY_URL&&(U=decodeURIComponent(U.substr((PROXY_URL+"?url=").length)));var Y=null;document.activeElement==P.cellEditor.textarea&&(Y=P.cellEditor.saveSelection());R=new FontDialog(this.editorUi,R,U,T,mxUtils.bind(this,function(Z,ba,-ha){null!=Y&&(P.cellEditor.restoreSelection(Y),Y=null);if(null!=Z&&0<Z.length)if(this.addCustomFont(Z,ba),P.isEditing())P.setFont(Z,ba);else{P.getModel().beginUpdate();try{P.stopEditing(!1),P.setCellStyles(mxConstants.STYLE_FONTFAMILY,Z),P.setCellStyles("fontSource",null!=ba?encodeURIComponent(ba):null),P.setCellStyles("FType",null)}finally{P.getModel().endUpdate()}}}));this.editorUi.showDialog(R.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);R.init()}),+this.addMenuItems(p,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(p,z){function A(O){var R=encodeURIComponent(O.name)+(null==O.url?"":"@"+encodeURIComponent(O.url));if(!M[R]){for(var T=O.name,U=0;null!=G[T.toLowerCase()];)T=O.name+" ("+ ++U+")";null==x[R]&&(N.push({name:O.name,url:O.url,label:T,title:O.url}),G[T.toLowerCase()]=O,x[R]=O)}}for(var C=mxUtils.bind(this,function(O,R,T,U,W){var X=c.editor.graph,Y=this.styleChange(p,null!=U?U:O,[mxConstants.STYLE_FONTFAMILY,+"fontSource","FType"],[O,null!=R?encodeURIComponent(R):null,null],null,z,function(){X.setFont(O,R);c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[O,null!=R?encodeURIComponent(R):null,null],"cells",[X.cellEditor.getEditingCell()]))},function(){X.updateLabelElements(X.getSelectionCells(),function(Z){Z.removeAttribute("face");Z.style.fontFamily=null;"PRE"==Z.nodeName&&X.replaceElement(Z,"div")})});T&&(T=document.createElement("img"),+T.className="geAdaptiveAsset",T.setAttribute("src",Editor.crossImage),T.setAttribute("title",mxResources.get("delete")),T.setAttribute("valign","absmiddle"),T.setAttribute("border","0"),T.style.position="relative",T.style.top="2px",T.style.width="14px",T.style.cursor="default",T.style.margin="0 3px",Y.firstChild.nextSibling.nextSibling.appendChild(T),mxEvent.addListener(T,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Z){this.removeCustomFont(O,R);this.editorUi.hideCurrentMenu();+mxEvent.consume(Z)})));Graph.addFont(O,R);Y.firstChild.nextSibling.style.fontFamily=O;W=null!=U?U:O;null!=R&&(W+=" ("+R+")");Y.setAttribute("title",W)}),M={},S=0;S<this.defaultFonts.length;S++){var l=this.defaultFonts[S];"string"===typeof l?C(l):null!=l.fontFamily&&null!=l.fontUrl&&(M[encodeURIComponent(l.fontFamily)+"@"+encodeURIComponent(l.fontUrl)]=!0,C(l.fontFamily,l.fontUrl))}p.addSeparator(z);var x={},G={},N=[];for(S=0;S<this.customFonts.length;S++)A(this.customFonts[S]);N.sort(function(O,R){return O.label<+R.label?-1:O.label>R.label?1:0});if(0<N.length){for(S=0;S<N.length;S++)C(N[S].name,N[S].url,!0,N[S].label);p.addSeparator(z)}p.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[];c.fireEvent(new mxEventObject("customFontsChanged"))}),z);p.addSeparator(z);p.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var O=this.editorUi.editor.graph,R=O.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],T="s",U=null;if(O.isEditing()){var W=+O.getSelectedEditingElement();if(null!=W){var X=mxUtils.getCurrentStyle(W);if(null!=X){R=mxUtils.getCssFontFamily(X.fontFamily);X=O.getView().getState(O.cellEditor.getEditingCell());U=null!=X?X.style.fontSource:null;for(null!=U&&(U=decodeURIComponent(U));null!=W&&W!=O.cellEditor.textarea;){if(W.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=W.getAttribute("data-font-src")){U=W.getAttribute("data-font-src");break}else if(W.getAttribute("face")==R){U=null;break}W=W.parentNode}null!=U&&(Graph.isGoogleFontUrl(U)?+(U=null,T="g"):T="w")}}}else X=O.getView().getState(O.getSelectionCell()),null!=X&&(R=X.style[mxConstants.STYLE_FONTFAMILY]||R,W=X.style.fontSource,null!=W&&(W=decodeURIComponent(W),Graph.isGoogleFontUrl(W)?T="g":(T="w",U=W)));null!=U&&U.substring(0,PROXY_URL.length)==PROXY_URL&&(U=decodeURIComponent(U.substr((PROXY_URL+"?url=").length)));var Y=null;document.activeElement==O.cellEditor.textarea&&(Y=O.cellEditor.saveSelection());R=new FontDialog(this.editorUi,R,U,T,mxUtils.bind(this,function(Z,ba,+fa){null!=Y&&(O.cellEditor.restoreSelection(Y),Y=null);if(null!=Z&&0<Z.length)if(this.addCustomFont(Z,ba),O.isEditing())O.setFont(Z,ba);else{O.getModel().beginUpdate();try{O.stopEditing(!1),O.setCellStyles(mxConstants.STYLE_FONTFAMILY,Z),O.setCellStyles("fontSource",null!=ba?encodeURIComponent(ba):null),O.setCellStyles("FType",null)}finally{O.getModel().endUpdate()}}}));this.editorUi.showDialog(R.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);R.init()}),z,null,!0)})))}})();function DiagramPage(b,e){this.node=b;null!=e?this.node.setAttribute("id",e):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,e,f){this.ui=b;this.page=e;this.previous=this.name=f}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(b,e,f){this.ui=b;this.oldIndex=e;this.newIndex=f}@@ -14493,29 +14495,29 @@ k.nextSibling,k.parentNode.removeChild(k),k=c;null!=k;){c=k.nextSibling;if(k.nodfunction(H){return this.isTreeEdge(H)}))};Graph.prototype.getIncomingTreeEdges=function(c,k){return this.getTreeEdges(c,k,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(c,k){return this.getTreeEdges(c,k,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function c(C){return m.isVertex(C)&&n(C)}function k(C){var M=!1;null!=C&&(M="1"==g.getCurrentCellStyle(C).treeMoving);return M}function n(C){var M=!1;null!=C&&(C=m.getParent(C),M=g.view.getState(C),M="tree"==(null!=M?M.style:g.getCellStyle(C)).containerType);return M}function q(C){var M=!1;null!=C&&(C=m.getParent(C),M=g.view.getState(C),g.view.getState(C),M=null!=(null!=M?M.style:g.getCellStyle(C)).childLayout);return M}function u(C){C=g.view.getState(C);if(null!=C){var M=g.getIncomingTreeEdges(C.cell);if(0<M.length&&(M=g.view.getState(M[0]),null!=M&&(M=M.absolutePoints,null!=M&&0<M.length&&(M=M[M.length-1],null!=M)))){if(M.y==C.y&&Math.abs(M.x-C.getCenterX())<C.width/2)return mxConstants.DIRECTION_SOUTH;if(M.y==C.y+C.height&&Math.abs(M.x-C.getCenterX())<C.width/2)return mxConstants.DIRECTION_NORTH;if(M.x>C.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function E(C,M){M=null!=M?M:!0;g.model.beginUpdate();try{var S=g.model.getParent(C),l=g.getIncomingTreeEdges(C),x=g.cloneCells([l[0],C]);g.model.setTerminal(x[0],g.model.getTerminal(l[0],-!0),!0);var G=u(C),N=S.geometry;G==mxConstants.DIRECTION_SOUTH||G==mxConstants.DIRECTION_NORTH?x[1].geometry.x+=M?C.geometry.width+10:-x[1].geometry.width-10:x[1].geometry.y+=M?C.geometry.height+10:-x[1].geometry.height-10;g.view.currentRoot!=S&&(x[1].geometry.x-=N.x,x[1].geometry.y-=N.y);var P=g.view.getState(C),R=g.view.scale;if(null!=P){var T=mxRectangle.fromRectangle(P);G==mxConstants.DIRECTION_SOUTH||G==mxConstants.DIRECTION_NORTH?T.x+=(M?C.geometry.width+10:-x[1].geometry.width-10)*R:T.y+=(M?-C.geometry.height+10:-x[1].geometry.height-10)*R;var U=g.getOutgoingTreeEdges(g.model.getTerminal(l[0],!0));if(null!=U){for(var W=G==mxConstants.DIRECTION_SOUTH||G==mxConstants.DIRECTION_NORTH,X=N=l=0;X<U.length;X++){var Y=g.model.getTerminal(U[X],!1);if(G==u(Y)){var Z=g.view.getState(Y);Y!=C&&null!=Z&&(W&&M!=Z.getCenterX()<P.getCenterX()||!W&&M!=Z.getCenterY()<P.getCenterY())&&mxUtils.intersects(T,Z)&&(l=10+Math.max(l,(Math.min(T.x+T.width,Z.x+Z.width)-Math.max(T.x,Z.x))/R),N=10+Math.max(N,(Math.min(T.y+-T.height,Z.y+Z.height)-Math.max(T.y,Z.y))/R))}}W?N=0:l=0;for(X=0;X<U.length;X++)if(Y=g.model.getTerminal(U[X],!1),G==u(Y)&&(Z=g.view.getState(Y),Y!=C&&null!=Z&&(W&&M!=Z.getCenterX()<P.getCenterX()||!W&&M!=Z.getCenterY()<P.getCenterY()))){var ba=[];g.traverse(Z.cell,!0,function(ha,ca){var da=null!=ca&&g.isTreeEdge(ca);da&&ba.push(ca);(null==ca||da)&&ba.push(ha);return null==ca||da});g.moveCells(ba,(M?1:-1)*l,(M?1:-1)*N)}}}return g.addCells(x,S)}finally{g.model.endUpdate()}}function H(C){g.model.beginUpdate();-try{var M=u(C),S=g.getIncomingTreeEdges(C),l=g.cloneCells([S[0],C]);g.model.setTerminal(S[0],l[1],!1);g.model.setTerminal(l[0],l[1],!0);g.model.setTerminal(l[0],C,!1);var x=g.model.getParent(C),G=x.geometry,N=[];g.view.currentRoot!=x&&(l[1].geometry.x-=G.x,l[1].geometry.y-=G.y);g.traverse(C,!0,function(T,U){var W=null!=U&&g.isTreeEdge(U);W&&N.push(U);(null==U||W)&&N.push(T);return null==U||W});var P=C.geometry.width+40,R=C.geometry.height+40;M==mxConstants.DIRECTION_SOUTH?P=0:M==mxConstants.DIRECTION_NORTH?-(P=0,R=-R):M==mxConstants.DIRECTION_WEST?(P=-P,R=0):M==mxConstants.DIRECTION_EAST&&(R=0);g.moveCells(N,P,R);return g.addCells(l,x)}finally{g.model.endUpdate()}}function D(C,M){g.model.beginUpdate();try{var S=g.model.getParent(C),l=g.getIncomingTreeEdges(C),x=u(C);0==l.length&&(l=[g.createEdge(S,null,"",null,null,g.createCurrentEdgeStyle())],x=M);var G=g.cloneCells([l[0],C]);g.model.setTerminal(G[0],C,!0);null==g.model.getTerminal(G[0],!1)&&(g.model.setTerminal(G[0],G[1],!1),g.applyNewEdgeStyle(G[1],-[G[0]],x));l=g.getOutgoingTreeEdges(C);var N=S.geometry;M=[];g.view.currentRoot==S&&(N=new mxRectangle);for(var P=0;P<l.length;P++){var R=g.model.getTerminal(l[P],!1);null!=R&&M.push(R)}var T=g.view.getBounds(M),U=g.view.translate,W=g.view.scale;x==mxConstants.DIRECTION_SOUTH?(G[1].geometry.x=null==T?C.geometry.x+(C.geometry.width-G[1].geometry.width)/2:(T.x+T.width)/W-U.x-N.x+10,G[1].geometry.y+=G[1].geometry.height-N.y+40):x==mxConstants.DIRECTION_NORTH?(G[1].geometry.x=null==T?C.geometry.x+(C.geometry.width-+!0),!0);var G=u(C),N=S.geometry;G==mxConstants.DIRECTION_SOUTH||G==mxConstants.DIRECTION_NORTH?x[1].geometry.x+=M?C.geometry.width+10:-x[1].geometry.width-10:x[1].geometry.y+=M?C.geometry.height+10:-x[1].geometry.height-10;g.view.currentRoot!=S&&(x[1].geometry.x-=N.x,x[1].geometry.y-=N.y);var O=g.view.getState(C),R=g.view.scale;if(null!=O){var T=mxRectangle.fromRectangle(O);G==mxConstants.DIRECTION_SOUTH||G==mxConstants.DIRECTION_NORTH?T.x+=(M?C.geometry.width+10:-x[1].geometry.width-10)*R:T.y+=(M?+C.geometry.height+10:-x[1].geometry.height-10)*R;var U=g.getOutgoingTreeEdges(g.model.getTerminal(l[0],!0));if(null!=U){for(var W=G==mxConstants.DIRECTION_SOUTH||G==mxConstants.DIRECTION_NORTH,X=N=l=0;X<U.length;X++){var Y=g.model.getTerminal(U[X],!1);if(G==u(Y)){var Z=g.view.getState(Y);Y!=C&&null!=Z&&(W&&M!=Z.getCenterX()<O.getCenterX()||!W&&M!=Z.getCenterY()<O.getCenterY())&&mxUtils.intersects(T,Z)&&(l=10+Math.max(l,(Math.min(T.x+T.width,Z.x+Z.width)-Math.max(T.x,Z.x))/R),N=10+Math.max(N,(Math.min(T.y++T.height,Z.y+Z.height)-Math.max(T.y,Z.y))/R))}}W?N=0:l=0;for(X=0;X<U.length;X++)if(Y=g.model.getTerminal(U[X],!1),G==u(Y)&&(Z=g.view.getState(Y),Y!=C&&null!=Z&&(W&&M!=Z.getCenterX()<O.getCenterX()||!W&&M!=Z.getCenterY()<O.getCenterY()))){var ba=[];g.traverse(Z.cell,!0,function(fa,ca){var da=null!=ca&&g.isTreeEdge(ca);da&&ba.push(ca);(null==ca||da)&&ba.push(fa);return null==ca||da});g.moveCells(ba,(M?1:-1)*l,(M?1:-1)*N)}}}return g.addCells(x,S)}finally{g.model.endUpdate()}}function H(C){g.model.beginUpdate();+try{var M=u(C),S=g.getIncomingTreeEdges(C),l=g.cloneCells([S[0],C]);g.model.setTerminal(S[0],l[1],!1);g.model.setTerminal(l[0],l[1],!0);g.model.setTerminal(l[0],C,!1);var x=g.model.getParent(C),G=x.geometry,N=[];g.view.currentRoot!=x&&(l[1].geometry.x-=G.x,l[1].geometry.y-=G.y);g.traverse(C,!0,function(T,U){var W=null!=U&&g.isTreeEdge(U);W&&N.push(U);(null==U||W)&&N.push(T);return null==U||W});var O=C.geometry.width+40,R=C.geometry.height+40;M==mxConstants.DIRECTION_SOUTH?O=0:M==mxConstants.DIRECTION_NORTH?+(O=0,R=-R):M==mxConstants.DIRECTION_WEST?(O=-O,R=0):M==mxConstants.DIRECTION_EAST&&(R=0);g.moveCells(N,O,R);return g.addCells(l,x)}finally{g.model.endUpdate()}}function D(C,M){g.model.beginUpdate();try{var S=g.model.getParent(C),l=g.getIncomingTreeEdges(C),x=u(C);0==l.length&&(l=[g.createEdge(S,null,"",null,null,g.createCurrentEdgeStyle())],x=M);var G=g.cloneCells([l[0],C]);g.model.setTerminal(G[0],C,!0);null==g.model.getTerminal(G[0],!1)&&(g.model.setTerminal(G[0],G[1],!1),g.applyNewEdgeStyle(G[1],+[G[0]],x));l=g.getOutgoingTreeEdges(C);var N=S.geometry;M=[];g.view.currentRoot==S&&(N=new mxRectangle);for(var O=0;O<l.length;O++){var R=g.model.getTerminal(l[O],!1);null!=R&&M.push(R)}var T=g.view.getBounds(M),U=g.view.translate,W=g.view.scale;x==mxConstants.DIRECTION_SOUTH?(G[1].geometry.x=null==T?C.geometry.x+(C.geometry.width-G[1].geometry.width)/2:(T.x+T.width)/W-U.x-N.x+10,G[1].geometry.y+=G[1].geometry.height-N.y+40):x==mxConstants.DIRECTION_NORTH?(G[1].geometry.x=null==T?C.geometry.x+(C.geometry.width-G[1].geometry.width)/2:(T.x+T.width)/W-U.x+-N.x+10,G[1].geometry.y-=G[1].geometry.height+N.y+40):(G[1].geometry.x=x==mxConstants.DIRECTION_WEST?G[1].geometry.x-(G[1].geometry.width+N.x+40):G[1].geometry.x+(G[1].geometry.width-N.x+40),G[1].geometry.y=null==T?C.geometry.y+(C.geometry.height-G[1].geometry.height)/2:(T.y+T.height)/W-U.y+-N.y+10);return g.addCells(G,S)}finally{g.model.endUpdate()}}function L(C,M,S){C=g.getOutgoingTreeEdges(C);S=g.view.getState(S);var l=[];if(null!=S&&null!=C){for(var x=-0;x<C.length;x++){var G=g.view.getState(g.model.getTerminal(C[x],!1));null!=G&&(!M&&Math.min(G.x+G.width,S.x+S.width)>=Math.max(G.x,S.x)||M&&Math.min(G.y+G.height,S.y+S.height)>=Math.max(G.y,S.y))&&l.push(G)}l.sort(function(N,P){return M?N.x+N.width-P.x-P.width:N.y+N.height-P.y-P.height})}return l}function F(C,M){var S=u(C),l=M==mxConstants.DIRECTION_EAST||M==mxConstants.DIRECTION_WEST;(S==mxConstants.DIRECTION_EAST||S==mxConstants.DIRECTION_WEST)==l&&S!=M?d.actions.get("selectParent").funct():S==+0;x<C.length;x++){var G=g.view.getState(g.model.getTerminal(C[x],!1));null!=G&&(!M&&Math.min(G.x+G.width,S.x+S.width)>=Math.max(G.x,S.x)||M&&Math.min(G.y+G.height,S.y+S.height)>=Math.max(G.y,S.y))&&l.push(G)}l.sort(function(N,O){return M?N.x+N.width-O.x-O.width:N.y+N.height-O.y-O.height})}return l}function F(C,M){var S=u(C),l=M==mxConstants.DIRECTION_EAST||M==mxConstants.DIRECTION_WEST;(S==mxConstants.DIRECTION_EAST||S==mxConstants.DIRECTION_WEST)==l&&S!=M?d.actions.get("selectParent").funct():S==M?(M=g.getOutgoingTreeEdges(C),null!=M&&0<M.length&&g.setSelectionCell(g.model.getTerminal(M[0],!1))):(S=g.getIncomingTreeEdges(C),null!=S&&0<S.length&&(l=L(g.model.getTerminal(S[0],!0),l,C),C=g.view.getState(C),null!=C&&(C=mxUtils.indexOf(l,C),0<=C&&(C+=M==mxConstants.DIRECTION_NORTH||M==mxConstants.DIRECTION_WEST?-1:1,0<=C&&C<=l.length-1&&g.setSelectionCell(l[C].cell)))))}var d=this,g=d.editor.graph,m=g.getModel(),t=d.menus.createPopupMenu;d.menus.createPopupMenu=function(C,M,S){t.apply(this,arguments);if(1==g.getSelectionCount()){M=g.getSelectionCell();var l=g.getOutgoingTreeEdges(M);C.addSeparator();0<l.length&&(c(g.getSelectionCell())&&this.addMenuItems(C,["selectChildren"],null,S),this.addMenuItems(C,["selectDescendants"],null,S));c(g.getSelectionCell())?(C.addSeparator(),0<g.getIncomingTreeEdges(M).length&&this.addMenuItems(C,["selectSiblings","selectParent"],null,S)):0<g.model.getEdgeCount(M)&&this.addMenuItems(C,["selectConnections"],null,S)}};d.actions.addAction("selectChildren",function(C){if(g.isEnabled()&&1==g.getSelectionCount()){var M=g.getSelectionCell();C=mxEvent.isControlDown(C)?null:g.getOutgoingTreeEdges(M);if(null!=C&&0<C.length){M=[];for(var S=0;S<C.length;S++)M.push(g.model.getTerminal(C[S],!1));g.setSelectionCells(M)}else g.setSelectionCells(g.model.getChildren(M))}},null,null,"Alt+Shift+C");d.actions.addAction("selectDescendants",function(C){var M=g.getSelectionCell();if(g.isEnabled()&&null!=M){var S=[];mxEvent.isControlDown(C)||g.traverse(M,!0,function(l,x){var G=null!=x&&g.isTreeEdge(x);G&&mxEvent.isControlDown(C)&&S.push(x);(null==x||G)&&S.push(l);return null==x||G});if(0==S.length||1==S.length&&S[0]==M)S=g.model.getDescendants(M);g.setSelectionCells(S)}},null,null,"Alt+Shift+X");d.actions.addAction("selectParent",function(C){var M=g.getSelectionCell();g.isEnabled()&&null!=M&&(C=mxEvent.isControlDown(C)?null:g.getIncomingTreeEdges(M),null!=C&&0<C.length?g.setSelectionCell(g.model.getTerminal(C[0],!0)):g.selectParentCell())},null,null,"Alt+Shift+P");d.actions.addAction("selectSiblings",function(C){if(g.isEnabled()&&1==g.getSelectionCount()){var M=g.getSelectionCell(),S=mxEvent.isControlDown(C)?null:g.getIncomingTreeEdges(M);C=[];if(null!=S&&0<S.length&&(S=g.getOutgoingTreeEdges(g.model.getTerminal(S[0],!0)),null!=S))for(var l=0;l<S.length;l++)C.push(g.model.getTerminal(S[l],!1));0==C.length&&(C=g.model.getChildren(g.model.getParent(M)));g.setSelectionCells(C)}},null,null,"Alt+Shift+S");var v=g.removeCells;g.removeCells=function(C,M){M=null!=M?M:!0;null==C&&(C=this.getDeletableCells(this.getSelectionCells()));-M&&(C=this.getDeletableCells(this.addAllEdges(C)));for(var S=[],l=0;l<C.length;l++){var x=C[l];m.isEdge(x)&&n(x)&&(S.push(x),x=m.getTerminal(x,!1));if(c(x)){var G=[];g.traverse(x,!0,function(N,P){var R=null!=P&&g.isTreeEdge(P);R&&G.push(P);(null==P||R)&&G.push(N);return null==P||R});0<G.length&&(S=S.concat(G),x=g.getIncomingTreeEdges(C[l]),C=C.concat(x))}else null!=x&&S.push(C[l])}C=S;return v.apply(this,arguments)};d.hoverIcons.getStateAt=function(C,M,S){return c(C.cell)?null:this.graph.view.getState(this.graph.getCellAt(M,-S))};var y=g.duplicateCells;g.duplicateCells=function(C,M){C=null!=C?C:this.getSelectionCells();for(var S=C.slice(0),l=0;l<S.length;l++){var x=g.view.getState(S[l]);if(null!=x&&c(x.cell)){var G=g.getIncomingTreeEdges(x.cell);for(x=0;x<G.length;x++)mxUtils.remove(G[x],C)}}this.model.beginUpdate();try{var N=y.call(this,C,M);if(N.length==C.length)for(l=0;l<C.length;l++)if(c(C[l])){var P=g.getIncomingTreeEdges(N[l]);G=g.getIncomingTreeEdges(C[l]);if(0==P.length&&0<G.length){var R=this.cloneCell(G[0]);-this.addEdge(R,g.getDefaultParent(),this.model.getTerminal(G[0],!0),N[l])}}}finally{this.model.endUpdate()}return N};var B=g.moveCells;g.moveCells=function(C,M,S,l,x,G,N){for(var P=null,R=[],T=0;T<C.length;T++)(k(C[T])||c(C[T]))&&!q(C[T])&&this.isCellCollapsed(C[T])?R=R.concat(this.getSubtree(C[T])):R.push(C[T]);C=mxUtils.removeDuplicates(R);this.model.beginUpdate();try{R=x;var U=this.getCurrentCellStyle(x);if(null!=C&&c(x)&&"1"==mxUtils.getValue(U,"treeFolding","0")){for(T=0;T<C.length;T++)if(c(C[T])||-g.model.isEdge(C[T])&&null==g.model.getTerminal(C[T],!0)){x=g.model.getParent(C[T]);break}if(null!=R&&x!=R&&null!=this.view.getState(C[0])){var W=g.getIncomingTreeEdges(C[0]);if(0<W.length){var X=g.view.getState(g.model.getTerminal(W[0],!0));if(null!=X){var Y=g.view.getState(R);null!=Y&&(M=(Y.getCenterX()-X.getCenterX())/g.view.scale,S=(Y.getCenterY()-X.getCenterY())/g.view.scale)}}}}P=B.apply(this,arguments);if(null!=P&&null!=C&&P.length==C.length)for(T=0;T<P.length;T++)if(this.model.isEdge(P[T]))c(R)&&-0>mxUtils.indexOf(P,this.model.getTerminal(P[T],!0))&&this.model.setTerminal(P[T],R,!0);else if(c(C[T])&&(W=g.getIncomingTreeEdges(C[T]),0<W.length))if(!l)c(R)&&0>mxUtils.indexOf(C,this.model.getTerminal(W[0],!0))&&this.model.setTerminal(W[0],R,!0);else if(0==g.getIncomingTreeEdges(P[T]).length){U=R;if(null==U||U==g.model.getParent(C[T]))U=g.model.getTerminal(W[0],!0);l=this.cloneCell(W[0]);this.addEdge(l,g.getDefaultParent(),U,P[T])}}finally{this.model.endUpdate()}return P};if(null!=d.sidebar){var I=-d.sidebar.dropAndConnect;d.sidebar.dropAndConnect=function(C,M,S,l){var x=g.model,G=null;x.beginUpdate();try{if(G=I.apply(this,arguments),c(C))for(var N=0;N<G.length;N++)if(x.isEdge(G[N])&&null==x.getTerminal(G[N],!0)){x.setTerminal(G[N],C,!0);var P=g.getCellGeometry(G[N]);P.points=null;null!=P.getTerminalPoint(!0)&&P.setTerminalPoint(null,!0)}}finally{x.endUpdate()}return G}}var K={67:d.actions.get("selectChildren"),88:d.actions.get("selectDescendants"),80:d.actions.get("selectParent"),83:d.actions.get("selectSiblings")},-J={67:d.actions.get("copyStyle"),86:d.actions.get("pasteStyle")},V=d.onKeyDown;d.onKeyDown=function(C){try{var M=g.getSelectionCell();if(g.isEnabled()&&!g.isEditing()&&null!=M){var S=mxEvent.isAltDown(C)&&mxEvent.isShiftDown(C)?K[C.keyCode]:mxEvent.isAltDown(C)?J[C.keyCode]:null;null!=S?(S.funct(C),mxEvent.consume(C)):c(M)&&(S=null,0<g.getIncomingTreeEdges(M).length&&(9==C.which?S=mxEvent.isShiftDown(C)?H(M):D(M):13==C.which&&(S=E(M,!mxEvent.isShiftDown(C)))),null!=S&&0<S.length?(1==S.length&&g.model.isEdge(S[0])?+M&&(C=this.getDeletableCells(this.addAllEdges(C)));for(var S=[],l=0;l<C.length;l++){var x=C[l];m.isEdge(x)&&n(x)&&(S.push(x),x=m.getTerminal(x,!1));if(c(x)){var G=[];g.traverse(x,!0,function(N,O){var R=null!=O&&g.isTreeEdge(O);R&&G.push(O);(null==O||R)&&G.push(N);return null==O||R});0<G.length&&(S=S.concat(G),x=g.getIncomingTreeEdges(C[l]),C=C.concat(x))}else null!=x&&S.push(C[l])}C=S;return v.apply(this,arguments)};d.hoverIcons.getStateAt=function(C,M,S){return c(C.cell)?null:this.graph.view.getState(this.graph.getCellAt(M,+S))};var y=g.duplicateCells;g.duplicateCells=function(C,M){C=null!=C?C:this.getSelectionCells();for(var S=C.slice(0),l=0;l<S.length;l++){var x=g.view.getState(S[l]);if(null!=x&&c(x.cell)){var G=g.getIncomingTreeEdges(x.cell);for(x=0;x<G.length;x++)mxUtils.remove(G[x],C)}}this.model.beginUpdate();try{var N=y.call(this,C,M);if(N.length==C.length)for(l=0;l<C.length;l++)if(c(C[l])){var O=g.getIncomingTreeEdges(N[l]);G=g.getIncomingTreeEdges(C[l]);if(0==O.length&&0<G.length){var R=this.cloneCell(G[0]);+this.addEdge(R,g.getDefaultParent(),this.model.getTerminal(G[0],!0),N[l])}}}finally{this.model.endUpdate()}return N};var B=g.moveCells;g.moveCells=function(C,M,S,l,x,G,N){for(var O=null,R=[],T=0;T<C.length;T++)(k(C[T])||c(C[T]))&&!q(C[T])&&this.isCellCollapsed(C[T])?R=R.concat(this.getSubtree(C[T])):R.push(C[T]);C=mxUtils.removeDuplicates(R);this.model.beginUpdate();try{R=x;var U=this.getCurrentCellStyle(x);if(null!=C&&c(x)&&"1"==mxUtils.getValue(U,"treeFolding","0")){for(T=0;T<C.length;T++)if(c(C[T])||+g.model.isEdge(C[T])&&null==g.model.getTerminal(C[T],!0)){x=g.model.getParent(C[T]);break}if(null!=R&&x!=R&&null!=this.view.getState(C[0])){var W=g.getIncomingTreeEdges(C[0]);if(0<W.length){var X=g.view.getState(g.model.getTerminal(W[0],!0));if(null!=X){var Y=g.view.getState(R);null!=Y&&(M=(Y.getCenterX()-X.getCenterX())/g.view.scale,S=(Y.getCenterY()-X.getCenterY())/g.view.scale)}}}}O=B.apply(this,arguments);if(null!=O&&null!=C&&O.length==C.length)for(T=0;T<O.length;T++)if(this.model.isEdge(O[T]))c(R)&&+0>mxUtils.indexOf(O,this.model.getTerminal(O[T],!0))&&this.model.setTerminal(O[T],R,!0);else if(c(C[T])&&(W=g.getIncomingTreeEdges(C[T]),0<W.length))if(!l)c(R)&&0>mxUtils.indexOf(C,this.model.getTerminal(W[0],!0))&&this.model.setTerminal(W[0],R,!0);else if(0==g.getIncomingTreeEdges(O[T]).length){U=R;if(null==U||U==g.model.getParent(C[T]))U=g.model.getTerminal(W[0],!0);l=this.cloneCell(W[0]);this.addEdge(l,g.getDefaultParent(),U,O[T])}}finally{this.model.endUpdate()}return O};if(null!=d.sidebar){var I=+d.sidebar.dropAndConnect;d.sidebar.dropAndConnect=function(C,M,S,l){var x=g.model,G=null;x.beginUpdate();try{if(G=I.apply(this,arguments),c(C))for(var N=0;N<G.length;N++)if(x.isEdge(G[N])&&null==x.getTerminal(G[N],!0)){x.setTerminal(G[N],C,!0);var O=g.getCellGeometry(G[N]);O.points=null;null!=O.getTerminalPoint(!0)&&O.setTerminalPoint(null,!0)}}finally{x.endUpdate()}return G}}var J={67:d.actions.get("selectChildren"),88:d.actions.get("selectDescendants"),80:d.actions.get("selectParent"),83:d.actions.get("selectSiblings")},+K={67:d.actions.get("copyStyle"),86:d.actions.get("pasteStyle")},V=d.onKeyDown;d.onKeyDown=function(C){try{var M=g.getSelectionCell();if(g.isEnabled()&&!g.isEditing()&&null!=M){var S=mxEvent.isAltDown(C)&&mxEvent.isShiftDown(C)?J[C.keyCode]:mxEvent.isAltDown(C)?K[C.keyCode]:null;null!=S?(S.funct(C),mxEvent.consume(C)):c(M)&&(S=null,0<g.getIncomingTreeEdges(M).length&&(9==C.which?S=mxEvent.isShiftDown(C)?H(M):D(M):13==C.which&&(S=E(M,!mxEvent.isShiftDown(C)))),null!=S&&0<S.length?(1==S.length&&g.model.isEdge(S[0])?g.setSelectionCell(g.model.getTerminal(S[0],!1)):g.setSelectionCell(S[S.length-1]),null!=d.hoverIcons&&d.hoverIcons.update(g.view.getState(M)),g.startEditingAtCell(M),mxEvent.consume(C)):37==C.keyCode?(F(M,mxConstants.DIRECTION_WEST),mxEvent.consume(C)):38==C.keyCode?(F(M,mxConstants.DIRECTION_NORTH),mxEvent.consume(C)):39==C.keyCode?(F(M,mxConstants.DIRECTION_EAST),mxEvent.consume(C)):40==C.keyCode&&(F(M,mxConstants.DIRECTION_SOUTH),mxEvent.consume(C)))}}catch(l){d.handleError(l)}mxEvent.isConsumed(C)||-V.apply(this,arguments)};var Q=g.connectVertex;g.connectVertex=function(C,M,S,l,x,G,N){var P=g.getIncomingTreeEdges(C);if(c(C)){var R=u(C),T=R==mxConstants.DIRECTION_EAST||R==mxConstants.DIRECTION_WEST,U=M==mxConstants.DIRECTION_EAST||M==mxConstants.DIRECTION_WEST;return R==M||0==P.length?D(C,M):T==U?H(C):E(C,M!=mxConstants.DIRECTION_NORTH&&M!=mxConstants.DIRECTION_WEST)}return Q.apply(this,arguments)};g.getSubtree=function(C){var M=[C];!k(C)&&!c(C)||q(C)||g.traverse(C,!0,function(S,l){var x=null!=-l&&g.isTreeEdge(l);x&&0>mxUtils.indexOf(M,l)&&M.push(l);(null==l||x)&&0>mxUtils.indexOf(M,S)&&M.push(S);return null==l||x});return M};var O=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){O.apply(this,arguments);(k(this.state.cell)||c(this.state.cell))&&!q(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title",+V.apply(this,arguments)};var Q=g.connectVertex;g.connectVertex=function(C,M,S,l,x,G,N){var O=g.getIncomingTreeEdges(C);if(c(C)){var R=u(C),T=R==mxConstants.DIRECTION_EAST||R==mxConstants.DIRECTION_WEST,U=M==mxConstants.DIRECTION_EAST||M==mxConstants.DIRECTION_WEST;return R==M||0==O.length?D(C,M):T==U?H(C):E(C,M!=mxConstants.DIRECTION_NORTH&&M!=mxConstants.DIRECTION_WEST)}return Q.apply(this,arguments)};g.getSubtree=function(C){var M=[C];!k(C)&&!c(C)||q(C)||g.traverse(C,!0,function(S,l){var x=null!=+l&&g.isTreeEdge(l);x&&0>mxUtils.indexOf(M,l)&&M.push(l);(null==l||x)&&0>mxUtils.indexOf(M,S)&&M.push(S);return null==l||x});return M};var P=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){P.apply(this,arguments);(k(this.state.cell)||c(this.state.cell))&&!q(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(C){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(C),mxEvent.getClientY(C),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(C);this.graph.isMouseDown=!0;d.hoverIcons.reset();mxEvent.consume(C)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var p=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){p.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var z=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(C){z.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=C?"":"none")};var A=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(C,M){A.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=@@ -14555,45 +14557,45 @@ this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWinew Menu(mxUtils.bind(this,function(m,t){for(var v=0;v<d.length;v++)"-"==d[v]?m.addSeparator(t):g(m,t,mxResources.get(d[v])+"...",d[v])})))};EditorUi.prototype.installFormatToolbar=function(F){var d=this.editor.graph,g=document.createElement("div");g.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";d.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(m,t){0<d.getSelectionCount()?(F.appendChild(g),g.innerHTML="Selected: "+d.getSelectionCount()):null!=g.parentNode&&g.parentNode.removeChild(g)}))};var D=!1;EditorUi.prototype.initFormatWindow=function(){if(!D&&null!=this.formatWindow){D=!0;var F=this.formatWindow.window.toggleMinimized,d=240;this.formatWindow.window.toggleMinimized=function(){F.apply(this,arguments);this.minimized?(d=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+d-140+"px"):(this.div.style.width=d+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-d+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(g){mxEvent.getSource(g)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var L=EditorUi.prototype.init;EditorUi.prototype.init=function(){function F(W,X,Y){var Z=y.menus.get(W),ba=-J.addMenu(mxResources.get(W),mxUtils.bind(this,function(){ba.classList.contains("mxDisabled")||Z.funct.apply(this,arguments)}),K);ba.className="geMenuItem";ba.style.display="inline-block";ba.style.boxSizing="border-box";ba.style.top="6px";ba.style.marginRight="6px";ba.style.height="30px";ba.style.paddingTop="6px";ba.style.paddingBottom="6px";ba.style.cursor="pointer";ba.setAttribute("title",mxResources.get(W));y.menus.menuCreated(Z,ba,"geMenuItem");null!=Y?(ba.style.backgroundImage="url("+Y+")",ba.style.backgroundPosition=-"center center",ba.style.backgroundRepeat="no-repeat",ba.style.backgroundSize="24px 24px",ba.style.width="34px",ba.innerText=""):X||(ba.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",ba.style.backgroundPosition="right 6px center",ba.style.backgroundRepeat="no-repeat",ba.style.paddingRight="22px");return ba}function d(W,X,Y,Z,ba,ha){var ca=document.createElement("a");ca.className="geMenuItem";ca.style.display="inline-block";ca.style.boxSizing="border-box";ca.style.height="30px";-ca.style.padding="6px";ca.style.position="relative";ca.style.verticalAlign="top";ca.style.top="0px";null!=y.statusContainer?I.insertBefore(ca,y.statusContainer):I.appendChild(ca);null!=ha?(ca.style.backgroundImage="url("+ha+")",ca.style.backgroundPosition="center center",ca.style.backgroundRepeat="no-repeat",ca.style.backgroundSize="24px 24px",ca.style.width="34px"):mxUtils.write(ca,W);mxEvent.addListener(ca,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(da){da.preventDefault()}));+K.addMenu(mxResources.get(W),mxUtils.bind(this,function(){ba.classList.contains("mxDisabled")||Z.funct.apply(this,arguments)}),J);ba.className="geMenuItem";ba.style.display="inline-block";ba.style.boxSizing="border-box";ba.style.top="6px";ba.style.marginRight="6px";ba.style.height="30px";ba.style.paddingTop="6px";ba.style.paddingBottom="6px";ba.style.cursor="pointer";ba.setAttribute("title",mxResources.get(W));y.menus.menuCreated(Z,ba,"geMenuItem");null!=Y?(ba.style.backgroundImage="url("+Y+")",ba.style.backgroundPosition=+"center center",ba.style.backgroundRepeat="no-repeat",ba.style.backgroundSize="24px 24px",ba.style.width="34px",ba.innerText=""):X||(ba.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",ba.style.backgroundPosition="right 6px center",ba.style.backgroundRepeat="no-repeat",ba.style.paddingRight="22px");return ba}function d(W,X,Y,Z,ba,fa){var ca=document.createElement("a");ca.className="geMenuItem";ca.style.display="inline-block";ca.style.boxSizing="border-box";ca.style.height="30px";+ca.style.padding="6px";ca.style.position="relative";ca.style.verticalAlign="top";ca.style.top="0px";null!=y.statusContainer?I.insertBefore(ca,y.statusContainer):I.appendChild(ca);null!=fa?(ca.style.backgroundImage="url("+fa+")",ca.style.backgroundPosition="center center",ca.style.backgroundRepeat="no-repeat",ca.style.backgroundSize="24px 24px",ca.style.width="34px"):mxUtils.write(ca,W);mxEvent.addListener(ca,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(da){da.preventDefault()}));mxEvent.addListener(ca,"click",function(da){"disabled"!=ca.getAttribute("disabled")&&X(da);mxEvent.consume(da)});null==Y&&(ca.style.marginRight="4px");null!=Z&&ca.setAttribute("title",Z);null!=ba&&(W=function(){ba.isEnabled()?(ca.removeAttribute("disabled"),ca.style.cursor="pointer"):(ca.setAttribute("disabled","disabled"),ca.style.cursor="default")},ba.addListener("stateChanged",W),B.addListener("enabledChanged",W),W());return ca}function g(W,X,Y){Y=document.createElement("div");Y.className="geMenuItem";Y.style.display="inline-block";Y.style.verticalAlign="top";Y.style.marginRight="6px";Y.style.padding="0 4px 0 4px";Y.style.height="30px";Y.style.position="relative";Y.style.top="0px";for(var Z=0;Z<W.length;Z++)null!=W[Z]&&(W[Z].style.margin="0px",W[Z].style.boxShadow="none",Y.appendChild(W[Z]));null!=X&&mxUtils.setOpacity(Y,X);null!=y.statusContainer?I.insertBefore(Y,y.statusContainer):I.appendChild(Y);return Y}function m(){for(var W=I.firstChild;null!=W;){var X=W.nextSibling;"geMenuItem"!=W.className&&-"geItem"!=W.className||W.parentNode.removeChild(W);W=X}K=I.firstChild;c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;W=1E3>c;var Y=null;W||(Y=F("diagram"));X=W?F("diagram",null,Editor.menuImage):null;null!=X&&(Y=X);g([Y,d(mxResources.get("shapes"),y.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),y.actions.get("image"),W?Editor.shapesImage:null),d(mxResources.get("format"),y.actions.get("format").funct,null,mxResources.get("format")+" ("+y.actions.get("format").shortcut+-")",y.actions.get("image"),W?Editor.formatImage:null)],W?60:null);X=F("insert",!0,W?O:null);g([X,d(mxResources.get("delete"),y.actions.get("delete").funct,null,mxResources.get("delete"),y.actions.get("delete"),W?Editor.trashImage:null)],W?60:null);B.isEnabled()||X.classList.add("mxDisabled");411<=c&&(g([N,P],60),520<=c&&g([R,640<=c?d("",M.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",M,Editor.zoomInImage):null,640<=c?d("",S.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",+"geItem"!=W.className||W.parentNode.removeChild(W);W=X}J=I.firstChild;c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;W=1E3>c;var Y=null;W||(Y=F("diagram"));X=W?F("diagram",null,Editor.menuImage):null;null!=X&&(Y=X);g([Y,d(mxResources.get("shapes"),y.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),y.actions.get("image"),W?Editor.shapesImage:null),d(mxResources.get("format"),y.actions.get("format").funct,null,mxResources.get("format")+" ("+y.actions.get("format").shortcut++")",y.actions.get("image"),W?Editor.formatImage:null)],W?60:null);X=F("insert",!0,W?P:null);g([X,d(mxResources.get("delete"),y.actions.get("delete").funct,null,mxResources.get("delete"),y.actions.get("delete"),W?Editor.trashImage:null)],W?60:null);B.isEnabled()||X.classList.add("mxDisabled");411<=c&&(g([N,O],60),520<=c&&g([R,640<=c?d("",M.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",M,Editor.zoomInImage):null,640<=c?d("",S.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",S,Editor.zoomOutImage):null],60))}L.apply(this,arguments);var t=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=t&&(t.classList.add("geSimple"),t.classList.add("geMinimal"));t=Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries);var v=document.createElement("div");v.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";v.style.bottom=t?"32px":"0px";this.sidebar=this.createSidebar(v);if(1E3<=c||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])f(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=c&&(b(this,!0),this.formatWindow.window.setVisible(!0));var y=this,B=y.editor.graph;y.toolbar=this.createToolbar(y.createDiv("geToolbar"));y.defaultLibraryName=mxResources.get("untitledLibrary");var I=-document.createElement("div");I.className="geMenubarContainer";var K=null,J=new Menubar(y,I);y.statusContainer=y.createStatusContainer();y.statusContainer.style.position="relative";y.statusContainer.style.maxWidth="";y.statusContainer.style.cursor="default";var V=y.hideCurrentMenu;y.hideCurrentMenu=function(){V.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var Q=y.descriptorChanged;y.descriptorChanged=function(){Q.apply(this,arguments);var W=y.getCurrentFile();if(null!=W&&null!=+document.createElement("div");I.className="geMenubarContainer";var J=null,K=new Menubar(y,I);y.statusContainer=y.createStatusContainer();y.statusContainer.style.position="relative";y.statusContainer.style.maxWidth="";y.statusContainer.style.cursor="default";var V=y.hideCurrentMenu;y.hideCurrentMenu=function(){V.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var Q=y.descriptorChanged;y.descriptorChanged=function(){Q.apply(this,arguments);var W=y.getCurrentFile();if(null!=W&&null!=W.getTitle()){var X=W.getMode();"google"==X?X="googleDrive":"github"==X?X="gitHub":"gitlab"==X?X="gitLab":"onedrive"==X&&(X="oneDrive");X=mxResources.get(X);I.setAttribute("title",W.getTitle()+(null!=X?" ("+X+")":""))}else I.removeAttribute("title")};y.setStatusText(y.editor.getStatus());I.appendChild(y.statusContainer);y.buttonContainer=document.createElement("div");y.buttonContainer.style.cssText="display:flex;justify-content:flex-end;padding-right:10px;gap:6px;white-space:nowrap;background-color:inherit;align-items:center;min-width:0;margin-left:auto;";-I.appendChild(y.buttonContainer);y.menubarContainer=y.buttonContainer;y.tabContainer=document.createElement("div");y.tabContainer.className="geTabContainer geTabItem";y.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;visibility:hidden;";t=y.diagramContainer.parentNode;v=document.createElement("div");v.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";y.diagramContainer.style.top="47px";var O=Editor.addBoxImage;+I.appendChild(y.buttonContainer);y.menubarContainer=y.buttonContainer;y.tabContainer=document.createElement("div");y.tabContainer.className="geTabContainer geTabItem";y.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;visibility:hidden;";t=y.diagramContainer.parentNode;v=document.createElement("div");v.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";y.diagramContainer.style.top="47px";var P=Editor.addBoxImage;if(null!=y.hoverIcons){var p=y.hoverIcons.update;y.hoverIcons.update=function(){B.freehand.isDrawing()||p.apply(this,arguments)}}if(null!=B.freehand){var z=B.freehand.createStyle;B.freehand.createStyle=function(W){return z.apply(this,arguments)+"sketch=0;"}}y.editor.addListener("statusChanged",mxUtils.bind(this,function(){y.setStatusText(y.editor.getStatus())}));y.setStatusText(y.editor.getStatus());var A=y.menus.get("viewZoom");if(null!=A){var C=function(W){if(mxEvent.isAltDown(W))y.hideCurrentMenu(),-y.actions.get("customZoom").funct(),mxEvent.consume(W);else if("geMenuItem"==mxEvent.getSource(W).className||mxEvent.isShiftDown(W))y.hideCurrentMenu(),y.actions.get("smartFit").funct(),mxEvent.consume(W)},M=y.actions.get("zoomIn"),S=y.actions.get("zoomOut"),l=y.actions.get("resetView"),x=y.actions.get("undo"),G=y.actions.get("redo"),N=d("",x.funct,null,mxResources.get("undo")+" ("+x.shortcut+")",x,Editor.undoImage),P=d("",G.funct,null,mxResources.get("redo")+" ("+G.shortcut+")",G,Editor.redoImage),-R=d("",C,!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",l,Editor.zoomFitImage);I.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;text-align:left;white-space:nowrap;";this.tabContainer.style.right="70px";var T=J.addMenu("100%",A.funct);T.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");T.className="geTabItem";T.style.height=y.tabContainerHeight+"px";T.style.position="absolute";T.style.display="0"!=urlParams.pages?"flex":"none";T.style.alignItems=+y.actions.get("customZoom").funct(),mxEvent.consume(W);else if("geMenuItem"==mxEvent.getSource(W).className||mxEvent.isShiftDown(W))y.hideCurrentMenu(),y.actions.get("smartFit").funct(),mxEvent.consume(W)},M=y.actions.get("zoomIn"),S=y.actions.get("zoomOut"),l=y.actions.get("resetView"),x=y.actions.get("undo"),G=y.actions.get("redo"),N=d("",x.funct,null,mxResources.get("undo")+" ("+x.shortcut+")",x,Editor.undoImage),O=d("",G.funct,null,mxResources.get("redo")+" ("+G.shortcut+")",G,Editor.redoImage),+R=d("",C,!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",l,Editor.zoomFitImage);I.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;text-align:left;white-space:nowrap;";this.tabContainer.style.right="70px";var T=K.addMenu("100%",A.funct);T.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");T.className="geTabItem";T.style.height=y.tabContainerHeight+"px";T.style.position="absolute";T.style.display="0"!=urlParams.pages?"flex":"none";T.style.alignItems="center";T.style.justifyContent="center";T.style.paddingRight="11px";T.style.whiteSpace="nowrap";T.style.overflow="hidden";T.style.fontSize="11px";T.style.width="51px";T.style.right="0px";T.style.bottom="0px";T.style.boxSizing="content-box";T.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";T.style.backgroundPosition="right 6px top 15px";T.style.backgroundRepeat="no-repeat";T.style.backgroundSize="10px";T.style.zIndex="1";v.appendChild(T);(function(W){mxEvent.addListener(W,"click",C);var X=mxUtils.bind(this,function(Y,Z,ba){W.innerText="";mxUtils.write(W,Math.round(100*y.editor.graph.view.scale*(null!=ba?ba:1))+"%")});y.editor.graph.view.addListener(mxEvent.EVENT_SCALE,X);y.editor.addListener("resetGraphView",X);y.editor.addListener("pageSelected",X);y.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(Y,Z){X(Y,Z,Z.getProperty("factor"))}))})(T);var U=y.setGraphEnabled;y.setGraphEnabled=function(){U.apply(this,arguments);null!=this.tabContainer&&(T.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="0"!=urlParams.pages&&"hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}v.appendChild(I);v.appendChild(y.diagramContainer);t.appendChild(v);y.updateTabContainer();!EditorUi.windowed&&1E3<=c&&b(this,!0);v.appendChild(y.tabContainer);m();y.addListener("lockedChanged",m);mxEvent.addListener(window,"resize",function(){m();null!=y.sidebarWindow&&y.sidebarWindow.window.fit();null!=y.formatWindow&&y.formatWindow.window.fit();null!=y.actions.outlineWindow&&y.actions.outlineWindow.window.fit();null!=y.actions.layersWindow&&y.actions.layersWindow.window.fit();null!=y.menus.chatWindow&&y.menus.chatWindow.window.fit();null!=y.menus.tagsWindow&&y.menus.tagsWindow.window.fit();null!=y.menus.findWindow&&y.menus.findWindow.window.fit();null!=y.menus.findReplaceWindow&&y.menus.findReplaceWindow.window.fit()})}}};(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(c,k,n,q){var u=k.y,E=k.x,H=!1,D=!1;if(null!=this.states&&null!=c&&null!=k){var L=this,F=new mxCellState,d=this.graph.getView().scale,g=Math.max(2,this.getGuideTolerance()/2);F.x=c.x+E;F.y=c.y+u;F.width=c.width;F.height=c.height;for(var m=[],t=[],v=0;v<this.states.length;v++){var y=this.states[v];y instanceof mxCellState&&(q||!this.graph.isCellSelected(y.cell))&&((F.x>=y.x&&F.x<=y.x+y.width||y.x>=F.x&&y.x<=F.x+F.width)&&(F.y>-y.y+y.height+4||F.y+F.height+4<y.y)?m.push(y):(F.y>=y.y&&F.y<=y.y+y.height||y.y>=F.y&&y.y<=F.y+F.height)&&(F.x>y.x+y.width+4||F.x+F.width+4<y.x)&&t.push(y))}var B=0,I=0,K=y=0,J=0,V=0,Q=0,O=0,p=5*d;if(1<m.length){m.push(F);m.sort(function(M,S){return M.y-S.y});var z=!1;v=F==m[0];d=F==m[m.length-1];if(!v&&!d)for(v=1;v<m.length-1;v++)if(F==m[v]){d=m[v-1];v=m[v+1];y=I=K=(v.y-d.y-d.height-F.height)/2;break}for(v=0;v<m.length-1;v++){d=m[v];var A=m[v+1],C=F==d||F==A;A=A.y-d.y-d.height;z|=F==d;if(0==I&&0==-B)I=A,B=1;else if(Math.abs(I-A)<=(C||1==v&&z?g:0))B+=1;else if(1<B&&z){m=m.slice(0,v+1);break}else if(3<=m.length-v&&!z)B=0,y=I=0!=K?K:0,m.splice(0,0==v?1:v),v=-1;else break;0!=y||C||(I=y=A)}3==m.length&&m[1]==F&&(y=0)}if(1<t.length){t.push(F);t.sort(function(M,S){return M.x-S.x});z=!1;v=F==t[0];d=F==t[t.length-1];if(!v&&!d)for(v=1;v<t.length-1;v++)if(F==t[v]){d=t[v-1];v=t[v+1];Q=V=O=(v.x-d.x-d.width-F.width)/2;break}for(v=0;v<t.length-1;v++){d=t[v];A=t[v+1];C=F==d||F==A;A=A.x-d.x-d.width;z|=F==d;-if(0==V&&0==J)V=A,J=1;else if(Math.abs(V-A)<=(C||1==v&&z?g:0))J+=1;else if(1<J&&z){t=t.slice(0,v+1);break}else if(3<=t.length-v&&!z)J=0,Q=V=0!=O?O:0,t.splice(0,0==v?1:v),v=-1;else break;0!=Q||C||(V=Q=A)}3==t.length&&t[1]==F&&(Q=0)}g=function(M,S,l,x){var G=[];if(x){x=p;var N=0}else x=0,N=p;G.push(new mxPoint(M.x-x,M.y-N));G.push(new mxPoint(M.x+x,M.y+N));G.push(M);G.push(S);G.push(new mxPoint(S.x-x,S.y-N));G.push(new mxPoint(S.x+x,S.y+N));if(null!=l)return l.points=G,l;M=new mxPolyline(G,mxConstants.GUIDE_COLOR,-mxConstants.GUIDE_STROKEWIDTH);M.dialect=mxConstants.DIALECT_SVG;M.pointerEvents=!1;M.init(L.graph.getView().getOverlayPane());return M};V=function(M,S){if(M&&null!=L.guidesArrHor)for(M=0;M<L.guidesArrHor.length;M++)L.guidesArrHor[M].node.style.visibility="hidden";if(S&&null!=L.guidesArrVer)for(M=0;M<L.guidesArrVer.length;M++)L.guidesArrVer[M].node.style.visibility="hidden"};if(1<J&&J==t.length-1){J=[];O=L.guidesArrHor;H=[];E=0;v=t[0]==F?1:0;z=t[v].y+t[v].height;if(0<Q)for(v=0;v<t.length-1;v++)d=-t[v],A=t[v+1],F==d?(E=A.x-d.width-Q,H.push(new mxPoint(E+d.width+p,z)),H.push(new mxPoint(A.x-p,z))):F==A?(H.push(new mxPoint(d.x+d.width+p,z)),E=d.x+d.width+Q,H.push(new mxPoint(E-p,z))):(H.push(new mxPoint(d.x+d.width+p,z)),H.push(new mxPoint(A.x-p,z)));else d=t[0],v=t[2],E=d.x+d.width+(v.x-d.x-d.width-F.width)/2,H.push(new mxPoint(d.x+d.width+p,z)),H.push(new mxPoint(E-p,z)),H.push(new mxPoint(E+F.width+p,z)),H.push(new mxPoint(v.x-p,z));for(v=0;v<H.length;v+=2)t=H[v],Q=H[v+1],t=g(t,Q,null!=O?-O[v/2]:null),t.node.style.visibility="visible",t.redraw(),J.push(t);for(v=H.length/2;null!=O&&v<O.length;v++)O[v].destroy();L.guidesArrHor=J;E-=c.x;H=!0}else V(!0);if(1<B&&B==m.length-1){J=[];O=L.guidesArrVer;D=[];u=0;v=m[0]==F?1:0;B=m[v].x+m[v].width;if(0<y)for(v=0;v<m.length-1;v++)d=m[v],A=m[v+1],F==d?(u=A.y-d.height-y,D.push(new mxPoint(B,u+d.height+p)),D.push(new mxPoint(B,A.y-p))):F==A?(D.push(new mxPoint(B,d.y+d.height+p)),u=d.y+d.height+y,D.push(new mxPoint(B,u-p))):(D.push(new mxPoint(B,d.y+-d.height+p)),D.push(new mxPoint(B,A.y-p)));else d=m[0],v=m[2],u=d.y+d.height+(v.y-d.y-d.height-F.height)/2,D.push(new mxPoint(B,d.y+d.height+p)),D.push(new mxPoint(B,u-p)),D.push(new mxPoint(B,u+F.height+p)),D.push(new mxPoint(B,v.y-p));for(v=0;v<D.length;v+=2)t=D[v],Q=D[v+1],t=g(t,Q,null!=O?O[v/2]:null,!0),t.node.style.visibility="visible",t.redraw(),J.push(t);for(v=D.length/2;null!=O&&v<O.length;v++)O[v].destroy();L.guidesArrVer=J;u-=c.y;D=!0}else V(!1,!0)}if(H||D)return F=new mxPoint(E,u),m=b.call(this,+y.y+y.height+4||F.y+F.height+4<y.y)?m.push(y):(F.y>=y.y&&F.y<=y.y+y.height||y.y>=F.y&&y.y<=F.y+F.height)&&(F.x>y.x+y.width+4||F.x+F.width+4<y.x)&&t.push(y))}var B=0,I=0,J=y=0,K=0,V=0,Q=0,P=0,p=5*d;if(1<m.length){m.push(F);m.sort(function(M,S){return M.y-S.y});var z=!1;v=F==m[0];d=F==m[m.length-1];if(!v&&!d)for(v=1;v<m.length-1;v++)if(F==m[v]){d=m[v-1];v=m[v+1];y=I=J=(v.y-d.y-d.height-F.height)/2;break}for(v=0;v<m.length-1;v++){d=m[v];var A=m[v+1],C=F==d||F==A;A=A.y-d.y-d.height;z|=F==d;if(0==I&&0==+B)I=A,B=1;else if(Math.abs(I-A)<=(C||1==v&&z?g:0))B+=1;else if(1<B&&z){m=m.slice(0,v+1);break}else if(3<=m.length-v&&!z)B=0,y=I=0!=J?J:0,m.splice(0,0==v?1:v),v=-1;else break;0!=y||C||(I=y=A)}3==m.length&&m[1]==F&&(y=0)}if(1<t.length){t.push(F);t.sort(function(M,S){return M.x-S.x});z=!1;v=F==t[0];d=F==t[t.length-1];if(!v&&!d)for(v=1;v<t.length-1;v++)if(F==t[v]){d=t[v-1];v=t[v+1];Q=V=P=(v.x-d.x-d.width-F.width)/2;break}for(v=0;v<t.length-1;v++){d=t[v];A=t[v+1];C=F==d||F==A;A=A.x-d.x-d.width;z|=F==d;+if(0==V&&0==K)V=A,K=1;else if(Math.abs(V-A)<=(C||1==v&&z?g:0))K+=1;else if(1<K&&z){t=t.slice(0,v+1);break}else if(3<=t.length-v&&!z)K=0,Q=V=0!=P?P:0,t.splice(0,0==v?1:v),v=-1;else break;0!=Q||C||(V=Q=A)}3==t.length&&t[1]==F&&(Q=0)}g=function(M,S,l,x){var G=[];if(x){x=p;var N=0}else x=0,N=p;G.push(new mxPoint(M.x-x,M.y-N));G.push(new mxPoint(M.x+x,M.y+N));G.push(M);G.push(S);G.push(new mxPoint(S.x-x,S.y-N));G.push(new mxPoint(S.x+x,S.y+N));if(null!=l)return l.points=G,l;M=new mxPolyline(G,mxConstants.GUIDE_COLOR,+mxConstants.GUIDE_STROKEWIDTH);M.dialect=mxConstants.DIALECT_SVG;M.pointerEvents=!1;M.init(L.graph.getView().getOverlayPane());return M};V=function(M,S){if(M&&null!=L.guidesArrHor)for(M=0;M<L.guidesArrHor.length;M++)L.guidesArrHor[M].node.style.visibility="hidden";if(S&&null!=L.guidesArrVer)for(M=0;M<L.guidesArrVer.length;M++)L.guidesArrVer[M].node.style.visibility="hidden"};if(1<K&&K==t.length-1){K=[];P=L.guidesArrHor;H=[];E=0;v=t[0]==F?1:0;z=t[v].y+t[v].height;if(0<Q)for(v=0;v<t.length-1;v++)d=+t[v],A=t[v+1],F==d?(E=A.x-d.width-Q,H.push(new mxPoint(E+d.width+p,z)),H.push(new mxPoint(A.x-p,z))):F==A?(H.push(new mxPoint(d.x+d.width+p,z)),E=d.x+d.width+Q,H.push(new mxPoint(E-p,z))):(H.push(new mxPoint(d.x+d.width+p,z)),H.push(new mxPoint(A.x-p,z)));else d=t[0],v=t[2],E=d.x+d.width+(v.x-d.x-d.width-F.width)/2,H.push(new mxPoint(d.x+d.width+p,z)),H.push(new mxPoint(E-p,z)),H.push(new mxPoint(E+F.width+p,z)),H.push(new mxPoint(v.x-p,z));for(v=0;v<H.length;v+=2)t=H[v],Q=H[v+1],t=g(t,Q,null!=P?+P[v/2]:null),t.node.style.visibility="visible",t.redraw(),K.push(t);for(v=H.length/2;null!=P&&v<P.length;v++)P[v].destroy();L.guidesArrHor=K;E-=c.x;H=!0}else V(!0);if(1<B&&B==m.length-1){K=[];P=L.guidesArrVer;D=[];u=0;v=m[0]==F?1:0;B=m[v].x+m[v].width;if(0<y)for(v=0;v<m.length-1;v++)d=m[v],A=m[v+1],F==d?(u=A.y-d.height-y,D.push(new mxPoint(B,u+d.height+p)),D.push(new mxPoint(B,A.y-p))):F==A?(D.push(new mxPoint(B,d.y+d.height+p)),u=d.y+d.height+y,D.push(new mxPoint(B,u-p))):(D.push(new mxPoint(B,d.y++d.height+p)),D.push(new mxPoint(B,A.y-p)));else d=m[0],v=m[2],u=d.y+d.height+(v.y-d.y-d.height-F.height)/2,D.push(new mxPoint(B,d.y+d.height+p)),D.push(new mxPoint(B,u-p)),D.push(new mxPoint(B,u+F.height+p)),D.push(new mxPoint(B,v.y-p));for(v=0;v<D.length;v+=2)t=D[v],Q=D[v+1],t=g(t,Q,null!=P?P[v/2]:null,!0),t.node.style.visibility="visible",t.redraw(),K.push(t);for(v=D.length/2;null!=P&&v<P.length;v++)P[v].destroy();L.guidesArrVer=K;u-=c.y;D=!0}else V(!1,!0)}if(H||D)return F=new mxPoint(E,u),m=b.call(this,c,F,n,q),H&&!D?F.y=m.y:D&&!H&&(F.x=m.x),m.y!=F.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),m.x!=F.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),F;V(!0,!0);return b.apply(this,arguments)};var e=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(c){e.call(this,c);var k=this.guidesArrVer,n=this.guidesArrHor;if(null!=k)for(var q=0;q<k.length;q++)k[q].node.style.visibility=c?"visible":"hidden";if(null!=-n)for(q=0;q<n.length;q++)n[q].node.style.visibility=c?"visible":"hidden"};var f=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){f.call(this);var c=this.guidesArrVer,k=this.guidesArrHor;if(null!=c){for(var n=0;n<c.length;n++)c[n].destroy();this.guidesArrVer=null}if(null!=k){for(n=0;n<k.length;n++)k[n].destroy();this.guidesArrHor=null}}})();function mxRuler(b,e,f,c){function k(){var B=b.diagramContainer;L.style.top=B.offsetTop-E+"px";L.style.left=B.offsetLeft-E+"px";L.style.width=(f?0:B.offsetWidth)+E+"px";L.style.height=(f?B.offsetHeight:0)+E+"px"}function n(B,I,K){if(null!=q)return B;var J;return function(){var V=this,Q=arguments,O=K&&!J;clearTimeout(J);J=setTimeout(function(){J=null;K||B.apply(V,Q)},I);O&&B.apply(V,Q)}}var q=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,+n)for(q=0;q<n.length;q++)n[q].node.style.visibility=c?"visible":"hidden"};var f=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){f.call(this);var c=this.guidesArrVer,k=this.guidesArrHor;if(null!=c){for(var n=0;n<c.length;n++)c[n].destroy();this.guidesArrVer=null}if(null!=k){for(n=0;n<k.length;n++)k[n].destroy();this.guidesArrHor=null}}})();function mxRuler(b,e,f,c){function k(){var B=b.diagramContainer;L.style.top=B.offsetTop-E+"px";L.style.left=B.offsetLeft-E+"px";L.style.width=(f?0:B.offsetWidth)+E+"px";L.style.height=(f?B.offsetHeight:0)+E+"px"}function n(B,I,J){if(null!=q)return B;var K;return function(){var V=this,Q=arguments,P=J&&!K;clearTimeout(K);K=setTimeout(function(){K=null;J||B.apply(V,Q)},I);P&&B.apply(V,Q)}}var q=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,u=window.cancelAnimationFrame||window.mozCancelAnimationFrame,E=this.RULER_THICKNESS,H=this;this.unit=e;var D=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:Editor.darkColor,cornerClr:Editor.darkColor,strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},L=document.createElement("div");L.className="geRuler";L.style.position="fixed";this.updateStyle=mxUtils.bind(this,function(){D=Editor.isDarkMode()?{outBkgClr:Editor.darkColor,cornerClr:Editor.darkColor,strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};L.style[f?"borderRight":"borderBottom"]="0.5px solid "+D.strokeClr;L.style.borderLeft="0.5px solid "+D.strokeClr});this.updateStyle();b.diagramContainer.appendChild(L);mxEvent.disableContextMenu(L);this.editorUiRefresh=b.refresh;b.refresh=function(B){H.editorUiRefresh.apply(b,-arguments);k()};k();var F=document.createElement("canvas");F.width=L.offsetWidth;F.height=L.offsetHeight;L.style.overflow="hidden";F.style.position="relative";L.appendChild(F);var d=F.getContext("2d");this.ui=b;var g=b.editor.graph;this.graph=g;this.container=L;this.canvas=F;var m=function(B,I,K,J,V){B=Math.round(B);I=Math.round(I);K=Math.round(K);J=Math.round(J);d.beginPath();d.moveTo(B+.5,I+.5);d.lineTo(K+.5,J+.5);d.stroke();V&&(f?(d.save(),d.translate(B,I),d.rotate(-Math.PI/2),d.fillText(V,0,0),-d.restore()):d.fillText(V,B,I))},t=function(){d.clearRect(0,0,F.width,F.height);d.beginPath();d.lineWidth=.7;d.strokeStyle=D.strokeClr;d.setLineDash([]);d.font="9px Arial";d.textAlign="center";var B=g.view.scale,I=g.view.getBackgroundPageBounds(),K=g.view.translate,J=g.pageVisible;K=J?E+(f?I.y-g.container.scrollTop:I.x-g.container.scrollLeft):E+(f?K.y*B-g.container.scrollTop:K.x*B-g.container.scrollLeft);var V=0;J&&(V=g.getPageLayout(),V=f?V.y*g.pageFormat.height:V.x*g.pageFormat.width);var Q;switch(H.unit){case mxConstants.POINTS:var O=-Q=10;var p=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:Q=10;O=mxConstants.PIXELS_PER_MM;p=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:Q=20;O=mxConstants.PIXELS_PER_MM;p=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:Q=.5>=B||4<=B?8:16,O=mxConstants.PIXELS_PER_INCH/Q,p=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var z=O;2<=B?z=O/(2*Math.floor(B/2)):.5>=B&&(z=O*Math.floor(1/B/2)*(H.unit==mxConstants.MILLIMETERS?2:1));O=null;I=J?Math.min(K+(f?I.height:I.width),f?-F.height:F.width):f?F.height:F.width;if(J)if(d.fillStyle=D.outBkgClr,f){var A=K-E;0<A&&d.fillRect(0,E,E,A);I<F.height&&d.fillRect(0,I,E,F.height)}else A=K-E,0<A&&d.fillRect(E,0,A,E),I<F.width&&d.fillRect(I,0,F.width,E);d.fillStyle=D.fontClr;for(J=J?K:K%(z*B);J<=I;J+=z*B)if(A=Math.round((J-K)/B/z),!(J<E||A==O)){O=A;var C=null;0==A%Q&&(C=H.formatText(V+A*z)+"");f?m(E-p[Math.abs(A)%Q],J,E,J,C):m(J,E-p[Math.abs(A)%Q],J,E,C)}d.lineWidth=1;m(f?0:E,f?E:0,E,E);d.fillStyle=D.cornerClr;d.fillRect(0,0,E,E)},+arguments);k()};k();var F=document.createElement("canvas");F.width=L.offsetWidth;F.height=L.offsetHeight;L.style.overflow="hidden";F.style.position="relative";L.appendChild(F);var d=F.getContext("2d");this.ui=b;var g=b.editor.graph;this.graph=g;this.container=L;this.canvas=F;var m=function(B,I,J,K,V){B=Math.round(B);I=Math.round(I);J=Math.round(J);K=Math.round(K);d.beginPath();d.moveTo(B+.5,I+.5);d.lineTo(J+.5,K+.5);d.stroke();V&&(f?(d.save(),d.translate(B,I),d.rotate(-Math.PI/2),d.fillText(V,0,0),+d.restore()):d.fillText(V,B,I))},t=function(){d.clearRect(0,0,F.width,F.height);d.beginPath();d.lineWidth=.7;d.strokeStyle=D.strokeClr;d.setLineDash([]);d.font="9px Arial";d.textAlign="center";var B=g.view.scale,I=g.view.getBackgroundPageBounds(),J=g.view.translate,K=g.pageVisible;J=K?E+(f?I.y-g.container.scrollTop:I.x-g.container.scrollLeft):E+(f?J.y*B-g.container.scrollTop:J.x*B-g.container.scrollLeft);var V=0;K&&(V=g.getPageLayout(),V=f?V.y*g.pageFormat.height:V.x*g.pageFormat.width);var Q;switch(H.unit){case mxConstants.POINTS:var P=+Q=10;var p=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:Q=10;P=mxConstants.PIXELS_PER_MM;p=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:Q=20;P=mxConstants.PIXELS_PER_MM;p=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:Q=.5>=B||4<=B?8:16,P=mxConstants.PIXELS_PER_INCH/Q,p=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var z=P;2<=B?z=P/(2*Math.floor(B/2)):.5>=B&&(z=P*Math.floor(1/B/2)*(H.unit==mxConstants.MILLIMETERS?2:1));P=null;I=K?Math.min(J+(f?I.height:I.width),f?+F.height:F.width):f?F.height:F.width;if(K)if(d.fillStyle=D.outBkgClr,f){var A=J-E;0<A&&d.fillRect(0,E,E,A);I<F.height&&d.fillRect(0,I,E,F.height)}else A=J-E,0<A&&d.fillRect(E,0,A,E),I<F.width&&d.fillRect(I,0,F.width,E);d.fillStyle=D.fontClr;for(K=K?J:J%(z*B);K<=I;K+=z*B)if(A=Math.round((K-J)/B/z),!(K<E||A==P)){P=A;var C=null;0==A%Q&&(C=H.formatText(V+A*z)+"");f?m(E-p[Math.abs(A)%Q],K,E,K,C):m(K,E-p[Math.abs(A)%Q],K,E,C)}d.lineWidth=1;m(f?0:E,f?E:0,E,E);d.fillStyle=D.cornerClr;d.fillRect(0,0,E,E)},v=-1,y=function(){null!=q?(null!=u&&u(v),v=q(t)):t()};this.drawRuler=y;this.sizeListener=e=n(function(){var B=g.container;f?(B=B.offsetHeight+E,F.height!=B&&(F.height=B,L.style.height=B+"px",y())):(B=B.offsetWidth+E,F.width!=B&&(F.width=B,L.style.width=B+"px",y()))},10);this.pageListener=function(){y()};this.scrollListener=c=n(function(){var B=f?g.container.scrollTop:g.container.scrollLeft;H.lastScroll!=B&&(H.lastScroll=B,y())},10);this.unitListener=function(B,I){H.setUnit(I.getProperty("unit"))};-g.addListener(mxEvent.SIZE,e);g.container.addEventListener("scroll",c);g.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(B){D=B;L.style.background=D.bkgClr;t()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(B,I,K,J){if(f&&4<B.height||!f&&4<B.width){if(null!=H.guidePart)try{d.putImageData(H.guidePart.imgData1,-H.guidePart.x1,H.guidePart.y1),d.putImageData(H.guidePart.imgData2,H.guidePart.x2,H.guidePart.y2),d.putImageData(H.guidePart.imgData3,H.guidePart.x3,H.guidePart.y3)}catch(x){}var V=H.origGuideMove.apply(this,arguments);try{d.lineWidth=.5;d.strokeStyle=D.guideClr;d.setLineDash([2]);if(f){var Q=B.y+V.y+E-this.graph.container.scrollTop;var O=0;var p=Q+B.height/2;var z=E/2;var A=Q+B.height;var C=0;var M=d.getImageData(O,Q-1,E,3);m(O,Q,E,Q);Q--;var S=d.getImageData(z,p-1,E,3);m(z,p,E,p);p--;var l=d.getImageData(C,-A-1,E,3);m(C,A,E,A);A--}else Q=0,O=B.x+V.x+E-this.graph.container.scrollLeft,p=E/2,z=O+B.width/2,A=0,C=O+B.width,M=d.getImageData(O-1,Q,3,E),m(O,Q,O,E),O--,S=d.getImageData(z-1,p,3,E),m(z,p,z,E),z--,l=d.getImageData(C-1,A,3,E),m(C,A,C,E),C--;if(null==H.guidePart||H.guidePart.x1!=O||H.guidePart.y1!=Q)H.guidePart={imgData1:M,x1:O,y1:Q,imgData2:S,x2:z,y2:p,imgData3:l,x3:C,y3:A}}catch(x){}}else V=H.origGuideMove.apply(this,arguments);return V};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=+g.addListener(mxEvent.SIZE,e);g.container.addEventListener("scroll",c);g.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(B){D=B;L.style.background=D.bkgClr;t()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(B,I,J,K){if(f&&4<B.height||!f&&4<B.width){if(null!=H.guidePart)try{d.putImageData(H.guidePart.imgData1,+H.guidePart.x1,H.guidePart.y1),d.putImageData(H.guidePart.imgData2,H.guidePart.x2,H.guidePart.y2),d.putImageData(H.guidePart.imgData3,H.guidePart.x3,H.guidePart.y3)}catch(x){}var V=H.origGuideMove.apply(this,arguments);try{d.lineWidth=.5;d.strokeStyle=D.guideClr;d.setLineDash([2]);if(f){var Q=B.y+V.y+E-this.graph.container.scrollTop;var P=0;var p=Q+B.height/2;var z=E/2;var A=Q+B.height;var C=0;var M=d.getImageData(P,Q-1,E,3);m(P,Q,E,Q);Q--;var S=d.getImageData(z,p-1,E,3);m(z,p,E,p);p--;var l=d.getImageData(C,+A-1,E,3);m(C,A,E,A);A--}else Q=0,P=B.x+V.x+E-this.graph.container.scrollLeft,p=E/2,z=P+B.width/2,A=0,C=P+B.width,M=d.getImageData(P-1,Q,3,E),m(P,Q,P,E),P--,S=d.getImageData(z-1,p,3,E),m(z,p,z,E),z--,l=d.getImageData(C-1,A,3,E),m(C,A,C,E),C--;if(null==H.guidePart||H.guidePart.x1!=P||H.guidePart.y1!=Q)H.guidePart={imgData1:M,x1:P,y1:Q,imgData2:S,x2:z,y2:p,imgData3:l,x3:C,y3:A}}catch(x){}}else V=H.origGuideMove.apply(this,arguments);return V};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var B=H.origGuideDestroy.apply(this,arguments);if(null!=H.guidePart)try{d.putImageData(H.guidePart.imgData1,H.guidePart.x1,H.guidePart.y1),d.putImageData(H.guidePart.imgData2,H.guidePart.x2,H.guidePart.y2),d.putImageData(H.guidePart.imgData3,H.guidePart.x3,H.guidePart.y3),H.guidePart=null}catch(I){}return B}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};mxRuler.prototype.formatText=function(b){switch(this.unit){case mxConstants.POINTS:return Math.round(b);case mxConstants.MILLIMETERS:return(b/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(b/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(b/mxConstants.PIXELS_PER_INCH).toFixed(2)}};mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener(this.unitListener);this.ui.removeListener(this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};@@ -14602,34 +14604,34 @@ function(n){k=null!=b.currentMenu;mxEvent.consume(n)}),null,mxUtils.bind(this,fu!0;q.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(q,arguments);b.resetCurrentMenu();q.destroy()});var u=mxEvent.getClientX(n),E=mxEvent.getClientY(n);q.popup(u,E,null,n);b.setCurrentMenu(q,c)}mxEvent.consume(n)}}))});e(this.hRuler.container);e(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.updateStyle=function(){this.vRuler.updateStyle();this.hRuler.updateStyle();this.vRuler.drawRuler();this.hRuler.drawRuler()};mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var e=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=e){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var f=mxFreehand.prototype.MILD_SMOOTHING,c=null,k=[],n,q=[],u,E=!1,H=!0,D=!0,L=!0,F=!0,d=[],g=!1,m=!1,t=!1,v="default",y={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},B=!0;this.setClosedPath=function(p){E=p};this.setAutoClose=function(p){H=p};this.setAutoInsert=function(p){D=p};this.setAutoScroll=function(p){L=p};this.setOpenFill=function(p){F=p};this.setStopClickEnabled=function(p){m=p};this.setSelectInserted=function(p){t=p};this.setSmoothing=function(p){f=p};this.getSmoothing=function(){return f};this.setPerfectFreehandMode=function(p){B=p};this.isPerfectFreehandMode=function(){return B};this.setBrushSize=function(p){y.size=p};this.getBrushSize=function(){return y.size};var I=function(p){g=p;b.getRubberband().setEnabled(!p);b.graphHandler.setSelectEnabled(!p);-b.graphHandler.setMoveEnabled(!p);b.container.style.cursor=p?"crosshair":"";b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){I(!0)};this.isDrawing=function(){return g};var K=mxUtils.bind(this,function(p){if(c){var z=u.length,A=m&&0<q.length&&null!=u&&2>u.length;A||q.push.apply(q,u);u=[];q.push(null);k.push(c);c=null;(A||D)&&this.stopDrawing();D&&(!A||2<=z)&&this.startDrawing();mxEvent.consume(p)}}),J=new mxCell;J.edge=!0;this.getStrokeColor=function(p){var z=null!=-v?v:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(J),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=z||p||(z=b.shapeForegroundColor);return z};this.setStrokeColor=function(p){v=p};this.createStyle=function(p){var z=";fillColor=none;";B&&(z=";lineShape=1;");z+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+"="+p+z};this.stopDrawing=function(){if(0<k.length){if(B){for(var p=[],z=0;z<q.length;z++)null!=q[z]&&p.push([q[z].x,+b.graphHandler.setMoveEnabled(!p);b.container.style.cursor=p?"crosshair":"";b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){I(!0)};this.isDrawing=function(){return g};var J=mxUtils.bind(this,function(p){if(c){var z=u.length,A=m&&0<q.length&&null!=u&&2>u.length;A||q.push.apply(q,u);u=[];q.push(null);k.push(c);c=null;(A||D)&&this.stopDrawing();D&&(!A||2<=z)&&this.startDrawing();mxEvent.consume(p)}}),K=new mxCell;K.edge=!0;this.getStrokeColor=function(p){var z=null!=+v?v:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(K),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=z||p||(z=b.shapeForegroundColor);return z};this.setStrokeColor=function(p){v=p};this.createStyle=function(p){var z=";fillColor=none;";B&&(z=";lineShape=1;");z+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+"="+p+z};this.stopDrawing=function(){if(0<k.length){if(B){for(var p=[],z=0;z<q.length;z++)null!=q[z]&&p.push([q[z].x,q[z].y]);p=PerfectFreehand.getStroke(p,y);q=[];for(z=0;z<p.length;z++)q.push({x:p[z][0],y:p[z][1]});q.push(null)}p=q[0].x;var A=q[0].x,C=q[0].y,M=q[0].y;for(z=1;z<q.length;z++)null!=q[z]&&(p=Math.max(p,q[z].x),A=Math.min(A,q[z].x),C=Math.max(C,q[z].y),M=Math.min(M,q[z].y));p-=A;C-=M;if(0<p&&0<C){var S=100/p,l=100/C;q.map(function(R){if(null==R)return R;R.x=(R.x-A)*S;R.y=(R.y-M)*l;return R});var x='<shape strokewidth="inherit"><foreground>',G=0;for(z=0;z<q.length;z++){var N=q[z];if(null==N){N=!1;G=-q[G];var P=q[z-1];!E&&H&&(N=G.x-P.x,P=G.y-P.y,N=Math.sqrt(N*N+P*P)<=b.tolerance);if(E||N)x+='<line x="'+G.x.toFixed(2)+'" y="'+G.y.toFixed(2)+'"/>';x+="</path>"+(F||E||N?"<fillstroke/>":"<stroke/>");G=z+1}else x=z==G?x+('<path><move x="'+N.x.toFixed(2)+'" y="'+N.y.toFixed(2)+'"/>'):x+('<line x="'+N.x.toFixed(2)+'" y="'+N.y.toFixed(2)+'"/>')}x+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){z=this.createStyle("stencil("+Graph.compress(x)+")");x=b.view.scale;G=b.view.translate;+q[G];var O=q[z-1];!E&&H&&(N=G.x-O.x,O=G.y-O.y,N=Math.sqrt(N*N+O*O)<=b.tolerance);if(E||N)x+='<line x="'+G.x.toFixed(2)+'" y="'+G.y.toFixed(2)+'"/>';x+="</path>"+(F||E||N?"<fillstroke/>":"<stroke/>");G=z+1}else x=z==G?x+('<path><move x="'+N.x.toFixed(2)+'" y="'+N.y.toFixed(2)+'"/>'):x+('<line x="'+N.x.toFixed(2)+'" y="'+N.y.toFixed(2)+'"/>')}x+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){z=this.createStyle("stencil("+Graph.compress(x)+")");x=b.view.scale;G=b.view.translate;z=new mxCell("",new mxGeometry(A/x-G.x,M/x-G.y,p/x,C/x),z);z.vertex=1;b.model.beginUpdate();try{z=b.addCell(z),b.fireEvent(new mxEventObject("cellsInserted","cells",[z])),b.fireEvent(new mxEventObject("freehandInserted","cell",z))}finally{b.model.endUpdate()}t&&b.setSelectionCells([z])}}for(z=0;z<k.length;z++)k[z].parentNode.removeChild(k[z]);c=null;k=[];q=[]}I(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(p,z){p=z.getProperty("eventName");z=z.getProperty("event");p==mxEvent.MOUSE_MOVE&&g&&(null!=z.sourceState&&z.sourceState.setCursor("crosshair"),z.consume())}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(p,z){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(p=z.getEvent(),g&&!mxEvent.isPopupTrigger(p)&&!mxEvent.isMiddleMouseButton(p)&&!mxEvent.isMultiTouchEvent(p))){var A=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);A=Math.max(1,A*b.view.scale);var C=this.getStrokeColor();c=document.createElementNS("http://www.w3.org/2000/svg","path");c.setAttribute("fill",B?C:"none");c.setAttribute("pointer-events","none");c.setAttribute("stroke",C);c.setAttribute("stroke-width",A);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(C=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",C=C.split(" ").map(function(M){return parseFloat(M)*A}).join(" "),c.setAttribute("stroke-dasharray",C));d=[];p=V(p);Q(p);n="M"+p.x+" "+p.y;q.push(p);u=[];c.setAttribute("d",B?PerfectFreehand.getSvgPathFromStroke([[p.x,p.y]],y):n);e.appendChild(c);z.consume()}}),-mouseMove:mxUtils.bind(this,function(p,z){if(null!=c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){p=z.getEvent();p=V(p);Q(p);var A=O(0);if(A)if(q.push(A),B){var C=[];for(A=0;A<q.length;A++)C.push([q[A].x,q[A].y]);u=[];for(var M=2;M<d.length;M+=2)A=O(M),C.push([A.x,A.y]),u.push(A);c.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(C,y))}else{n+=" L"+A.x+" "+A.y;C="";u=[];for(M=2;M<d.length;M+=2)A=O(M),C+=" L"+A.x+" "+A.y,u.push(A);c.setAttribute("d",n+C)}L&&(A=b.view.translate,b.scrollRectToVisible((new mxRectangle(p.x--A.x,p.y-A.y)).grow(20)));z.consume()}}),mouseUp:mxUtils.bind(this,function(p,z){null!=c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(K(z.getEvent()),z.consume())})});var V=function(p){return mxUtils.convertPoint(b.container,mxEvent.getClientX(p),mxEvent.getClientY(p))},Q=function(p){for(d.push(p);d.length>f;)d.shift()},O=function(p){var z=d.length;if(1===z%2||z>=f){var A=0,C=0,M,S=0;for(M=p;M<z;M++)S++,p=d[M],A+=p.x,C+=p.y;return{x:A/S,y:C/S}}return null}}}-mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;function P2PCollab(b,e,f){function c(G,N){try{if(!O){var P=e.file.getCurrentUser();if(Q&&null!=P&&null!=P.displayName){var R={from:I,id:m,type:G,sessionId:e.clientId,userId:P.id,username:P.displayName,data:N,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION};R={bytes:e.objectToString(R),data:"aes"};R=JSON.stringify(R);p&&"cursor"!=G&&EditorUi.debug("P2PCollab: sending to socket server",[R]);m++;P=!p&&("cursor"==G||"selectionChange"==G);V&&!P&&M("message",R);if(P)for(p2pId in J)J[p2pId].send(R)}}}catch(T){null!=-window.console&&console.error(T,G,N)}}function k(G){if(b.shareCursorPosition&&!D.isMouseDown){var N=mxUtils.getOffset(D.container),P=D.view.translate,R=D.view.scale,T=null!=b.currentPage?b.currentPage.getId():null;c("cursor",{pageId:T,x:Math.round((G.getX()-N.x+D.container.scrollLeft)/R-P.x),y:Math.round((G.getY()-N.y+D.container.scrollTop)/R-P.y)})}}function n(G,N){var P=null!=b.currentPage?b.currentPage.getId():null;if(null!=G&&null!=G.cursor&&null!=G.lastCursor)if(null!=G.lastCursor.hide||!b.isShowRemoteCursors()||-null!=G.lastCursor.pageId&&G.lastCursor.pageId!=P)G.cursor.style.display="none";else{P=function(){var Y=Math.max(D.container.scrollLeft,Math.min(D.container.scrollLeft+D.container.clientWidth-G.cursor.clientWidth,U)),Z=Math.max(D.container.scrollTop-22,Math.min(D.container.scrollTop+D.container.clientHeight-G.cursor.clientHeight,W));X.style.opacity=Y!=U||Z!=W?0:1;G.cursor.style.left=Y+"px";G.cursor.style.top=Z+"px";G.cursor.style.display=""};var R=D.view.translate,T=D.view.scale,U=(R.x+G.lastCursor.x)*-T+8,W=(R.y+G.lastCursor.y)*T-12,X=G.cursor.getElementsByTagName("img")[0];N?(mxUtils.setPrefixedStyle(G.cursor.style,"transition","all 900ms ease-out"),mxUtils.setPrefixedStyle(X.style,"transition","all 900ms ease-out"),window.setTimeout(P,0)):(mxUtils.setPrefixedStyle(G.cursor.style,"transition",null),mxUtils.setPrefixedStyle(X.style,"transition",null),P())}}function q(G,N){try{var P=function(){if(null==g[T]){var ca=B[T];null==ca&&(ca=L%d.length,B[T]=ca,L++);var da=d[ca];ca=11<ca?"black":"white";+mouseMove:mxUtils.bind(this,function(p,z){if(null!=c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){p=z.getEvent();p=V(p);Q(p);var A=P(0);if(A)if(q.push(A),B){var C=[];for(A=0;A<q.length;A++)C.push([q[A].x,q[A].y]);u=[];for(var M=2;M<d.length;M+=2)A=P(M),C.push([A.x,A.y]),u.push(A);c.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(C,y))}else{n+=" L"+A.x+" "+A.y;C="";u=[];for(M=2;M<d.length;M+=2)A=P(M),C+=" L"+A.x+" "+A.y,u.push(A);c.setAttribute("d",n+C)}L&&(A=b.view.translate,b.scrollRectToVisible((new mxRectangle(p.x-+A.x,p.y-A.y)).grow(20)));z.consume()}}),mouseUp:mxUtils.bind(this,function(p,z){null!=c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(J(z.getEvent()),z.consume())})});var V=function(p){return mxUtils.convertPoint(b.container,mxEvent.getClientX(p),mxEvent.getClientY(p))},Q=function(p){for(d.push(p);d.length>f;)d.shift()},P=function(p){var z=d.length;if(1===z%2||z>=f){var A=0,C=0,M,S=0;for(M=p;M<z;M++)S++,p=d[M],A+=p.x,C+=p.y;return{x:A/S,y:C/S}}return null}}}+mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;function P2PCollab(b,e,f){function c(G,N){try{if(!P){var O=e.file.getCurrentUser();if(Q&&null!=O&&null!=O.displayName){var R={from:I,id:m,type:G,sessionId:e.clientId,userId:O.id,username:O.displayName,data:N,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION};R={bytes:e.objectToString(R),data:"aes"};R=JSON.stringify(R);p&&"cursor"!=G&&EditorUi.debug("P2PCollab: sending to socket server",[R]);m++;O=!p&&("cursor"==G||"selectionChange"==G);V&&!O&&M("message",R);if(O)for(p2pId in K)K[p2pId].send(R)}}}catch(T){null!=+window.console&&console.error(T,G,N)}}function k(G){if(b.shareCursorPosition&&!D.isMouseDown){var N=mxUtils.getOffset(D.container),O=D.view.translate,R=D.view.scale,T=null!=b.currentPage?b.currentPage.getId():null;c("cursor",{pageId:T,x:Math.round((G.getX()-N.x+D.container.scrollLeft)/R-O.x),y:Math.round((G.getY()-N.y+D.container.scrollTop)/R-O.y)})}}function n(G,N){var O=null!=b.currentPage?b.currentPage.getId():null;if(null!=G&&null!=G.cursor&&null!=G.lastCursor)if(null!=G.lastCursor.hide||!b.isShowRemoteCursors()||+null!=G.lastCursor.pageId&&G.lastCursor.pageId!=O)G.cursor.style.display="none";else{O=function(){var Y=Math.max(D.container.scrollLeft,Math.min(D.container.scrollLeft+D.container.clientWidth-G.cursor.clientWidth,U)),Z=Math.max(D.container.scrollTop-22,Math.min(D.container.scrollTop+D.container.clientHeight-G.cursor.clientHeight,W));X.style.opacity=Y!=U||Z!=W?0:1;G.cursor.style.left=Y+"px";G.cursor.style.top=Z+"px";G.cursor.style.display=""};var R=D.view.translate,T=D.view.scale,U=(R.x+G.lastCursor.x)*+T+8,W=(R.y+G.lastCursor.y)*T-12,X=G.cursor.getElementsByTagName("img")[0];N?(mxUtils.setPrefixedStyle(G.cursor.style,"transition","all 900ms ease-out"),mxUtils.setPrefixedStyle(X.style,"transition","all 900ms ease-out"),window.setTimeout(O,0)):(mxUtils.setPrefixedStyle(G.cursor.style,"transition",null),mxUtils.setPrefixedStyle(X.style,"transition",null),O())}}function q(G,N){try{var O=function(){if(null==g[T]){var ca=B[T];null==ca&&(ca=L%d.length,B[T]=ca,L++);var da=d[ca];ca=11<ca?"black":"white";g[T]={cursor:document.createElement("div"),color:da,selection:{}};v[N]=T;U=g[T].cursor;U.style.pointerEvents="none";U.style.position="absolute";U.style.display="none";U.style.opacity="0.9";var ja=document.createElement("img");mxUtils.setPrefixedStyle(ja.style,"transform","rotate(-45deg)translateX(-14px)");ja.setAttribute("src",Graph.createSvgImage(8,12,'<path d="M 4 0 L 8 12 L 4 10 L 0 12 Z" stroke="'+da+'" fill="'+da+'"/>').src);ja.style.width="10px";U.appendChild(ja);ja=document.createElement("div");-ja.style.backgroundColor=da;ja.style.color=ca;ja.style.fontSize="9pt";ja.style.padding="3px 7px";ja.style.marginTop="8px";ja.style.borderRadius="10px";ja.style.maxWidth="100px";ja.style.overflow="hidden";ja.style.textOverflow="ellipsis";ja.style.whiteSpace="nowrap";mxUtils.write(ja,R);U.appendChild(ja);b.diagramContainer.appendChild(U)}else U=g[T].cursor;W=g[T].selection};if(!O){G=JSON.parse(G);null!=G.bytes&&(G=e.stringToObject(G.bytes));p&&"cursor"!=G.type&&EditorUi.debug("P2PCollab: msg received",-[G]);if(null!=N){if(G.from==I||t[G.from]>=G.id){EditorUi.debug("P2PCollab: Dropped Message",G,I,t[G.from]);return}t[G.from]=G.id}var R=G.username?G.username:"Anonymous",T=G.sessionId,U,W;null!=g[T]&&(clearTimeout(g[T].inactiveTO),g[T].inactiveTO=setTimeout(function(){E(null,T)},12E4));var X=G.data;switch(G.type){case "cursor":P();g[T].lastCursor=X;n(g[T],!0);break;case "diff":try{G=null!=X.patch?e.stringToObject(decodeURIComponent(X.patch)):X.diff,e.receiveRemoteChanges(G.d)}catch(ca){EditorUi.debug("P2PCollab: Diff msg error",-ca)}break;case "selectionChange":if("0"!=urlParams["remote-selection"]){var Y=null!=b.currentPage?b.currentPage.getId():null;if(null==Y||null!=X.pageId&&X.pageId==Y){P();for(P=0;P<X.removed.length;P++){var Z=X.removed[P];if(null!=Z){var ba=W[Z];delete W[Z];null!=ba&&ba.destroy()}}for(P=0;P<X.added.length;P++)if(Z=X.added[P],null!=Z){var ha=D.model.getCell(Z);null!=ha&&(W[Z]=D.highlightCell(ha,g[T].color,6E4,70,3))}}}break;case "notify":G=null!=X.data?e.stringToObject(decodeURIComponent(X.data)):X.msg,-e.handleMessageData(G.d)}e.file.fireEvent(new mxEventObject("realtimeMessage","message",G))}}catch(ca){null!=window.console&&console.warn(ca,G,N)}}function u(G,N){if(!p&&SimplePeer.WEBRTC_SUPPORT){var P=new SimplePeer({initiator:N,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});P.on("signal",function(R){M("sendSignal",{to:G,from:I,signal:R})});P.on("error",function(R){delete K[G];EditorUi.debug("P2PCollab: p2p socket error",R);!O&&N&&P.destroyed&&y[G]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",-G),u(G,!0))});P.on("connect",function(){delete K[G];null==J[G]||J[G].destroyed?(J[G]=P,y[G]=!0,EditorUi.debug("P2PCollab: p2p socket connected",G)):(P.noP2PMapDel=!0,P.destroy(),EditorUi.debug("P2PCollab: p2p socket duplicate",G))});P.on("close",function(){P.noP2PMapDel||(EditorUi.debug("P2PCollab: p2p socket closed",G),H(v[G]),delete J[G])});P.on("data",q);return K[G]=P}}function E(G,N){H(N||v[G]);null!=G&&(delete v[G],y[G]=!1)}function H(G){var N=g[G];if(null!=N){var P=N.selection,R;for(R in P)null!=-P[R]&&P[R].destroy();null!=N.cursor&&null!=N.cursor.parentNode&&N.cursor.parentNode.removeChild(N.cursor);clearTimeout(N.inactiveTO);delete g[G]}}var D=b.editor.graph,L=0,F=null,d="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),g={},m=1,t={},v={},y={},B={},I,K={},J={},V=!0,Q=!1,O=!1,p="0"!=urlParams["no-p2p"],z=!1,A=0,C=null,M=mxUtils.bind(this,function(G,N){if(!O)try{null!=-F?(F.send(JSON.stringify({action:G,msg:N})),p||EditorUi.debug("P2PCollab: sending to socket server",[G],[N])):this.joinFile(!0)}catch(P){C=P,e.file.fireEvent(new mxEventObject("realtimeStateChanged")),EditorUi.debug("P2PCollab:","sendReply error",arguments,P)}});this.sendMessage=c;this.sendDiff=function(G){this.sendMessage("diff",{diff:G})};this.sendNotification=function(G){this.sendMessage("notify",{msg:G})};this.getState=function(){return null!=F?F.readyState:3};this.getLastError=function(){return C};-this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(G,N){},mouseMove:function(G,N){var P,R=-1;return function(){clearTimeout(P);var T=this,U=arguments,W=function(){P=null;R=Date.now();G.apply(T,U)};Date.now()-R>N?W():P=setTimeout(W,N)}}(function(G,N){k(N)},300),mouseUp:function(G,N){k(N)}};D.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||c("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);-var S=mxGraphHandler.prototype.maxCells,l=null,x={};this.selectionChangeListener=function(G,N){var P=function(R){return null!=R?R.id:null};null!=l&&window.clearTimeout(l);l=window.setTimeout(function(){for(var R=D.getSelectionCount()>S?[]:D.getSelectionCells().map(P),T=null!=b.currentPage?b.currentPage.getId():null,U={},W=[],X=[],Y=0;Y<R.length;Y++){var Z=R[Y];null!=Z&&(U[Z]=!0,null==x[Z]&&X.push(Z))}for(Z in x)U[Z]||W.push(Z);x=U;c("selectionChange",{pageId:T,removed:W,added:X})},300)};D.getSelectionModel().addListener(mxEvent.CHANGE,-this.selectionChangeListener);this.cursorHandler=mxUtils.bind(this,function(){for(var G in g)n(g[G])});mxEvent.addListener(D.container,"scroll",this.cursorHandler);D.getView().addListener(mxEvent.SCALE,this.cursorHandler);D.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);D.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(G){if(!O)try{z&&+ja.style.backgroundColor=da;ja.style.color=ca;ja.style.fontSize="9pt";ja.style.padding="3px 7px";ja.style.marginTop="8px";ja.style.borderRadius="10px";ja.style.maxWidth="100px";ja.style.overflow="hidden";ja.style.textOverflow="ellipsis";ja.style.whiteSpace="nowrap";mxUtils.write(ja,R);U.appendChild(ja);b.diagramContainer.appendChild(U)}else U=g[T].cursor;W=g[T].selection};if(!P){G=JSON.parse(G);null!=G.bytes&&(G=e.stringToObject(G.bytes));p&&"cursor"!=G.type&&EditorUi.debug("P2PCollab: msg received",+[G]);if(null!=N){if(G.from==I||t[G.from]>=G.id){EditorUi.debug("P2PCollab: Dropped Message",G,I,t[G.from]);return}t[G.from]=G.id}var R=G.username?G.username:"Anonymous",T=G.sessionId,U,W;null!=g[T]&&(clearTimeout(g[T].inactiveTO),g[T].inactiveTO=setTimeout(function(){E(null,T)},12E4));var X=G.data;switch(G.type){case "cursor":O();g[T].lastCursor=X;n(g[T],!0);break;case "diff":try{G=null!=X.patch?e.stringToObject(decodeURIComponent(X.patch)):X.diff,e.receiveRemoteChanges(G.d)}catch(ca){EditorUi.debug("P2PCollab: Diff msg error",+ca)}break;case "selectionChange":if("0"!=urlParams["remote-selection"]){var Y=null!=b.currentPage?b.currentPage.getId():null;if(null==Y||null!=X.pageId&&X.pageId==Y){O();for(O=0;O<X.removed.length;O++){var Z=X.removed[O];if(null!=Z){var ba=W[Z];delete W[Z];null!=ba&&ba.destroy()}}for(O=0;O<X.added.length;O++)if(Z=X.added[O],null!=Z){var fa=D.model.getCell(Z);null!=fa&&(W[Z]=D.highlightCell(fa,g[T].color,6E4,70,3))}}}break;case "notify":G=null!=X.data?e.stringToObject(decodeURIComponent(X.data)):X.msg,+e.handleMessageData(G.d)}e.file.fireEvent(new mxEventObject("realtimeMessage","message",G))}}catch(ca){null!=window.console&&console.warn(ca,G,N)}}function u(G,N){if(!p&&SimplePeer.WEBRTC_SUPPORT){var O=new SimplePeer({initiator:N,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});O.on("signal",function(R){M("sendSignal",{to:G,from:I,signal:R})});O.on("error",function(R){delete J[G];EditorUi.debug("P2PCollab: p2p socket error",R);!P&&N&&O.destroyed&&y[G]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",+G),u(G,!0))});O.on("connect",function(){delete J[G];null==K[G]||K[G].destroyed?(K[G]=O,y[G]=!0,EditorUi.debug("P2PCollab: p2p socket connected",G)):(O.noP2PMapDel=!0,O.destroy(),EditorUi.debug("P2PCollab: p2p socket duplicate",G))});O.on("close",function(){O.noP2PMapDel||(EditorUi.debug("P2PCollab: p2p socket closed",G),H(v[G]),delete K[G])});O.on("data",q);return J[G]=O}}function E(G,N){H(N||v[G]);null!=G&&(delete v[G],y[G]=!1)}function H(G){var N=g[G];if(null!=N){var O=N.selection,R;for(R in O)null!=+O[R]&&O[R].destroy();null!=N.cursor&&null!=N.cursor.parentNode&&N.cursor.parentNode.removeChild(N.cursor);clearTimeout(N.inactiveTO);delete g[G]}}var D=b.editor.graph,L=0,F=null,d="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),g={},m=1,t={},v={},y={},B={},I,J={},K={},V=!0,Q=!1,P=!1,p="0"!=urlParams["no-p2p"],z=!1,A=0,C=null,M=mxUtils.bind(this,function(G,N){if(!P)try{null!=+F?(F.send(JSON.stringify({action:G,msg:N})),p||EditorUi.debug("P2PCollab: sending to socket server",[G],[N])):this.joinFile(!0)}catch(O){C=O,e.file.fireEvent(new mxEventObject("realtimeStateChanged")),EditorUi.debug("P2PCollab:","sendReply error",arguments,O)}});this.sendMessage=c;this.sendDiff=function(G){this.sendMessage("diff",{diff:G})};this.sendNotification=function(G){this.sendMessage("notify",{msg:G})};this.getState=function(){return null!=F?F.readyState:3};this.getLastError=function(){return C};+this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(G,N){},mouseMove:function(G,N){var O,R=-1;return function(){clearTimeout(O);var T=this,U=arguments,W=function(){O=null;R=Date.now();G.apply(T,U)};Date.now()-R>N?W():O=setTimeout(W,N)}}(function(G,N){k(N)},300),mouseUp:function(G,N){k(N)}};D.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||c("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);+var S=mxGraphHandler.prototype.maxCells,l=null,x={};this.selectionChangeListener=function(G,N){var O=function(R){return null!=R?R.id:null};null!=l&&window.clearTimeout(l);l=window.setTimeout(function(){for(var R=D.getSelectionCount()>S?[]:D.getSelectionCells().map(O),T=null!=b.currentPage?b.currentPage.getId():null,U={},W=[],X=[],Y=0;Y<R.length;Y++){var Z=R[Y];null!=Z&&(U[Z]=!0,null==x[Z]&&X.push(Z))}for(Z in x)U[Z]||W.push(Z);x=U;c("selectionChange",{pageId:T,removed:W,added:X})},300)};D.getSelectionModel().addListener(mxEvent.CHANGE,+this.selectionChangeListener);this.cursorHandler=mxUtils.bind(this,function(){for(var G in g)n(g[G])});mxEvent.addListener(D.container,"scroll",this.cursorHandler);D.getView().addListener(mxEvent.SCALE,this.cursorHandler);D.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);D.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(G){if(!P)try{z&&(EditorUi.debug("P2PCollab: joinInProgress on",z),C="busy");z=++A;try{null!=F&&1==F.readyState&&(EditorUi.debug("P2PCollab: force closing socket on",F.joinId),F.close(1E3),F=null)}catch(R){EditorUi.debug("P2PCollab: closing socket error",R)}var N=new WebSocket(window.RT_WEBSOCKET_URL+"?id="+f);null==F&&(F=N);N.addEventListener("open",function(R){F=N;F.joinId=z;z=!1;e.file.fireEvent(new mxEventObject("realtimeStateChanged"));EditorUi.debug("P2PCollab: open socket",F.joinId);Editor.enableRealtimeCache||-window.setTimeout(function(){e.sendJoinMessage()},0);G&&e.scheduleCleanup()});N.addEventListener("message",function(R){try{p||EditorUi.debug("P2PCollab: msg received",[R]);var T=JSON.parse(R.data);p&&"message"!=T.action&&EditorUi.debug("P2PCollab: msg received",[R]);switch(T.action){case "message":q(T.msg,T.from);break;case "clientsList":var U=T.msg;I=U.cId;Q=!0;for(T=0;T<U.list.length;T++)u(U.list[T],!0);break;case "signal":var W=T.msg;if(!p){if(K[W.from])var X=K[W.from];else X=u(W.from,!1),V=!0;-X.signal(W.signal)}break;case "newClient":V=!0;break;case "clientLeft":E(T.msg);break;case "sendSignalFailed":var Y=T.msg;EditorUi.debug("P2PCollab: signal failed (socket not found on server)",Y);delete K[Y.to];y[Y.to]=!1}}catch(Z){null!=window.console&&console.warn(Z,R)}});var P=!1;N.addEventListener("close",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket closed",N.joinId,"reconnecting",R.code,R.reason);EditorUi.debug("P2PCollab: closing socket on",N.joinId);O||1E3==R.code||A!=-N.joinId||(z==A&&(EditorUi.debug("P2PCollab: joinInProgress in close on",N.joinId),z=!1),P||(EditorUi.debug("P2PCollab: calling rejoin on",N.joinId),window.setTimeout(mxUtils.bind(this,function(){P=!0;this.joinFile(!0)}),500)));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));N.addEventListener("error",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket error, reconnecting",R);EditorUi.debug("P2PCollab: error socket on",N.joinId);O||A!=N.joinId||(z==A&&(EditorUi.debug("P2PCollab: joinInProgress in error on",-N.joinId),z=!1),P||(EditorUi.debug("P2PCollab: calling rejoin on",N.joinId),P=!0,this.joinFile(!0)));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}catch(R){C=R,e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}};this.destroy=function(){if(!O){EditorUi.debug("P2PCollab: destroyed");O=!0;for(sessionId in g)H(sessionId);null!=this.mouseListeners&&D.removeMouseListener(this.mouseListeners);null!=this.selectionChangeListener&&-D.getSelectionModel().removeListener(this.selectionChangeListener);null!=this.shareCursorPositionListener&&b.removeListener(this.shareCursorPositionListener);null!=this.cursorHandler&&(mxEvent.removeListener(D.container,"scroll",this.cursorHandler),D.view.removeListener(this.cursorHandler),b.editor.removeListener(this.cursorHandler),b.removeListener(this.cursorHandler));null!=F&&1<=F.readyState&&(F.close(1E3),F=null);for(var G in J)null!=J[G]&&J[G].destroy();e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}}}+window.setTimeout(function(){e.sendJoinMessage()},0);G&&e.scheduleCleanup()});N.addEventListener("message",function(R){try{p||EditorUi.debug("P2PCollab: msg received",[R]);var T=JSON.parse(R.data);p&&"message"!=T.action&&EditorUi.debug("P2PCollab: msg received",[R]);switch(T.action){case "message":q(T.msg,T.from);break;case "clientsList":var U=T.msg;I=U.cId;Q=!0;for(T=0;T<U.list.length;T++)u(U.list[T],!0);break;case "signal":var W=T.msg;if(!p){if(J[W.from])var X=J[W.from];else X=u(W.from,!1),V=!0;+X.signal(W.signal)}break;case "newClient":V=!0;break;case "clientLeft":E(T.msg);break;case "sendSignalFailed":var Y=T.msg;EditorUi.debug("P2PCollab: signal failed (socket not found on server)",Y);delete J[Y.to];y[Y.to]=!1}}catch(Z){null!=window.console&&console.warn(Z,R)}});var O=!1;N.addEventListener("close",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket closed",N.joinId,"reconnecting",R.code,R.reason);EditorUi.debug("P2PCollab: closing socket on",N.joinId);P||1E3==R.code||A!=+N.joinId||(z==A&&(EditorUi.debug("P2PCollab: joinInProgress in close on",N.joinId),z=!1),O||(EditorUi.debug("P2PCollab: calling rejoin on",N.joinId),window.setTimeout(mxUtils.bind(this,function(){O=!0;this.joinFile(!0)}),500)));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));N.addEventListener("error",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket error, reconnecting",R);EditorUi.debug("P2PCollab: error socket on",N.joinId);P||A!=N.joinId||(z==A&&(EditorUi.debug("P2PCollab: joinInProgress in error on",+N.joinId),z=!1),O||(EditorUi.debug("P2PCollab: calling rejoin on",N.joinId),O=!0,this.joinFile(!0)));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}catch(R){C=R,e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}};this.destroy=function(){if(!P){EditorUi.debug("P2PCollab: destroyed");P=!0;for(sessionId in g)H(sessionId);null!=this.mouseListeners&&D.removeMouseListener(this.mouseListeners);null!=this.selectionChangeListener&&+D.getSelectionModel().removeListener(this.selectionChangeListener);null!=this.shareCursorPositionListener&&b.removeListener(this.shareCursorPositionListener);null!=this.cursorHandler&&(mxEvent.removeListener(D.container,"scroll",this.cursorHandler),D.view.removeListener(this.cursorHandler),b.editor.removeListener(this.cursorHandler),b.removeListener(this.cursorHandler));null!=F&&1<=F.readyState&&(F.close(1E3),F=null);for(var G in K)null!=K[G]&&K[G].destroy();e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}}};diff --git a/src/main/webapp/js/integrate.min.js b/src/main/webapp/js/integrate.min.jsindex 49df13457..11e8d3133 100644--- a/src/main/webapp/js/integrate.min.js+++ b/src/main/webapp/js/integrate.min.js@@ -64,7 +64,7 @@ if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==url"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};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||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.0.3",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.0.4",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&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:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().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:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||@@ -12128,25 +12128,25 @@ DrawioFile.prototype.synchronizeFile=function(b,f){if(this.savingFile)null!=f&&ffunction(x){l&&(window.clearTimeout(d),this.sync.cleanup(b,f,x))}),t,y):this.updateFile(mxUtils.bind(this,function(){l&&(window.clearTimeout(d),null!=b&&b())}),t,y)}};DrawioFile.prototype.updateFile=function(b,f,l,d,t){null!=l&&l()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",t,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=f&&f():this.getLatestVersion(mxUtils.bind(this,function(y){try{null!=l&&l()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[y]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=f&&f():null!=y?this.mergeFile(y,b,f,d,t):this.reloadFile(b,f))}catch(x){null!=f&&f(x)}}),f))};-DrawioFile.prototype.mergeFile=function(b,f,l,d,t){try{var y=b.getShadowPages();if(null!=y&&0<y.length){var x=this.getShadowPages(),C=[this.ui.diffPages(null!=d?d:x,y)],L=this.ignorePatches(C);if(L)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",L),null!=f&&f();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var N=this.isModified()?this.ui.diffPages(x,+DrawioFile.prototype.mergeFile=function(b,f,l,d,t){try{var y=b.getShadowPages();if(null!=y&&0<y.length){var x=this.getShadowPages(),C=[this.ui.diffPages(null!=d?d:x,y)],K=this.ignorePatches(C);if(K)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",K),null!=f&&f();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var N=this.isModified()?this.ui.diffPages(x,this.isRealtime()?this.ownPages:this.ui.pages):null,O=this.ui.patchPages(this.ui.clonePages(x),C[0]),Q=this.ui.getHashValueForPages(O,{}),I=this.ui.getHashValueForPages(y,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",x,"pages",y,"patched",O,"patches",C,"changes",N,"checksum",Q,"current",I,"valid",Q==I,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",t);if(null!=Q&&Q!=I)this.checksumError(l,C,null,null,"mergeFile",Q,I,b.getCurrentRevisionId());else{this.setShadowPages(y);if(null!=this.sync){var c=this.sync.patchRealtime(C,DrawioFile.LAST_WRITE_WINS?N:null,null,t);null==c||mxUtils.isEmptyObject(c)||C.push(c)}this.patch(C,DrawioFile.LAST_WRITE_WINS?N:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=f&&f()}}catch(n){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=l&&l(n);try{var e=this.getCurrentUser(),k=null!=e?e.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),k,n)}catch(q){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(n){null!=l&&l(n)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var f=new mxCodec(mxUtils.createXmlDocument()),l=f.document.createElement("mxfile");if(null!=b)for(var d=0;d<b.length;d++){var t=f.encode(new mxGraphModel(b[d].root));"1"!=urlParams.dev&&(t=this.ui.anonymizeNode(t,!0));t.setAttribute("id",b[d].getId());b[d].viewState&&this.ui.editor.graph.saveViewState(b[d].viewState,t,!0);l.appendChild(t)}return mxUtils.getPrettyXml(l)};DrawioFile.prototype.compressReportData=function(b,f,l){f=null!=f?f:1E4;null!=l&&null!=b&&b.length>l?b=b.substring(0,l)+"[...]":null!=b&&b.length>f&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,f,l,d,t,y,x,C){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var L=this.getCurrentUser(),N=null!=L?L.id:"unknown",O=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",Q=JSON.stringify(f).length,I=null;if(null!=f&&1E3>Q){for(b=0;b<f.length;b++)this.ui.anonymizePatch(f[b]);I=JSON.stringify(f);I=null!=I&&1E3>I.length?Graph.compress(I):+DrawioFile.prototype.checksumError=function(b,f,l,d,t,y,x,C){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var K=this.getCurrentUser(),N=null!=K?K.id:"unknown",O=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",Q=JSON.stringify(f).length,I=null;if(null!=f&&1E3>Q){for(b=0;b<f.length;b++)this.ui.anonymizePatch(f[b]);I=JSON.stringify(f);I=null!=I&&1E3>I.length?Graph.compress(I):null}this.getLatestVersion(mxUtils.bind(this,function(c){try{var e=null!=I?"report":"error",k=this.ui.getHashValueForPages(c.getShadowPages()),n="unknown",q="unknown",u="unknown";try{var A=null!=c.initialData&&0<c.initialData.length?mxUtils.parseXml(c.initialData).documentElement:null;null!=A&&(null!=A.getAttribute("version")&&(n=A.getAttribute("version")),null!=A.getAttribute("agent")&&(q=A.getAttribute("agent")),null!=A.getAttribute("type")&&(u=A.getAttribute("type")))}catch(D){}EditorUi.logError("Checksum "+e+" in "+t,null,this.getMode()+"."+O,"user_"+N+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+f.length+(null!=I?"-json_"+I:"")+"-size_"+this.getSize()+(null!=y?"-expected_"+y:"")+(null!=x?"-current_"+x:"")+(null!=C?"-rev_"+this.ui.hashValue(C):"")+(null!=k?"-latest_"+k:"")+"-latestRev_"+this.ui.hashValue(c.getCurrentRevisionId())+("-latestVersion_"+n)+("-latestAgent_"+q)+("-latestType_"+u));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+O,action:t,label:"user_"+N+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+f.length+"-size_"+this.getSize()})}catch(D){}}),function(){})}catch(c){}};-DrawioFile.prototype.sendErrorReport=function(b,f,l,d){try{var t=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),y=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),x=this.getCurrentUser(),C=null!=x?this.ui.hashValue(x.id):"unknown",L=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",N=this.getTitle(),O=N.lastIndexOf(".");x="xml";0<O&&(x=N.substring(O));var Q=null!=l?l.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+-":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+x+")\nUser="+C+L+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=f?"\n\n"+f:+DrawioFile.prototype.sendErrorReport=function(b,f,l,d){try{var t=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),y=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),x=this.getCurrentUser(),C=null!=x?this.ui.hashValue(x.id):"unknown",K=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",N=this.getTitle(),O=N.lastIndexOf(".");x="xml";0<O&&(x=N.substring(O));var Q=null!=l?l.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+x+")\nUser="+C+K+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=f?"\n\n"+f:"")+(null!=l?"\n\nError: "+l.message:"")+"\n\nStack:\n"+Q+"\n\nShadow:\n"+t+"\n\nData:\n"+y,d)}catch(I){}};DrawioFile.prototype.reloadFile=function(b,f){try{this.stats.fileReloaded++;var l=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),d=this.ui.editor.graph,t=d.getSelectionCells(),y=d.getViewState(),x=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(C){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[l],"viewState",[y],"latestFile",C);null!=C?(this.ui.replaceFileData(C.getData(),-[l]),this.ui.restoreViewState(x,y,t),this.setDescriptor(C.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var L=this.ui.getCurrentFile();null!=L&&(L.stats=this.stats,L.patch([l]),L.fileChanged());this.ui.restoreViewState(x,y,t);null!=b&&b()}else null!=f&&f(this.ui.fileLoadedError)}),!0))}),f)}catch(C){null!=f&&f(C)}};+[l]),this.ui.restoreViewState(x,y,t),this.setDescriptor(C.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var K=this.ui.getCurrentFile();null!=K&&(K.stats=this.stats,K.patch([l]),K.fileChanged());this.ui.restoreViewState(x,y,t);null!=b&&b()}else null!=f&&f(this.ui.fileLoadedError)}),!0))}),f)}catch(C){null!=f&&f(C)}};DrawioFile.prototype.copyFile=function(b,f){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var f=!0;if(null!=b)for(var l=0;l<b.length&&f;l++)f=f&&mxUtils.isEmptyObject(b[l]);return f};-DrawioFile.prototype.patch=function(b,f,l,d){if(null!=b){var t=this.ui.editor.undoManager,y=t.history.slice(),x=t.indexOfNextAdd,C=this.ui.editor.graph;C.container.style.visibility="hidden";var L=this.changeListenerEnabled;this.changeListenerEnabled=l;var N=C.foldingEnabled,O=C.mathEnabled,Q=C.cellRenderer.redraw;C.cellRenderer.redraw=function(q){q.view.graph.isEditing(q.cell)&&(q.view.graph.scrollCellToVisible(q.cell),q.view.graph.cellEditor.resize());Q.apply(this,arguments)};C.model.beginUpdate();+DrawioFile.prototype.patch=function(b,f,l,d){if(null!=b){var t=this.ui.editor.undoManager,y=t.history.slice(),x=t.indexOfNextAdd,C=this.ui.editor.graph;C.container.style.visibility="hidden";var K=this.changeListenerEnabled;this.changeListenerEnabled=l;var N=C.foldingEnabled,O=C.mathEnabled,Q=C.cellRenderer.redraw;C.cellRenderer.redraw=function(q){q.view.graph.isEditing(q.cell)&&(q.view.graph.scrollCellToVisible(q.cell),q.view.graph.cellEditor.resize());Q.apply(this,arguments)};C.model.beginUpdate();try{if(l){for(var I=this.ui.pages.slice(),c=this.ui.currentPage,e=this.ui.applyPatches(this.ui.pages,b,!0,f,this.isModified()),k=0;k<e.length;k++){var n=mxUtils.indexOf(this.ui.pages,e[k]);0>n?this.ui.insertPage(e[k],Math.min(k,this.ui.pages.length)):this.ui.movePage(n,k)}for(k=0;k<I.length;k++)0>mxUtils.indexOf(e,I[k])&&this.ui.removePage(I[k]);0<=mxUtils.indexOf(this.ui.pages,c)&&this.ui.selectPage(c,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,f,this.isModified());0==this.ui.pages.length&&-this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);C.checkDefaultParent()}finally{C.container.style.visibility="";C.model.endUpdate();C.cellRenderer.redraw=Q;this.changeListenerEnabled=L;l||(t.history=y,t.indexOfNextAdd=x,t.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)O!=C.mathEnabled?(this.ui.editor.updateGraphComponents(),C.refresh()):(N!=C.foldingEnabled?+this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);C.checkDefaultParent()}finally{C.container.style.visibility="";C.model.endUpdate();C.cellRenderer.redraw=Q;this.changeListenerEnabled=K;l||(t.history=y,t.indexOfNextAdd=x,t.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)O!=C.mathEnabled?(this.ui.editor.updateGraphComponents(),C.refresh()):(N!=C.foldingEnabled?C.view.revalidate():C.view.validate(),C.sizeDidChange());null!=this.sync&&this.isRealtime()&&!d&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",f,"undoable",l)}return b};DrawioFile.prototype.save=function(b,f,l,d,t,y){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",d,"overwrite",t,"manual",y,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!t&&this.invalidChecksum)if(null!=l)l({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=f&&f();else if(null!=l)l({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(x){if(null!=l)l(x);else throw x;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var f=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=f&&(f.viewState=this.ui.editor.graph.getViewState(),f.needsUpdate=!0)}f=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return f};@@ -12197,7 +12197,7 @@ DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=newmxUtils.bind(this,function(f){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(f){this.handleFileError(f)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var f=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(f,mxUtils.bind(this,function(l){EditorUi.debug("DrawioFile.createSecret",[this],"secret",f,"token",l);b(f,l)}),mxUtils.bind(this,function(){b(f)})):b(f)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};DrawioFile.prototype.fileSaved=function(b,f,l,d,t,y,x){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;y=null!=y?y:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(y),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=l&&l()):this.sync.fileSaved(y,f,l,d,t,x)}catch(N){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=d&&d(N);try{var C=this.getCurrentUser(),L=null!=C?C.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),L,N)}catch(O){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[f],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(N){this.descriptorChanged(),null!=d&&d(N)}};+this.inConflictState=!0;this.descriptorChanged();null!=d&&d(N);try{var C=this.getCurrentUser(),K=null!=C?C.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),K,N)}catch(O){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[f],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(N){this.descriptorChanged(),null!=d&&d(N)}};DrawioFile.prototype.autosave=function(b,f,l,d){null==this.lastAutosave&&(this.lastAutosave=Date.now());var t=Date.now()-this.lastAutosave<f?b:0;this.clearAutosave();var y=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==y&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",y,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var x=this.isAutosaveRevision();x&&(this.lastAutosaveRevision=(new Date).getTime());this.save(x,mxUtils.bind(this,function(C){this.autosaveCompleted();null!=l&&l(C)}),mxUtils.bind(this,function(C){null!=d&&d(C)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=l&&l(null)}catch(C){null!=d&&d(C)}}),t);this.autosaveThread=y;EditorUi.debug("DrawioFile.autosave",[this],"thread",y,"delay",b,"maxDelay",f,"actualDelay",t,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};@@ -12206,10 +12206,10 @@ DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(thisDrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,f){b([])};DrawioFile.prototype.addComment=function(b,f,l){f(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,f){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,f)};LocalFile=function(b,f,l,d,t,y,x){DrawioFile.call(this,b,f);this.title=l;this.mode=d?null:App.MODE_DEVICE;this.fileHandle=t;this.desc=y;this.editable=x};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,f,l,d,t){this.saveAs(this.title,f,l,d,t)};LocalFile.prototype.saveAs=function(b,f,l,d,t){this.saveFile(b,!1,f,l,null,d,t)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,f){null==this.fileHandle?null!=f&&f({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,f)};-LocalFile.prototype.saveFile=function(b,f,l,d,t,y,x){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;t||this.updateFileData();var C=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var L=this.getData(),N=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=l&&l()}),O=mxUtils.bind(this,function(Q){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var I=mxUtils.bind(this,function(e){this.savingFile=!1;null!=d&&d({error:e})});this.saveDraft(L);this.fileHandle.createWritable().then(mxUtils.bind(this,function(e){this.fileHandle.getFile().then(mxUtils.bind(this,function(k){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[k],"conflict",this.desc.lastModified!=k.lastModified);x||this.desc.lastModified==k.lastModified?e.write(C?this.ui.base64ToBlob(Q,"image/png"):Q).then(mxUtils.bind(this,function(){e.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(n){try{var q=this.desc;this.savingFile=!1;this.desc=n;this.fileSaved(L,q,N,I);this.removeDraft()}catch(u){I(u)}}),I)}),I)}),I):(this.inConflictState=!0,I())}),mxUtils.bind(this,function(k){this.invalidFileHandle=!0;I(k)}))}),I)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(Q,b,C?"image/png":"text/xml",C);else if(Q.length<MAX_REQUEST_SIZE){var c=b.lastIndexOf(".");c=0<c?b.substring(c+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+c+"&xml="+encodeURIComponent(Q)+"&filename="+encodeURIComponent(b)+(C?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Q)}));N()}});C?(f=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(Q){O(Q)}),d,this.ui.getCurrentFile()!=this?L:null,f.scale,f.border)):O(L)};+LocalFile.prototype.saveFile=function(b,f,l,d,t,y,x){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;t||this.updateFileData();var C=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var K=this.getData(),N=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=l&&l()}),O=mxUtils.bind(this,function(Q){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var I=mxUtils.bind(this,function(e){this.savingFile=!1;null!=d&&d({error:e})});this.saveDraft(K);this.fileHandle.createWritable().then(mxUtils.bind(this,function(e){this.fileHandle.getFile().then(mxUtils.bind(this,function(k){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[k],"conflict",this.desc.lastModified!=k.lastModified);x||this.desc.lastModified==k.lastModified?e.write(C?this.ui.base64ToBlob(Q,"image/png"):Q).then(mxUtils.bind(this,function(){e.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(n){try{var q=this.desc;this.savingFile=!1;this.desc=n;this.fileSaved(K,q,N,I);this.removeDraft()}catch(u){I(u)}}),I)}),I)}),I):(this.inConflictState=!0,I())}),mxUtils.bind(this,function(k){this.invalidFileHandle=!0;I(k)}))}),I)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(Q,b,C?"image/png":"text/xml",C);else if(Q.length<MAX_REQUEST_SIZE){var c=b.lastIndexOf(".");c=0<c?b.substring(c+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+c+"&xml="+encodeURIComponent(Q)+"&filename="+encodeURIComponent(b)+(C?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Q)}));N()}});C?(f=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(Q){O(Q)}),d,this.ui.getCurrentFile()!=this?K:null,f.scale,f.border)):O(K)};LocalFile.prototype.rename=function(b,f,l){this.title=b;this.descriptorChanged();null!=f&&f()};LocalLibrary=function(b,f,l){LocalFile.call(this,b,f,l)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,f,l){this.saveFile(b,!1,f,l)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,f,l){DrawioFile.call(this,b,f);this.title=l;this.etag=this.getEtag(f)};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.getEtag=function(b){return this.ui.hashValue(null!=b?b:"")};StorageFile.prototype.autosaveDelay=500;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.maxRetries=5;StorageFile.prototype.type="F";StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isSyncSupported=function(){return!0};StorageFile.prototype.isPolling=function(){return this.isSyncSupported()};StorageFile.prototype.getPollingInterval=function(){return 1E4};StorageFile.prototype.loadDescriptor=function(b,f){this.getLatestVersionId(b,f)};StorageFile.prototype.getLatestVersionId=function(b,f){StorageFile.getFileContent(this.ui,this.title,mxUtils.bind(this,function(l){b(this.getEtag(l))}),f)};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title};StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.getDescriptor=function(){return this.etag};StorageFile.prototype.setDescriptor=function(b){this.etag=b};StorageFile.prototype.getDescriptorEtag=function(b){return b};StorageFile.prototype.save=function(b,f,l){this.saveAs(this.getTitle(),f,l)};@@ -12229,97 +12229,97 @@ StorageLibrary.prototype.isRenamable=function(b,f,l){return".scratchpad"!=this.tRemoteLibrary.prototype.saveAs=function(b,f,l){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(b,f,l){StorageFile.call(this,b,f,l);b=l;f=b.lastIndexOf("/");0<=f&&(b=b.substring(f+1));this.fname=b};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(b,f,l){return!1};UrlLibrary.prototype.saveAs=function(b,f,l){};UrlLibrary.prototype.open=function(){};EmbedFile=function(b,f,l){DrawioFile.call(this,b,f);this.desc=l||{};this.mode=App.MODE_EMBED};mxUtils.extend(EmbedFile,DrawioFile);EmbedFile.prototype.getMode=function(){return this.mode};EmbedFile.prototype.getTitle=function(){return this.desc.title||""};/*mxClient.IS_IOS || */var StorageDialog=function(b,f,l){function d(Q,I,c,e,k,n){function q(){mxEvent.addListener(u,"click",null!=n?n:function(){c==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(c,!0);f()})):c==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(c,!0);f()}),function(U){b.spinner.stop();b.handleError(U)}):-(b.setMode(c,!0),f())})}C++;++x>l&&(mxUtils.br(L),x=1);var u=document.createElement("a");u.style.overflow="hidden";u.style.display="inline-block";u.className="geBaseButton";u.style.boxSizing="border-box";u.style.fontSize="11px";u.style.position="relative";u.style.margin="4px";u.style.marginTop="8px";u.style.marginBottom="0px";u.style.padding="8px 10px 8px 10px";u.style.width="88px";u.style.height="100px";u.style.whiteSpace="nowrap";u.setAttribute("title",I);var A=document.createElement("div");A.style.textOverflow=+(b.setMode(c,!0),f())})}C++;++x>l&&(mxUtils.br(K),x=1);var u=document.createElement("a");u.style.overflow="hidden";u.style.display="inline-block";u.className="geBaseButton";u.style.boxSizing="border-box";u.style.fontSize="11px";u.style.position="relative";u.style.margin="4px";u.style.marginTop="8px";u.style.marginBottom="0px";u.style.padding="8px 10px 8px 10px";u.style.width="88px";u.style.height="100px";u.style.whiteSpace="nowrap";u.setAttribute("title",I);var A=document.createElement("div");A.style.textOverflow="ellipsis";A.style.overflow="hidden";A.style.position="absolute";A.style.bottom="8px";A.style.left="0px";A.style.right="0px";mxUtils.write(A,I);u.appendChild(A);if(null!=Q){var D=document.createElement("img");D.setAttribute("src",Q);D.setAttribute("border","0");D.setAttribute("align","absmiddle");D.style.width="60px";D.style.height="60px";D.style.paddingBottom="6px";u.appendChild(D)}else A.style.paddingTop="5px",A.style.whiteSpace="normal",mxClient.IS_IOS?(u.style.padding="0px 10px 20px 10px",u.style.top=-"6px"):mxClient.IS_FF&&(A.style.paddingTop="0px",A.style.marginTop="-2px");if(null!=k)for(Q=0;Q<k.length;Q++)mxUtils.br(A),mxUtils.write(A,k[Q]);if(null!=e&&null==b[e]){D.style.visibility="hidden";mxUtils.setOpacity(A,10);var G=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});G.spin(u);var E=window.setTimeout(function(){null==b[e]&&(G.stop(),u.style.display="none")},3E4);b.addListener("clientLoaded",-mxUtils.bind(this,function(U,P){null!=b[e]&&P.getProperty("client")==b[e]&&(window.clearTimeout(E),mxUtils.setOpacity(A,100),D.style.visibility="",G.stop(),q(),"drive"==e&&null!=N.parentNode&&N.parentNode.removeChild(N))}))}else q();L.appendChild(u)}l=null!=l?l:2;var t=document.createElement("div");t.style.textAlign="center";t.style.whiteSpace="nowrap";t.style.paddingTop="0px";t.style.paddingBottom="20px";var y=document.createElement("div");y.style.border="1px solid #d3d3d3";y.style.borderWidth="1px 0px 1px 0px";-y.style.padding="10px 0px 20px 0px";var x=0,C=0,L=document.createElement("div");L.style.paddingTop="2px";y.appendChild(L);var N=document.createElement("p"),O=document.createElement("p");O.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(O,mxResources.get("saveDiagramsTo")+":");t.appendChild(O);t.appendChild(y);x=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===+"6px"):mxClient.IS_FF&&(A.style.paddingTop="0px",A.style.marginTop="-2px");if(null!=k)for(Q=0;Q<k.length;Q++)mxUtils.br(A),mxUtils.write(A,k[Q]);if(null!=e&&null==b[e]){D.style.visibility="hidden";mxUtils.setOpacity(A,10);var F=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});F.spin(u);var E=window.setTimeout(function(){null==b[e]&&(F.stop(),u.style.display="none")},3E4);b.addListener("clientLoaded",+mxUtils.bind(this,function(U,P){null!=b[e]&&P.getProperty("client")==b[e]&&(window.clearTimeout(E),mxUtils.setOpacity(A,100),D.style.visibility="",F.stop(),q(),"drive"==e&&null!=N.parentNode&&N.parentNode.removeChild(N))}))}else q();K.appendChild(u)}l=null!=l?l:2;var t=document.createElement("div");t.style.textAlign="center";t.style.whiteSpace="nowrap";t.style.paddingTop="0px";t.style.paddingBottom="20px";var y=document.createElement("div");y.style.border="1px solid #d3d3d3";y.style.borderWidth="1px 0px 1px 0px";+y.style.padding="10px 0px 20px 0px";var x=0,C=0,K=document.createElement("div");K.style.paddingTop="2px";y.appendChild(K);var N=document.createElement("p"),O=document.createElement("p");O.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(O,mxResources.get("saveDiagramsTo")+":");t.appendChild(O);t.appendChild(y);x=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");"1"!=urlParams.noDevice&&d(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||d(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.DropboxClient&&d(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox");null!=b.gitHub&&d(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=b.gitLab&&d(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");y=document.createElement("span");y.style.position="absolute";y.style.cursor="pointer";y.style.bottom="27px";y.style.color="gray";y.style.userSelect="none";y.style.textAlign="center";y.style.left="50%";mxUtils.setPrefixedStyle(y.style,"transform","translate(-50%,0)");mxUtils.write(y,mxResources.get("decideLater"));t.appendChild(y);mxEvent.addListener(y,"click",function(){b.hideDialog();var Q=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=Q});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(N.style.padding="7px",N.style.fontSize="9pt",N.style.marginTop="-14px",N.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://www.drawio.com/doc/faq/google-drive-connection-problems" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="absmiddle" style="margin-top:-4px"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",t.appendChild(N))},5E3);this.container=t},SplashDialog=function(b){var f=document.createElement("div");f.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var l=b.addLanguageMenu(f,!1,"28px");null!=l&&(l.style.bottom="24px")}var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width="32px";d.style.height="32px";d.style.marginRight="8px";d.style.marginTop="-4px";var t=document.createElement("div");t.style.margin="8px 0px 0px 0px";t.style.padding="18px 0px 24px 0px";l="";b.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",l=mxResources.get("googleDrive")):b.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",l=mxResources.get("dropbox")):b.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",l=mxResources.get("oneDrive")):b.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+"/github-logo.svg",l=mxResources.get("github")):b.mode==App.MODE_GITLAB?(d.src=IMAGE_PATH+"/gitlab-logo.svg",l=mxResources.get("gitlab")):b.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",l=mxResources.get("browser")):b.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",l=mxResources.get("trello")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",t.style.paddingBottom="10px",t.style.paddingTop="30px",l=mxResources.get("device"));var y=document.createElement("button");-y.className="geBigButton";y.style.marginBottom="8px";y.style.fontSize="18px";y.style.padding="10px";y.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)t.style.padding="42px 0px 10px 0px",y.style.marginBottom="12px";else{t.style.border="1px solid #d3d3d3";t.style.borderWidth="1px 0px 1px 0px";var x=document.createElement("table"),C=document.createElement("tbody"),L=document.createElement("tr"),N=document.createElement("td"),O=document.createElement("td");x.setAttribute("align",-"center");N.appendChild(d);d=document.createElement("div");d.style.fontSize="22px";d.style.paddingBottom="6px";d.style.color="gray";mxUtils.write(d,l);O.style.textAlign="left";O.appendChild(d);L.appendChild(N);L.appendChild(O);C.appendChild(L);x.appendChild(C);f.appendChild(x);l=document.createElement("span");l.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(l.style,"transform","translate(-50%,0)");mxUtils.write(l,+y.className="geBigButton";y.style.marginBottom="8px";y.style.fontSize="18px";y.style.padding="10px";y.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)t.style.padding="42px 0px 10px 0px",y.style.marginBottom="12px";else{t.style.border="1px solid #d3d3d3";t.style.borderWidth="1px 0px 1px 0px";var x=document.createElement("table"),C=document.createElement("tbody"),K=document.createElement("tr"),N=document.createElement("td"),O=document.createElement("td");x.setAttribute("align",+"center");N.appendChild(d);d=document.createElement("div");d.style.fontSize="22px";d.style.paddingBottom="6px";d.style.color="gray";mxUtils.write(d,l);O.style.textAlign="left";O.appendChild(d);K.appendChild(N);K.appendChild(O);C.appendChild(K);x.appendChild(C);f.appendChild(x);l=document.createElement("span");l.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(l.style,"transform","translate(-50%,0)");mxUtils.write(l,mxResources.get("changeStorage"));mxEvent.addListener(l,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});f.appendChild(l)}mxUtils.write(y,mxResources.get("createNewDiagram"));mxEvent.addListener(y,"click",function(){b.hideDialog();b.actions.get("new").funct()});t.appendChild(y);mxUtils.br(t);y=document.createElement("button");y.className="geBigButton";y.style.marginBottom="22px";y.style.fontSize="18px";y.style.padding="10px";y.style.width="340px";mxUtils.write(y,mxResources.get("openExistingDiagram"));mxEvent.addListener(y,"click",function(){b.actions.get("open").funct()});t.appendChild(y);b.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):b.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):b.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):b.mode==App.MODE_GITHUB?mxResources.get("github"):b.mode==App.MODE_GITLAB?mxResources.get("gitlab"):b.mode==App.MODE_TRELLO?mxResources.get("trello"):b.mode==App.MODE_DEVICE?mxResources.get("device"):b.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp)if(l=function(c){y.style.marginBottom="24px";var e=document.createElement("a");e.style.display="inline-block";e.style.color="gray";e.style.cursor="pointer";e.style.marginTop="6px";mxUtils.write(e,mxResources.get("signOut"));y.style.marginBottom="16px";t.style.paddingBottom="18px";mxEvent.addListener(e,"click",function(){b.confirm(mxResources.get("areYouSure"),function(){c()})});t.appendChild(e)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var Q=b.drive.getUsersList();if(0<Q.length){d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+":");y.style.marginBottom="16px";t.style.paddingBottom="18px";t.appendChild(d);var I=document.createElement("select");I.style.marginLeft="4px";I.style.width="140px";for(l=0;l<Q.length;l++)x=document.createElement("option"),mxUtils.write(x,Q[l].displayName),x.value=l,I.appendChild(x),x=document.createElement("option"),x.innerHTML=" ",mxUtils.write(x,"<"+Q[l].email+">"),x.setAttribute("disabled","disabled"),I.appendChild(x);x=document.createElement("option");mxUtils.write(x,mxResources.get("addAccount"));x.value=Q.length;I.appendChild(x);mxEvent.addListener(I,"change",function(){var c=I.value,e=Q.length!=c;e&&b.drive.setUser(Q[c]);b.drive.authorize(e,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(k){b.handleError(k,null,function(){b.hideDialog();b.showSplash()})},!0)});t.appendChild(I)}else l(function(){b.drive.logout()})}else b.mode!=App.MODE_ONEDRIVE||null==b.oneDrive||b.oneDrive.noLogout?b.mode==App.MODE_GITHUB&&null!=b.gitHub?l(function(){b.gitHub.logout();b.openLink("https://www.github.com/logout")}):b.mode==App.MODE_GITLAB&&null!=b.gitLab?l(function(){b.gitLab.logout();var c=document.createElement("form");c.setAttribute("method","post");c.setAttribute("action",DRAWIO_GITLAB_URL+"/users/sign_out");c.setAttribute("target","_blank");document.body.appendChild(c);c.submit();c.parentNode.removeChild(c)}):b.mode==App.MODE_TRELLO&&-null!=b.trello?b.trello.isAuthorized()&&l(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&l(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):l(function(){b.oneDrive.logout()});f.appendChild(t);this.container=f},EmbedDialog=function(b,f,l,d,t,y,x,C,L){x=null!=x?x:"Check out the diagram I made using @drawio";d=document.createElement("div");var N=/^https?:\/\//.test(f)||/^mailto:\/\//.test(f);null!=y?mxUtils.write(d,y):mxUtils.write(d,mxResources.get(5E5>+null!=b.trello?b.trello.isAuthorized()&&l(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&l(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):l(function(){b.oneDrive.logout()});f.appendChild(t);this.container=f},EmbedDialog=function(b,f,l,d,t,y,x,C,K){x=null!=x?x:"Check out the diagram I made using @drawio";d=document.createElement("div");var N=/^https?:\/\//.test(f)||/^mailto:\/\//.test(f);null!=y?mxUtils.write(d,y):mxUtils.write(d,mxResources.get(5E5>f.length?N?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(d);y=document.createElement("div");y.style.position="absolute";y.style.top="30px";y.style.right="30px";y.style.color="gray";mxUtils.write(y,b.formatFileSize(f.length));d.appendChild(y);var O=document.createElement("textarea");O.setAttribute("autocomplete","off");O.setAttribute("autocorrect","off");O.setAttribute("autocapitalize","off");O.setAttribute("spellcheck","false");O.style.fontFamily="monospace";O.style.wordBreak="break-all";O.style.marginTop="10px";O.style.resize="none";O.style.height="150px";O.style.width="440px";O.style.border="1px solid gray";O.value=mxResources.get("updatingDocument");d.appendChild(O);mxUtils.br(d);this.init=function(){window.setTimeout(function(){5E5>f.length?(O.value=f,O.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?O.select():document.execCommand("selectAll",!1,null)):(O.setAttribute("readonly","true"),O.value=mxResources.get("tooLargeUseDownload"))},0)};y=document.createElement("div");y.style.position="absolute";y.style.bottom="36px";y.style.right="32px";var Q=null;!EmbedDialog.showPreviewOption||mxIsElectron||mxClient.IS_CHROMEAPP&&!N||navigator.standalone||!(N||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(Q=mxUtils.button(null!=C?C:mxResources.get(5E5>f.length?"preview":"openInNewWindow"),function(){var c=5E5>f.length?O.value:f;if(null!=t)t(c);else if(N)try{var e=b.openLink(c);null!=e&&(null==l||0<l)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=e&&null!=e.location.href&&e.location.href.substring(0,8)!=c.substring(0,8)&&(e.close(),b.handleError({message:mxResources.get("drawingTooLarge")}))}catch(n){}}),l||500)}catch(n){b.handleError({message:n.message||mxResources.get("drawingTooLarge")})}else{var k=window.open();k=null!=k?k.document:null;null!=k?(k.writeln("<html><head><title>"+mxUtils.htmlEntities(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+("<iframe"==f.substring(0,7)?f:mxUtils.htmlEntities(f))+"</body></html>"),-k.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),Q.className="geBtn",y.appendChild(Q));if(!N||7500<f.length)C=mxUtils.button(mxResources.get(mxIsElectron?"save":"download"),function(){b.hideDialog();b.saveData(null!=L?L:"embed.txt","txt",f,"text/plain")}),C.className="geBtn",y.appendChild(C);if(N&&(!b.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>f.length){var I=mxUtils.button("",function(){try{var c="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(O.value);+k.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),Q.className="geBtn",y.appendChild(Q));if(!N||7500<f.length)C=mxUtils.button(mxResources.get(mxIsElectron?"save":"download"),function(){b.hideDialog();b.saveData(null!=K?K:"embed.txt","txt",f,"text/plain")}),C.className="geBtn",y.appendChild(C);if(N&&(!b.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>f.length){var I=mxUtils.button("",function(){try{var c="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(O.value);b.openLink(c)}catch(e){b.handleError({message:e.message||mxResources.get("drawingTooLarge")})}});C=document.createElement("img");C.setAttribute("src",Editor.facebookImage);C.setAttribute("width","18");C.setAttribute("height","18");C.setAttribute("border","0");I.appendChild(C);I.setAttribute("title",mxResources.get("facebook")+" ("+b.formatFileSize(51200)+" max)");I.style.verticalAlign="bottom";I.style.paddingTop="4px";I.style.minWidth="46px";I.className="geBtn";y.appendChild(I)}7168>f.length&&(I=mxUtils.button("",function(){try{var c="https://twitter.com/intent/tweet?text="+encodeURIComponent(x)+"&url="+encodeURIComponent(O.value);b.openLink(c)}catch(e){b.handleError({message:e.message||mxResources.get("drawingTooLarge")})}}),C=document.createElement("img"),C.setAttribute("src",Editor.tweetImage),C.setAttribute("width","18"),C.setAttribute("height","18"),C.setAttribute("border","0"),C.style.marginBottom="5px",I.appendChild(C),I.setAttribute("title",mxResources.get("twitter")+" ("+b.formatFileSize(7168)+-" max)"),I.style.verticalAlign="bottom",I.style.paddingTop="4px",I.style.minWidth="46px",I.className="geBtn",y.appendChild(I))}!b.isOffline()&&5E5>f.length&&(I=mxUtils.button("",function(){try{var c="mailto:?subject="+encodeURIComponent(L||b.defaultFilename)+"&body="+encodeURIComponent(O.value);b.openLink(c)}catch(e){b.handleError({message:e.message||mxResources.get("drawingTooLarge")})}}),C=document.createElement("img"),C.className="geAdaptiveAsset",C.setAttribute("src",Editor.mailImage),C.setAttribute("width",+" max)"),I.style.verticalAlign="bottom",I.style.paddingTop="4px",I.style.minWidth="46px",I.className="geBtn",y.appendChild(I))}!b.isOffline()&&5E5>f.length&&(I=mxUtils.button("",function(){try{var c="mailto:?subject="+encodeURIComponent(K||b.defaultFilename)+"&body="+encodeURIComponent(O.value);b.openLink(c)}catch(e){b.handleError({message:e.message||mxResources.get("drawingTooLarge")})}}),C=document.createElement("img"),C.className="geAdaptiveAsset",C.setAttribute("src",Editor.mailImage),C.setAttribute("width","18"),C.setAttribute("height","18"),C.setAttribute("border","0"),C.style.marginBottom="5px",I.appendChild(C),I.style.verticalAlign="bottom",I.style.paddingTop="4px",I.style.minWidth="46px",I.className="geBtn",y.appendChild(I));C=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});y.appendChild(C);I=mxUtils.button(mxResources.get("copy"),function(){O.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?O.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});5E5>f.length?mxClient.IS_SF||null!=document.documentMode?C.className="geBtn gePrimaryBtn":(y.appendChild(I),I.className="geBtn gePrimaryBtn",C.className="geBtn"):null!=Q&&(y.appendChild(Q),C.className="geBtn",Q.className="geBtn gePrimaryBtn");d.appendChild(y);this.container=d};EmbedDialog.showPreviewOption=!0;-var GoogleSitesDialog=function(b,f){function l(){var U=null!=E&&null!=E.getTitle()?E.getTitle():this.defaultFilename;if(D.checked&&""!=I.value){var P="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(I.value));null!=U&&(P+="&title="+encodeURIComponent(U));0<G.length&&(P+="&s="+G);""!=c.value&&"0"!=c.value&&(P+="&border="+c.value);""!=Q.value&&(P+="&height="+Q.value);P+="&pan="+(e.checked?"1":"0");P+="&zoom="+(k.checked?"1":"0");P+="&fit="+(A.checked?"1":"0");-P+="&resize="+(u.checked?"1":"0");P+="&x0="+Number(O.value);P+="&y0="+L;t.mathEnabled&&(P+="&math=1");q.checked?P+="&edit=_blank":n.checked&&(P+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));N.value=P}else E.constructor==DriveFile||E.constructor==DropboxFile?(P="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=I.value?P+=encodeURIComponent(mxUtils.htmlEntities(I.value))+"&type=3":(P+=E.getHash().substring(1),P=E.constructor==DropboxFile?P+"&type=2":P+"&type=1"),null!=-U&&(P+="&title="+encodeURIComponent(U)),""!=Q.value&&(U=parseInt(Q.value)+parseInt(O.value),P+="&height="+U),N.value=P):N.value=""}var d=document.createElement("div"),t=b.editor.graph,y=t.getGraphBounds(),x=t.view.scale,C=Math.floor(y.x/x-t.view.translate.x),L=Math.floor(y.y/x-t.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var N=document.createElement("input");N.setAttribute("type","text");N.style.marginBottom="8px";N.style.marginTop="2px";N.style.width="410px";+var GoogleSitesDialog=function(b,f){function l(){var U=null!=E&&null!=E.getTitle()?E.getTitle():this.defaultFilename;if(D.checked&&""!=I.value){var P="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(I.value));null!=U&&(P+="&title="+encodeURIComponent(U));0<F.length&&(P+="&s="+F);""!=c.value&&"0"!=c.value&&(P+="&border="+c.value);""!=Q.value&&(P+="&height="+Q.value);P+="&pan="+(e.checked?"1":"0");P+="&zoom="+(k.checked?"1":"0");P+="&fit="+(A.checked?"1":"0");+P+="&resize="+(u.checked?"1":"0");P+="&x0="+Number(O.value);P+="&y0="+K;t.mathEnabled&&(P+="&math=1");q.checked?P+="&edit=_blank":n.checked&&(P+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));N.value=P}else E.constructor==DriveFile||E.constructor==DropboxFile?(P="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=I.value?P+=encodeURIComponent(mxUtils.htmlEntities(I.value))+"&type=3":(P+=E.getHash().substring(1),P=E.constructor==DropboxFile?P+"&type=2":P+"&type=1"),null!=+U&&(P+="&title="+encodeURIComponent(U)),""!=Q.value&&(U=parseInt(Q.value)+parseInt(O.value),P+="&height="+U),N.value=P):N.value=""}var d=document.createElement("div"),t=b.editor.graph,y=t.getGraphBounds(),x=t.view.scale,C=Math.floor(y.x/x-t.view.translate.x),K=Math.floor(y.y/x-t.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var N=document.createElement("input");N.setAttribute("type","text");N.style.marginBottom="8px";N.style.marginTop="2px";N.style.width="410px";d.appendChild(N);mxUtils.br(d);this.init=function(){N.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?N.select():document.execCommand("selectAll",!1,null)};mxUtils.write(d,mxResources.get("top")+":");var O=document.createElement("input");O.setAttribute("type","text");O.setAttribute("size","4");O.style.marginRight="16px";O.style.marginLeft="4px";O.value=C;d.appendChild(O);mxUtils.write(d,mxResources.get("height")+":");var Q=document.createElement("input");Q.setAttribute("type","text");Q.setAttribute("size","4");Q.style.marginLeft="4px";Q.value=Math.ceil(y.height/x);d.appendChild(Q);mxUtils.br(d);y=document.createElement("hr");y.setAttribute("size","1");y.style.marginBottom="16px";y.style.marginTop="16px";d.appendChild(y);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);var I=document.createElement("input");I.setAttribute("type","text");I.setAttribute("size","28");I.style.marginBottom="8px";I.style.marginTop="2px";I.style.width="410px";I.value=f||"";d.appendChild(I);mxUtils.br(d);mxUtils.write(d,mxResources.get("borderWidth")+":");var c=document.createElement("input");c.setAttribute("type","text");c.setAttribute("size","3");c.style.marginBottom="8px";c.style.marginLeft="4px";c.value="0";d.appendChild(c);mxUtils.br(d);var e=document.createElement("input");e.setAttribute("type","checkbox");e.setAttribute("checked","checked");e.defaultChecked=!0;e.style.marginLeft="16px";d.appendChild(e);mxUtils.write(d,mxResources.get("pan")+" ");var k=document.createElement("input");k.setAttribute("type","checkbox");k.setAttribute("checked","checked");k.defaultChecked=!0;k.style.marginLeft="8px";d.appendChild(k);mxUtils.write(d,mxResources.get("zoom")+" ");var n=document.createElement("input");n.setAttribute("type","checkbox");n.style.marginLeft="8px";n.setAttribute("title",window.location.href);d.appendChild(n);mxUtils.write(d,mxResources.get("edit")+" ");var q=document.createElement("input");q.setAttribute("type","checkbox");q.style.marginLeft="8px";d.appendChild(q);mxUtils.write(d,mxResources.get("asNew")+" ");mxUtils.br(d);var u=document.createElement("input");u.setAttribute("type","checkbox");u.setAttribute("checked","checked");u.defaultChecked=!0;u.style.marginLeft="16px";d.appendChild(u);mxUtils.write(d,mxResources.get("resize")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";d.appendChild(A);mxUtils.write(d,mxResources.get("fit")+" ");var D=document.createElement("input");D.setAttribute("type","checkbox");D.style.marginLeft=-"8px";d.appendChild(D);mxUtils.write(d,mxResources.get("embed")+" ");var G=b.getBasenames().join(";"),E=b.getCurrentFile();mxEvent.addListener(e,"change",l);mxEvent.addListener(k,"change",l);mxEvent.addListener(u,"change",l);mxEvent.addListener(A,"change",l);mxEvent.addListener(n,"change",l);mxEvent.addListener(q,"change",l);mxEvent.addListener(D,"change",l);mxEvent.addListener(Q,"change",l);mxEvent.addListener(O,"change",l);mxEvent.addListener(c,"change",l);mxEvent.addListener(I,"change",l);l();+"8px";d.appendChild(D);mxUtils.write(d,mxResources.get("embed")+" ");var F=b.getBasenames().join(";"),E=b.getCurrentFile();mxEvent.addListener(e,"change",l);mxEvent.addListener(k,"change",l);mxEvent.addListener(u,"change",l);mxEvent.addListener(A,"change",l);mxEvent.addListener(n,"change",l);mxEvent.addListener(q,"change",l);mxEvent.addListener(D,"change",l);mxEvent.addListener(Q,"change",l);mxEvent.addListener(O,"change",l);mxEvent.addListener(c,"change",l);mxEvent.addListener(I,"change",l);l();mxEvent.addListener(N,"click",function(){N.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?N.select():document.execCommand("selectAll",!1,null)});f=document.createElement("div");f.style.paddingTop="12px";f.style.textAlign="right";y=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});y.className="geBtn gePrimaryBtn";f.appendChild(y);d.appendChild(f);this.container=d},CreateGraphDialog=function(b,f,l){var d=document.createElement("div");d.style.textAlign="right";this.init=function(){var t=document.createElement("div");t.style.position="relative";t.style.border="1px solid gray";t.style.boxSizing="border-box";t.style.width="100%";t.style.height="360px";t.style.overflow="hidden";t.style.marginBottom="16px";mxEvent.disableContextMenu(t);d.appendChild(t);var y=new Graph(t);y.setCellsCloneable(!0);y.setPanning(!0);y.setAllowDanglingEdges(!1);y.connectionHandler.select=!1;y.view.setTranslate(20,20);y.border=20;y.panningHandler.useLeftButtonForPanning=!0;mxClient.IS_SVG&&null!=y.view.getDrawPane()&&(t=y.view.getDrawPane().ownerSVGElement,null!=t&&(t.style.position="absolute"));var x="curved=1;";y.cellRenderer.installCellOverlayListeners=function(e,k,n){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(n.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(q){k.fireEvent(new mxEventObject("pointerdown","event",q,"state",e))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(n.node,"touchstart",function(q){k.fireEvent(new mxEventObject("pointerdown",-"event",q,"state",e))})};y.getAllConnectionConstraints=function(){return null};y.connectionHandler.marker.highlight.keepOnTop=!1;y.connectionHandler.createEdgeState=function(e){e=y.createEdge(null,null,null,null,null,x);return new mxCellState(this.graph.view,e,this.graph.getCellStyle(e))};var C=y.getDefaultParent(),L=mxUtils.bind(this,function(e){var k=new mxCellOverlay(this.connectImage,"Add outgoing");k.cursor="hand";k.addListener(mxEvent.CLICK,function(n,q){y.connectionHandler.reset();y.clearSelection();-var u=y.getCellGeometry(e),A;Q(function(){A=y.insertVertex(C,null,"Entry",u.x,u.y,80,30,"rounded=1;");L(A);y.view.refresh(A);y.insertEdge(C,null,"",e,A,x)},function(){y.scrollCellToVisible(A)})});k.addListener("pointerdown",function(n,q){n=q.getProperty("event");q=q.getProperty("state");y.popupMenuHandler.hideMenu();y.stopEditing(!1);var u=mxUtils.convertPoint(y.container,mxEvent.getClientX(n),mxEvent.getClientY(n));y.connectionHandler.start(q,u.x,u.y);y.isMouseDown=!0;y.isMouseTrigger=mxEvent.isMouseEvent(n);-mxEvent.consume(n)});y.addCellOverlay(e,k)});y.getModel().beginUpdate();try{var N=y.insertVertex(C,null,"Start",0,0,80,30,"ellipse");L(N)}finally{y.getModel().endUpdate()}if("horizontalTree"==l){var O=new mxCompactTreeLayout(y);O.edgeRouting=!1;O.levelDistance=30;O.sortEdges=!0;x="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==l?(O=new mxCompactTreeLayout(y,!1),O.edgeRouting=!1,O.levelDistance=30,O.sortEdges=!0,x="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==l?(O=new mxRadialTreeLayout(y,+"event",q,"state",e))})};y.getAllConnectionConstraints=function(){return null};y.connectionHandler.marker.highlight.keepOnTop=!1;y.connectionHandler.createEdgeState=function(e){e=y.createEdge(null,null,null,null,null,x);return new mxCellState(this.graph.view,e,this.graph.getCellStyle(e))};var C=y.getDefaultParent(),K=mxUtils.bind(this,function(e){var k=new mxCellOverlay(this.connectImage,"Add outgoing");k.cursor="hand";k.addListener(mxEvent.CLICK,function(n,q){y.connectionHandler.reset();y.clearSelection();+var u=y.getCellGeometry(e),A;Q(function(){A=y.insertVertex(C,null,"Entry",u.x,u.y,80,30,"rounded=1;");K(A);y.view.refresh(A);y.insertEdge(C,null,"",e,A,x)},function(){y.scrollCellToVisible(A)})});k.addListener("pointerdown",function(n,q){n=q.getProperty("event");q=q.getProperty("state");y.popupMenuHandler.hideMenu();y.stopEditing(!1);var u=mxUtils.convertPoint(y.container,mxEvent.getClientX(n),mxEvent.getClientY(n));y.connectionHandler.start(q,u.x,u.y);y.isMouseDown=!0;y.isMouseTrigger=mxEvent.isMouseEvent(n);+mxEvent.consume(n)});y.addCellOverlay(e,k)});y.getModel().beginUpdate();try{var N=y.insertVertex(C,null,"Start",0,0,80,30,"ellipse");K(N)}finally{y.getModel().endUpdate()}if("horizontalTree"==l){var O=new mxCompactTreeLayout(y);O.edgeRouting=!1;O.levelDistance=30;O.sortEdges=!0;x="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==l?(O=new mxCompactTreeLayout(y,!1),O.edgeRouting=!1,O.levelDistance=30,O.sortEdges=!0,x="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==l?(O=new mxRadialTreeLayout(y,!1),O.edgeRouting=!1,O.levelDistance=80):"verticalFlow"==l?O=new mxHierarchicalLayout(y,mxConstants.DIRECTION_NORTH):"horizontalFlow"==l?O=new mxHierarchicalLayout(y,mxConstants.DIRECTION_WEST):"circle"==l?O=new mxCircleLayout(y):(O=new mxFastOrganicLayout(y,!1),O.forceConstant=80);if(null!=O){var Q=function(e,k){y.getModel().beginUpdate();try{null!=e&&e(),O.execute(y.getDefaultParent(),N)}catch(n){throw n;}finally{e=new mxMorphing(y),e.addListener(mxEvent.DONE,mxUtils.bind(this,function(){y.getModel().endUpdate();null!=k&&k()})),e.startAnimation()}},I=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(e,k,n,q,u){I.apply(this,arguments);Q()};y.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);Q()};y.connectionHandler.addListener(mxEvent.CONNECT,function(){Q()})}t=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});t.className="geBtn";b.editor.cancelFirst&&d.appendChild(t);var c=mxUtils.button(mxResources.get("insert"),function(e){y.clearCellOverlays();var k=y.getModel().getChildren(y.getDefaultParent());e=mxEvent.isAltDown(e)?b.editor.graph.getFreeInsertPoint():b.editor.graph.getCenterInsertPoint(y.getBoundingBoxFromGeometry(k,!0));k=b.editor.graph.importCells(k,e.x,e.y);e=b.editor.graph.view;var n=e.getBounds(k);null!=n&&(n.x-=e.translate.x,n.y-=e.translate.y,b.editor.graph.scrollRectToVisible(n),b.editor.graph.setSelectionCells(k));b.hideDialog()});d.appendChild(c);c.className="geBtn gePrimaryBtn";b.editor.cancelFirst||d.appendChild(t);this.graph=y};this.container=d};CreateGraphDialog.prototype.connectImage=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==":IMAGE_PATH+"/handle-connect.png",26,26);-var BackgroundImageDialog=function(b,f,l,d,t){function y(){null==m||m==mxConstants.NONE?(J.style.display="none",U.checked=!1):(J.style.backgroundColor=m,J.style.display="",U.checked=!0)}var x=b.editor.graph,C=document.createElement("div");C.style.whiteSpace="nowrap";var L=document.createElement("h2");mxUtils.write(L,mxResources.get("background"));L.style.marginTop="0px";C.appendChild(L);var N=null!=l&&null!=l.originalSrc;L=!1;var O=document.createElement("input");O.style.cssText="margin-right:8px;margin-bottom:8px;";+var BackgroundImageDialog=function(b,f,l,d,t){function y(){null==m||m==mxConstants.NONE?(M.style.display="none",U.checked=!1):(M.style.backgroundColor=m,M.style.display="",U.checked=!0)}var x=b.editor.graph,C=document.createElement("div");C.style.whiteSpace="nowrap";var K=document.createElement("h2");mxUtils.write(K,mxResources.get("background"));K.style.marginTop="0px";C.appendChild(K);var N=null!=l&&null!=l.originalSrc;K=!1;var O=document.createElement("input");O.style.cssText="margin-right:8px;margin-bottom:8px;";O.setAttribute("value","url");O.setAttribute("type","radio");O.setAttribute("name","geBackgroundImageDialogOption");var Q=document.createElement("input");Q.style.cssText="margin-right:8px;margin-bottom:8px;";Q.setAttribute("value","url");Q.setAttribute("type","radio");Q.setAttribute("name","geBackgroundImageDialogOption");var I=document.createElement("input");I.setAttribute("type","text");I.style.marginBottom="8px";I.style.width="360px";I.value=N||null==l?"":l.src;var c=document.createElement("select");-c.style.width="360px";if(null!=b.pages)for(var e=0;e<b.pages.length;e++){var k=document.createElement("option");mxUtils.write(k,b.pages[e].getName()||mxResources.get("pageWithNumber",[e+1]));k.setAttribute("value","data:page/id,"+b.pages[e].getId());b.pages[e]==b.currentPage&&k.setAttribute("disabled","disabled");null!=l&&l.originalSrc==k.getAttribute("value")&&(k.setAttribute("selected","selected"),L=!0);c.appendChild(k)}N||null!=b.pages&&1!=b.pages.length||(O.style.display="none",Q.style.display=-"none",c.style.display="none");var n=document.createElement("option"),q=!1,u=!1,A=function(z,B){q||null!=z&&u||(Q.checked?null!=B&&B(n.selected?null:c.value):""==I.value||b.isOffline()?(G.value="",E.value="",null!=B&&B("")):(I.value=mxUtils.trim(I.value),b.loadImage(I.value,function(H){G.value=H.width;E.value=H.height;null!=B&&B(I.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));G.value="";E.value="";null!=B&&B(null)})))},D=mxUtils.bind(this,-function(z){b.importFiles(z,0,0,b.maxBackgroundSize,function(B,H,T,g,p,F){I.value=B;A();I.focus()},function(){},function(B){return"image/"==B.type.substring(0,6)},function(B){for(var H=0;H<B.length;H++)B[H]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){N?c.focus():I.focus();mxEvent.addListener(c,"focus",function(){O.removeAttribute("checked");Q.setAttribute("checked","checked");Q.checked=!0});mxEvent.addListener(I,"focus",function(){Q.removeAttribute("checked");O.setAttribute("checked",+c.style.width="360px";if(null!=b.pages)for(var e=0;e<b.pages.length;e++){var k=document.createElement("option");mxUtils.write(k,b.pages[e].getName()||mxResources.get("pageWithNumber",[e+1]));k.setAttribute("value","data:page/id,"+b.pages[e].getId());b.pages[e]==b.currentPage&&k.setAttribute("disabled","disabled");null!=l&&l.originalSrc==k.getAttribute("value")&&(k.setAttribute("selected","selected"),K=!0);c.appendChild(k)}N||null!=b.pages&&1!=b.pages.length||(O.style.display="none",Q.style.display=+"none",c.style.display="none");var n=document.createElement("option"),q=!1,u=!1,A=function(z,B){q||null!=z&&u||(Q.checked?null!=B&&B(n.selected?null:c.value):""==I.value||b.isOffline()?(F.value="",E.value="",null!=B&&B("")):(I.value=mxUtils.trim(I.value),b.loadImage(I.value,function(H){F.value=H.width;E.value=H.height;null!=B&&B(I.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));F.value="";E.value="";null!=B&&B(null)})))},D=mxUtils.bind(this,+function(z){b.importFiles(z,0,0,b.maxBackgroundSize,function(B,H,T,g,p,G){I.value=B;A();I.focus()},function(){},function(B){return"image/"==B.type.substring(0,6)},function(B){for(var H=0;H<B.length;H++)B[H]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){N?c.focus():I.focus();mxEvent.addListener(c,"focus",function(){O.removeAttribute("checked");Q.setAttribute("checked","checked");Q.checked=!0});mxEvent.addListener(I,"focus",function(){Q.removeAttribute("checked");O.setAttribute("checked","checked");O.checked=!0});if(Graph.fileSupport){I.setAttribute("placeholder",mxResources.get("dragImagesHere"));var z=C.parentNode,B=null;mxEvent.addListener(z,"dragleave",function(H){null!=B&&(B.parentNode.removeChild(B),B=null);H.stopPropagation();H.preventDefault()});mxEvent.addListener(z,"dragover",mxUtils.bind(this,function(H){null==B&&(!mxClient.IS_IE||10<document.documentMode)&&(B=b.highlightElement(z));H.stopPropagation();H.preventDefault()}));mxEvent.addListener(z,"drop",mxUtils.bind(this,function(H){null!=B&&(B.parentNode.removeChild(B),B=null);if(0<H.dataTransfer.files.length)D(H.dataTransfer.files);else if(0<=mxUtils.indexOf(H.dataTransfer.types,"text/uri-list")){var T=H.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(T)&&(I.value=decodeURIComponent(T),A())}H.stopPropagation();H.preventDefault()}),!1)}};C.appendChild(O);C.appendChild(I);mxUtils.br(C);e=document.createElement("span");e.style.marginLeft="30px";mxUtils.write(e,mxResources.get("width")+-":");C.appendChild(e);var G=document.createElement("input");G.setAttribute("type","text");G.style.width="60px";G.style.marginLeft="8px";G.style.marginRight="16px";G.value=null==l||N?"":l.width;C.appendChild(G);mxUtils.write(C,mxResources.get("height")+":");var E=document.createElement("input");E.setAttribute("type","text");E.style.width="60px";E.style.marginLeft="8px";E.style.marginRight="16px";E.value=null==l||N?"":l.height;C.appendChild(E);mxUtils.br(C);mxUtils.br(C);mxEvent.addListener(I,"change",-A);ImageDialog.filePicked=function(z){z.action==google.picker.Action.PICKED&&null!=z.docs[0].thumbnails&&(z=z.docs[0].thumbnails[z.docs[0].thumbnails.length-1],null!=z&&(I.value=z.url,A()));I.focus()};C.appendChild(Q);C.appendChild(c);mxUtils.br(C);mxUtils.br(C);N?(Q.setAttribute("checked","checked"),Q.checked=!0):(O.setAttribute("checked","checked"),O.checked=!0);!L&&Q.checked&&(mxUtils.write(n,mxResources.get("pageNotFound")),n.setAttribute("disabled","disabled"),n.setAttribute("selected","selected"),+":");C.appendChild(e);var F=document.createElement("input");F.setAttribute("type","text");F.style.width="60px";F.style.marginLeft="8px";F.style.marginRight="16px";F.value=null==l||N?"":l.width;C.appendChild(F);mxUtils.write(C,mxResources.get("height")+":");var E=document.createElement("input");E.setAttribute("type","text");E.style.width="60px";E.style.marginLeft="8px";E.style.marginRight="16px";E.value=null==l||N?"":l.height;C.appendChild(E);mxUtils.br(C);mxUtils.br(C);mxEvent.addListener(I,"change",+A);ImageDialog.filePicked=function(z){z.action==google.picker.Action.PICKED&&null!=z.docs[0].thumbnails&&(z=z.docs[0].thumbnails[z.docs[0].thumbnails.length-1],null!=z&&(I.value=z.url,A()));I.focus()};C.appendChild(Q);C.appendChild(c);mxUtils.br(C);mxUtils.br(C);N?(Q.setAttribute("checked","checked"),Q.checked=!0):(O.setAttribute("checked","checked"),O.checked=!0);!K&&Q.checked&&(mxUtils.write(n,mxResources.get("pageNotFound")),n.setAttribute("disabled","disabled"),n.setAttribute("selected","selected"),n.setAttribute("value","pageNotFound"),c.appendChild(n),mxEvent.addListener(c,"change",function(){null==n.parentNode||n.selected||n.parentNode.removeChild(n)}));l=document.createElement("div");l.style.display=t?"inline-flex":"none";l.style.alignItems="center";l.style.cursor="default";l.style.minWidth="40%";l.style.height="20px";var U=document.createElement("input");U.setAttribute("type","checkbox");U.style.margin="0px 10px 0px 4px";U.style.verticalAlign="bottom";U.defaultChecked=d!=mxConstants.NONE&&null!=d;U.checked=U.defaultChecked;l.appendChild(U);mxUtils.write(l,mxResources.get("fillColor"));t=l.cloneNode(!1);var P=document.createElement("input");P.setAttribute("type","checkbox");P.style.margin="0px 10px 0px 30px";P.style.verticalAlign="bottom";P.defaultChecked=x.shadowVisible;P.checked=P.defaultChecked;t.appendChild(P);mxUtils.write(t,mxResources.get("shadow"));mxClient.IS_SVG&&!mxClient.IS_SF||P.setAttribute("disabled","disabled");mxEvent.addListener(t,"click",function(z){mxEvent.getSource(z)!=-P&&(P.checked=!P.checked)});var J=document.createElement("button");J.style.width="36px";J.style.height="18px";J.style.cursor="pointer";J.style.marginLeft="10px";J.style.backgroundPosition="center center";J.style.backgroundRepeat="no-repeat";J.style.verticalAlign="bottom";J.className="geColorBtn";var m=d;y();mxEvent.addListener(l,"click",function(z){mxEvent.getSource(z)!=U&&(U.checked=!U.checked);m=U.checked?"#ffffff":null;y()});mxEvent.addListener(J,"click",function(z){b.pickColor(m||"none",function(B){m=-B;y()});mxEvent.consume(z)});l.appendChild(J);C.appendChild(l);C.appendChild(t);mxUtils.br(C);d=document.createElement("div");d.style.marginTop="30px";d.style.textAlign="right";x=mxUtils.button(mxResources.get("cancel"),function(){q=!0;b.hideDialog()});x.className="geBtn";b.editor.cancelFirst&&d.appendChild(x);t=mxUtils.button(mxResources.get("reset"),function(){I.value="";G.value="";E.value="";O.checked=!0;m=mxConstants.NONE;y();q=!1});mxEvent.addGestureListeners(t,function(){q=!0});t.className=+P&&(P.checked=!P.checked)});var M=document.createElement("button");M.style.width="36px";M.style.height="18px";M.style.cursor="pointer";M.style.marginLeft="10px";M.style.backgroundPosition="center center";M.style.backgroundRepeat="no-repeat";M.style.verticalAlign="bottom";M.className="geColorBtn";var m=d;y();mxEvent.addListener(l,"click",function(z){mxEvent.getSource(z)!=U&&(U.checked=!U.checked);m=U.checked?"#ffffff":null;y()});mxEvent.addListener(M,"click",function(z){b.pickColor(m||"none",function(B){m=+B;y()});mxEvent.consume(z)});l.appendChild(M);C.appendChild(l);C.appendChild(t);mxUtils.br(C);d=document.createElement("div");d.style.marginTop="30px";d.style.textAlign="right";x=mxUtils.button(mxResources.get("cancel"),function(){q=!0;b.hideDialog()});x.className="geBtn";b.editor.cancelFirst&&d.appendChild(x);t=mxUtils.button(mxResources.get("reset"),function(){I.value="";F.value="";E.value="";O.checked=!0;m=mxConstants.NONE;y();q=!1});mxEvent.addGestureListeners(t,function(){q=!0});t.className="geBtn";t.width="100";d.appendChild(t);if(Graph.fileSupport){var v=document.createElement("input");v.setAttribute("multiple","multiple");v.setAttribute("type","file");mxEvent.addListener(v,"change",function(z){null!=v.files&&(D(v.files),v.type="",v.type="file",v.value="")});v.style.display="none";C.appendChild(v);t=mxUtils.button(mxResources.get("open"),function(){v.click()});t.className="geBtn";d.appendChild(t)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();A(null,function(z){f(""!=-z&&null!=z?new mxImage(z,G.value,E.value):null,null==z,m,!mxClient.IS_SVG||mxClient.IS_SF?null:P.checked)})});mxEvent.addGestureListeners(applyBtn,function(){u=!0});applyBtn.className="geBtn gePrimaryBtn";d.appendChild(applyBtn);b.editor.cancelFirst||d.appendChild(x);C.appendChild(d);this.container=C},ParseDialog=function(b,f,l){function d(c,e,k){var n=c.split("\n");if("plantUmlPng"==e||"plantUmlSvg"==e||"plantUmlTxt"==e){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var q=function(T,-g,p,F,K){y=mxEvent.isAltDown(k)?y:u.getCenterInsertPoint(new mxRectangle(0,0,F,K));var M=null;u.getModel().beginUpdate();try{M="txt"==g?b.insertAsPreText(p,y.x,y.y):u.insertVertex(null,null,null,y.x,y.y,F,K,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(p)+";"),u.setAttributeForCell(M,"plantUmlData",JSON.stringify({data:T,format:g},null,2))}finally{u.getModel().endUpdate()}null!=M&&(u.setSelectionCell(M),u.scrollCellToVisible(M))},u=b.editor.graph,A="plantUmlTxt"==+z&&null!=z?new mxImage(z,F.value,E.value):null,null==z,m,!mxClient.IS_SVG||mxClient.IS_SF?null:P.checked)})});mxEvent.addGestureListeners(applyBtn,function(){u=!0});applyBtn.className="geBtn gePrimaryBtn";d.appendChild(applyBtn);b.editor.cancelFirst||d.appendChild(x);C.appendChild(d);this.container=C},ParseDialog=function(b,f,l){function d(c,e,k){var n=c.split("\n");if("plantUmlPng"==e||"plantUmlSvg"==e||"plantUmlTxt"==e){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var q=function(T,+g,p,G,J){y=mxEvent.isAltDown(k)?y:u.getCenterInsertPoint(new mxRectangle(0,0,G,J));var L=null;u.getModel().beginUpdate();try{L="txt"==g?b.insertAsPreText(p,y.x,y.y):u.insertVertex(null,null,null,y.x,y.y,G,J,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(p)+";"),u.setAttributeForCell(L,"plantUmlData",JSON.stringify({data:T,format:g},null,2))}finally{u.getModel().endUpdate()}null!=L&&(u.setSelectionCell(L),u.scrollCellToVisible(L))},u=b.editor.graph,A="plantUmlTxt"==e?"txt":"plantUmlPng"==e?"png":"svg";"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml"==c&&"svg"==A?window.setTimeout(function(){b.spinner.stop();q(c,A,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U2NyaXB0VHlwZT0iYXBwbGljYXRpb24vZWNtYXNjcmlwdCIgY29udGVudFN0eWxlVHlwZT0idGV4dC9jc3MiIGhlaWdodD0iMjEycHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDoyOTVweDtoZWlnaHQ6MjEycHg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyOTUgMjEyIiB3aWR0aD0iMjk1cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogNS4wLDUuMDsiIHgxPSIzMSIgeDI9IjMxIiB5MT0iMzQuNDg4MyIgeTI9IjE3MS43MzA1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDUuMCw1LjA7IiB4MT0iMjY0LjUiIHgyPSIyNjQuNSIgeTE9IjM0LjQ4ODMiIHkyPSIxNzEuNzMwNSIvPjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIzMyIgeD0iMTUiIHk9IjIzLjUzNTIiPkFsaWNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjE3MC43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMzMiIHg9IjE1IiB5PSIxOTEuMjY1NiI+QWxpY2U8L3RleHQ+PHJlY3QgZmlsbD0iI0ZFRkVDRSIgaGVpZ2h0PSIzMC40ODgzIiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuNTsiIHdpZHRoPSI0MCIgeD0iMjQ0LjUiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjIzLjUzNTIiPkJvYjwvdGV4dD48cmVjdCBmaWxsPSIjRkVGRUNFIiBoZWlnaHQ9IjMwLjQ4ODMiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS41OyIgd2lkdGg9IjQwIiB4PSIyNDQuNSIgeT0iMTcwLjczMDUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjE5MS4yNjU2Ij5Cb2I8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSIyNTIuNSw2MS43OTg4LDI2Mi41LDY1Ljc5ODgsMjUyLjUsNjkuNzk4OCwyNTYuNSw2NS43OTg4IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiIHgxPSIzMS41IiB4Mj0iMjU4LjUiIHkxPSI2NS43OTg4IiB5Mj0iNjUuNzk4OCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmdBbmRHbHlwaHMiIHRleHRMZW5ndGg9IjE0NyIgeD0iMzguNSIgeT0iNjEuMDU2NiI+QXV0aGVudGljYXRpb24gUmVxdWVzdDwvdGV4dD48cG9seWdvbiBmaWxsPSIjQTgwMDM2IiBwb2ludHM9IjQyLjUsOTEuMTA5NCwzMi41LDk1LjEwOTQsNDIuNSw5OS4xMDk0LDM4LjUsOTUuMTA5NCIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDIuMCwyLjA7IiB4MT0iMzYuNSIgeDI9IjI2My41IiB5MT0iOTUuMTA5NCIgeTI9Ijk1LjEwOTQiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxNTciIHg9IjQ4LjUiIHk9IjkwLjM2NzIiPkF1dGhlbnRpY2F0aW9uIFJlc3BvbnNlPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiNBODAwMzYiIHBvaW50cz0iMjUyLjUsMTIwLjQxOTksMjYyLjUsMTI0LjQxOTksMjUyLjUsMTI4LjQxOTksMjU2LjUsMTI0LjQxOTkiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIgeDE9IjMxLjUiIHgyPSIyNTguNSIgeTE9IjEyNC40MTk5IiB5Mj0iMTI0LjQxOTkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxOTkiIHg9IjM4LjUiIHk9IjExOS42Nzc3Ij5Bbm90aGVyIGF1dGhlbnRpY2F0aW9uIFJlcXVlc3Q8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSI0Mi41LDE0OS43MzA1LDMyLjUsMTUzLjczMDUsNDIuNSwxNTcuNzMwNSwzOC41LDE1My43MzA1IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogMi4wLDIuMDsiIHgxPSIzNi41IiB4Mj0iMjYzLjUiIHkxPSIxNTMuNzMwNSIgeTI9IjE1My43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMjA5IiB4PSI0OC41IiB5PSIxNDguOTg4MyI+QW5vdGhlciBhdXRoZW50aWNhdGlvbiBSZXNwb25zZTwvdGV4dD48IS0tTUQ1PVs3ZjNlNGQwYzkwMWVmZGJjNTdlYjQ0MjQ5YTNiODE5N10KQHN0YXJ0dW1sDQpza2lucGFyYW0gc2hhZG93aW5nIGZhbHNlDQpBbGljZSAtPiBCb2I6IEF1dGhlbnRpY2F0aW9uIFJlcXVlc3QNCkJvYiAtIC0+IEFsaWNlOiBBdXRoZW50aWNhdGlvbiBSZXNwb25zZQ0KDQpBbGljZSAtPiBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVxdWVzdA0KQWxpY2UgPC0gLSBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVzcG9uc2UNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMC4wMihTdW4gTWFyIDAxIDA0OjIyOjA3IENTVCAyMDIwKQooTUlUIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkphdmEgVmVyc2lvbjogMTIrMzMKT3BlcmF0aW5nIFN5c3RlbTogTWFjIE9TIFgKRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=",-295,212)},200):b.generatePlantUmlImage(c,A,function(T,g,p){b.spinner.stop();q(c,A,T,g,p)},function(T){b.handleError(T)})}}else if("mermaid"==e||"mermaid2drawio"==e){if(b.spinner.spin(document.body,mxResources.get("inserting"))){for(var D=0;D<n.length&&(0==n[D].trim().length||"%%"==n[D].substring(0,2));)D++;if("---"==n[D].trim()){do D++;while(D<n.length&&"---"!=n[D].trim());D++}D=n[D].trim().toLowerCase();n=D.indexOf(" ");D=D.substring(0,0<n?n:D.length);var G="undefined"!==typeof mxMermaidToDrawio&&-"mermaid2drawio"==e&&("graph"==D||"flowchart"==D||"sequencediagram"==D||"classdiagram"==D||"statediagram-v2"==D||"statediagram"==D||"erdiagram"==D||"requirementdiagram"==D||"gitgraph"==D||"mindmap"==D);u=b.editor.graph;G&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(T){b.spinner.stop();u.setSelectionCells(b.importXml(T,Math.max(y.x,20),Math.max(y.y,20),!0,null,null,!0));u.scrollCellToVisible(u.getSelectionCell())}));b.generateMermaidImage(c,null,function(T,g,p){if(!G){y=mxEvent.isAltDown(k)?-y:u.getCenterInsertPoint(new mxRectangle(0,0,g,p));b.spinner.stop();var F=null;u.getModel().beginUpdate();try{F=u.insertVertex(null,null,null,y.x,y.y,g,p,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+T+";"),u.setAttributeForCell(F,"mermaidData",JSON.stringify({data:c},null,2))}finally{u.getModel().endUpdate()}null!=F&&(u.setSelectionCell(F),u.scrollCellToVisible(F))}},function(T){"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();b.handleError(T)})}}else if("table"==-e){e=null;var E=[],U=0,P={};for(D=0;D<n.length;D++){var J=mxUtils.trim(n[D]);if("primary key"==J.substring(0,11).toLowerCase()){var m=J.match(/\((.+)\)/);m&&m[1]&&(P[m[1]]=!0);n.splice(D,1)}else 0<J.toLowerCase().indexOf("primary key")&&(P[J.split(" ")[0]]=!0,n[D]=mxUtils.trim(J.replace(/primary key/i,"")))}for(D=0;D<n.length;D++)if(J=mxUtils.trim(n[D]),"create table"==J.substring(0,12).toLowerCase())J=mxUtils.trim(J.substring(12)),"("==J.charAt(J.length-1)&&(J=mxUtils.trim(J.substring(0,J.length--1))),e=new mxCell(J,new mxGeometry(U,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),e.vertex=!0,E.push(e),J=b.editor.graph.getPreferredSizeForCell(v),null!=J&&(e.geometry.width=J.width+10);else if(null!=e&&")"==J.charAt(0))U+=e.geometry.width+40,e=null;else if("("!=J&&null!=e){J=J.substring(0,","==J.charAt(J.length-1)?J.length-1:J.length);m=P[J.split(" ")[0]];var v=new mxCell("",new mxGeometry(0,-0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="+(m?"1":"0")+";");v.vertex=!0;var z=new mxCell(m?"PK":"",new mxGeometry(0,0,30,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;strokeColor=inherit;top=0;left=0;bottom=0;right=0;"+(m?"fontStyle=1;":""));z.vertex=!0;v.insert(z);J=new mxCell(J,new mxGeometry(30,-0,130,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;align=left;strokeColor=inherit;top=0;left=0;bottom=0;right=0;spacingLeft=6;"+(m?"fontStyle=5;":""));J.vertex=!0;v.insert(J);J=b.editor.graph.getPreferredSizeForCell(J);null!=J&&e.geometry.width<J.width+30&&(e.geometry.width=Math.min(320,Math.max(e.geometry.width,J.width+30)));e.insert(v,m?0:null);e.geometry.height+=30}0<E.length&&(u=b.editor.graph,y=mxEvent.isAltDown(k)?y:u.getCenterInsertPoint(u.getBoundingBoxFromGeometry(E,-!0)),u.setSelectionCells(u.importCells(E,y.x,y.y)),u.scrollCellToVisible(u.getSelectionCell()))}else if("list"==e){if(0<n.length){u=b.editor.graph;e=null;E=[];for(D=v=0;D<n.length;D++)";"!=n[D].charAt(0)&&(0==n[D].length?e=null:null==e?(e=new mxCell(n[D],new mxGeometry(v,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),e.vertex=!0,E.push(e),J=u.getPreferredSizeForCell(e),-null!=J&&e.geometry.width<J.width+10&&(e.geometry.width=J.width+10),v+=e.geometry.width+40):"--"==n[D]?(J=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),J.vertex=!0,e.geometry.height+=J.geometry.height,e.insert(J)):0<n[D].length&&(U=new mxCell(n[D],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),-U.vertex=!0,J=u.getPreferredSizeForCell(U),null!=J&&U.geometry.width<J.width&&(U.geometry.width=J.width),e.geometry.width=Math.max(e.geometry.width,U.geometry.width),e.geometry.height+=U.geometry.height,e.insert(U)));if(0<E.length){y=mxEvent.isAltDown(k)?y:u.getCenterInsertPoint(u.getBoundingBoxFromGeometry(E,!0));u.getModel().beginUpdate();try{E=u.importCells(E,y.x,y.y);J=[];for(D=0;D<E.length;D++)J.push(E[D]),J=J.concat(E[D].children);u.fireEvent(new mxEventObject("cellsInserted","cells",J))}finally{u.getModel().endUpdate()}u.setSelectionCells(E);+295,212)},200):b.generatePlantUmlImage(c,A,function(T,g,p){b.spinner.stop();q(c,A,T,g,p)},function(T){b.handleError(T)})}}else if("mermaid"==e||"mermaid2drawio"==e){if(b.spinner.spin(document.body,mxResources.get("inserting"))){for(var D=0;D<n.length&&(0==n[D].trim().length||"%%"==n[D].substring(0,2));)D++;if("---"==n[D].trim()){do D++;while(D<n.length&&"---"!=n[D].trim());D++}D=n[D].trim().toLowerCase();n=D.indexOf(" ");D=D.substring(0,0<n?n:D.length);var F="undefined"!==typeof mxMermaidToDrawio&&+"mermaid2drawio"==e&&("graph"==D||"flowchart"==D||"sequencediagram"==D||"classdiagram"==D||"statediagram-v2"==D||"statediagram"==D||"erdiagram"==D||"requirementdiagram"==D||"gitgraph"==D||"mindmap"==D);u=b.editor.graph;F&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(T){b.spinner.stop();u.setSelectionCells(b.importXml(T,Math.max(y.x,20),Math.max(y.y,20),!0,null,null,!0));u.scrollCellToVisible(u.getSelectionCell())}));b.generateMermaidImage(c,null,function(T,g,p){if(!F){y=mxEvent.isAltDown(k)?+y:u.getCenterInsertPoint(new mxRectangle(0,0,g,p));b.spinner.stop();var G=null;u.getModel().beginUpdate();try{G=u.insertVertex(null,null,null,y.x,y.y,g,p,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+T+";"),u.setAttributeForCell(G,"mermaidData",JSON.stringify({data:c},null,2))}finally{u.getModel().endUpdate()}null!=G&&(u.setSelectionCell(G),u.scrollCellToVisible(G))}},function(T){"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();b.handleError(T)})}}else if("table"==+e){e=null;var E=[],U=0,P={};for(D=0;D<n.length;D++){var M=mxUtils.trim(n[D]);if("primary key"==M.substring(0,11).toLowerCase()){var m=M.match(/\((.+)\)/);m&&m[1]&&(P[m[1]]=!0);n.splice(D,1)}else 0<M.toLowerCase().indexOf("primary key")&&(P[M.split(" ")[0]]=!0,n[D]=mxUtils.trim(M.replace(/primary key/i,"")))}for(D=0;D<n.length;D++)if(M=mxUtils.trim(n[D]),"create table"==M.substring(0,12).toLowerCase())M=mxUtils.trim(M.substring(12)),"("==M.charAt(M.length-1)&&(M=mxUtils.trim(M.substring(0,M.length-+1))),e=new mxCell(M,new mxGeometry(U,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),e.vertex=!0,E.push(e),M=b.editor.graph.getPreferredSizeForCell(v),null!=M&&(e.geometry.width=M.width+10);else if(null!=e&&")"==M.charAt(0))U+=e.geometry.width+40,e=null;else if("("!=M&&null!=e){M=M.substring(0,","==M.charAt(M.length-1)?M.length-1:M.length);m=P[M.split(" ")[0]];var v=new mxCell("",new mxGeometry(0,+0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="+(m?"1":"0")+";");v.vertex=!0;var z=new mxCell(m?"PK":"",new mxGeometry(0,0,30,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;strokeColor=inherit;top=0;left=0;bottom=0;right=0;"+(m?"fontStyle=1;":""));z.vertex=!0;v.insert(z);M=new mxCell(M,new mxGeometry(30,+0,130,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;align=left;strokeColor=inherit;top=0;left=0;bottom=0;right=0;spacingLeft=6;"+(m?"fontStyle=5;":""));M.vertex=!0;v.insert(M);M=b.editor.graph.getPreferredSizeForCell(M);null!=M&&e.geometry.width<M.width+30&&(e.geometry.width=Math.min(320,Math.max(e.geometry.width,M.width+30)));e.insert(v,m?0:null);e.geometry.height+=30}0<E.length&&(u=b.editor.graph,y=mxEvent.isAltDown(k)?y:u.getCenterInsertPoint(u.getBoundingBoxFromGeometry(E,+!0)),u.setSelectionCells(u.importCells(E,y.x,y.y)),u.scrollCellToVisible(u.getSelectionCell()))}else if("list"==e){if(0<n.length){u=b.editor.graph;e=null;E=[];for(D=v=0;D<n.length;D++)";"!=n[D].charAt(0)&&(0==n[D].length?e=null:null==e?(e=new mxCell(n[D],new mxGeometry(v,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),e.vertex=!0,E.push(e),M=u.getPreferredSizeForCell(e),+null!=M&&e.geometry.width<M.width+10&&(e.geometry.width=M.width+10),v+=e.geometry.width+40):"--"==n[D]?(M=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),M.vertex=!0,e.geometry.height+=M.geometry.height,e.insert(M)):0<n[D].length&&(U=new mxCell(n[D],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),+U.vertex=!0,M=u.getPreferredSizeForCell(U),null!=M&&U.geometry.width<M.width&&(U.geometry.width=M.width),e.geometry.width=Math.max(e.geometry.width,U.geometry.width),e.geometry.height+=U.geometry.height,e.insert(U)));if(0<E.length){y=mxEvent.isAltDown(k)?y:u.getCenterInsertPoint(u.getBoundingBoxFromGeometry(E,!0));u.getModel().beginUpdate();try{E=u.importCells(E,y.x,y.y);M=[];for(D=0;D<E.length;D++)M.push(E[D]),M=M.concat(E[D].children);u.fireEvent(new mxEventObject("cellsInserted","cells",M))}finally{u.getModel().endUpdate()}u.setSelectionCells(E);u.scrollCellToVisible(u.getSelectionCell())}}}else{v=function(T){var g=B[T];null==g&&(g=new mxCell(T,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),g.vertex=!0,B[T]=g,E.push(g));return g};var B={};E=[];for(D=0;D<n.length;D++)if(";"!=n[D].charAt(0)){var H=n[D].split("->");2<=H.length&&(m=v(H[0]),z=v(H[H.length-1]),H=new mxCell(2<H.length?H[1]:"",new mxGeometry),H.edge=!0,H.geometry.relative=!0,m.insertEdge(H,!0),z.insertEdge(H,!1),E.push(H))}if(0<E.length){n=document.createElement("div");n.style.visibility=-"hidden";document.body.appendChild(n);u=new Graph(n);u.getModel().beginUpdate();try{E=u.importCells(E);for(D=0;D<E.length;D++)u.getModel().isVertex(E[D])&&(J=u.getPreferredSizeForCell(E[D]),E[D].geometry.width=Math.max(E[D].geometry.width,J.width),E[D].geometry.height=Math.max(E[D].geometry.height,J.height));D=!0;"horizontalFlow"==e||"verticalFlow"==e?((new mxHierarchicalLayout(u,"horizontalFlow"==e?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(u.getDefaultParent(),E),D=!1):"circle"==-e?(new mxCircleLayout(u)).execute(u.getDefaultParent()):(U=new mxFastOrganicLayout(u),U.disableEdgeStyle=!1,U.forceConstant=180,U.execute(u.getDefaultParent()));D&&(P=new mxParallelEdgeLayout(u),P.spacing=30,P.execute(u.getDefaultParent()))}finally{u.getModel().endUpdate()}u.clearCellOverlays();J=[];b.editor.graph.getModel().beginUpdate();try{E=u.getModel().getChildren(u.getDefaultParent()),y=mxEvent.isAltDown(k)?y:b.editor.graph.getCenterInsertPoint(u.getBoundingBoxFromGeometry(E,!0)),J=b.editor.graph.importCells(E,-y.x,y.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",J))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(J);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());u.destroy();n.parentNode.removeChild(n)}}}function t(){return"list"==C.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==C.value||+"hidden";document.body.appendChild(n);u=new Graph(n);u.getModel().beginUpdate();try{E=u.importCells(E);for(D=0;D<E.length;D++)u.getModel().isVertex(E[D])&&(M=u.getPreferredSizeForCell(E[D]),E[D].geometry.width=Math.max(E[D].geometry.width,M.width),E[D].geometry.height=Math.max(E[D].geometry.height,M.height));D=!0;"horizontalFlow"==e||"verticalFlow"==e?((new mxHierarchicalLayout(u,"horizontalFlow"==e?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(u.getDefaultParent(),E),D=!1):"circle"==+e?(new mxCircleLayout(u)).execute(u.getDefaultParent()):(U=new mxFastOrganicLayout(u),U.disableEdgeStyle=!1,U.forceConstant=180,U.execute(u.getDefaultParent()));D&&(P=new mxParallelEdgeLayout(u),P.spacing=30,P.execute(u.getDefaultParent()))}finally{u.getModel().endUpdate()}u.clearCellOverlays();M=[];b.editor.graph.getModel().beginUpdate();try{E=u.getModel().getChildren(u.getDefaultParent()),y=mxEvent.isAltDown(k)?y:b.editor.graph.getCenterInsertPoint(u.getBoundingBoxFromGeometry(E,!0)),M=b.editor.graph.importCells(E,+y.x,y.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",M))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(M);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());u.destroy();n.parentNode.removeChild(n)}}}function t(){return"list"==C.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==C.value||"mermaid2drawio"==C.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==C.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==C.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":"plantUmlSvg"==C.value||"plantUmlTxt"==C.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var y=b.editor.graph.getFreeInsertPoint();f=document.createElement("div");f.style.textAlign="right";var x=document.createElement("textarea");x.style.boxSizing="border-box";x.style.resize=-"none";x.style.width="100%";x.style.height="354px";x.style.marginBottom="16px";var C=document.createElement("select");C.className="geBtn";if("formatSql"==l||"mermaid"==l&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())C.style.display="none";var L=document.createElement("option");L.setAttribute("value","list");mxUtils.write(L,mxResources.get("list"));"plantUml"!=l&&"mermaid"!=l&&C.appendChild(L);null!=l&&"fromText"!=l||L.setAttribute("selected","selected");L=document.createElement("option");-L.setAttribute("value","table");mxUtils.write(L,mxResources.get("formatSql"));"formatSql"==l&&(C.appendChild(L),L.setAttribute("selected","selected"));L=document.createElement("option");L.setAttribute("value","mermaid");mxUtils.write(L,mxResources.get("image"));if("mermaid"==l)if("undefined"!==typeof mxMermaidToDrawio){var N=document.createElement("option");N.setAttribute("value","mermaid2drawio");N.setAttribute("selected","selected");mxUtils.write(N,mxResources.get("diagram"));C.appendChild(N)}else C.style.display=-"none";C.appendChild(L);L=document.createElement("option");L.setAttribute("value","diagram");mxUtils.write(L,mxResources.get("diagram"));N=document.createElement("option");N.setAttribute("value","circle");mxUtils.write(N,mxResources.get("circle"));var O=document.createElement("option");O.setAttribute("value","horizontalFlow");mxUtils.write(O,mxResources.get("horizontalFlow"));var Q=document.createElement("option");Q.setAttribute("value","verticalFlow");mxUtils.write(Q,mxResources.get("verticalFlow"));-"plantUml"!=l&&"mermaid"!=l&&(C.appendChild(L),C.appendChild(N),C.appendChild(O),C.appendChild(Q));L=document.createElement("option");L.setAttribute("value","plantUmlSvg");mxUtils.write(L,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==l&&L.setAttribute("selected","selected");N=document.createElement("option");N.setAttribute("value","plantUmlPng");mxUtils.write(N,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");O=document.createElement("option");O.setAttribute("value",-"plantUmlTxt");mxUtils.write(O,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==l&&(C.appendChild(L),C.appendChild(N),C.appendChild(O));var I=t();x.value=I;f.appendChild(x);this.init=function(){x.focus()};Graph.fileSupport&&(x.addEventListener("dragover",function(c){c.stopPropagation();c.preventDefault()},!1),x.addEventListener("drop",function(c){c.stopPropagation();c.preventDefault();if(0<c.dataTransfer.files.length){c=-c.dataTransfer.files[0];var e=new FileReader;e.onload=function(k){x.value=k.target.result};e.readAsText(c)}},!1));f.appendChild(C);mxEvent.addListener(C,"change",function(){var c=t();if(0==x.value.length||x.value==I)I=c,x.value=I});b.isOffline()||"mermaid"!=l&&"plantUml"!=l||(L=mxUtils.button(mxResources.get("help"),function(){b.openLink("mermaid"==l?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),L.className="geBtn",f.appendChild(L));L=mxUtils.button(mxResources.get("close"),-function(){x.value==I?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});L.className="geBtn";b.editor.cancelFirst&&f.appendChild(L);N=mxUtils.button(mxResources.get("insert"),function(c){try{b.hideDialog(),d(x.value,C.value,c)}catch(e){b.handleError(e)}});N.className="geBtn gePrimaryBtn";f.appendChild(N);b.editor.cancelFirst||f.appendChild(L);this.container=f},NewDialog=function(b,f,l,d,t,y,x,C,L,N,O,Q,I,c,e,k,n,q){function u(ja){null!=ja&&(pa=Aa=ja?135:140);ja=!0;+"none";x.style.width="100%";x.style.height="354px";x.style.marginBottom="16px";var C=document.createElement("select");C.className="geBtn";if("formatSql"==l||"mermaid"==l&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())C.style.display="none";var K=document.createElement("option");K.setAttribute("value","list");mxUtils.write(K,mxResources.get("list"));"plantUml"!=l&&"mermaid"!=l&&C.appendChild(K);null!=l&&"fromText"!=l||K.setAttribute("selected","selected");K=document.createElement("option");+K.setAttribute("value","table");mxUtils.write(K,mxResources.get("formatSql"));"formatSql"==l&&(C.appendChild(K),K.setAttribute("selected","selected"));K=document.createElement("option");K.setAttribute("value","mermaid");mxUtils.write(K,mxResources.get("image"));if("mermaid"==l)if("undefined"!==typeof mxMermaidToDrawio){var N=document.createElement("option");N.setAttribute("value","mermaid2drawio");N.setAttribute("selected","selected");mxUtils.write(N,mxResources.get("diagram"));C.appendChild(N)}else C.style.display=+"none";C.appendChild(K);K=document.createElement("option");K.setAttribute("value","diagram");mxUtils.write(K,mxResources.get("diagram"));N=document.createElement("option");N.setAttribute("value","circle");mxUtils.write(N,mxResources.get("circle"));var O=document.createElement("option");O.setAttribute("value","horizontalFlow");mxUtils.write(O,mxResources.get("horizontalFlow"));var Q=document.createElement("option");Q.setAttribute("value","verticalFlow");mxUtils.write(Q,mxResources.get("verticalFlow"));+"plantUml"!=l&&"mermaid"!=l&&(C.appendChild(K),C.appendChild(N),C.appendChild(O),C.appendChild(Q));K=document.createElement("option");K.setAttribute("value","plantUmlSvg");mxUtils.write(K,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==l&&K.setAttribute("selected","selected");N=document.createElement("option");N.setAttribute("value","plantUmlPng");mxUtils.write(N,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");O=document.createElement("option");O.setAttribute("value",+"plantUmlTxt");mxUtils.write(O,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==l&&(C.appendChild(K),C.appendChild(N),C.appendChild(O));var I=t();x.value=I;f.appendChild(x);this.init=function(){x.focus()};Graph.fileSupport&&(x.addEventListener("dragover",function(c){c.stopPropagation();c.preventDefault()},!1),x.addEventListener("drop",function(c){c.stopPropagation();c.preventDefault();if(0<c.dataTransfer.files.length){c=+c.dataTransfer.files[0];var e=new FileReader;e.onload=function(k){x.value=k.target.result};e.readAsText(c)}},!1));f.appendChild(C);mxEvent.addListener(C,"change",function(){var c=t();if(0==x.value.length||x.value==I)I=c,x.value=I});b.isOffline()||"mermaid"!=l&&"plantUml"!=l||(K=mxUtils.button(mxResources.get("help"),function(){b.openLink("mermaid"==l?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),K.className="geBtn",f.appendChild(K));K=mxUtils.button(mxResources.get("close"),+function(){x.value==I?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});K.className="geBtn";b.editor.cancelFirst&&f.appendChild(K);N=mxUtils.button(mxResources.get("insert"),function(c){try{b.hideDialog(),d(x.value,C.value,c)}catch(e){b.handleError(e)}});N.className="geBtn gePrimaryBtn";f.appendChild(N);b.editor.cancelFirst||f.appendChild(K);this.container=f},NewDialog=function(b,f,l,d,t,y,x,C,K,N,O,Q,I,c,e,k,n,q){function u(ja){null!=ja&&(pa=Aa=ja?135:140);ja=!0;if(null!=Wa)for(;g<Wa.length&&(ja||0!=mxUtils.mod(g,30));){var xa=Wa[g++];xa=m(xa.url,xa.libs,xa.title,xa.tooltip?xa.tooltip:xa.title,xa.select,xa.imgUrl,xa.info,xa.onClick,xa.preview,xa.noImg,xa.clibs,xa.type);ja&&xa.click();ja=!1}}function A(ja,xa,qa,oa,la,ya){if(null!=ja&&mxUtils.isAncestorNode(document.body,oa)){ja=mxUtils.parseXml(ja);ja=Editor.parseDiagramNode(ja.documentElement,null,!0);var Ja=new mxCodec(ja.ownerDocument),Fa=new mxGraphModel;Ja.decode(ja,Fa);b.sidebar.createTooltip(oa,Fa.root.children,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=la?mxResources.get(la):null,!0,new mxPoint(xa,qa),!0,function(){S=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=ya&&E(oa,null,null,ya,infoObj,clibs)},!0,!1)}}function D(){var ja=document.createElement("div");ja.style.position="absolute";ja.style.overflow="visible";ja.style.left="8px";ja.style.right="8px";ja.style.bottom="8px";ja.style.top="8px";mxUtils.write(ja,mxResources.get("describeYourDiagram")+":");mxUtils.br(ja);var xa=document.createElement("input");xa.setAttribute("type","text");xa.setAttribute("placeholder",mxResources.get("processForHiringNewEmployee"));xa.style.width="100%";xa.style.marginTop="6px";xa.style.marginBottom="4px";xa.style.boxSizing="border-box";ja.appendChild(xa);ja.init=function(){xa.focus()};mxUtils.br(ja);var qa=document.createElement("div");@@ -12327,298 +12327,298 @@ qa.style.top="86px";qa.style.left="2px";qa.style.right="2px";qa.style.bottom="2pmxUtils.write(oa,mxResources.get("diagramType"));oa.setAttribute("value","");la.appendChild(oa);for(var ya=0;ya<EditorUi.mermaidDiagramTypes.length;ya++){oa=document.createElement("option");var Ja=EditorUi.mermaidDiagramTypes[ya],Fa=Ja;Ja==urlParams["smart-template-type"]&&oa.setAttribute("selected","selected");"erDiagram"==Fa&&(Fa="entityRelationshipDiagram");Fa=mxResources.get(Fa,null,Fa.charAt(0).toUpperCase()+Fa.substring(1).replace(/[A-Z]/g," $&"));oa.setAttribute("value",Ja);mxUtils.write(oa,Fa);la.appendChild(oa)}var La=mxUtils.button(mxResources.get("generate"),function(){var Pa=xa.value,Ka=la.value.replace(/([A-Z])/g," $1").toLowerCase();Pa="Write the declaration code for a detailed and complex "+(""!=Ka?Ka:"graph")+' that shows "'+(""!=Pa?Pa:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.';Ka=""!=la.value?" ("+mxUtils.trim(mxUtils.getTextContent(la.options[la.selectedIndex]))+")":"";var Ra="gantt"==la.value||"pie"==la.value||"timeline"==la.value||"quadrantchart"==la.value||"c4context"==la.value,Ma=xa.value+Ka;"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(Qa){Ra||(sa=ma=Qa,ea="Smart Template: "+Ma)}));b.spinner.spin(document.body,mxResources.get("loading"))&&b.generateOpenAiMermaidDiagram(Pa,function(Qa,Ya,Ga,eb){b.spinner.stop();qa.innerHTML="";var Ua=document.createElement("img");Ua.setAttribute("title",Ma);Ua.src="data:image/svg+xml;base64,"+Ya.substring(Ya.indexOf(",")+-1);Ua.style.cursor="pointer";Ua.style.width="100%";Ua.style.height="100%";qa.appendChild(Ua);Qa=b.createMermaidXml(Qa,EditorUi.defaultMermaidConfig,Ya,Ga,eb,Ma);var ib="<mxfile><diagram>"+Graph.compress(Qa)+"</diagram></mxfile>";if(Ra||"undefined"===typeof mxMermaidToDrawio)sa=ma=Qa;Qa=K.cloneNode(!0);qa.appendChild(Qa);Ya=function(fb){S=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display};Ga=function(fb){S||A(ib,mxEvent.getClientX(fb),mxEvent.getClientY(fb),Ua,Ma)};mxEvent.addGestureListeners(Ua,+1);Ua.style.cursor="pointer";Ua.style.width="100%";Ua.style.height="100%";qa.appendChild(Ua);Qa=b.createMermaidXml(Qa,EditorUi.defaultMermaidConfig,Ya,Ga,eb,Ma);var ib="<mxfile><diagram>"+Graph.compress(Qa)+"</diagram></mxfile>";if(Ra||"undefined"===typeof mxMermaidToDrawio)sa=ma=Qa;Qa=J.cloneNode(!0);qa.appendChild(Qa);Ya=function(fb){S=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display};Ga=function(fb){S||A(ib,mxEvent.getClientX(fb),mxEvent.getClientY(fb),Ua,Ma)};mxEvent.addGestureListeners(Ua,Ya,null,Ga);mxEvent.addGestureListeners(Qa,Ya,null,Ga)},function(Qa){b.spinner.stop();null!=mxMermaidToDrawio.resetListeners&&mxMermaidToDrawio.resetListeners();b.handleError(Qa)})});La.setAttribute("disabled","disabled");La.className="geBtn gePrimaryBtn";oa=function(){window.setTimeout(function(){""!=xa.value?La.removeAttribute("disabled"):La.setAttribute("disabled","disabled")},0)};ya=urlParams["smart-template"];null!=ya&&"1"!=ya&&(xa.value=decodeURIComponent(ya),oa(),"1"==urlParams["smart-template-generate"]&&window.setTimeout(function(){La.click()},0));mxEvent.addListener(xa,"change",oa);mxEvent.addListener(xa,"keydown",oa);mxEvent.addListener(xa,"cut",oa);mxEvent.addListener(xa,"paste",oa);mxEvent.addListener(xa,"keydown",function(Pa){13==Pa.keyCode&&La.click()});oa=document.createElement("div");oa.style.height="40px";oa.style.marginTop="4px";oa.style.marginBottom="4px";oa.style.whiteSpace="nowrap";oa.style.overflowX="auto";oa.style.overflowY="hidden";oa.appendChild(la);oa.appendChild(La);ja.appendChild(oa);-ja.appendChild(qa);return ja}function G(){null!=ma&&ma==sa&&EditorUi.logEvent({category:"OPENAI-DIAGRAM",action:"templateGenerated",label:ea});if(ia&&null!=c)l||b.hideDialog(),c(ia,ta,T.value);else if(d)l||b.hideDialog(),d(ma,T.value,ka,ca);else{var ja=T.value;if(null!=ja&&0<ja.length){var xa=function(oa,la,ya){b.createFile(ya,ma,null!=ca&&0<ca.length?ca:null,oa,function(){b.hideDialog()},null,la,null,null!=da&&0<da.length?da:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var qa=new SaveDialog(b,+ja.appendChild(qa);return ja}function F(){null!=ma&&ma==sa&&EditorUi.logEvent({category:"OPENAI-DIAGRAM",action:"templateGenerated",label:ea});if(ia&&null!=c)l||b.hideDialog(),c(ia,ta,T.value);else if(d)l||b.hideDialog(),d(ma,T.value,ka,ca);else{var ja=T.value;if(null!=ja&&0<ja.length){var xa=function(oa,la,ya){b.createFile(ya,ma,null!=ca&&0<ca.length?ca:null,oa,function(){b.hideDialog()},null,la,null,null!=da&&0<da.length?da:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var qa=new SaveDialog(b,ja,mxUtils.bind(this,function(oa,la,ya){xa(la,ya,oa.value)}),null,null,null,null,b.mode);b.showDialog(qa.container,420,150,!0,!1);qa.init()}else b.pickFolder(b.mode,function(oa){xa(b.mode,oa,ja)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function E(ja,xa,qa,oa,la,ya,Ja){return aa!=ja?(null!=aa&&(aa.style.backgroundColor="transparent",aa.style.border="2px solid transparent",0<aa.getElementsByTagName("table").length&&(aa.getElementsByTagName("table")[0].style.visibility="visible"),aa==na&&(na.style.backgroundImage=Ha,na.style.backgroundPosition="center center",na.style.backgroundRepeat="no-repeat",na.style.backgroundSize="contain",wa.style.visibility="hidden",Da.style.visibility="hidden",Ca.style.visibility="hidden",Ba.style.visibility="hidden",Ea.style.visibility=null!=sa?"visible":"hidden",na.getElementsByTagName("table")[0].style.visibility="visible")),""!=ja.style.backgroundImage&&0<ja.getElementsByTagName("table").length&&(ja.getElementsByTagName("table")[0].style.visibility=-"hidden"),ja==na&&(xa=sa,null!=xa?(Ea.style.visibility="visible",Ea.style.visibility=null!=sa?"visible":"hidden",Ba.style.visibility="visible"):(wa.style.visibility="visible",Da.style.visibility="visible",Ca.style.visibility="visible",Ba.style.visibility="hidden",Ea.style.visibility="hidden")),F.removeAttribute("disabled"),ma=xa,ca=qa,da=ya,aa=ja,ia=oa,ka=Ja,ta=la,aa.style.border=L,!0):!1}function U(){na.style.backgroundImage="";na.getElementsByTagName("table")[0].style.visibility="hidden";wa.style.visibility=-"visible";Da.style.visibility="visible";Ca.style.visibility="visible";Ba.style.visibility="hidden";Ea.style.visibility="hidden";wa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?wa.select():document.execCommand("selectAll",!1,null)}function P(){wa.style.visibility="hidden";Da.style.visibility="hidden";Ca.style.visibility="hidden";na.style.backgroundImage=Ha;na.style.backgroundSize="contain";Ba.style.visibility="visible";Ea.style.visibility="visible"}function J(ja){var xa=mxUtils.trim(wa.value);+"hidden"),ja==na&&(xa=sa,null!=xa?(Ea.style.visibility="visible",Ea.style.visibility=null!=sa?"visible":"hidden",Ba.style.visibility="visible"):(wa.style.visibility="visible",Da.style.visibility="visible",Ca.style.visibility="visible",Ba.style.visibility="hidden",Ea.style.visibility="hidden")),G.removeAttribute("disabled"),ma=xa,ca=qa,da=ya,aa=ja,ia=oa,ka=Ja,ta=la,aa.style.border=K,!0):!1}function U(){na.style.backgroundImage="";na.getElementsByTagName("table")[0].style.visibility="hidden";wa.style.visibility=+"visible";Da.style.visibility="visible";Ca.style.visibility="visible";Ba.style.visibility="hidden";Ea.style.visibility="hidden";wa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?wa.select():document.execCommand("selectAll",!1,null)}function P(){wa.style.visibility="hidden";Da.style.visibility="hidden";Ca.style.visibility="hidden";na.style.backgroundImage=Ha;na.style.backgroundSize="contain";Ba.style.visibility="visible";Ea.style.visibility="visible"}function M(ja){var xa=mxUtils.trim(wa.value);if(ja||""==xa)null!=ea&&(wa.value=ea,P());else{wa.style.visibility="hidden";Da.style.visibility="hidden";Ca.style.visibility="hidden";var qa=!1;ja='Write a detailed and complex MermaidJS declaration for "'+(""!=xa?xa:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.';"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(oa){oa!=b.emptyDiagramXml&&(qa=!0,ma=oa)}));na.style.backgroundImage="url("+Editor.spinImage+")";na.style.backgroundSize="12px 12px";b.generateOpenAiMermaidDiagram(ja,function(oa,la,ya,Ja){aa==na&&"hidden"==wa.style.visibility&&(Ha="url(data:image/svg+xml;base64,"+la.substring(la.indexOf(",")+1)+")",na.setAttribute("title",xa),sa=ma=oa=qa?ma:b.createMermaidXml(oa,EditorUi.defaultMermaidConfig,la,ya,Ja,xa),ea=xa,P())},function(oa){aa==na&&(wa.style.visibility="visible",Da.style.visibility="visible",Ca.style.visibility="visible",Ba.style.visibility="visible",Ea.style.visibility="visible",b.handleError(oa))})}}-function m(ja,xa,qa,oa,la,ya,Ja,Fa,La,Pa,Ka,Ra){function Ma(Oa,$a){null==eb?(Ua=Oa,Ua=/^https?:\/\//.test(Ua)?b.editor.isCorsEnabledForUrl(Ua)?Ua:PROXY_URL+"?url="+encodeURIComponent(Ua):TEMPLATE_PATH+"/"+Ua,mxUtils.get(Ua,mxUtils.bind(this,function(ab){200<=ab.getStatus()&&299>=ab.getStatus()&&(eb=ab.getText());$a(eb,Ua)}))):$a(eb,Ua)}function Qa(Oa,$a){if(null==ja||M||b.sidebar.currentElt==Ga)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=R){var ab="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+-R.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+R.naturalWidth+'" height="'+R.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";A(ab,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),qa,ja)}else b.sidebar.currentElt=Ga,M=!0,Ma(ja,function(gb){if(M&&b.sidebar.currentElt==Ga)try{A(gb,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),Ga,$a)}catch(Za){b.sidebar.currentElt=null,b.handleError(Za)}M=!1})}function Ya(){var Oa=document.createElement("table");+function m(ja,xa,qa,oa,la,ya,Ja,Fa,La,Pa,Ka,Ra){function Ma(Oa,$a){null==eb?(Ua=Oa,Ua=/^https?:\/\//.test(Ua)?b.editor.isCorsEnabledForUrl(Ua)?Ua:PROXY_URL+"?url="+encodeURIComponent(Ua):TEMPLATE_PATH+"/"+Ua,mxUtils.get(Ua,mxUtils.bind(this,function(ab){200<=ab.getStatus()&&299>=ab.getStatus()&&(eb=ab.getText());$a(eb,Ua)}))):$a(eb,Ua)}function Qa(Oa,$a){if(null==ja||L||b.sidebar.currentElt==Ga)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=R){var ab="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='++R.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+R.naturalWidth+'" height="'+R.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";A(ab,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),qa,ja)}else b.sidebar.currentElt=Ga,L=!0,Ma(ja,function(gb){if(L&&b.sidebar.currentElt==Ga)try{A(gb,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),Ga,$a)}catch(Za){b.sidebar.currentElt=null,b.handleError(Za)}L=!1})}function Ya(){var Oa=document.createElement("table");Oa.setAttribute("width","100%");Oa.setAttribute("height","100%");Oa.style.background="light-dark(rgba(255,255,255,0.85), transparent)";Oa.style.lineHeight="1.3em";Oa.style.border="none";var $a=document.createElement("tbody"),ab=document.createElement("tr"),gb=document.createElement("td");gb.setAttribute("align","center");gb.setAttribute("valign","middle");var Za=document.createElement("span");Za.style.display="inline-block";Za.style.padding="2px 8px";Za.style.userSelect="none";Za.style.borderRadius="8px";Za.style.background="rgba(255,255,255,0.7)";Za.style.overflow="hidden";Za.style.textOverflow="ellipsis";Za.style.maxWidth=pa-34+"px";mxUtils.write(Za,mxResources.get(qa,null,qa));gb.appendChild(Za);ab.appendChild(gb);$a.appendChild(ab);Oa.appendChild($a);return Oa}var Ga=null;if("generative"!=Ra||null==na){Ga=document.createElement("div");Ga.className="geTemplate geAdaptiveAsset";Ga.style.backgroundOrigin="content-box";Ga.style.backgroundPosition="center center";Ga.style.backgroundRepeat="no-repeat";Ga.style.backgroundSize="contain";Ga.style.boxSizing="border-box";Ga.style.borderRadius="12px";Ga.style.position="relative";Ga.style.height=pa+"px";Ga.style.width=Aa+"px";Ga.style.padding="4px";Ga.style.border="2px solid transparent";var eb=null,Ua=ja;null!=qa?Ga.setAttribute("title",mxResources.get(qa,null,qa)):null!=oa&&0<oa.length&&Ga.setAttribute("title",oa)}else Ga=na;if(null!=ya){Ga.style.display="inline-flex";Ga.style.justifyContent="center";Ga.style.alignItems="center";la=document.createElement("img");-la.setAttribute("src",ya);la.setAttribute("alt",oa);la.style.maxWidth=pa+"px";la.style.maxHeight=Aa+"px";R=la;var ib=ya.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ga.appendChild(la);la.onerror=function(){this.src!=ib?this.src=ib:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ga,mxUtils.bind(this,function(Oa){E(Ga,null,null,ja,Ja,Ka)}),null,null);mxEvent.addListener(Ga,"dblclick",function(Oa){G();mxEvent.consume(Oa)})}else if(!Pa&&null!=ja&&0<ja.length){var fb=-function(Oa){p.spin(ra)&&Ma(ja,function($a,ab){p.stop();null!=$a&&(E(Ga,$a,xa,null,null,Ka,ab),Oa&&G())})};ya=La||TEMPLATE_PATH+"/"+ja.substring(0,ja.length-4)+".png";Ga.style.backgroundImage="url("+ya+")";null!=qa&&Ga.appendChild(Ya());mxEvent.addGestureListeners(Ga,mxUtils.bind(this,function(Oa){fb()}),null,null);mxEvent.addListener(Ga,"dblclick",function(Oa){fb(!0);mxEvent.consume(Oa)})}else Ga.appendChild(Ya()),"generative"==Ra&&null==na&&(Ga.style.backgroundImage=Ha,Ga.style.overflow="visible",-Ga.appendChild(Ea),Ga.appendChild(Ba),Ga.appendChild(wa),Ga.appendChild(Da),Ga.appendChild(Ca),na=Ga),la&&E(Ga),null!=Fa?(mxEvent.addGestureListeners(Ga,null,null,mxUtils.bind(this,function(Oa){E(Ga,null,null,ja,Ja)})),mxEvent.addListener(Ga,"click",Fa)):(mxEvent.addListener(Ga,"click",function(Oa){E(Ga,null,null,ja,Ja)&&"generative"==Ra&&null==sa&&U()}),mxEvent.addListener(Ga,"dblclick",function(Oa){"generative"!=Ra?G():"hidden"==wa.style.visibility&&U();mxEvent.consume(Oa)}));null!=ja&&(ya=K.cloneNode(!0),+la.setAttribute("src",ya);la.setAttribute("alt",oa);la.style.maxWidth=pa+"px";la.style.maxHeight=Aa+"px";R=la;var ib=ya.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ga.appendChild(la);la.onerror=function(){this.src!=ib?this.src=ib:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ga,mxUtils.bind(this,function(Oa){E(Ga,null,null,ja,Ja,Ka)}),null,null);mxEvent.addListener(Ga,"dblclick",function(Oa){F();mxEvent.consume(Oa)})}else if(!Pa&&null!=ja&&0<ja.length){var fb=+function(Oa){p.spin(ra)&&Ma(ja,function($a,ab){p.stop();null!=$a&&(E(Ga,$a,xa,null,null,Ka,ab),Oa&&F())})};ya=La||TEMPLATE_PATH+"/"+ja.substring(0,ja.length-4)+".png";Ga.style.backgroundImage="url("+ya+")";null!=qa&&Ga.appendChild(Ya());mxEvent.addGestureListeners(Ga,mxUtils.bind(this,function(Oa){fb()}),null,null);mxEvent.addListener(Ga,"dblclick",function(Oa){fb(!0);mxEvent.consume(Oa)})}else Ga.appendChild(Ya()),"generative"==Ra&&null==na&&(Ga.style.backgroundImage=Ha,Ga.style.overflow="visible",+Ga.appendChild(Ea),Ga.appendChild(Ba),Ga.appendChild(wa),Ga.appendChild(Da),Ga.appendChild(Ca),na=Ga),la&&E(Ga),null!=Fa?(mxEvent.addGestureListeners(Ga,null,null,mxUtils.bind(this,function(Oa){E(Ga,null,null,ja,Ja)})),mxEvent.addListener(Ga,"click",Fa)):(mxEvent.addListener(Ga,"click",function(Oa){E(Ga,null,null,ja,Ja)&&"generative"==Ra&&null==sa&&U()}),mxEvent.addListener(Ga,"dblclick",function(Oa){"generative"!=Ra?F():"hidden"==wa.style.visibility&&U();mxEvent.consume(Oa)}));null!=ja&&(ya=J.cloneNode(!0),Ga.appendChild(ya),mxEvent.addGestureListeners(ya,mxUtils.bind(this,function(Oa){S=b.sidebar.currentElt==Ga}),null,null),mxEvent.addListener(ya,"click",mxUtils.bind(this,function(Oa){S||Qa(Oa,null!=qa?qa:oa);mxEvent.consume(Oa)})));ra.appendChild(Ga);return Ga}function v(){function ja(Ma,Qa){Ma=mxResources.get(Ma,null,Ma.substring(0,1).toUpperCase()+Ma.substring(1));18<Ma.length&&(Ma=Ma.substring(0,18)+"…");return Ma+(null!=Qa?" ("+Qa.length+")":"")}function xa(Ma,Qa,Ya){mxEvent.addListener(Qa,"click",function(){Sa!=Qa&&(null!=Sa&&(Sa.style.backgroundColor=""),Sa=Qa,Sa.style.backgroundColor=x,ra.scrollTop=0,ra.innerText="",g=0,null!=Ia[Ma].content?(ra.appendChild(Ia[Ma].content),ma=sa,Wa=null,null!=Ia[Ma].content.init&&Ia[Ma].content.init()):(Wa=Ya?Va[Ma][Ya]:Ia[Ma],W=null,u(!1)))});null!=urlParams["smart-template"]&&"smartTemplate"==Ma&&Qa.click()}jb&&(jb=!1,mxEvent.addListener(ra,"scroll",function(Ma){ra.scrollTop+ra.clientHeight>=ra.scrollHeight&&(u(),mxEvent.consume(Ma))}));if(0<Xa){var qa=-document.createElement("div");qa.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(qa,mxResources.get("custom"));fa.appendChild(qa);for(var oa in Ta){var la=document.createElement("div");qa=oa;var ya=Ta[oa];18<qa.length&&(qa=qa.substring(0,18)+"…");la.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";la.setAttribute("title",qa+" ("+-ya.length+")");mxUtils.write(la,la.getAttribute("title"));null!=N&&(la.style.padding=N);fa.appendChild(la);(function(Ma,Qa){mxEvent.addListener(la,"click",function(){Sa!=Qa&&(Sa.style.backgroundColor="",Sa=Qa,Sa.style.backgroundColor=x,ra.scrollTop=0,ra.innerText="",g=0,Wa=Ta[Ma],W=null,u(!1))})})(oa,la)}qa=document.createElement("div");qa.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(qa,"draw.io");fa.appendChild(qa)}for(oa in Ia){qa=-ya=null;if(null!=Ia[oa].content)la=document.createElement(Ja?"ul":"div"),qa=ja(oa),la.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",la.setAttribute("title",qa),mxUtils.write(la,qa),fa.appendChild(la),qa=la;else{var Ja=Va[oa];qa=la=document.createElement(Ja?"ul":"div");ya=Ia[oa];var Fa=ja(oa,ya);if(null!=Ja){ya=document.createElement("li");var La=document.createElement("div");+document.createElement("div");qa.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(qa,mxResources.get("custom"));ha.appendChild(qa);for(var oa in Ta){var la=document.createElement("div");qa=oa;var ya=Ta[oa];18<qa.length&&(qa=qa.substring(0,18)+"…");la.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";la.setAttribute("title",qa+" ("++ya.length+")");mxUtils.write(la,la.getAttribute("title"));null!=N&&(la.style.padding=N);ha.appendChild(la);(function(Ma,Qa){mxEvent.addListener(la,"click",function(){Sa!=Qa&&(Sa.style.backgroundColor="",Sa=Qa,Sa.style.backgroundColor=x,ra.scrollTop=0,ra.innerText="",g=0,Wa=Ta[Ma],W=null,u(!1))})})(oa,la)}qa=document.createElement("div");qa.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(qa,"draw.io");ha.appendChild(qa)}for(oa in Ia){qa=+ya=null;if(null!=Ia[oa].content)la=document.createElement(Ja?"ul":"div"),qa=ja(oa),la.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",la.setAttribute("title",qa),mxUtils.write(la,qa),ha.appendChild(la),qa=la;else{var Ja=Va[oa];qa=la=document.createElement(Ja?"ul":"div");ya=Ia[oa];var Fa=ja(oa,ya);if(null!=Ja){ya=document.createElement("li");var La=document.createElement("div");La.className="geTempTreeCaret";La.setAttribute("title",Fa);mxUtils.write(La,Fa);qa=La;ya.appendChild(La);Fa=document.createElement("ul");Fa.className="geTempTreeNested";Fa.style.visibility="hidden";for(var Pa in Ja){var Ka=document.createElement("li"),Ra=ja(Pa,Ja[Pa]);Ka.setAttribute("title",Ra);mxUtils.write(Ka,Ra);xa(oa,Ka,Pa);Fa.appendChild(Ka)}ya.appendChild(Fa);la.className="geTempTree";la.appendChild(ya);(function(Ma,Qa){mxEvent.addListener(Qa,"click",function(){Ma.style.visibility="visible";-Ma.classList.toggle("geTempTreeActive");Ma.classList.toggle("geTempTreeNested")&&setTimeout(function(){Ma.style.visibility="hidden"},550);Qa.classList.toggle("geTempTreeCaret-down")})})(Fa,La)}else la.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",la.setAttribute("title",Fa),mxUtils.write(la,Fa);null!=N&&(la.style.padding=N);fa.appendChild(la)}xa(oa,qa);null==Sa&&qa.click()}u(!1)}-C=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);l=null!=l?l:!0;t=null!=t?t:!1;x=null!=x?x:"light-dark(#ebf2f9, "+Editor.darkColor+")";L=null!=L?L:"2px dashed light-dark(#29b6f2, #00a8ff)";O=null!=O?O:EditorUi.templateFile;var z=document.createElement("div");z.style.userSelect="none";z.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";l&&z.appendChild(B);var H=document.createElement("img");H.setAttribute("border",+Ma.classList.toggle("geTempTreeActive");Ma.classList.toggle("geTempTreeNested")&&setTimeout(function(){Ma.style.visibility="hidden"},550);Qa.classList.toggle("geTempTreeCaret-down")})})(Fa,La)}else la.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",la.setAttribute("title",Fa),mxUtils.write(la,Fa);null!=N&&(la.style.padding=N);ha.appendChild(la)}xa(oa,qa);null==Sa&&qa.click()}u(!1)}+C=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);l=null!=l?l:!0;t=null!=t?t:!1;x=null!=x?x:"light-dark(#ebf2f9, "+Editor.darkColor+")";K=null!=K?K:"2px dashed light-dark(#29b6f2, #00a8ff)";O=null!=O?O:EditorUi.templateFile;var z=document.createElement("div");z.style.userSelect="none";z.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";l&&z.appendChild(B);var H=document.createElement("img");H.setAttribute("border","0");H.setAttribute("align","absmiddle");H.style.width="40px";H.style.height="40px";H.style.marginRight="10px";H.style.paddingBottom="4px";H.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";f||C||!l||B.appendChild(H);l&&mxUtils.write(B,(C?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");H=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?H=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?H=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?H=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?H=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?H=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(H=b.trello.extension);var T=document.createElement("input");T.setAttribute("value",b.defaultFilename+H);T.style.marginLeft="10px";T.style.width=f||C?"144px":"244px";this.init=function(){l&&Editor.selectFilename(T);null!=ra.parentNode&&null!=ra.parentNode.parentNode&&mxEvent.addGestureListeners(ra.parentNode.parentNode,mxUtils.bind(this,function(ja){null!=b.sidebar&&-b.sidebar.hideTooltip()}),null,null)};l&&(B.appendChild(T),q?T.style.width=f||C?"350px":"450px":null!=b.editor.diagramFileTypes&&(q=FilenameDialog.createFileTypes(b,T,b.editor.diagramFileTypes),q.style.marginLeft="6px",q.style.width=f||C?"80px":"180px",B.appendChild(q)));q=!1;var g=0,p=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),F=mxUtils.button(k||mxResources.get("create"),function(){F.setAttribute("disabled",-"disabled");G();F.removeAttribute("disabled")});F.className="geBtn gePrimaryBtn";var K=document.createElement("img");K.setAttribute("src",Editor.magnifyImage);K.setAttribute("title",mxResources.get("preview"));K.className="geAdaptiveAsset geActiveButton";K.style.position="absolute";K.style.borderRadius="16px";K.style.background="white";K.style.cursor="default";K.style.padding="2px";K.style.opacity="0.8";K.style.height="16px";K.style.right="2px";K.style.top="2px";var M=!1,R=null,S=!1;if(Q||I){var V=-[],W=null,X=null,Y=null,Z=function(ja){F.setAttribute("disabled","disabled");for(var xa=0;xa<V.length;xa++)V[xa].className=xa==ja?"geBtn gePrimaryBtn":"geBtn"};q=!0;k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.height="30px";z.appendChild(k);C=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){fa.style.display="";ua.style.display="";ra.style.left="160px";Z(0);ra.scrollTop=0;ra.innerText="";g=0;W!=Wa&&(Wa=W,Ia=X,Xa=Y,fa.innerText="",v(),W=null)});V.push(C);-k.appendChild(C);var ba=function(ja){fa.style.display="none";ua.style.display="none";ra.style.left="30px";Z(ja?-1:1);null==W&&(W=Wa);ra.scrollTop=0;ra.innerText="";p.spin(ra);var xa=function(qa,oa,la){g=0;p.stop();Wa=qa;la=la||{};var ya=0,Ja;for(Ja in la)ya+=la[Ja].length;if(oa)ra.innerText=oa;else if(0==qa.length&&0==ya)ra.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(ra.innerText="",0<ya){fa.style.display="";ra.style.left="160px";fa.innerText="";Xa=0;Ia={"draw.io":qa};-for(Ja in la)Ia[Ja]=la[Ja];v()}else u(!0)};ja?I(ha.value,xa):Q(xa)};Q&&(C=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){ba()}),k.appendChild(C),V.push(C));if(I){C=document.createElement("span");C.style.marginLeft="10px";C.innerText=mxResources.get("search")+":";k.appendChild(C);var ha=document.createElement("input");ha.style.marginRight="10px";ha.style.marginLeft="10px";ha.style.width="220px";mxEvent.addListener(ha,"keypress",function(ja){13==ja.keyCode&&ba(!0)});k.appendChild(ha);+b.sidebar.hideTooltip()}),null,null)};l&&(B.appendChild(T),q?T.style.width=f||C?"350px":"450px":null!=b.editor.diagramFileTypes&&(q=FilenameDialog.createFileTypes(b,T,b.editor.diagramFileTypes),q.style.marginLeft="6px",q.style.width=f||C?"80px":"180px",B.appendChild(q)));q=!1;var g=0,p=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),G=mxUtils.button(k||mxResources.get("create"),function(){G.setAttribute("disabled",+"disabled");F();G.removeAttribute("disabled")});G.className="geBtn gePrimaryBtn";var J=document.createElement("img");J.setAttribute("src",Editor.magnifyImage);J.setAttribute("title",mxResources.get("preview"));J.className="geAdaptiveAsset geActiveButton";J.style.position="absolute";J.style.borderRadius="16px";J.style.background="white";J.style.cursor="default";J.style.padding="2px";J.style.opacity="0.8";J.style.height="16px";J.style.right="2px";J.style.top="2px";var L=!1,R=null,S=!1;if(Q||I){var V=+[],W=null,X=null,Y=null,Z=function(ja){G.setAttribute("disabled","disabled");for(var xa=0;xa<V.length;xa++)V[xa].className=xa==ja?"geBtn gePrimaryBtn":"geBtn"};q=!0;k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.height="30px";z.appendChild(k);C=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){ha.style.display="";ua.style.display="";ra.style.left="160px";Z(0);ra.scrollTop=0;ra.innerText="";g=0;W!=Wa&&(Wa=W,Ia=X,Xa=Y,ha.innerText="",v(),W=null)});V.push(C);+k.appendChild(C);var ba=function(ja){ha.style.display="none";ua.style.display="none";ra.style.left="30px";Z(ja?-1:1);null==W&&(W=Wa);ra.scrollTop=0;ra.innerText="";p.spin(ra);var xa=function(qa,oa,la){g=0;p.stop();Wa=qa;la=la||{};var ya=0,Ja;for(Ja in la)ya+=la[Ja].length;if(oa)ra.innerText=oa;else if(0==qa.length&&0==ya)ra.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(ra.innerText="",0<ya){ha.style.display="";ra.style.left="160px";ha.innerText="";Xa=0;Ia={"draw.io":qa};+for(Ja in la)Ia[Ja]=la[Ja];v()}else u(!0)};ja?I(fa.value,xa):Q(xa)};Q&&(C=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){ba()}),k.appendChild(C),V.push(C));if(I){C=document.createElement("span");C.style.marginLeft="10px";C.innerText=mxResources.get("search")+":";k.appendChild(C);var fa=document.createElement("input");fa.style.marginRight="10px";fa.style.marginLeft="10px";fa.style.width="220px";mxEvent.addListener(fa,"keypress",function(ja){13==ja.keyCode&&ba(!0)});k.appendChild(fa);C=mxUtils.button(mxResources.get("search"),function(){ba(!0)});C.className="geBtn";k.appendChild(C)}Z(0)}var ca=null,da=null,ma=null,aa=null,ia=null,ka=null,ta=null,sa=null,ea=null,ra=document.createElement("div");ra.style.border="1px solid #d3d3d3";ra.style.position="absolute";ra.style.left="160px";ra.style.right="34px";k=(l?72:40)+(q?30:0);ra.style.top=k+"px";ra.style.bottom="68px";ra.style.margin="6px 0 0 -1px";ra.style.padding="6px";ra.style.overflow="auto";var ua=document.createElement("div");ua.style.cssText="position:absolute;left:30px;width:128px;top:"+k+"px;height:22px;margin-top: 6px;white-space: nowrap;";var za=document.createElement("input");za.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";za.setAttribute("placeholder",mxResources.get("search"));za.setAttribute("type","text");ua.appendChild(za);var va=document.createElement("img");va.setAttribute("src",Editor.magnifyImage);va.setAttribute("title",mxResources.get("search"));va.className="geAdaptiveAsset";va.style.position="relative";va.style.cursor="pointer";va.style.opacity="0.5";va.style.height="16px";va.style.left="-20px";va.style.top="4px";va.style.background="url('"+b.editor.transparentImage+"')";ua.appendChild(va);mxEvent.addListener(va,"click",function(){va.getAttribute("src")!=Editor.magnifyImage&&(va.setAttribute("src",Editor.magnifyImage),va.setAttribute("title",mxResources.get("search")),za.value="",null!=bb&&(bb.click(),bb=null));za.focus()});mxEvent.addListener(za,"keydown",mxUtils.bind(this,function(ja){if(13==ja.keyCode){var xa=za.value;if(""==xa)null!=bb&&(bb.click(),bb=null);else{if(null==NewDialog.tagsList[O]){var qa={};for(Ka in Ia)if(null==Ia[Ka].content)for(var oa=Ia[Ka],la=0;la<oa.length;la++){var ya=oa[la];if(null!=ya.tags)for(var Ja=ya.tags.toLowerCase().split(";"),Fa=0;Fa<Ja.length;Fa++)null==qa[Ja[Fa]]&&(qa[Ja[Fa]]=[]),qa[Ja[Fa]].push(ya)}NewDialog.tagsList[O]=qa}var La=xa.toLowerCase().split(" ");qa=NewDialog.tagsList[O];if(0<Xa&&null==qa.__tagsList__){for(Ka in Ta)for(oa=Ta[Ka],la=0;la<oa.length;la++)for(ya=oa[la],Ja=ya.title.split(" "),Ja.push(Ka),Fa=0;Fa<Ja.length;Fa++){var Pa=Ja[Fa].toLowerCase();null==qa[Pa]&&(qa[Pa]=[]);qa[Pa].push(ya)}qa.__tagsList__=!0}var Ka=[];oa={};for(la=Ja=0;la<La.length;la++)if(0<La[la].length){Pa=qa[La[la]];var Ra={};Ka=[];if(null!=Pa)for(Fa=0;Fa<Pa.length;Fa++)ya=Pa[Fa],0==Ja==(null==oa[ya.url])&&(Ra[ya.url]=!0,Ka.push(ya));oa=Ra;Ja++}ra.scrollTop=0;ra.innerText="";g=0;qa=document.createElement("div");qa.style.cssText="border: 1px solid #D3D3D3; padding: 6px; background: #F5F5F5;";-mxUtils.write(qa,mxResources.get(0==Ka.length?"noResultsFor":"resultsFor",[xa]));ra.appendChild(qa);null!=Sa&&null==bb&&(Sa.style.backgroundColor="",bb=Sa,Sa=qa);Wa=Ka;W=null;u(!1)}mxEvent.consume(ja)}}));mxEvent.addListener(za,"keyup",mxUtils.bind(this,function(ja){""==za.value?(va.setAttribute("src",Editor.magnifyImage),va.setAttribute("title",mxResources.get("search"))):(va.setAttribute("src",Editor.crossImage),va.setAttribute("title",mxResources.get("reset")))}));k+=23;var fa=document.createElement("div");-fa.style.cssText="position:absolute;left:30px;width:128px;top:"+k+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(ra,"scroll",function(){b.sidebar.hideTooltip()});var pa=140,Aa=pa,na=null,Ha="url("+Editor.sparklesImage+")",wa=document.createElement("textarea");wa.setAttribute("placeholder",mxResources.get("describeYourDiagram"));wa.style.position="absolute";wa.style.fontFamily="sans-serif";wa.style.outline="none";wa.style.left="0px";wa.style.right="0px";+mxUtils.write(qa,mxResources.get(0==Ka.length?"noResultsFor":"resultsFor",[xa]));ra.appendChild(qa);null!=Sa&&null==bb&&(Sa.style.backgroundColor="",bb=Sa,Sa=qa);Wa=Ka;W=null;u(!1)}mxEvent.consume(ja)}}));mxEvent.addListener(za,"keyup",mxUtils.bind(this,function(ja){""==za.value?(va.setAttribute("src",Editor.magnifyImage),va.setAttribute("title",mxResources.get("search"))):(va.setAttribute("src",Editor.crossImage),va.setAttribute("title",mxResources.get("reset")))}));k+=23;var ha=document.createElement("div");+ha.style.cssText="position:absolute;left:30px;width:128px;top:"+k+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(ra,"scroll",function(){b.sidebar.hideTooltip()});var pa=140,Aa=pa,na=null,Ha="url("+Editor.sparklesImage+")",wa=document.createElement("textarea");wa.setAttribute("placeholder",mxResources.get("describeYourDiagram"));wa.style.position="absolute";wa.style.fontFamily="sans-serif";wa.style.outline="none";wa.style.left="0px";wa.style.right="0px";wa.style.top="0px";wa.style.bottom="38px";wa.style.resize="none";wa.style.boxSizing="border-box";wa.style.fontSize="12px";wa.style.border="none";wa.style.margin="8px";var Da=document.createElement("button");Da.className="geBtn gePrimaryBtn";Da.style.position="absolute";Da.style.bottom="0px";Da.style.height="30px";Da.style.right="0px";Da.style.left="0px";Da.style.margin="8px";Da.style.fontSize="14px";Da.style.borderRadius="4px";Da.setAttribute("disabled","disabled");Da.setAttribute("title",mxResources.get("ok"));-mxUtils.write(Da,mxResources.get("ok"));var Ea=K.cloneNode(!0),Na=!1;mxEvent.addGestureListeners(Ea,function(ja){Na=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(ja){if(!Na&&null!=sa){var xa="<mxfile><diagram>"+Graph.compress(sa)+"</diagram></mxfile>";A(xa,mxEvent.getClientX(ja),mxEvent.getClientY(ja),na,ea)}});var Ba=K.cloneNode(!0);Ba.setAttribute("src",Editor.editImage);Ba.setAttribute("title",mxResources.get("edit"));Ba.style.right="";Ba.style.left="2px";var Ca=-K.cloneNode(!0);Ca.setAttribute("src",Editor.helpImage);Ca.setAttribute("title",mxResources.get("help"));Ca.style.opacity="1";Ca.style.right="-8px";Ca.style.top="-8px";mxEvent.addListener(Ca,"click",function(ja){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(ja)});wa.style.visibility="hidden";Da.style.visibility="hidden";Ba.style.visibility="hidden";Ca.style.visibility="hidden";Ea.style.visibility="hidden";mxEvent.addListener(Ba,"click",U);mxEvent.addListener(wa,-"input",function(){""!=wa.value?Da.removeAttribute("disabled"):Da.setAttribute("disabled","disabled")});mxEvent.addListener(Da,"click",function(){J()});mxEvent.addListener(wa,"keydown",function(ja){13!=ja.keyCode||mxEvent.isShiftDown(ja)?27==ja.keyCode&&(J(!0),mxEvent.consume(ja)):(J(),mxEvent.consume(ja))});var Ia={},Va={},Ta={},Xa=0,jb=!0,Sa=null,bb=null;Ia.basic=[{title:"blankDiagram"}];var Wa=Ia.basic;Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==+mxUtils.write(Da,mxResources.get("ok"));var Ea=J.cloneNode(!0),Na=!1;mxEvent.addGestureListeners(Ea,function(ja){Na=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(ja){if(!Na&&null!=sa){var xa="<mxfile><diagram>"+Graph.compress(sa)+"</diagram></mxfile>";A(xa,mxEvent.getClientX(ja),mxEvent.getClientY(ja),na,ea)}});var Ba=J.cloneNode(!0);Ba.setAttribute("src",Editor.editImage);Ba.setAttribute("title",mxResources.get("edit"));Ba.style.right="";Ba.style.left="2px";var Ca=+J.cloneNode(!0);Ca.setAttribute("src",Editor.helpImage);Ca.setAttribute("title",mxResources.get("help"));Ca.style.opacity="1";Ca.style.right="-8px";Ca.style.top="-8px";mxEvent.addListener(Ca,"click",function(ja){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(ja)});wa.style.visibility="hidden";Da.style.visibility="hidden";Ba.style.visibility="hidden";Ca.style.visibility="hidden";Ea.style.visibility="hidden";mxEvent.addListener(Ba,"click",U);mxEvent.addListener(wa,+"input",function(){""!=wa.value?Da.removeAttribute("disabled"):Da.setAttribute("disabled","disabled")});mxEvent.addListener(Da,"click",function(){M()});mxEvent.addListener(wa,"keydown",function(ja){13!=ja.keyCode||mxEvent.isShiftDown(ja)?27==ja.keyCode&&(M(!0),mxEvent.consume(ja)):(M(),mxEvent.consume(ja))});var Ia={},Va={},Ta={},Xa=0,jb=!0,Sa=null,bb=null;Ia.basic=[{title:"blankDiagram"}];var Wa=Ia.basic;Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&Ia.basic.push({title:"generate",type:"generative"});Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(Ia.smartTemplate={content:D()});if(!f){var cb=function(){mxUtils.get(db,function(ja){if(!hb){hb=!0;ja=ja.getXml().documentElement.firstChild;for(var xa={};null!=ja;){if("undefined"!==typeof ja.getAttribute)if("parsererror"==ja.nodeName)null!=window.console&&console.log("Parser error in "+O+": "+ja.textContent);else if("clibs"==ja.nodeName){for(var qa=ja.getAttribute("name"),oa=ja.getElementsByTagName("add"),la=[],ya=0;ya<oa.length;ya++)la.push(encodeURIComponent(mxUtils.getTextContent(oa[ya])));null!=qa&&0<la.length&&(xa[qa]=la.join(";"))}else if(la=ja.getAttribute("url"),null!=la){oa=ja.getAttribute("section");qa=ja.getAttribute("subsection");if(null==oa&&(ya=la.indexOf("/"),oa=la.substring(0,ya),null==qa)){var Ja=la.indexOf("/",ya+1);-1<Ja&&(qa=la.substring(ya+-1,Ja))}ya=Ia[oa];null==ya&&(ya=[],Ia[oa]=ya);la=ja.getAttribute("clibs");null!=xa[la]&&(la=xa[la]);la={url:ja.getAttribute("url"),libs:ja.getAttribute("libs"),title:ja.getAttribute("title"),tooltip:ja.getAttribute("name")||ja.getAttribute("url"),preview:ja.getAttribute("preview"),clibs:la,tags:ja.getAttribute("tags")};ya.push(la);null!=qa&&(ya=Va[oa],null==ya&&(ya={},Va[oa]=ya),oa=ya[qa],null==oa&&(oa=[],ya[qa]=oa),oa.push(la))}ja=ja.nextSibling}p.stop();v()}})};z.appendChild(ua);z.appendChild(fa);-z.appendChild(ra);var hb=!1,db=O;/^https?:\/\//.test(db)&&!b.editor.isCorsEnabledForUrl(db)&&(db=PROXY_URL+"?url="+encodeURIComponent(db));p.spin(ra);null!=n?n(function(ja,xa){Ta=ja;Y=Xa=xa;cb()},cb):cb();X=Ia}mxEvent.addListener(T,"keypress",function(ja){b.dialog.container.firstChild==z&&13==ja.keyCode&&G()});n=document.createElement("div");n.style.marginTop=f?"4px":"16px";n.style.textAlign="right";n.style.position="absolute";n.style.left="40px";n.style.bottom="24px";n.style.right="40px";k=mxUtils.button(mxResources.get("cancel"),-function(){null!=y&&y();b.hideDialog(!0)});k.className="geBtn";!b.editor.cancelFirst||t&&null==y||n.appendChild(k);f||"1"==urlParams.embed||t||mxClient.IS_ANDROID||mxClient.IS_IOS||"1"==urlParams.noDevice||(f=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var ja=new FilenameDialog(b,"",mxResources.get("create"),function(xa){null!=xa&&0<xa.length&&b.editor.loadUrl(b.editor.getProxiedUrl(xa),function(qa){ma=qa;ca=null;templateRealURl=xa;b.hideDialog();G()},function(qa){b.handleError(qa)})},+1,Ja))}ya=Ia[oa];null==ya&&(ya=[],Ia[oa]=ya);la=ja.getAttribute("clibs");null!=xa[la]&&(la=xa[la]);la={url:ja.getAttribute("url"),libs:ja.getAttribute("libs"),title:ja.getAttribute("title"),tooltip:ja.getAttribute("name")||ja.getAttribute("url"),preview:ja.getAttribute("preview"),clibs:la,tags:ja.getAttribute("tags")};ya.push(la);null!=qa&&(ya=Va[oa],null==ya&&(ya={},Va[oa]=ya),oa=ya[qa],null==oa&&(oa=[],ya[qa]=oa),oa.push(la))}ja=ja.nextSibling}p.stop();v()}})};z.appendChild(ua);z.appendChild(ha);+z.appendChild(ra);var hb=!1,db=O;/^https?:\/\//.test(db)&&!b.editor.isCorsEnabledForUrl(db)&&(db=PROXY_URL+"?url="+encodeURIComponent(db));p.spin(ra);null!=n?n(function(ja,xa){Ta=ja;Y=Xa=xa;cb()},cb):cb();X=Ia}mxEvent.addListener(T,"keypress",function(ja){b.dialog.container.firstChild==z&&13==ja.keyCode&&F()});n=document.createElement("div");n.style.marginTop=f?"4px":"16px";n.style.textAlign="right";n.style.position="absolute";n.style.left="40px";n.style.bottom="24px";n.style.right="40px";k=mxUtils.button(mxResources.get("cancel"),+function(){null!=y&&y();b.hideDialog(!0)});k.className="geBtn";!b.editor.cancelFirst||t&&null==y||n.appendChild(k);f||"1"==urlParams.embed||t||mxClient.IS_ANDROID||mxClient.IS_IOS||"1"==urlParams.noDevice||(f=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var ja=new FilenameDialog(b,"",mxResources.get("create"),function(xa){null!=xa&&0<xa.length&&b.editor.loadUrl(b.editor.getProxiedUrl(xa),function(qa){ma=qa;ca=null;templateRealURl=xa;b.hideDialog();F()},function(qa){b.handleError(qa)})},mxResources.get("url"),null,null,null,!1);b.showDialog(ja.container,300,80,!0,!0);ja.init()}),f.className="geBtn",n.appendChild(f));Graph.fileSupport&&e&&(e=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var ja=document.createElement("input");ja.setAttribute("multiple","multiple");ja.setAttribute("type","file");mxEvent.addListener(ja,"change",function(xa){b.openFiles(ja.files,!0);ja.value=""});ja.style.display="none";document.body.appendChild(ja);b.newDlgFileInputElt=-ja}b.newDlgFileInputElt.click()}),e.className="geBtn",n.appendChild(e));n.appendChild(F);b.editor.cancelFirst||null!=d||t&&null==y||n.appendChild(k);z.appendChild(n);this.container=z};NewDialog.tagsList={};-var SaveDialog=function(b,f,l,d,t,y,x,C){function L(z,B,H,T,g,p){var F=null;if(null==d||0>mxUtils.indexOf(d,z))if(g=null!=g?g:b.getTitleForService(z),0<=mxUtils.indexOf(U,z)||null!=b.getServiceForName(z)){F=document.createElement("option");if("pick"==p)F.innerHTML=mxUtils.htmlEntities(g)+" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"...",F.setAttribute("value","pickFolder-"+z),F.setAttribute("title",g+" - "+mxResources.get("pickFolder")+"...");else{var K=z+-(null!=H?"-"+H:""),M=m[K];null!=M&&null!=M.option&&M.option.parentNode.removeChild(M.option);M=null;if(null!=B){"/"==B.charAt(B.length-1)&&(B=B.substring(0,B.length-1));"/"==B.charAt(0)&&(B=B.substring(1));M=B;if(z!=App.MODE_GITHUB&&z==App.MODE_GITLAB){var R=M.lastIndexOf("/");0<=R&&(M=M.substring(R+1))}40<M.length&&(M=M.substring(0,20)+"..."+M.substring(M.length-20))}F.innerHTML=mxUtils.htmlEntities(g)+(null!=M?" – "+mxUtils.htmlEntities(M):"");F.setAttribute("title",g+-(null!=B?" ("+B+")":"")+(null!=H&&decodeURIComponent(H)!=B?" ["+H+"]":""));F.setAttribute("value",K);m[K]={option:F,mode:z,path:B,id:H};SaveDialog.lastValue==K&&null==C?T=!0:null==T&&("root"==p?T=null==C&&b.mode==z||null!=z&&z==C:"pickFolder-"==G.value.substring(0,11)&&(T=!0));T&&F.setAttribute("selected","selected")}G.appendChild(F)}return F}function N(z){b.pickFolder(z,function(B){var H=null;z==App.MODE_GOOGLE&&null!=B.docs&&0<B.docs.length?H={mode:z,path:B.docs[0].name,id:B.docs[0].id}:z==App.MODE_ONEDRIVE&&-null!=B.value&&0<B.value.length?H={mode:z,path:B.value[0].name,id:OneDriveFile.prototype.getIdOf(B.value[0])}:(z==App.MODE_GITHUB||z==App.MODE_GITLAB)&&null!=B&&0<B.length&&(H={mode:z,path:decodeURIComponent(B),id:B});null!=H&&(E.style.display="",b.addRecent(H,"Folders",5),B=L(H.mode,H.path,H.id,!0),G.innerHTML="",m={},O(),H=G.selectedIndex,G.value=B.value,0>G.selectedIndex&&(G.selectedIndex=H))},!0,!0,!0,!0)}function O(){var z=b.getRecent("Folders"),B=0;if(null!=z&&0<z.length){for(var H=0;H<z.length;H++)null!=-L(z[H].mode,z[H].path,z[H].id)&&B++;0<B&&G.appendChild(P.cloneNode(!0))}L(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");L(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(L(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),L(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.dropbox&&L(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);L(App.MODE_GITHUB,null,null,null,null,"pick");L(App.MODE_GITLAB,null,-null,null,null,"pick");L(App.MODE_TRELLO);z=!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&z&&L(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=d&&0<=mxUtils.indexOf(d,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&L(App.MODE_BROWSER);z&&L("download");Editor.popupsAllowed&&L("_blank",null,null,null,mxResources.get("openInNewWindow"));0<B&&(G.appendChild(P.cloneNode(!0)),B=G.value,G.appendChild(E),-G.value=B);if("pickFolder-"==G.value.substring(0,11)||"reset"==G.value)B=document.createElement("option"),B.setAttribute("value",""),B.setAttribute("selected","selected"),mxUtils.write(B,mxResources.get("pickFolder")+"..."),G.insertBefore(B,G.firstChild);J=G.value}function Q(){if("reset"==G.value)b.resetRecent("Folders"),G.innerHTML="",G.value="",pickFolderOption=null,m={},O();else if("pickFolder-"==G.value.substring(0,11)){var z=G.value.substring(11);G.value=J;N(z)}else if(null!=D&&null!=m[G.value]&&-null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[D.value].extension){z=b.getExtensionForService(m[G.value].mode);var B=A.value;null!=z&&0>f.indexOf(".")&&0>B.indexOf(".")&&(A.value=B+z)}v.innerHTML="";mxUtils.write(v,mxResources.get("download"==G.value||"_blank"==G.value?"ok":"save"));""==G.value?v.setAttribute("disabled","disabled"):v.removeAttribute("disabled")}var I=document.createElement("div");I.style.display="flex";I.style.flexWrap="wrap";I.style.whiteSpace="nowrap";var c=+ja}b.newDlgFileInputElt.click()}),e.className="geBtn",n.appendChild(e));n.appendChild(G);b.editor.cancelFirst||null!=d||t&&null==y||n.appendChild(k);z.appendChild(n);this.container=z};NewDialog.tagsList={};+var SaveDialog=function(b,f,l,d,t,y,x,C){function K(z,B,H,T,g,p){var G=null;if(null==d||0>mxUtils.indexOf(d,z))if(g=null!=g?g:b.getTitleForService(z),0<=mxUtils.indexOf(U,z)||null!=b.getServiceForName(z)){G=document.createElement("option");if("pick"==p)G.innerHTML=mxUtils.htmlEntities(g)+" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"...",G.setAttribute("value","pickFolder-"+z),G.setAttribute("title",g+" - "+mxResources.get("pickFolder")+"...");else{var J=z++(null!=H?"-"+H:""),L=m[J];null!=L&&null!=L.option&&L.option.parentNode.removeChild(L.option);L=null;if(null!=B){"/"==B.charAt(B.length-1)&&(B=B.substring(0,B.length-1));"/"==B.charAt(0)&&(B=B.substring(1));L=B;if(z!=App.MODE_GITHUB&&z==App.MODE_GITLAB){var R=L.lastIndexOf("/");0<=R&&(L=L.substring(R+1))}40<L.length&&(L=L.substring(0,20)+"..."+L.substring(L.length-20))}G.innerHTML=mxUtils.htmlEntities(g)+(null!=L?" – "+mxUtils.htmlEntities(L):"");G.setAttribute("title",g++(null!=B?" ("+B+")":"")+(null!=H&&decodeURIComponent(H)!=B?" ["+H+"]":""));G.setAttribute("value",J);m[J]={option:G,mode:z,path:B,id:H};SaveDialog.lastValue==J&&null==C?T=!0:null==T&&("root"==p?T=null==C&&b.mode==z||null!=z&&z==C:"pickFolder-"==F.value.substring(0,11)&&(T=!0));T&&G.setAttribute("selected","selected")}F.appendChild(G)}return G}function N(z){b.pickFolder(z,function(B){var H=null;z==App.MODE_GOOGLE&&null!=B.docs&&0<B.docs.length?H={mode:z,path:B.docs[0].name,id:B.docs[0].id}:z==App.MODE_ONEDRIVE&&+null!=B.value&&0<B.value.length?H={mode:z,path:B.value[0].name,id:OneDriveFile.prototype.getIdOf(B.value[0])}:(z==App.MODE_GITHUB||z==App.MODE_GITLAB)&&null!=B&&0<B.length&&(H={mode:z,path:decodeURIComponent(B),id:B});null!=H&&(E.style.display="",b.addRecent(H,"Folders",5),B=K(H.mode,H.path,H.id,!0),F.innerHTML="",m={},O(),H=F.selectedIndex,F.value=B.value,0>F.selectedIndex&&(F.selectedIndex=H))},!0,!0,!0,!0)}function O(){var z=b.getRecent("Folders"),B=0;if(null!=z&&0<z.length){for(var H=0;H<z.length;H++)null!=+K(z[H].mode,z[H].path,z[H].id)&&B++;0<B&&F.appendChild(P.cloneNode(!0))}K(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");K(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(K(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),K(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.dropbox&&K(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);K(App.MODE_GITHUB,null,null,null,null,"pick");K(App.MODE_GITLAB,null,+null,null,null,"pick");K(App.MODE_TRELLO);z=!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&z&&K(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=d&&0<=mxUtils.indexOf(d,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&K(App.MODE_BROWSER);z&&K("download");Editor.popupsAllowed&&K("_blank",null,null,null,mxResources.get("openInNewWindow"));0<B&&(F.appendChild(P.cloneNode(!0)),B=F.value,F.appendChild(E),+F.value=B);if("pickFolder-"==F.value.substring(0,11)||"reset"==F.value)B=document.createElement("option"),B.setAttribute("value",""),B.setAttribute("selected","selected"),mxUtils.write(B,mxResources.get("pickFolder")+"..."),F.insertBefore(B,F.firstChild);M=F.value}function Q(){if("reset"==F.value)b.resetRecent("Folders"),F.innerHTML="",F.value="",pickFolderOption=null,m={},O();else if("pickFolder-"==F.value.substring(0,11)){var z=F.value.substring(11);F.value=M;N(z)}else if(null!=D&&null!=m[F.value]&&+null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[D.value].extension){z=b.getExtensionForService(m[F.value].mode);var B=A.value;null!=z&&0>f.indexOf(".")&&0>B.indexOf(".")&&(A.value=B+z)}v.innerHTML="";mxUtils.write(v,mxResources.get("download"==F.value||"_blank"==F.value?"ok":"save"));""==F.value?v.setAttribute("disabled","disabled"):v.removeAttribute("disabled")}var I=document.createElement("div");I.style.display="flex";I.style.flexWrap="wrap";I.style.whiteSpace="nowrap";var c=document.createElement("div");c.style.display="grid";c.style.gap="5px 8px";c.style.gridAutoRows="auto auto 44px";c.style.gridAutoColumns="0fr minmax(0,1fr)";c.style.width="100%";var e=null,k=null;if(null!=t&&null!=y&&"image/"==y.substring(0,6)&&("image/svg"!=y.substring(0,9)||mxClient.IS_SVG)){c.style.display="inline-grid";c.style.flexBasis="75%";e=document.createElement("div");e.style.display="inline-block";e.style.height="auto";e.style.maxWidth="25%";e.style.margin="auto";var n=document.createElement("img"),q=x?t:btoa(unescape(encodeURIComponent(t)));n.setAttribute("src","data:"+y+";base64,"+q);n.style.boxSizing="border-box";n.style.maxHeight="50px";n.style.maxWidth="100%";n.style.paddingLeft="10px";e.appendChild(n);mxClient.IS_FF||"image/png"!=y||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(k=mxUtils.button(mxResources.get("copy"),function(){var z=b.base64ToBlob(q,"image/png");z=new ClipboardItem({"image/png":z,"text/html":new Blob(['<img src="data:'+y+";base64,"+q+'">'],{type:"text/html"})});navigator.clipboard.write([z]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(B){b.handleError(B)}))},null,"geBtn"));Editor.popupsAllowed&&(null==d||0>mxUtils.indexOf(d,"_blank"))?(e.setAttribute("title",mxResources.get("openInNewWindow")),e.style.cursor="pointer",mxEvent.addGestureListeners(e,null,null,function(z){mxEvent.isPopupTrigger(z)||b.openInNewWindow(t,y,x)})):e.setAttribute("title",mxResources.get("preview"))}n=document.createElement("div");n.style.display="flex";n.style.padding="1px";n.style.alignItems="center";n.style.justifyContent="flex-end";n.style.gridColumn="1";n.style.whiteSpace="nowrap";var u=document.createElement("div");u.style.display="grid";u.style.padding="1px";u.style.alignItems="center";u.style.gridColumn="2";u.style.gridAutoColumns="minmax(0,1fr) auto";u.style.gap="6px";mxUtils.write(n,mxResources.get("saveAs")+":");var A=document.createElement("input");A.setAttribute("type","text");A.setAttribute("value",f);A.style.boxSizing=-"border-box";A.style.width="100%";u.appendChild(A);c.appendChild(n);c.appendChild(u);var D=null;null!=b.editor.diagramFileTypes&&null==y&&(n=n.cloneNode(!1),u=u.cloneNode(!1),mxUtils.write(n,mxResources.get("type")+":"),D=FilenameDialog.createFileTypes(b,A,b.editor.diagramFileTypes),D.style.boxSizing="border-box",D.style.width="100%",u.appendChild(D),c.appendChild(n),c.appendChild(u));n=n.cloneNode(!1);u=u.cloneNode(!1);mxUtils.write(n,mxResources.get("where")+":");var G=document.createElement("select");-G.style.textOverflow="ellipsis";G.style.gridColumn="1";var E=document.createElement("option");mxUtils.write(E,mxResources.get("reset"));E.setAttribute("value","reset");var U=["browser","device","download","_blank"],P=document.createElement("option");P.setAttribute("disabled","disabled");P.innerHTML="-----------------";var J=null,m={},v=mxUtils.button(mxResources.get("save"),function(){SaveDialog.lastValue=G.value;var z=m[SaveDialog.lastValue];null!=z&&l(A,z.mode,z.id)},null,"geBtn gePrimaryBtn");-mxEvent.addListener(A,"keypress",function(z){13==z.keyCode&&v.click()});mxEvent.addListener(G,"change",Q);O();Q();u.appendChild(G);null!=SaveDialog.lastValue&&null!=m[SaveDialog.lastValue]&&(G.value=SaveDialog.lastValue);c.appendChild(n);c.appendChild(u);I.appendChild(c);null!=e&&I.appendChild(e);c=document.createElement("div");c.style.flexBasis="100%";c.style.textAlign="right";c.style.marginTop=null!=y?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||c.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));-e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&c.appendChild(e);null!=k&&c.appendChild(k);c.appendChild(v);b.editor.cancelFirst||c.appendChild(e);I.appendChild(c);this.init=function(){Editor.selectFilename(A)};this.container=I},CreateDialog=function(b,f,l,d,t,y,x,C,L,N,O,Q,I,c,e,k,n){function q(J,m,v,z){function B(){mxEvent.addListener(H,"click",function(){var K=v;if(x){var M=D.value,R=M.lastIndexOf(".");if(0>f.lastIndexOf(".")&&0>R){K=null!=-K?K:P.value;var S="";K==App.MODE_GOOGLE?S=b.drive.extension:K==App.MODE_GITHUB?S=b.gitHub.extension:K==App.MODE_GITLAB?S=b.gitLab.extension:K==App.MODE_TRELLO?S=b.trello.extension:K==App.MODE_DROPBOX?S=b.dropbox.extension:K==App.MODE_ONEDRIVE?S=b.oneDrive.extension:K==App.MODE_DEVICE&&(S=".drawio");0<=R&&(M=M.substring(0,R));D.value=M+S}}u(v)})}var H=document.createElement("a");H.style.overflow="hidden";var T=document.createElement("img");T.src=J;T.setAttribute("border","0");T.setAttribute("align",+"border-box";A.style.width="100%";u.appendChild(A);c.appendChild(n);c.appendChild(u);var D=null;null!=b.editor.diagramFileTypes&&null==y&&(n=n.cloneNode(!1),u=u.cloneNode(!1),mxUtils.write(n,mxResources.get("type")+":"),D=FilenameDialog.createFileTypes(b,A,b.editor.diagramFileTypes),D.style.boxSizing="border-box",D.style.width="100%",u.appendChild(D),c.appendChild(n),c.appendChild(u));n=n.cloneNode(!1);u=u.cloneNode(!1);mxUtils.write(n,mxResources.get("where")+":");var F=document.createElement("select");+F.style.textOverflow="ellipsis";F.style.gridColumn="1";var E=document.createElement("option");mxUtils.write(E,mxResources.get("reset"));E.setAttribute("value","reset");var U=["browser","device","download","_blank"],P=document.createElement("option");P.setAttribute("disabled","disabled");P.innerHTML="-----------------";var M=null,m={},v=mxUtils.button(mxResources.get("save"),function(){SaveDialog.lastValue=F.value;var z=m[SaveDialog.lastValue];null!=z&&l(A,z.mode,z.id)},null,"geBtn gePrimaryBtn");+mxEvent.addListener(A,"keypress",function(z){13==z.keyCode&&v.click()});mxEvent.addListener(F,"change",Q);O();Q();u.appendChild(F);null!=SaveDialog.lastValue&&null!=m[SaveDialog.lastValue]&&(F.value=SaveDialog.lastValue);c.appendChild(n);c.appendChild(u);I.appendChild(c);null!=e&&I.appendChild(e);c=document.createElement("div");c.style.flexBasis="100%";c.style.textAlign="right";c.style.marginTop=null!=y?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||c.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));+e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&c.appendChild(e);null!=k&&c.appendChild(k);c.appendChild(v);b.editor.cancelFirst||c.appendChild(e);I.appendChild(c);this.init=function(){Editor.selectFilename(A)};this.container=I},CreateDialog=function(b,f,l,d,t,y,x,C,K,N,O,Q,I,c,e,k,n){function q(M,m,v,z){function B(){mxEvent.addListener(H,"click",function(){var J=v;if(x){var L=D.value,R=L.lastIndexOf(".");if(0>f.lastIndexOf(".")&&0>R){J=null!=+J?J:P.value;var S="";J==App.MODE_GOOGLE?S=b.drive.extension:J==App.MODE_GITHUB?S=b.gitHub.extension:J==App.MODE_GITLAB?S=b.gitLab.extension:J==App.MODE_TRELLO?S=b.trello.extension:J==App.MODE_DROPBOX?S=b.dropbox.extension:J==App.MODE_ONEDRIVE?S=b.oneDrive.extension:J==App.MODE_DEVICE&&(S=".drawio");0<=R&&(L=L.substring(0,R));D.value=L+S}}u(v)})}var H=document.createElement("a");H.style.overflow="hidden";var T=document.createElement("img");T.src=M;T.setAttribute("border","0");T.setAttribute("align","absmiddle");T.style.width="60px";T.style.height="60px";T.style.paddingBottom="6px";H.style.display="inline-block";H.className="geBaseButton";H.style.position="relative";H.style.margin="4px";H.style.padding="8px 8px 10px 8px";H.style.whiteSpace="nowrap";H.appendChild(T);H.style.color="gray";H.style.fontSize="11px";var g=document.createElement("div");H.appendChild(g);mxUtils.write(g,m);if(null!=z&&null==b[z]){T.style.visibility="hidden";mxUtils.setOpacity(g,10);var p=new Spinner({lines:12,length:12,-width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});p.spin(H);var F=window.setTimeout(function(){null==b[z]&&(p.stop(),H.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[z]&&(window.clearTimeout(F),mxUtils.setOpacity(g,100),T.style.visibility="",p.stop(),B())}))}else B();E.appendChild(H);++U==Q&&(mxUtils.br(E),U=0)}function u(J){var m=D.value;if(null==J||null!=m&&0<m.length)n&&b.hideDialog(),-l(m,J,D)}O="1"==urlParams.noDevice?!1:O;x=null!=x?x:!0;C=null!=C?C:!0;Q=null!=Q?Q:4;n=null!=n?n:!0;y=document.createElement("div");y.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(y);var A=document.createElement("h2");mxUtils.write(A,t||mxResources.get("create"));A.style.marginTop="0px";A.style.marginBottom="24px";y.appendChild(A);t=document.createElement("span");mxUtils.write(t,mxResources.get("filename")+":");t.style.maxWidth="106px";t.style.overflow="hidden";t.style.textOverflow="ellipsis";+width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});p.spin(H);var G=window.setTimeout(function(){null==b[z]&&(p.stop(),H.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[z]&&(window.clearTimeout(G),mxUtils.setOpacity(g,100),T.style.visibility="",p.stop(),B())}))}else B();E.appendChild(H);++U==Q&&(mxUtils.br(E),U=0)}function u(M){var m=D.value;if(null==M||null!=m&&0<m.length)n&&b.hideDialog(),+l(m,M,D)}O="1"==urlParams.noDevice?!1:O;x=null!=x?x:!0;C=null!=C?C:!0;Q=null!=Q?Q:4;n=null!=n?n:!0;y=document.createElement("div");y.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(y);var A=document.createElement("h2");mxUtils.write(A,t||mxResources.get("create"));A.style.marginTop="0px";A.style.marginBottom="24px";y.appendChild(A);t=document.createElement("span");mxUtils.write(t,mxResources.get("filename")+":");t.style.maxWidth="106px";t.style.overflow="hidden";t.style.textOverflow="ellipsis";t.style.display="inline-block";y.appendChild(t);var D=document.createElement("input");D.setAttribute("value",f);D.style.width="180px";D.style.marginLeft="10px";D.style.marginBottom="20px";D.style.maxWidth="70%";this.init=function(){Editor.selectFilename(D)};y.appendChild(D);null!=k&&null!=b.editor.diagramFileTypes&&(k=FilenameDialog.createFileTypes(b,D,b.editor.diagramFileTypes),k.style.marginLeft="6px",k.style.width="90px",y.appendChild(k));k=null;if("1"!=urlParams.noDevice&&null!=I&&null!=c&&"image/"==-c.substring(0,6)&&("image/svg"!=c.substring(0,9)||mxClient.IS_SVG)){D.style.width="160px";t=document.createElement("img");var G=e?I:btoa(unescape(encodeURIComponent(I)));t.setAttribute("src","data:"+c+";base64,"+G);t.style.position="absolute";t.style.top="70px";t.style.right="100px";t.style.maxWidth="120px";t.style.maxHeight="80px";mxUtils.setPrefixedStyle(t.style,"transform","translate(50%,-50%)");y.appendChild(t);mxClient.IS_FF||"image/png"!=c||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||-(k=mxUtils.button(mxResources.get("copy"),function(J){J=b.base64ToBlob(G,"image/png");J=new ClipboardItem({"image/png":J,"text/html":new Blob(['<img src="data:'+c+";base64,"+G+'">'],{type:"text/html"})});navigator.clipboard.write([J]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(m){b.handleError(m)}))}),k.style.marginTop="6px",k.className="geBtn");L&&Editor.popupsAllowed&&(t.style.cursor="pointer",mxEvent.addGestureListeners(t,-null,null,function(J){mxEvent.isPopupTrigger(J)||u("_blank")}))}mxUtils.br(y);var E=document.createElement("div");E.style.textAlign="center";var U=0;E.style.marginTop="6px";y.appendChild(E);var P=document.createElement("select");P.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(I=document.createElement("option"),I.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(I,mxResources.get("googleDrive")),P.appendChild(I),q(IMAGE_PATH+"/google-drive-logo.svg",+c.substring(0,6)&&("image/svg"!=c.substring(0,9)||mxClient.IS_SVG)){D.style.width="160px";t=document.createElement("img");var F=e?I:btoa(unescape(encodeURIComponent(I)));t.setAttribute("src","data:"+c+";base64,"+F);t.style.position="absolute";t.style.top="70px";t.style.right="100px";t.style.maxWidth="120px";t.style.maxHeight="80px";mxUtils.setPrefixedStyle(t.style,"transform","translate(50%,-50%)");y.appendChild(t);mxClient.IS_FF||"image/png"!=c||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||+(k=mxUtils.button(mxResources.get("copy"),function(M){M=b.base64ToBlob(F,"image/png");M=new ClipboardItem({"image/png":M,"text/html":new Blob(['<img src="data:'+c+";base64,"+F+'">'],{type:"text/html"})});navigator.clipboard.write([M]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(m){b.handleError(m)}))}),k.style.marginTop="6px",k.className="geBtn");K&&Editor.popupsAllowed&&(t.style.cursor="pointer",mxEvent.addGestureListeners(t,+null,null,function(M){mxEvent.isPopupTrigger(M)||u("_blank")}))}mxUtils.br(y);var E=document.createElement("div");E.style.textAlign="center";var U=0;E.style.marginTop="6px";y.appendChild(E);var P=document.createElement("select");P.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(I=document.createElement("option"),I.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(I,mxResources.get("googleDrive")),P.appendChild(I),q(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(I=document.createElement("option"),I.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(I,mxResources.get("oneDrive")),P.appendChild(I),b.mode==App.MODE_ONEDRIVE&&I.setAttribute("selected","selected"),q(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(I=document.createElement("option"),I.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(I,mxResources.get("dropbox")),P.appendChild(I),b.mode==App.MODE_DROPBOX&&I.setAttribute("selected","selected"),q(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(I=document.createElement("option"),I.setAttribute("value",App.MODE_GITHUB),mxUtils.write(I,mxResources.get("github")),P.appendChild(I),q(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(I=document.createElement("option"),I.setAttribute("value",App.MODE_GITLAB),mxUtils.write(I,mxResources.get("gitlab")),P.appendChild(I),q(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(I=document.createElement("option"),I.setAttribute("value",App.MODE_TRELLO),mxUtils.write(I,mxResources.get("trello")),P.appendChild(I),q(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)I=document.createElement("option"),I.setAttribute("value",App.MODE_DEVICE),mxUtils.write(I,mxResources.get("device")),P.appendChild(I),b.mode!=App.MODE_DEVICE&&C||I.setAttribute("selected","selected"),O&&q(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);C&&isLocalStorage&&"0"!=urlParams.browser&&(C=document.createElement("option"),C.setAttribute("value",App.MODE_BROWSER),mxUtils.write(C,mxResources.get("browser")),P.appendChild(C),b.mode==App.MODE_BROWSER&&C.setAttribute("selected","selected"),q(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));C=document.createElement("div");C.style.marginTop="26px";C.style.textAlign="center";null!=N&&(O=mxUtils.button(mxResources.get("help"),function(){b.openLink(N)}),O.className="geBtn",C.appendChild(O));O=mxUtils.button(mxResources.get(null!=d?"close":"cancel"),function(){null!=d?d():(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});-O.className="geBtn";b.editor.cancelFirst&&null==d&&C.appendChild(O);null==d&&(I=mxUtils.button(mxResources.get("decideLater"),function(){u(null)}),I.className="geBtn",C.appendChild(I));L&&Editor.popupsAllowed&&(L=mxUtils.button(mxResources.get("openInNewWindow"),function(){u("_blank")}),L.className="geBtn",C.appendChild(L));CreateDialog.showDownloadButton&&(L=mxUtils.button(mxResources.get("download"),function(){u("download")}),L.className="geBtn",C.appendChild(L),null!=k&&(L.style.marginTop="6px",-C.style.marginTop="6px"));null!=k&&(mxUtils.br(C),C.appendChild(k));b.editor.cancelFirst&&null==d||C.appendChild(O);mxEvent.addListener(D,"keypress",function(J){13==J.keyCode?u(App.MODE_DEVICE):27==J.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});y.appendChild(C);this.container=y};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;+O.className="geBtn";b.editor.cancelFirst&&null==d&&C.appendChild(O);null==d&&(I=mxUtils.button(mxResources.get("decideLater"),function(){u(null)}),I.className="geBtn",C.appendChild(I));K&&Editor.popupsAllowed&&(K=mxUtils.button(mxResources.get("openInNewWindow"),function(){u("_blank")}),K.className="geBtn",C.appendChild(K));CreateDialog.showDownloadButton&&(K=mxUtils.button(mxResources.get("download"),function(){u("download")}),K.className="geBtn",C.appendChild(K),null!=k&&(K.style.marginTop="6px",+C.style.marginTop="6px"));null!=k&&(mxUtils.br(C),C.appendChild(k));b.editor.cancelFirst&&null==d||C.appendChild(O);mxEvent.addListener(D,"keypress",function(M){13==M.keyCode?u(App.MODE_DEVICE):27==M.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});y.appendChild(C);this.container=y};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;var PopupDialog=function(b,f,l,d,t){t=null!=t?t:!0;var y=document.createElement("div");y.style.textAlign="left";y.style.height="100%";mxUtils.write(y,mxResources.get("fileOpenLocation"));mxUtils.br(y);mxUtils.br(y);var x=mxUtils.button(mxResources.get("openInThisWindow"),function(){t&&b.hideDialog();null!=d&&d()});x.className="geBtn";x.style.marginBottom="8px";x.style.width="280px";y.appendChild(x);mxUtils.br(y);var C=mxUtils.button(mxResources.get("openInNewWindow"),function(){t&&b.hideDialog();-null!=l&&l();b.openLink(f,null,!0)});C.className="geBtn gePrimaryBtn";C.style.width=x.style.width;y.appendChild(C);mxUtils.br(y);mxUtils.br(y);mxUtils.write(y,mxResources.get("allowPopups"));this.container=y},ImageDialog=function(b,f,l,d,t,y,x,C){function L(){0<Q.value.length?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled");"data:"!=Q.value.substring(0,5)?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")}y=null!=y?y:!0;var N=b.editor.graph,O=document.createElement("div");+null!=l&&l();b.openLink(f,null,!0)});C.className="geBtn gePrimaryBtn";C.style.width=x.style.width;y.appendChild(C);mxUtils.br(y);mxUtils.br(y);mxUtils.write(y,mxResources.get("allowPopups"));this.container=y},ImageDialog=function(b,f,l,d,t,y,x,C){function K(){0<Q.value.length?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled");"data:"!=Q.value.substring(0,5)?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")}y=null!=y?y:!0;var N=b.editor.graph,O=document.createElement("div");mxUtils.write(O,f);f=document.createElement("div");f.className="geTitle";f.style.backgroundColor="transparent";f.style.borderColor="transparent";f.style.whiteSpace="nowrap";f.style.textOverflow="clip";f.style.cursor="default";f.style.paddingRight="20px";var Q=document.createElement("input");Q.setAttribute("value",l);Q.setAttribute("type","text");Q.setAttribute("spellcheck","false");Q.setAttribute("autocorrect","off");Q.setAttribute("autocomplete","off");Q.setAttribute("autocapitalize","off");Q.style.marginTop="6px";Q.style.width=(Graph.fileSupport?460:340)-20+"px";Q.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";Q.style.backgroundRepeat="no-repeat";Q.style.backgroundPosition="100% 50%";Q.style.paddingRight="14px";l=document.createElement("div");l.setAttribute("title",mxResources.get("reset"));l.style.position="relative";l.style.left="-16px";l.style.width="12px";l.style.height="14px";l.style.cursor="pointer";l.style.display="inline-block";l.style.top="3px";l.style.background="url('"+b.editor.transparentImage+-"')";mxEvent.addListener(l,"click",function(){Q.value="";Q.focus()});f.appendChild(Q);f.appendChild(l);O.appendChild(f);var I=C,c,e,k=function(D,G,E,U){var P="data:"==D.substring(0,5);!b.isOffline()||P&&"undefined"===typeof chrome?0<D.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(D,function(J){b.spinner.stop();b.hideDialog();var m=!1===U?1:null!=G&&null!=E?Math.max(G/J.width,E/J.height):Math.min(1,Math.min(520/J.width,520/J.height));y&&(D=b.convertDataUri(D));d(D,-Math.round(Number(J.width)*m),Math.round(Number(J.height)*m),I,c,e)},function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(D,null,null,I,c,e)):(D=b.convertDataUri(D),G=null==G?120:G,E=null==E?100:E,b.hideDialog(),d(D,G,E,I,c,e))},n=function(D,G){if(null!=D){var E=t?null:N.getModel().getGeometry(N.getSelectionCell());null!=E?k(D,E.width,E.height,G):k(D,null,null,G)}else b.hideDialog(),d(null)};this.init=function(){Q.focus();-if(Graph.fileSupport){Q.setAttribute("placeholder",mxResources.get("dragImagesHere"));var D=O.parentNode,G=null;mxEvent.addListener(D,"dragleave",function(E){null!=G&&(G.parentNode.removeChild(G),G=null);E.stopPropagation();E.preventDefault()});mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(E){null==G&&(!mxClient.IS_IE||10<document.documentMode)&&(G=b.highlightElement(D));E.stopPropagation();E.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(E){null!=G&&(G.parentNode.removeChild(G),-G=null);if(0<E.dataTransfer.files.length)b.importFiles(E.dataTransfer.files,0,0,b.maxImageSize,function(P,J,m,v,z,B,H,T){n(P,T)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var J=0;J<P.length;J++)P[J]()},!mxEvent.isControlDown(E),null,null,!0);else if(0<=mxUtils.indexOf(E.dataTransfer.types,"text/uri-list")){var U=E.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(U)&&n(decodeURIComponent(U))}E.stopPropagation();E.preventDefault()}),+"')";mxEvent.addListener(l,"click",function(){Q.value="";Q.focus()});f.appendChild(Q);f.appendChild(l);O.appendChild(f);var I=C,c,e,k=function(D,F,E,U){var P="data:"==D.substring(0,5);!b.isOffline()||P&&"undefined"===typeof chrome?0<D.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(D,function(M){b.spinner.stop();b.hideDialog();var m=!1===U?1:null!=F&&null!=E?Math.max(F/M.width,E/M.height):Math.min(1,Math.min(520/M.width,520/M.height));y&&(D=b.convertDataUri(D));d(D,+Math.round(Number(M.width)*m),Math.round(Number(M.height)*m),I,c,e)},function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(D,null,null,I,c,e)):(D=b.convertDataUri(D),F=null==F?120:F,E=null==E?100:E,b.hideDialog(),d(D,F,E,I,c,e))},n=function(D,F){if(null!=D){var E=t?null:N.getModel().getGeometry(N.getSelectionCell());null!=E?k(D,E.width,E.height,F):k(D,null,null,F)}else b.hideDialog(),d(null)};this.init=function(){Q.focus();+if(Graph.fileSupport){Q.setAttribute("placeholder",mxResources.get("dragImagesHere"));var D=O.parentNode,F=null;mxEvent.addListener(D,"dragleave",function(E){null!=F&&(F.parentNode.removeChild(F),F=null);E.stopPropagation();E.preventDefault()});mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(E){null==F&&(!mxClient.IS_IE||10<document.documentMode)&&(F=b.highlightElement(D));E.stopPropagation();E.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(E){null!=F&&(F.parentNode.removeChild(F),+F=null);if(0<E.dataTransfer.files.length)b.importFiles(E.dataTransfer.files,0,0,b.maxImageSize,function(P,M,m,v,z,B,H,T){n(P,T)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var M=0;M<P.length;M++)P[M]()},!mxEvent.isControlDown(E),null,null,!0);else if(0<=mxUtils.indexOf(E.dataTransfer.types,"text/uri-list")){var U=E.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(U)&&n(decodeURIComponent(U))}E.stopPropagation();E.preventDefault()}),!1)}};C=document.createElement("div");C.style.marginTop="14px";C.style.textAlign="center";l=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});l.className="geBtn";b.editor.cancelFirst&&C.appendChild(l);ImageDialog.filePicked=function(D){D.action==google.picker.Action.PICKED&&null!=D.docs[0].thumbnails&&(D=D.docs[0].thumbnails[D.docs[0].thumbnails.length-1],null!=D&&(Q.value=D.url));Q.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var q=document.createElement("input");-q.setAttribute("multiple","multiple");q.setAttribute("type","file");mxEvent.addListener(q,"change",function(D){null!=q.files&&(b.importFiles(q.files,0,0,b.maxImageSize,function(G,E,U,P,J,m){n(G)},function(){},function(G){return"image/"==G.type.substring(0,6)},function(G){for(var E=0;E<G.length;E++)G[E]()},!0),q.type="",q.type="file",q.value="")});q.style.display="none";document.body.appendChild(q);b.imgDlgFileInputElt=q}f=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});-f.className="geBtn";C.appendChild(f)}mxEvent.addListener(Q,"keypress",function(D){13==D.keyCode&&n(Q.value)});var u=mxUtils.button(mxResources.get("crop"),function(){var D=new CropImageDialog(b,Q.value,I,function(G,E,U){I=G;c=E;e=U});b.showDialog(D.container,300,390,!0,!0)});x&&(u.className="geBtn",C.appendChild(u));var A=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=Q.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var D=b.editor.createImageUrlConverter().convert(Q.value),-G=new Image;G.onload=function(){b.editor.convertImageToDataUri(D,function(E){b.confirmImageResize(function(U){b.resizeImage(G,E,mxUtils.bind(this,function(P,J,m){b.spinner.stop();null!=P&&P.length<b.maxImageBytes?(Q.value=P,L()):b.handleError({message:mxResources.get("imageTooBig")})}),U,b.maxImageSize)},G.width>b.maxImageSize||G.height>b.maxImageSize||E.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};G.onerror=function(){b.spinner.stop();-b.handleError({message:mxResources.get("fileNotFound")})};G.src=D}});A.className="geBtn";mxEvent.addListener(Q,"change",function(D){I=null;L()});L();C.appendChild(A);x=mxUtils.button(mxResources.get("apply"),function(){n(Q.value)});x.className="geBtn gePrimaryBtn";C.appendChild(x);b.editor.cancelFirst||C.appendChild(l);Graph.fileSupport&&(C.style.marginTop="120px",O.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",O.style.backgroundPosition="center 65%",O.style.backgroundRepeat="no-repeat",-x=document.createElement("div"),x.style.position="absolute",x.style.width="420px",x.style.top="58%",x.style.textAlign="center",x.style.fontSize="18px",x.style.color="#a0c3ff",mxUtils.write(x,mxResources.get("dragImagesHere")),O.appendChild(x));O.appendChild(C);this.container=O},LinkDialog=function(b,f,l,d,t,y,x){function C(D,G){var E=document.createElement("option");mxUtils.write(E,mxResources.get(D));E.value=D;u.appendChild(E);A[D]=G}var L=document.createElement("div");L.style.height="100%";mxUtils.write(L,+q.setAttribute("multiple","multiple");q.setAttribute("type","file");mxEvent.addListener(q,"change",function(D){null!=q.files&&(b.importFiles(q.files,0,0,b.maxImageSize,function(F,E,U,P,M,m){n(F)},function(){},function(F){return"image/"==F.type.substring(0,6)},function(F){for(var E=0;E<F.length;E++)F[E]()},!0),q.type="",q.type="file",q.value="")});q.style.display="none";document.body.appendChild(q);b.imgDlgFileInputElt=q}f=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});+f.className="geBtn";C.appendChild(f)}mxEvent.addListener(Q,"keypress",function(D){13==D.keyCode&&n(Q.value)});var u=mxUtils.button(mxResources.get("crop"),function(){var D=new CropImageDialog(b,Q.value,I,function(F,E,U){I=F;c=E;e=U});b.showDialog(D.container,300,390,!0,!0)});x&&(u.className="geBtn",C.appendChild(u));var A=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=Q.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var D=b.editor.createImageUrlConverter().convert(Q.value),+F=new Image;F.onload=function(){b.editor.convertImageToDataUri(D,function(E){b.confirmImageResize(function(U){b.resizeImage(F,E,mxUtils.bind(this,function(P,M,m){b.spinner.stop();null!=P&&P.length<b.maxImageBytes?(Q.value=P,K()):b.handleError({message:mxResources.get("imageTooBig")})}),U,b.maxImageSize)},F.width>b.maxImageSize||F.height>b.maxImageSize||E.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};F.onerror=function(){b.spinner.stop();+b.handleError({message:mxResources.get("fileNotFound")})};F.src=D}});A.className="geBtn";mxEvent.addListener(Q,"change",function(D){I=null;K()});K();C.appendChild(A);x=mxUtils.button(mxResources.get("apply"),function(){n(Q.value)});x.className="geBtn gePrimaryBtn";C.appendChild(x);b.editor.cancelFirst||C.appendChild(l);Graph.fileSupport&&(C.style.marginTop="120px",O.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",O.style.backgroundPosition="center 65%",O.style.backgroundRepeat="no-repeat",+x=document.createElement("div"),x.style.position="absolute",x.style.width="420px",x.style.top="58%",x.style.textAlign="center",x.style.fontSize="18px",x.style.color="#a0c3ff",mxUtils.write(x,mxResources.get("dragImagesHere")),O.appendChild(x));O.appendChild(C);this.container=O},LinkDialog=function(b,f,l,d,t,y,x){function C(D,F){var E=document.createElement("option");mxUtils.write(E,mxResources.get(D));E.value=D;u.appendChild(E);A[D]=F}var K=document.createElement("div");K.style.height="100%";mxUtils.write(K,mxResources.get("editLink")+":");var N=document.createElement("div");N.className="geTitle";N.style.backgroundColor="transparent";N.style.borderColor="transparent";N.style.whiteSpace="nowrap";N.style.textOverflow="clip";N.style.cursor="default";var O=document.createElement("input");O.setAttribute("placeholder",mxResources.get("dragUrlsHere"));O.setAttribute("type","text");O.style.marginTop="6px";O.style.width="414px";O.style.boxSizing="border-box";O.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";O.style.backgroundRepeat="no-repeat";O.style.backgroundPosition="100% 50%";O.style.paddingRight="14px";O.style.marginBottom="4px";var Q=document.createElement("div");Q.setAttribute("title",mxResources.get("reset"));Q.style.position="relative";Q.style.left="-16px";Q.style.width="12px";Q.style.height="14px";Q.style.cursor="pointer";Q.style.display="inline-block";Q.style.top="3px";Q.style.background="url('"+b.editor.transparentImage+"')";mxEvent.addListener(Q,"click",function(){O.value="";O.focus()});var I=document.createElement("input");I.style.cssText="margin-right:8px;margin-bottom:8px;";I.setAttribute("value","url");I.setAttribute("type","radio");I.setAttribute("name","geLinkDialogOption");var c=document.createElement("input");c.style.cssText="margin-right:8px;margin-bottom:8px;";c.setAttribute("value","url");c.setAttribute("type","radio");c.setAttribute("name","geLinkDialogOption");var e=document.createElement("select");e.style.width="414px";var k=document.createElement("input");k.setAttribute("type","checkbox");k.style.margin="0 6p 0 6px";null!=x&&(k.setAttribute("checked","checked"),k.defaultChecked=!0);x=null!=x?x:"_blank";k.setAttribute("title",x);y&&(O.style.width="200px");if(t&&null!=b.pages){null!=f&&Graph.isPageLink(f)?(c.setAttribute("checked","checked"),c.defaultChecked=!0):(O.setAttribute("value",f),I.setAttribute("checked","checked"),I.defaultChecked=!0);N.appendChild(I);N.appendChild(O);N.appendChild(Q);y&&(N.appendChild(k),mxUtils.write(N,mxResources.get("openInNewWindow")));mxUtils.br(N);N.appendChild(c);t=!1;for(y=0;y<b.pages.length;y++)Q=document.createElement("option"),mxUtils.write(Q,b.pages[y].getName()||mxResources.get("pageWithNumber",[y+1])),Q.setAttribute("value","data:page/id,"+b.pages[y].getId()),f==Q.getAttribute("value")&&(Q.setAttribute("selected","selected"),t=!0),e.appendChild(Q);if(!t&&c.checked){var n=document.createElement("option");mxUtils.write(n,mxResources.get("pageNotFound"));n.setAttribute("disabled","disabled");n.setAttribute("selected","selected");n.setAttribute("value",-"pageNotFound");e.appendChild(n);mxEvent.addListener(e,"change",function(){null==n.parentNode||n.selected||n.parentNode.removeChild(n)})}N.appendChild(e)}else O.setAttribute("value",f),N.appendChild(O),N.appendChild(Q);L.appendChild(N);var q=mxUtils.button(l,function(){b.hideDialog();d(c.checked?"pageNotFound"!==e.value?e.value:f:O.value,LinkDialog.selectedDocs,k.checked?x:null)});q.style.verticalAlign="middle";q.className="geBtn gePrimaryBtn";this.init=function(){c.checked?e.focus():(O.focus(),mxClient.IS_GC||-mxClient.IS_FF||5<=document.documentMode?O.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(e,"focus",function(){I.removeAttribute("checked");c.setAttribute("checked","checked");c.checked=!0});mxEvent.addListener(O,"focus",function(){c.removeAttribute("checked");I.setAttribute("checked","checked");I.checked=!0});if(Graph.fileSupport){var D=L.parentNode,G=null;mxEvent.addListener(D,"dragleave",function(E){null!=G&&(G.parentNode.removeChild(G),G=null);E.stopPropagation();E.preventDefault()});-mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(E){null==G&&(!mxClient.IS_IE||10<document.documentMode)&&(G=b.highlightElement(D));E.stopPropagation();E.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(E){try{null!=G&&(G.parentNode.removeChild(G),G=null),0<=mxUtils.indexOf(E.dataTransfer.types,"text/uri-list")&&(O.value=decodeURIComponent(E.dataTransfer.getData("text/uri-list")),I.setAttribute("checked","checked"),I.checked=!0,q.click())}catch(U){b.handleError(U)}E.stopPropagation();+"pageNotFound");e.appendChild(n);mxEvent.addListener(e,"change",function(){null==n.parentNode||n.selected||n.parentNode.removeChild(n)})}N.appendChild(e)}else O.setAttribute("value",f),N.appendChild(O),N.appendChild(Q);K.appendChild(N);var q=mxUtils.button(l,function(){b.hideDialog();d(c.checked?"pageNotFound"!==e.value?e.value:f:O.value,LinkDialog.selectedDocs,k.checked?x:null)});q.style.verticalAlign="middle";q.className="geBtn gePrimaryBtn";this.init=function(){c.checked?e.focus():(O.focus(),mxClient.IS_GC||+mxClient.IS_FF||5<=document.documentMode?O.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(e,"focus",function(){I.removeAttribute("checked");c.setAttribute("checked","checked");c.checked=!0});mxEvent.addListener(O,"focus",function(){c.removeAttribute("checked");I.setAttribute("checked","checked");I.checked=!0});if(Graph.fileSupport){var D=K.parentNode,F=null;mxEvent.addListener(D,"dragleave",function(E){null!=F&&(F.parentNode.removeChild(F),F=null);E.stopPropagation();E.preventDefault()});+mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(E){null==F&&(!mxClient.IS_IE||10<document.documentMode)&&(F=b.highlightElement(D));E.stopPropagation();E.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(E){try{null!=F&&(F.parentNode.removeChild(F),F=null),0<=mxUtils.indexOf(E.dataTransfer.types,"text/uri-list")&&(O.value=decodeURIComponent(E.dataTransfer.getData("text/uri-list")),I.setAttribute("checked","checked"),I.checked=!0,q.click())}catch(U){b.handleError(U)}E.stopPropagation();E.preventDefault()}),!1)}};l=document.createElement("div");l.style.marginTop="16px";l.style.textAlign="right";b.isOffline()||l.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));N=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});N.style.verticalAlign="middle";N.className="geBtn";b.editor.cancelFirst&&l.appendChild(N);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(D){if(D.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=D.docs;-var G=D.docs[0].url;"application/mxe"==D.docs[0].mimeType||null!=D.docs[0].mimeType&&"application/vnd.jgraph."==D.docs[0].mimeType.substring(0,23)?G="https://www.draw.io/#G"+D.docs[0].id:"application/vnd.google-apps.folder"==D.docs[0].mimeType&&(G="https://drive.google.com/#folders/"+D.docs[0].id);O.value=G;O.focus()}else LinkDialog.selectedDocs=null;O.focus()};var u=document.createElement("select");u.className="geBtn";u.style.position="relative";u.style.top="1px";u.style.maxWidth="120px";var A={};-t=document.createElement("option");mxUtils.write(t,mxResources.get("select")+"...");t.value="";u.appendChild(t);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&C("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==b.linkPicker){var D=b.drive.createLinkPicker();b.linkPicker=D.setCallback(function(G){LinkDialog.filePicked(G)}).build()}b.linkPicker.setVisible(!0)}))});-"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&C("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(D){O.value=D[0].link;O.focus()}})});null!=b.oneDrive&&C("oneDrive",function(){b.oneDrive.pickFile(function(D,G){null!=G&&null!=G.value&&0<G.value.length&&(O.value=G.value[0].webUrl,O.focus())},!0)});null!=b.gitHub&&C("github",function(){b.gitHub.pickFile(function(D){if(null!=D){D=D.split("/");var G=D[0],E=D[1],U=D[2];D=D.slice(3,D.length).join("/");-O.value="https://github.com/"+G+"/"+E+"/blob/"+U+"/"+D;O.focus()}})});null!=b.gitLab&&C("gitlab",function(){b.gitLab.pickFile(function(D){if(null!=D){D=D.split("/");var G=D[0],E=D[1],U=D[2];D=D.slice(3,D.length).join("/");O.value=DRAWIO_GITLAB_URL+"/"+G+"/"+E+"/blob/"+U+"/"+D;O.focus()}})});1<u.children.length&&(l.appendChild(u),mxEvent.addListener(u,"change",function(D){null!=A[u.value]&&(A[u.value](),u.value="")}));mxEvent.addListener(O,"keypress",function(D){13==D.keyCode&&q.click()});l.appendChild(q);-b.editor.cancelFirst||l.appendChild(N);L.appendChild(l);this.container=L},FeedbackDialog=function(b,f,l,d){var t=document.createElement("div"),y=document.createElement("div");mxUtils.write(y,mxResources.get("sendYourFeedback"));y.style.fontSize="18px";y.style.marginBottom="18px";t.appendChild(y);y=document.createElement("div");mxUtils.write(y,mxResources.get("yourEmailAddress")+(l?"":" ("+mxResources.get("required")+")"));t.appendChild(y);var x=document.createElement("input");x.setAttribute("type",+var F=D.docs[0].url;"application/mxe"==D.docs[0].mimeType||null!=D.docs[0].mimeType&&"application/vnd.jgraph."==D.docs[0].mimeType.substring(0,23)?F="https://www.draw.io/#G"+D.docs[0].id:"application/vnd.google-apps.folder"==D.docs[0].mimeType&&(F="https://drive.google.com/#folders/"+D.docs[0].id);O.value=F;O.focus()}else LinkDialog.selectedDocs=null;O.focus()};var u=document.createElement("select");u.className="geBtn";u.style.position="relative";u.style.top="1px";u.style.maxWidth="120px";var A={};+t=document.createElement("option");mxUtils.write(t,mxResources.get("select")+"...");t.value="";u.appendChild(t);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&C("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==b.linkPicker){var D=b.drive.createLinkPicker();b.linkPicker=D.setCallback(function(F){LinkDialog.filePicked(F)}).build()}b.linkPicker.setVisible(!0)}))});+"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&C("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(D){O.value=D[0].link;O.focus()}})});null!=b.oneDrive&&C("oneDrive",function(){b.oneDrive.pickFile(function(D,F){null!=F&&null!=F.value&&0<F.value.length&&(O.value=F.value[0].webUrl,O.focus())},!0)});null!=b.gitHub&&C("github",function(){b.gitHub.pickFile(function(D){if(null!=D){D=D.split("/");var F=D[0],E=D[1],U=D[2];D=D.slice(3,D.length).join("/");+O.value="https://github.com/"+F+"/"+E+"/blob/"+U+"/"+D;O.focus()}})});null!=b.gitLab&&C("gitlab",function(){b.gitLab.pickFile(function(D){if(null!=D){D=D.split("/");var F=D[0],E=D[1],U=D[2];D=D.slice(3,D.length).join("/");O.value=DRAWIO_GITLAB_URL+"/"+F+"/"+E+"/blob/"+U+"/"+D;O.focus()}})});1<u.children.length&&(l.appendChild(u),mxEvent.addListener(u,"change",function(D){null!=A[u.value]&&(A[u.value](),u.value="")}));mxEvent.addListener(O,"keypress",function(D){13==D.keyCode&&q.click()});l.appendChild(q);+b.editor.cancelFirst||l.appendChild(N);K.appendChild(l);this.container=K},FeedbackDialog=function(b,f,l,d){var t=document.createElement("div"),y=document.createElement("div");mxUtils.write(y,mxResources.get("sendYourFeedback"));y.style.fontSize="18px";y.style.marginBottom="18px";t.appendChild(y);y=document.createElement("div");mxUtils.write(y,mxResources.get("yourEmailAddress")+(l?"":" ("+mxResources.get("required")+")"));t.appendChild(y);var x=document.createElement("input");x.setAttribute("type","text");x.style.marginTop="6px";x.style.width="600px";var C=mxUtils.button(mxResources.get("sendMessage"),function(){var Q=O.value+(N.checked?"\nDiagram:\n"+(null!=d?d:mxUtils.getXml(b.getXmlFileData())):"")+"\nuserAgent:\n"+navigator.userAgent+"\nappVersion:\n"+navigator.appVersion+"\nappName:\n"+navigator.appName+"\nplatform:\n"+navigator.platform;Q.length>FeedbackDialog.maxAttachmentSize?b.alert(mxResources.get("drawingTooLarge")):(b.hideDialog(),b.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(x.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent((null!=f?f:"Feedback")+":\n"+Q),function(I){b.spinner.stop();200<=I.getStatus()&&299>=I.getStatus()?b.alert(mxResources.get("feedbackSent")):b.alert(mxResources.get("errorSendingFeedback"))},function(){b.spinner.stop();b.alert(mxResources.get("errorSendingFeedback"))}))});C.className=-"geBtn gePrimaryBtn";if(!l){C.setAttribute("disabled","disabled");var L=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;mxEvent.addListener(x,"change",function(){0<x.value.length&&0<L.test(x.value)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")});mxEvent.addListener(x,"keyup",function(){0<x.value.length&&L.test(x.value)?C.removeAttribute("disabled"):C.setAttribute("disabled",+"geBtn gePrimaryBtn";if(!l){C.setAttribute("disabled","disabled");var K=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;mxEvent.addListener(x,"change",function(){0<x.value.length&&0<K.test(x.value)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")});mxEvent.addListener(x,"keyup",function(){0<x.value.length&&K.test(x.value)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")})}t.appendChild(x);this.init=function(){x.focus()};var N=document.createElement("input");N.setAttribute("type","checkbox");N.setAttribute("checked","checked");N.defaultChecked=!0;l=document.createElement("p");l.style.marginTop="14px";l.appendChild(N);y=document.createElement("span");mxUtils.write(y," "+mxResources.get("includeCopyOfMyDiagram"));l.appendChild(y);mxEvent.addListener(y,"click",function(Q){N.checked=!N.checked;mxEvent.consume(Q)});t.appendChild(l);y=document.createElement("div");mxUtils.write(y,mxResources.get("feedback"));t.appendChild(y);var O=document.createElement("textarea");O.style.resize="none";O.style.width="600px";O.style.height="140px";O.style.marginTop="6px";O.setAttribute("placeholder",mxResources.get("comments"));t.appendChild(O);l=document.createElement("div");l.style.marginTop="26px";l.style.textAlign="right";y=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});y.className="geBtn";b.editor.cancelFirst?(l.appendChild(y),l.appendChild(C)):(l.appendChild(C),l.appendChild(y));t.appendChild(l);this.container=t};FeedbackDialog.maxAttachmentSize=1E6;var RevisionDialog=function(b,f,l){var d=document.createElement("div"),t=document.createElement("h3");t.style.marginTop="3px";mxUtils.write(t,mxResources.get("revisionHistory"));d.appendChild(t);t=document.createElement("div");t.style.position="absolute";t.style.overflow="auto";t.style.width="170px";t.style.height="378px";d.appendChild(t);var y=document.createElement("div");y.style.position="absolute";y.style.left="200px";y.style.width="470px";y.style.height="376px";y.style.overflow="hidden";y.style.borderWidth="1px";y.style.borderStyle="solid";var x=document.createElement("div");x.style.position="absolute";x.style.display="none";x.style.textAlign="center";x.style.padding="8px";x.style.borderRadius="8px";x.style.left="50%";x.style.top="50%";x.style.whiteSpace="nowrap";x.style.transform="translate(-50%, -50%)";x.style.background="inherit";x.style.border="1px solid";y.appendChild(x);mxEvent.disableContextMenu(y);d.appendChild(y);var C=new Graph(y);C.setTooltips(!1);C.setEnabled(!1);C.setPanning(!0);C.panningHandler.ignoreCell=-!0;C.panningHandler.useLeftButtonForPanning=!0;C.minFitScale=null;C.maxFitScale=null;C.centerZoom=!0;var L=0,N=null,O=0,Q=C.getGlobalVariable;C.getGlobalVariable=function(X){return"page"==X&&null!=N&&null!=N[O]?N[O].getAttribute("name"):"pagenumber"==X?O+1:"pagecount"==X?null!=N?N.length:1:Q.apply(this,arguments)};C.getLinkForCell=function(){return null};for(var I=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,-shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),c=b.getCurrentFile(),e=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),k={},n=0;n<e.length;n++)k[e[n].getAttribute("id")]=e[n];var q=null,u=null,A=null,D=null,G=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=A&&C.zoomIn()},20);G.setAttribute("disabled","disabled");var E=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=A&&C.zoomOut()},20);E.setAttribute("disabled",-"disabled");var U=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=A&&(1==C.view.scale?(C.maxFitScale=8,C.fit(8)):C.zoomActual(),C.center())},20);U.setAttribute("disabled","disabled");var P=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"),null,20);P.setAttribute("disabled","disabled");var J=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"),null,20);J.setAttribute("disabled","disabled");var m=y.cloneNode(!1);m.style.pointerEvent=+!0;C.panningHandler.useLeftButtonForPanning=!0;C.minFitScale=null;C.maxFitScale=null;C.centerZoom=!0;var K=0,N=null,O=0,Q=C.getGlobalVariable;C.getGlobalVariable=function(X){return"page"==X&&null!=N&&null!=N[O]?N[O].getAttribute("name"):"pagenumber"==X?O+1:"pagecount"==X?null!=N?N.length:1:Q.apply(this,arguments)};C.getLinkForCell=function(){return null};for(var I=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,+shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),c=b.getCurrentFile(),e=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),k={},n=0;n<e.length;n++)k[e[n].getAttribute("id")]=e[n];var q=null,u=null,A=null,D=null,F=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=A&&C.zoomIn()},20);F.setAttribute("disabled","disabled");var E=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=A&&C.zoomOut()},20);E.setAttribute("disabled",+"disabled");var U=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=A&&(1==C.view.scale?(C.maxFitScale=8,C.fit(8)):C.zoomActual(),C.center())},20);U.setAttribute("disabled","disabled");var P=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"),null,20);P.setAttribute("disabled","disabled");var M=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"),null,20);M.setAttribute("disabled","disabled");var m=y.cloneNode(!1);m.style.pointerEvent="none";y.parentNode.appendChild(m);var v=new Graph(m);v.setTooltips(!1);v.setEnabled(!1);v.setPanning(!0);v.panningHandler.ignoreCell=!0;v.panningHandler.useLeftButtonForPanning=!0;v.minFitScale=null;v.maxFitScale=null;v.centerZoom=!0;var z=document.createElement("div");z.style.textAlign="left";z.style.color="gray";z.style.backgroundColor="transparent";z.style.overflow="hidden";z.style.textOverflow="ellipsis";z.style.whiteSpace="nowrap";z.style.cursor="default";z.style.height="100%";z.style.display=-"inline-flex";z.style.alignItems="center";z.style.flexGrow="1";mxEvent.addListener(z,"click",function(){var X=mxUtils.getTextContent(z);""!=X&&b.alert(X)});var B=null;mxEvent.addGestureListeners(P,function(X){try{var Y=null!=N[L]?k[N[L].getAttribute("id")]:null;mxUtils.setOpacity(P,20);x.innerText="";if(null==Y)x.style.display="inline-block",mxUtils.write(x,mxResources.get("pageNotFound"));else{B=z.innerHTML;z.innerHTML=mxResources.get("current");y.style.display="none";m.style.display="";m.style.backgroundColor=+"inline-flex";z.style.alignItems="center";z.style.flexGrow="1";mxEvent.addListener(z,"click",function(){var X=mxUtils.getTextContent(z);""!=X&&b.alert(X)});var B=null;mxEvent.addGestureListeners(P,function(X){try{var Y=null!=N[K]?k[N[K].getAttribute("id")]:null;mxUtils.setOpacity(P,20);x.innerText="";if(null==Y)x.style.display="inline-block",mxUtils.write(x,mxResources.get("pageNotFound"));else{B=z.innerHTML;z.innerHTML=mxResources.get("current");y.style.display="none";m.style.display="";m.style.backgroundColor=y.style.backgroundColor;var Z=Editor.parseDiagramNode(Y);(new mxCodec(Z.ownerDocument)).decode(Z,v.getModel());v.view.scaleAndTranslate(C.view.scale,C.view.translate.x,C.view.translate.y);v.mathEnabled="1"==Z.getAttribute("math");v.setAdaptiveColors(Z.getAttribute("adaptiveColors"));Editor.MathJaxRender&&v.mathEnabled&&Editor.MathJaxRender(v.container)}}catch(ba){x.style.display="inline-block",x.innerText="",mxUtils.write(x,mxResources.get("pageNotFound")+": "+ba.message)}},null,function(){mxUtils.setOpacity(P,-60);x.style.display="none";x.innerText="";"none"==y.style.display&&(y.style.display="",z.innerHTML=B,m.style.display="none")});mxEvent.addListener(J,"click",mxUtils.bind(this,function(X){null!=A&&(X=b.getPagesForNode(A.documentElement),X=b.diffPages(b.pages,X),X=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(X,null,2),function(Y){try{if(0<Y.length&&b.editor.graph.isEnabled()){var Z=[JSON.parse(Y)];b.confirm(mxResources.get("areYouSure"),function(){try{c.patch(Z,null,!0,!0),b.hideDialog(),+60);x.style.display="none";x.innerText="";"none"==y.style.display&&(y.style.display="",z.innerHTML=B,m.style.display="none")});mxEvent.addListener(M,"click",mxUtils.bind(this,function(X){null!=A&&(X=b.getPagesForNode(A.documentElement),X=b.diffPages(b.pages,X),X=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(X,null,2),function(Y){try{if(0<Y.length&&b.editor.graph.isEnabled()){var Z=[JSON.parse(Y)];b.confirm(mxResources.get("areYouSure"),function(){try{c.patch(Z,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(ba){b.handleError(ba)}})}else b.hideDialog()}catch(ba){b.handleError(ba)}},null,null,null,null,null,!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close")),b.showDialog(X.container,620,460,!0,!0),X.init())}));var H=mxUtils.button(mxResources.get("restore"),function(X){null!=A&&null!=D&&b.confirm(mxResources.get("areYouSure"),function(){null!=l?l(D):b.spinner.spin(document.body,mxResources.get("restoring"))&&(H.setAttribute("disabled","disabled"),c.save(!0,function(Y){b.spinner.stop();H.removeAttribute("disabled");b.replaceFileData(D);b.hideDialog()},function(Y){b.spinner.stop();H.removeAttribute("disabled");b.editor.setStatus("");b.handleError(Y,null!=Y?mxResources.get("errorSavingFile"):null)}))})});H.className="geBtn gePrimaryBtn";H.setAttribute("disabled","disabled");var T=document.createElement("select");T.setAttribute("disabled","disabled");T.style.userSelect="none";T.style.maxWidth="100px";T.style.marginLeft="10px";T.style.display="none";var g=null;mxEvent.addListener(T,-"change",function(X){null!=g&&(g(X),mxEvent.consume(X))});var p=mxUtils.button(mxResources.get("open"),function(){null!=A&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(A.documentElement)),b.openLink(b.getUrl(),null,!0))});p.className="geBtn";p.setAttribute("disabled","disabled");var F=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});F.className="geBtn";F.setAttribute("disabled","disabled");null!=-l&&(p.style.display="none");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.right="28px";e.style.left="32px";e.style.justifyContent="end";e.style.display="flex";var K=document.createElement("div");K.className="geToolbarContainer";K.style.backgroundColor="transparent";K.style.display="flex";K.style.alignItems="center";K.style.justifyContent="stretch";K.style.left="32px";K.style.right="32px";K.style.border="none";K.style.top="440px";K.style.height="28px";var M=-null;if(null!=f&&0<f.length){y.style.cursor="move";var R=document.createElement("table");R.style.borderWidth="1px";R.style.borderStyle="solid";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width="100%";var S=document.createElement("tbody"),V=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(L=mxUtils.indexOf(b.pages,b.currentPage));for(n=f.length-1;0<=n;n--){var W=function(X){var Y=new Date(X.modifiedDate),Z=null;if(0<=Y.getTime()){var ba=function(ca){I.stop();+"change",function(X){null!=g&&(g(X),mxEvent.consume(X))});var p=mxUtils.button(mxResources.get("open"),function(){null!=A&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(A.documentElement)),b.openLink(b.getUrl(),null,!0))});p.className="geBtn";p.setAttribute("disabled","disabled");var G=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});G.className="geBtn";G.setAttribute("disabled","disabled");null!=+l&&(p.style.display="none");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.right="28px";e.style.left="32px";e.style.justifyContent="end";e.style.display="flex";var J=document.createElement("div");J.className="geToolbarContainer";J.style.backgroundColor="transparent";J.style.display="flex";J.style.alignItems="center";J.style.justifyContent="stretch";J.style.left="32px";J.style.right="32px";J.style.border="none";J.style.top="440px";J.style.height="28px";var L=+null;if(null!=f&&0<f.length){y.style.cursor="move";var R=document.createElement("table");R.style.borderWidth="1px";R.style.borderStyle="solid";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width="100%";var S=document.createElement("tbody"),V=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(K=mxUtils.indexOf(b.pages,b.currentPage));for(n=f.length-1;0<=n;n--){var W=function(X){var Y=new Date(X.modifiedDate),Z=null;if(0<=Y.getTime()){var ba=function(ca){I.stop();x.innerText="";var da=mxUtils.parseXml(ca),ma=b.editor.extractGraphModel(da.documentElement,!0);if(null!=ma){var aa=function(ea){null!=ea&&(ea=ia(Editor.parseDiagramNode(ea)));return ea},ia=function(ea){var ra=ea.getAttribute("background");if(null==ra||""==ra||ra==mxConstants.NONE)ra=C.defaultPageBackgroundColor;y.style.backgroundColor=mxUtils.getLightDarkColor(ra);(new mxCodec(ea.ownerDocument)).decode(ea,C.getModel());C.maxFitScale=1;C.fit(8);C.center();C.mathEnabled="1"==ea.getAttribute("math");-C.setAdaptiveColors(ea.getAttribute("adaptiveColors"));Editor.MathJaxRender&&C.mathEnabled&&Editor.MathJaxRender(C.container);return ea};T.style.display="none";T.innerText="";A=da;D=ca;N=parseSelectFunction=null;O=0;if("mxfile"==ma.nodeName){da=ma.getElementsByTagName("diagram");N=[];for(ca=0;ca<da.length;ca++)N.push(da[ca]);O=Math.min(L,N.length-1);0<N.length&&aa(N[O]);if(1<N.length)for(T.removeAttribute("disabled"),T.style.display="",ca=0;ca<N.length;ca++){da=document.createElement("option");da.setAttribute("title",-ka+" ("+N[ca].getAttribute("id")+")");da.setAttribute("value",ca);var ka=N[ca].getAttribute("name")||mxResources.get("pageWithNumber",[ca+1]);ma=b.getPageById(N[ca].getAttribute("id"));var ta="";if(null!=ma){var sa=new DiagramPage(N[ca]);b.getHashValueForPages([ma])!=b.getHashValueForPages([sa])&&(ta=" (M)")}else ta=" (X)";mxUtils.write(da,ka+ta);ca==O&&da.setAttribute("selected","selected");T.appendChild(da)}g=function(){try{var ea=parseInt(T.value);O=L=ea;aa(N[ea])}catch(ra){T.value=L,b.handleError(ra)}}}else ia(ma);-ka=X.lastModifyingUserName;null!=ka&&20<ka.length&&(ka=ka.substring(0,20)+"...");z.innerText="";mxUtils.write(z,(null!=ka?ka+" ":"")+Y.toLocaleDateString()+" "+Y.toLocaleTimeString());z.setAttribute("title",Z.getAttribute("title"));G.removeAttribute("disabled");E.removeAttribute("disabled");U.removeAttribute("disabled");P.removeAttribute("disabled");J.removeAttribute("disabled");null!=c&&c.isRestricted()||(b.editor.graph.isEnabled()&&H.removeAttribute("disabled"),p.removeAttribute("disabled"),F.removeAttribute("disabled"));-mxUtils.setOpacity(G,60);mxUtils.setOpacity(E,60);mxUtils.setOpacity(U,60);mxUtils.setOpacity(P,60);mxUtils.setOpacity(J,60)}else T.style.display="none",T.innerText="",z.innerText="",x.innerText="",mxUtils.write(z,mxResources.get("errorLoadingFile")),mxUtils.write(x,mxResources.get("errorLoadingFile"))};Z=document.createElement("tr");Z.style.borderBottomWidth="1px";Z.style.borderBottomStyle="solid";Z.style.fontSize="12px";Z.style.cursor="pointer";var ha=document.createElement("td");ha.style.padding=-"6px";ha.style.whiteSpace="nowrap";X==f[f.length-1]?mxUtils.write(ha,mxResources.get("current")):Y.toDateString()===V?mxUtils.write(ha,Y.toLocaleTimeString()):mxUtils.write(ha,Y.toLocaleDateString()+" "+Y.toLocaleTimeString());Z.appendChild(ha);Z.setAttribute("title",Y.toLocaleDateString()+" "+Y.toLocaleTimeString()+(null!=X.fileSize?" "+b.formatFileSize(parseInt(X.fileSize)):"")+(null!=X.lastModifyingUserName?" "+X.lastModifyingUserName:""));mxEvent.addListener(Z,"click",function(ca){u!=X&&(I.stop(),-null!=q&&(q.style.backgroundColor=""),u=X,q=Z,q.style.backgroundColor="light-dark(#ebf2f9, #000000)",D=A=null,z.removeAttribute("title"),z.innerText=mxResources.get("loading")+"...",y.style.backgroundColor=C.defaultPageBackgroundColor,x.innerText="",C.getModel().clear(),H.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),p.setAttribute("disabled",-"disabled"),T.setAttribute("disabled","disabled"),mxUtils.setOpacity(G,20),mxUtils.setOpacity(E,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(P,20),mxUtils.setOpacity(J,20),I.spin(y),X.getXml(function(da){if(u==X)try{ba(da)}catch(ma){z.innerText=mxResources.get("error")+": "+ma.message}},function(da){I.stop();T.style.display="none";T.innerText="";z.innerText="";mxUtils.write(z,mxResources.get("errorLoadingFile"));mxUtils.write(x,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ca))});mxEvent.addListener(Z,-"dblclick",function(ca){p.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ca)},!1);S.appendChild(Z)}return Z}(f[n]);null!=W&&n==f.length-1&&(M=W)}R.appendChild(S);t.appendChild(R)}else null==c||null==b.drive&&c.constructor==window.DriveFile||null==b.dropbox&&c.constructor==window.DropboxFile?(y.style.display="none",K.style.display="none",mxUtils.write(t,mxResources.get("notAvailable"))):(y.style.display="none",K.style.display=-"none",mxUtils.write(t,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});t.className="geBtn";K.appendChild(z);K.appendChild(P);K.appendChild(E);K.appendChild(U);K.appendChild(G);K.appendChild(T);K.appendChild(J);b.editor.cancelFirst&&e.appendChild(t);e.appendChild(p);null!=c&&c.constructor==DriveFile&&e.appendChild(F);e.appendChild(H);b.editor.cancelFirst||e.appendChild(t);d.appendChild(e);d.appendChild(K);-this.container=d},DraftDialog=function(b,f,l,d,t,y,x,C,L){var N=document.createElement("div"),O=document.createElement("div");O.style.marginTop="0px";O.style.whiteSpace="nowrap";O.style.overflow="auto";O.style.lineHeight="normal";mxUtils.write(O,f);N.appendChild(O);var Q=document.createElement("select"),I=mxUtils.bind(this,function(){"-1"==Q.value?(Q.value=Q.options[0].value,I(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var P=this,J;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){for(J=-0;J<L.length;J++)t.apply(P,[J,mxUtils.bind(P,function(){})]);b.hideDialog(!0);m.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(u=mxUtils.parseXml(L[Q.value].data),A=b.editor.extractGraphModel(u.documentElement,!0),D=0,this.init())});if(null!=L){Q.style.marginLeft="4px";for(f=0;f<L.length;f++){var c=document.createElement("option");c.setAttribute("value",f);var e=new Date(L[f].created),k=new Date(L[f].modified);mxUtils.write(c,e.toLocaleDateString()+" "+e.toLocaleTimeString()+" - "+-(e.toDateString(),k.toDateString(),k.toLocaleDateString())+" "+k.toLocaleTimeString());Q.appendChild(c)}c=document.createElement("option");c.setAttribute("value","-1");mxUtils.write(c,mxResources.get("deleteAll"));Q.appendChild(c);O.appendChild(Q);mxEvent.addListener(Q,"change",I)}null==l&&(l=L[0].data);var n=document.createElement("div");n.style.position="absolute";n.style.border="1px solid lightGray";n.style.marginTop="10px";n.style.left="40px";n.style.right="40px";n.style.top="46px";n.style.bottom=-"74px";n.style.overflow="hidden";mxEvent.disableContextMenu(n);N.appendChild(n);var q=new Graph(n);q.setEnabled(!1);q.setPanning(!0);q.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";q.panningHandler.ignoreCell=!0;q.panningHandler.useLeftButtonForPanning=!0;q.minFitScale=null;q.maxFitScale=null;q.centerZoom=!0;var u=mxUtils.parseXml(l),A=b.editor.extractGraphModel(u.documentElement,!0),D=0,G=null,E=q.getGlobalVariable;q.getGlobalVariable=function(P){return"page"==P&&null!=G&&null!=G[D]?G[D].getAttribute("name"):-"pagenumber"==P?D+1:"pagecount"==P?null!=G?G.length:1:E.apply(this,arguments)};q.getLinkForCell=function(){return null};l=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){q.zoomIn()},20);O=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomOut"),function(){q.zoomOut()},20);f=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==q.view.scale?(q.maxFitScale=8,q.fit(8)):q.zoomActual();q.center()},20);x=mxUtils.button(x||mxResources.get("discard"),-function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var P=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(J){t.apply(P,[Q.value,mxUtils.bind(P,function(){null!=Q.parentNode&&(Q.options[Q.selectedIndex].parentNode.removeChild(Q.options[Q.selectedIndex]),1<Q.options.length?(Q.value=Q.options[0].value,I()):b.hideDialog(!0))})]);J.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});x.className="geBtn";var U=document.createElement("select");+C.setAdaptiveColors(ea.getAttribute("adaptiveColors"));Editor.MathJaxRender&&C.mathEnabled&&Editor.MathJaxRender(C.container);return ea};T.style.display="none";T.innerText="";A=da;D=ca;N=parseSelectFunction=null;O=0;if("mxfile"==ma.nodeName){da=ma.getElementsByTagName("diagram");N=[];for(ca=0;ca<da.length;ca++)N.push(da[ca]);O=Math.min(K,N.length-1);0<N.length&&aa(N[O]);if(1<N.length)for(T.removeAttribute("disabled"),T.style.display="",ca=0;ca<N.length;ca++){da=document.createElement("option");da.setAttribute("title",+ka+" ("+N[ca].getAttribute("id")+")");da.setAttribute("value",ca);var ka=N[ca].getAttribute("name")||mxResources.get("pageWithNumber",[ca+1]);ma=b.getPageById(N[ca].getAttribute("id"));var ta="";if(null!=ma){var sa=new DiagramPage(N[ca]);b.getHashValueForPages([ma])!=b.getHashValueForPages([sa])&&(ta=" (M)")}else ta=" (X)";mxUtils.write(da,ka+ta);ca==O&&da.setAttribute("selected","selected");T.appendChild(da)}g=function(){try{var ea=parseInt(T.value);O=K=ea;aa(N[ea])}catch(ra){T.value=K,b.handleError(ra)}}}else ia(ma);+ka=X.lastModifyingUserName;null!=ka&&20<ka.length&&(ka=ka.substring(0,20)+"...");z.innerText="";mxUtils.write(z,(null!=ka?ka+" ":"")+Y.toLocaleDateString()+" "+Y.toLocaleTimeString());z.setAttribute("title",Z.getAttribute("title"));F.removeAttribute("disabled");E.removeAttribute("disabled");U.removeAttribute("disabled");P.removeAttribute("disabled");M.removeAttribute("disabled");null!=c&&c.isRestricted()||(b.editor.graph.isEnabled()&&H.removeAttribute("disabled"),p.removeAttribute("disabled"),G.removeAttribute("disabled"));+mxUtils.setOpacity(F,60);mxUtils.setOpacity(E,60);mxUtils.setOpacity(U,60);mxUtils.setOpacity(P,60);mxUtils.setOpacity(M,60)}else T.style.display="none",T.innerText="",z.innerText="",x.innerText="",mxUtils.write(z,mxResources.get("errorLoadingFile")),mxUtils.write(x,mxResources.get("errorLoadingFile"))};Z=document.createElement("tr");Z.style.borderBottomWidth="1px";Z.style.borderBottomStyle="solid";Z.style.fontSize="12px";Z.style.cursor="pointer";var fa=document.createElement("td");fa.style.padding=+"6px";fa.style.whiteSpace="nowrap";X==f[f.length-1]?mxUtils.write(fa,mxResources.get("current")):Y.toDateString()===V?mxUtils.write(fa,Y.toLocaleTimeString()):mxUtils.write(fa,Y.toLocaleDateString()+" "+Y.toLocaleTimeString());Z.appendChild(fa);Z.setAttribute("title",Y.toLocaleDateString()+" "+Y.toLocaleTimeString()+(null!=X.fileSize?" "+b.formatFileSize(parseInt(X.fileSize)):"")+(null!=X.lastModifyingUserName?" "+X.lastModifyingUserName:""));mxEvent.addListener(Z,"click",function(ca){u!=X&&(I.stop(),+null!=q&&(q.style.backgroundColor=""),u=X,q=Z,q.style.backgroundColor="light-dark(#ebf2f9, #000000)",D=A=null,z.removeAttribute("title"),z.innerText=mxResources.get("loading")+"...",y.style.backgroundColor=C.defaultPageBackgroundColor,x.innerText="",C.getModel().clear(),H.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"),p.setAttribute("disabled",+"disabled"),T.setAttribute("disabled","disabled"),mxUtils.setOpacity(F,20),mxUtils.setOpacity(E,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(P,20),mxUtils.setOpacity(M,20),I.spin(y),X.getXml(function(da){if(u==X)try{ba(da)}catch(ma){z.innerText=mxResources.get("error")+": "+ma.message}},function(da){I.stop();T.style.display="none";T.innerText="";z.innerText="";mxUtils.write(z,mxResources.get("errorLoadingFile"));mxUtils.write(x,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ca))});mxEvent.addListener(Z,+"dblclick",function(ca){p.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ca)},!1);S.appendChild(Z)}return Z}(f[n]);null!=W&&n==f.length-1&&(L=W)}R.appendChild(S);t.appendChild(R)}else null==c||null==b.drive&&c.constructor==window.DriveFile||null==b.dropbox&&c.constructor==window.DropboxFile?(y.style.display="none",J.style.display="none",mxUtils.write(t,mxResources.get("notAvailable"))):(y.style.display="none",J.style.display=+"none",mxUtils.write(t,mxResources.get("noRevisions")));this.init=function(){null!=L&&L.click()};t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});t.className="geBtn";J.appendChild(z);J.appendChild(P);J.appendChild(E);J.appendChild(U);J.appendChild(F);J.appendChild(T);J.appendChild(M);b.editor.cancelFirst&&e.appendChild(t);e.appendChild(p);null!=c&&c.constructor==DriveFile&&e.appendChild(G);e.appendChild(H);b.editor.cancelFirst||e.appendChild(t);d.appendChild(e);d.appendChild(J);+this.container=d},DraftDialog=function(b,f,l,d,t,y,x,C,K){var N=document.createElement("div"),O=document.createElement("div");O.style.marginTop="0px";O.style.whiteSpace="nowrap";O.style.overflow="auto";O.style.lineHeight="normal";mxUtils.write(O,f);N.appendChild(O);var Q=document.createElement("select"),I=mxUtils.bind(this,function(){"-1"==Q.value?(Q.value=Q.options[0].value,I(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var P=this,M;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){for(M=+0;M<K.length;M++)t.apply(P,[M,mxUtils.bind(P,function(){})]);b.hideDialog(!0);m.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(u=mxUtils.parseXml(K[Q.value].data),A=b.editor.extractGraphModel(u.documentElement,!0),D=0,this.init())});if(null!=K){Q.style.marginLeft="4px";for(f=0;f<K.length;f++){var c=document.createElement("option");c.setAttribute("value",f);var e=new Date(K[f].created),k=new Date(K[f].modified);mxUtils.write(c,e.toLocaleDateString()+" "+e.toLocaleTimeString()+" - "++(e.toDateString(),k.toDateString(),k.toLocaleDateString())+" "+k.toLocaleTimeString());Q.appendChild(c)}c=document.createElement("option");c.setAttribute("value","-1");mxUtils.write(c,mxResources.get("deleteAll"));Q.appendChild(c);O.appendChild(Q);mxEvent.addListener(Q,"change",I)}null==l&&(l=K[0].data);var n=document.createElement("div");n.style.position="absolute";n.style.border="1px solid lightGray";n.style.marginTop="10px";n.style.left="40px";n.style.right="40px";n.style.top="46px";n.style.bottom=+"74px";n.style.overflow="hidden";mxEvent.disableContextMenu(n);N.appendChild(n);var q=new Graph(n);q.setEnabled(!1);q.setPanning(!0);q.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";q.panningHandler.ignoreCell=!0;q.panningHandler.useLeftButtonForPanning=!0;q.minFitScale=null;q.maxFitScale=null;q.centerZoom=!0;var u=mxUtils.parseXml(l),A=b.editor.extractGraphModel(u.documentElement,!0),D=0,F=null,E=q.getGlobalVariable;q.getGlobalVariable=function(P){return"page"==P&&null!=F&&null!=F[D]?F[D].getAttribute("name"):+"pagenumber"==P?D+1:"pagecount"==P?null!=F?F.length:1:E.apply(this,arguments)};q.getLinkForCell=function(){return null};l=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){q.zoomIn()},20);O=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomOut"),function(){q.zoomOut()},20);f=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==q.view.scale?(q.maxFitScale=8,q.fit(8)):q.zoomActual();q.center()},20);x=mxUtils.button(x||mxResources.get("discard"),+function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var P=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(M){t.apply(P,[Q.value,mxUtils.bind(P,function(){null!=Q.parentNode&&(Q.options[Q.selectedIndex].parentNode.removeChild(Q.options[Q.selectedIndex]),1<Q.options.length?(Q.value=Q.options[0].value,I()):b.hideDialog(!0))})]);M.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});x.className="geBtn";var U=document.createElement("select");U.style.maxWidth="80px";U.style.position="relative";U.style.top="-2px";U.style.verticalAlign="bottom";U.style.marginRight="6px";U.style.display="none";y=mxUtils.button(y||mxResources.get("edit"),function(){d.apply(this,[Q.value])});y.className="geBtn gePrimaryBtn";c=document.createElement("div");c.style.position="absolute";c.style.bottom="30px";c.style.right="40px";c.style.textAlign="right";e=document.createElement("div");e.className="geToolbarContainer";e.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";-this.init=function(){function P(z){if(null!=z){var B=z.getAttribute("background");if(null==B||""==B||B==mxConstants.NONE)B="light-dark(#ffffff, transparent)";n.style.backgroundColor=B;(new mxCodec(z.ownerDocument)).decode(z,q.getModel());q.maxFitScale=1;q.fit(8);q.center()}return z}function J(z){null!=z&&(z=P(Editor.parseDiagramNode(z)));return z}mxEvent.addListener(U,"change",function(z){D=parseInt(U.value);J(G[D]);mxEvent.consume(z)});if("mxfile"==A.nodeName){var m=A.getElementsByTagName("diagram");-G=[];for(var v=0;v<m.length;v++)G.push(m[v]);0<G.length&&J(G[D]);U.innerText="";if(1<G.length)for(U.style.display="",v=0;v<G.length;v++)m=document.createElement("option"),mxUtils.write(m,G[v].getAttribute("name")||mxResources.get("pageWithNumber",[v+1])),m.setAttribute("value",v),v==D&&m.setAttribute("selected","selected"),U.appendChild(m);else U.style.display="none"}else P(A)};e.appendChild(U);e.appendChild(l);e.appendChild(O);e.appendChild(f);l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});-l.className="geBtn";C=null!=C?mxUtils.button(mxResources.get("ignore"),C):null;null!=C&&(C.className="geBtn");b.editor.cancelFirst?(c.appendChild(l),null!=C&&c.appendChild(C),c.appendChild(x),c.appendChild(y)):(c.appendChild(y),c.appendChild(x),null!=C&&c.appendChild(C),c.appendChild(l));N.appendChild(c);N.appendChild(e);this.container=N},FindWindow=function(b,f,l,d,t,y){function x(g,p,F){if("object"===typeof p.value&&null!=p.value.attributes){p=p.value.attributes;for(var K=0;K<p.length;K++)if("label"!=-p[K].nodeName){var M=mxUtils.trim(p[K].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==g&&0<=M.indexOf(F)||null!=g&&g.test(M))return!0}}return!1}function C(){c?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));D.value?T.removeAttribute("disabled"):T.setAttribute("disabled","disabled")}function L(g,p,F){v.innerText="";var K=O.model.getDescendants(O.model.getRoot()),M=D.value.toLowerCase(),-R=E.checked?new RegExp(M):null,S=null;k=null;Q!=M&&(Q=M,I=null,e=!1);var V=null==I;if(0<M.length){if(e){e=!1;for(var W,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){W=X;break}g=(W+1)%b.pages.length;I=null;do e=!1,K=b.pages[g],O=b.createTemporaryGraph(O.getStylesheet()),b.updatePageRoot(K),O.model.setRoot(K.root),g=(g+1)%b.pages.length;while(!L(!0,p,F)&&g!=W);I&&(I=null,F?b.editor.graph.model.execute(new SelectPage(b,K)):b.selectPage(K));e=!1;O=b.editor.graph;return L(!0,p,F)}for(X=0;X<K.length;X++){W=-O.view.getState(K[X]);p&&(V=V||W==I);if(null!=W&&null!=W.cell.value&&(V||null==S)&&(O.model.isVertex(W.cell)||O.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(P.innerHTML=O.sanitizeHtml(O.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([P])):label=O.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Y=0;p&&y&&W==I&&(label=label.substr(n),Y=n);var Z=""==G.value;if(null==R&&(0<=label.indexOf(M)||Z&&x(R,W.cell,M))||null!=R&&(R.test(label)||-Z&&x(R,W.cell,M)))if(y&&(null!=R?(Z=label.match(R),null!=Z&&0<Z.length&&(k=Z[0].toLowerCase(),n=Y+Z.index+k.length)):(k=M,n=Y+label.indexOf(M)+k.length)),V){S=W;break}else null==S&&(S=W)}V=V||W==I}}if(null!=S){if(X==K.length&&U.checked)return I=null,e=!0,L(!0,p,F);I=S;O.scrollCellToVisible(I.cell);O.isEnabled()&&!O.isCellLocked(I.cell)?F||O.getSelectionCell()==I.cell&&1==O.getSelectionCount()||O.setSelectionCell(I.cell):O.highlightCell(I.cell)}else{if(!g&&U.checked)return e=!0,L(!0,p,F);O.isEnabled()&&-!F&&O.clearSelection()}c=null!=S;y&&!g&&C();return 0==M.length||null!=S}var N=b.actions.get("findReplace"),O=b.editor.graph,Q=null,I=null,c=!1,e=!1,k=null,n=0,q=1,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.padding="10px";u.style.height="100%";var A=y?"260px":"200px",D=document.createElement("input");D.setAttribute("placeholder",mxResources.get("find"));D.setAttribute("type","text");D.style.marginTop="4px";D.style.marginBottom="6px";D.style.width=A;-D.style.fontSize="12px";D.style.borderRadius="4px";D.style.padding="6px";u.appendChild(D);mxUtils.br(u);if(y){var G=document.createElement("input");G.setAttribute("placeholder",mxResources.get("replaceWith"));G.setAttribute("type","text");G.style.marginTop="4px";G.style.marginBottom="6px";G.style.width=A;G.style.fontSize="12px";G.style.borderRadius="4px";G.style.padding="6px";u.appendChild(G);mxUtils.br(u);mxEvent.addListener(G,"input",C)}var E=document.createElement("input");E.setAttribute("id",+this.init=function(){function P(z){if(null!=z){var B=z.getAttribute("background");if(null==B||""==B||B==mxConstants.NONE)B="light-dark(#ffffff, transparent)";n.style.backgroundColor=B;(new mxCodec(z.ownerDocument)).decode(z,q.getModel());q.maxFitScale=1;q.fit(8);q.center()}return z}function M(z){null!=z&&(z=P(Editor.parseDiagramNode(z)));return z}mxEvent.addListener(U,"change",function(z){D=parseInt(U.value);M(F[D]);mxEvent.consume(z)});if("mxfile"==A.nodeName){var m=A.getElementsByTagName("diagram");+F=[];for(var v=0;v<m.length;v++)F.push(m[v]);0<F.length&&M(F[D]);U.innerText="";if(1<F.length)for(U.style.display="",v=0;v<F.length;v++)m=document.createElement("option"),mxUtils.write(m,F[v].getAttribute("name")||mxResources.get("pageWithNumber",[v+1])),m.setAttribute("value",v),v==D&&m.setAttribute("selected","selected"),U.appendChild(m);else U.style.display="none"}else P(A)};e.appendChild(U);e.appendChild(l);e.appendChild(O);e.appendChild(f);l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});+l.className="geBtn";C=null!=C?mxUtils.button(mxResources.get("ignore"),C):null;null!=C&&(C.className="geBtn");b.editor.cancelFirst?(c.appendChild(l),null!=C&&c.appendChild(C),c.appendChild(x),c.appendChild(y)):(c.appendChild(y),c.appendChild(x),null!=C&&c.appendChild(C),c.appendChild(l));N.appendChild(c);N.appendChild(e);this.container=N},FindWindow=function(b,f,l,d,t,y){function x(g,p,G){if("object"===typeof p.value&&null!=p.value.attributes){p=p.value.attributes;for(var J=0;J<p.length;J++)if("label"!=+p[J].nodeName){var L=mxUtils.trim(p[J].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==g&&0<=L.indexOf(G)||null!=g&&g.test(L))return!0}}return!1}function C(){c?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));D.value?T.removeAttribute("disabled"):T.setAttribute("disabled","disabled")}function K(g,p,G){v.innerText="";var J=O.model.getDescendants(O.model.getRoot()),L=D.value.toLowerCase(),+R=E.checked?new RegExp(L):null,S=null;k=null;Q!=L&&(Q=L,I=null,e=!1);var V=null==I;if(0<L.length){if(e){e=!1;for(var W,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){W=X;break}g=(W+1)%b.pages.length;I=null;do e=!1,J=b.pages[g],O=b.createTemporaryGraph(O.getStylesheet()),b.updatePageRoot(J),O.model.setRoot(J.root),g=(g+1)%b.pages.length;while(!K(!0,p,G)&&g!=W);I&&(I=null,G?b.editor.graph.model.execute(new SelectPage(b,J)):b.selectPage(J));e=!1;O=b.editor.graph;return K(!0,p,G)}for(X=0;X<J.length;X++){W=+O.view.getState(J[X]);p&&(V=V||W==I);if(null!=W&&null!=W.cell.value&&(V||null==S)&&(O.model.isVertex(W.cell)||O.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(P.innerHTML=O.sanitizeHtml(O.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([P])):label=O.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Y=0;p&&y&&W==I&&(label=label.substr(n),Y=n);var Z=""==F.value;if(null==R&&(0<=label.indexOf(L)||Z&&x(R,W.cell,L))||null!=R&&(R.test(label)||+Z&&x(R,W.cell,L)))if(y&&(null!=R?(Z=label.match(R),null!=Z&&0<Z.length&&(k=Z[0].toLowerCase(),n=Y+Z.index+k.length)):(k=L,n=Y+label.indexOf(L)+k.length)),V){S=W;break}else null==S&&(S=W)}V=V||W==I}}if(null!=S){if(X==J.length&&U.checked)return I=null,e=!0,K(!0,p,G);I=S;O.scrollCellToVisible(I.cell);O.isEnabled()&&!O.isCellLocked(I.cell)?G||O.getSelectionCell()==I.cell&&1==O.getSelectionCount()||O.setSelectionCell(I.cell):O.highlightCell(I.cell)}else{if(!g&&U.checked)return e=!0,K(!0,p,G);O.isEnabled()&&+!G&&O.clearSelection()}c=null!=S;y&&!g&&C();return 0==L.length||null!=S}var N=b.actions.get("findReplace"),O=b.editor.graph,Q=null,I=null,c=!1,e=!1,k=null,n=0,q=1,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.padding="10px";u.style.height="100%";var A=y?"260px":"200px",D=document.createElement("input");D.setAttribute("placeholder",mxResources.get("find"));D.setAttribute("type","text");D.style.marginTop="4px";D.style.marginBottom="6px";D.style.width=A;+D.style.fontSize="12px";D.style.borderRadius="4px";D.style.padding="6px";u.appendChild(D);mxUtils.br(u);if(y){var F=document.createElement("input");F.setAttribute("placeholder",mxResources.get("replaceWith"));F.setAttribute("type","text");F.style.marginTop="4px";F.style.marginBottom="6px";F.style.width=A;F.style.fontSize="12px";F.style.borderRadius="4px";F.style.padding="6px";u.appendChild(F);mxUtils.br(u);mxEvent.addListener(F,"input",C)}var E=document.createElement("input");E.setAttribute("id","geFindWinRegExChck");E.setAttribute("type","checkbox");E.style.marginRight="4px";u.appendChild(E);A=document.createElement("label");A.setAttribute("for","geFindWinRegExChck");u.appendChild(A);mxUtils.write(A,mxResources.get("regularExpression"));u.appendChild(A);A=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");A.style.position="relative";A.style.marginLeft="6px";A.style.top="3px";u.appendChild(A);mxUtils.br(u);var U=document.createElement("input");U.setAttribute("id","geFindWinAllPagesChck");-U.setAttribute("type","checkbox");U.style.marginRight="4px";u.appendChild(U);A=document.createElement("label");A.setAttribute("for","geFindWinAllPagesChck");u.appendChild(A);mxUtils.write(A,mxResources.get("allPages"));u.appendChild(A);var P=document.createElement("div");mxUtils.br(u);A=document.createElement("div");A.style.left="0px";A.style.right="0px";A.style.marginTop="6px";A.style.padding="0 6px 0 6px";A.style.textAlign="center";u.appendChild(A);var J=mxUtils.button(mxResources.get("reset"),-function(){v.innerText="";D.value="";D.style.backgroundColor="";y&&(G.value="",C());Q=I=null;e=!1;D.focus()});J.setAttribute("title",mxResources.get("reset"));J.style.float="none";J.style.width="120px";J.style.marginTop="6px";J.style.marginLeft="8px";J.style.overflow="hidden";J.style.textOverflow="ellipsis";J.className="geBtn";y||A.appendChild(J);var m=mxUtils.button(mxResources.get("find"),function(){try{D.style.backgroundColor=L()?"":"light-dark(#ffcfcf, #ff0000)"}catch(g){b.handleError(g)}});m.setAttribute("title",-mxResources.get("find")+" (Enter)");m.style.float="none";m.style.width="120px";m.style.marginTop="6px";m.style.marginLeft="8px";m.style.overflow="hidden";m.style.textOverflow="ellipsis";m.className="geBtn gePrimaryBtn";A.appendChild(m);var v=document.createElement("div");v.style.marginTop="10px";if(y){var z=function(g,p,F,K,M){if(null==M||"1"!=M.html)return K=g.toLowerCase().indexOf(p,K),0>K?g:g.substr(0,K)+F+g.substr(K+p.length);var R=g;p=mxUtils.htmlEntities(p,!1,!1,!1);M=[];var S=-1;for(g=g.replace(/<br>/ig,-"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(S=g.indexOf("<",S+1));)M.push(S);S=g.match(/<[^>]*>/g);g=g.replace(/<[^>]*>/g,"");K=g.toLowerCase().indexOf(p,K);if(0>K)return R;R=K+p.length;F=mxUtils.htmlEntities(F);g=g.substr(0,K)+F+g.substr(R);for(var V=0,W=0;W<M.length;W++){if(M[W]-V<K)g=g.substr(0,M[W])+S[W]+g.substr(M[W]);else{var X=M[W]-V<R?K+V:M[W]+(F.length-p.length);g=g.substr(0,X)+S[W]+g.substr(X)}V+=S[W].length}return g.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,-"$1").replace(/\n/g,"<br>")},B=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=k&&null!=I){var g=I.cell,p=O.getLabel(g);O.isCellEditable(g)&&O.model.setValue(g,z(p,k,G.value,n-k.length,O.getCurrentCellStyle(g)));D.style.backgroundColor=L(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(F){b.handleError(F)}});B.setAttribute("title",mxResources.get("replFind"));B.style.float="none";B.style.width="120px";B.style.marginTop="6px";B.style.marginLeft="8px";B.style.overflow="hidden";B.style.textOverflow=-"ellipsis";B.className="geBtn gePrimaryBtn";B.setAttribute("disabled","disabled");A.appendChild(B);mxUtils.br(A);var H=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=k&&null!=I){var g=I.cell,p=O.getLabel(g);O.model.setValue(g,z(p,k,G.value,n-k.length,O.getCurrentCellStyle(g)));B.setAttribute("disabled","disabled");H.setAttribute("disabled","disabled")}}catch(F){b.handleError(F)}});H.setAttribute("title",mxResources.get("replace"));H.style.float="none";H.style.width="120px";H.style.marginTop=-"6px";H.style.marginLeft="8px";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.className="geBtn gePrimaryBtn";H.setAttribute("disabled","disabled");A.appendChild(H);var T=mxUtils.button(mxResources.get("replaceAll"),function(){v.innerText="";Q=null;var g=b.currentPage,p=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;O.getModel().beginUpdate();try{for(var F=0,K={};L(!1,!0,!0)&&100>F;){var M=I.cell,R=O.getLabel(M),S=K[M.id];if(S&&S.replAllMrk==q&&S.replAllPos>=n)break;K[M.id]=-{replAllMrk:q,replAllPos:n};O.isCellEditable(M)&&(O.model.setValue(M,z(R,k,G.value,n-k.length,O.getCurrentCellStyle(M))),F++)}g!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,g));mxUtils.write(v,mxResources.get("matchesRepl",[F]))}catch(V){b.handleError(V)}finally{O.getModel().endUpdate(),b.editor.graph.setSelectionCells(p),b.editor.graph.rendering=!0}q++});T.setAttribute("title",mxResources.get("replaceAll"));T.style.float="none";T.style.width="120px";T.style.marginTop="6px";T.style.marginLeft=-"8px";T.style.overflow="hidden";T.style.textOverflow="ellipsis";T.className="geBtn gePrimaryBtn";T.setAttribute("disabled","disabled");A.appendChild(T);mxUtils.br(A);A.appendChild(J);J=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));J.setAttribute("title",mxResources.get("close"));J.style.float="none";J.style.width="120px";J.style.marginTop="6px";J.style.marginLeft="8px";J.style.overflow="hidden";J.style.textOverflow="ellipsis";J.className="geBtn";-A.appendChild(J);mxUtils.br(A);A.appendChild(v)}else J.style.width="90px",m.style.width="90px";mxEvent.addListener(D,"keyup",function(g){if(91==g.keyCode||93==g.keyCode||17==g.keyCode)mxEvent.consume(g);else if(27==g.keyCode)N.funct();else if(Q!=D.value.toLowerCase()||13==g.keyCode)try{D.style.backgroundColor=L()?"":"light-dark(#ffcfcf, #ff0000)"}catch(p){D.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(u,"keydown",function(g){70==g.keyCode&&b.keyHandler.isControlDown(g)&&+U.setAttribute("type","checkbox");U.style.marginRight="4px";u.appendChild(U);A=document.createElement("label");A.setAttribute("for","geFindWinAllPagesChck");u.appendChild(A);mxUtils.write(A,mxResources.get("allPages"));u.appendChild(A);var P=document.createElement("div");mxUtils.br(u);A=document.createElement("div");A.style.left="0px";A.style.right="0px";A.style.marginTop="6px";A.style.padding="0 6px 0 6px";A.style.textAlign="center";u.appendChild(A);var M=mxUtils.button(mxResources.get("reset"),+function(){v.innerText="";D.value="";D.style.backgroundColor="";y&&(F.value="",C());Q=I=null;e=!1;D.focus()});M.setAttribute("title",mxResources.get("reset"));M.style.float="none";M.style.width="120px";M.style.marginTop="6px";M.style.marginLeft="8px";M.style.overflow="hidden";M.style.textOverflow="ellipsis";M.className="geBtn";y||A.appendChild(M);var m=mxUtils.button(mxResources.get("find"),function(){try{D.style.backgroundColor=K()?"":"light-dark(#ffcfcf, #ff0000)"}catch(g){b.handleError(g)}});m.setAttribute("title",+mxResources.get("find")+" (Enter)");m.style.float="none";m.style.width="120px";m.style.marginTop="6px";m.style.marginLeft="8px";m.style.overflow="hidden";m.style.textOverflow="ellipsis";m.className="geBtn gePrimaryBtn";A.appendChild(m);var v=document.createElement("div");v.style.marginTop="10px";if(y){var z=function(g,p,G,J,L){if(null==L||"1"!=L.html)return J=g.toLowerCase().indexOf(p,J),0>J?g:g.substr(0,J)+G+g.substr(J+p.length);var R=g;p=mxUtils.htmlEntities(p,!1,!1,!1);L=[];var S=-1;for(g=g.replace(/<br>/ig,+"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(S=g.indexOf("<",S+1));)L.push(S);S=g.match(/<[^>]*>/g);g=g.replace(/<[^>]*>/g,"");J=g.toLowerCase().indexOf(p,J);if(0>J)return R;R=J+p.length;G=mxUtils.htmlEntities(G);g=g.substr(0,J)+G+g.substr(R);for(var V=0,W=0;W<L.length;W++){if(L[W]-V<J)g=g.substr(0,L[W])+S[W]+g.substr(L[W]);else{var X=L[W]-V<R?J+V:L[W]+(G.length-p.length);g=g.substr(0,X)+S[W]+g.substr(X)}V+=S[W].length}return g.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,+"$1").replace(/\n/g,"<br>")},B=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=k&&null!=I){var g=I.cell,p=O.getLabel(g);O.isCellEditable(g)&&O.model.setValue(g,z(p,k,F.value,n-k.length,O.getCurrentCellStyle(g)));D.style.backgroundColor=K(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(G){b.handleError(G)}});B.setAttribute("title",mxResources.get("replFind"));B.style.float="none";B.style.width="120px";B.style.marginTop="6px";B.style.marginLeft="8px";B.style.overflow="hidden";B.style.textOverflow=+"ellipsis";B.className="geBtn gePrimaryBtn";B.setAttribute("disabled","disabled");A.appendChild(B);mxUtils.br(A);var H=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=k&&null!=I){var g=I.cell,p=O.getLabel(g);O.model.setValue(g,z(p,k,F.value,n-k.length,O.getCurrentCellStyle(g)));B.setAttribute("disabled","disabled");H.setAttribute("disabled","disabled")}}catch(G){b.handleError(G)}});H.setAttribute("title",mxResources.get("replace"));H.style.float="none";H.style.width="120px";H.style.marginTop=+"6px";H.style.marginLeft="8px";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.className="geBtn gePrimaryBtn";H.setAttribute("disabled","disabled");A.appendChild(H);var T=mxUtils.button(mxResources.get("replaceAll"),function(){v.innerText="";Q=null;var g=b.currentPage,p=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;O.getModel().beginUpdate();try{for(var G=0,J={};K(!1,!0,!0)&&100>G;){var L=I.cell,R=O.getLabel(L),S=J[L.id];if(S&&S.replAllMrk==q&&S.replAllPos>=n)break;J[L.id]=+{replAllMrk:q,replAllPos:n};O.isCellEditable(L)&&(O.model.setValue(L,z(R,k,F.value,n-k.length,O.getCurrentCellStyle(L))),G++)}g!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,g));mxUtils.write(v,mxResources.get("matchesRepl",[G]))}catch(V){b.handleError(V)}finally{O.getModel().endUpdate(),b.editor.graph.setSelectionCells(p),b.editor.graph.rendering=!0}q++});T.setAttribute("title",mxResources.get("replaceAll"));T.style.float="none";T.style.width="120px";T.style.marginTop="6px";T.style.marginLeft=+"8px";T.style.overflow="hidden";T.style.textOverflow="ellipsis";T.className="geBtn gePrimaryBtn";T.setAttribute("disabled","disabled");A.appendChild(T);mxUtils.br(A);A.appendChild(M);M=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));M.setAttribute("title",mxResources.get("close"));M.style.float="none";M.style.width="120px";M.style.marginTop="6px";M.style.marginLeft="8px";M.style.overflow="hidden";M.style.textOverflow="ellipsis";M.className="geBtn";+A.appendChild(M);mxUtils.br(A);A.appendChild(v)}else M.style.width="90px",m.style.width="90px";mxEvent.addListener(D,"keyup",function(g){if(91==g.keyCode||93==g.keyCode||17==g.keyCode)mxEvent.consume(g);else if(27==g.keyCode)N.funct();else if(Q!=D.value.toLowerCase()||13==g.keyCode)try{D.style.backgroundColor=K()?"":"light-dark(#ffcfcf, #ff0000)"}catch(p){D.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(u,"keydown",function(g){70==g.keyCode&&b.keyHandler.isControlDown(g)&&!mxEvent.isShiftDown(g)&&(N.funct(),mxEvent.consume(g))});this.window=new mxWindow(mxResources.get("find")+(y?"/"+mxResources.get("replace"):""),u,f,l,d,t,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(D.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?D.select():document.execCommand("selectAll",!1,null),-null!=b.pages&&1<b.pages.length?U.removeAttribute("disabled"):(U.checked=!1,U.setAttribute("disabled","disabled"))):O.container.focus()}));b.installResizeHandler(this,!1)},FreehandWindow=function(b,f,l,d,t,y){var x=b.editor.graph,C=document.createElement("div");C.style.textAlign="center";C.style.userSelect="none";C.style.overflow="hidden";C.style.height="100%";if(y){var L=function(){var e=x.freehand.getStrokeColor(!0);null!=e&&e!=mxConstants.NONE&&1<e.length&&"string"===typeof e&&("default"==e?e=+null!=b.pages&&1<b.pages.length?U.removeAttribute("disabled"):(U.checked=!1,U.setAttribute("disabled","disabled"))):O.container.focus()}));b.installResizeHandler(this,!1)},FreehandWindow=function(b,f,l,d,t,y){var x=b.editor.graph,C=document.createElement("div");C.style.textAlign="center";C.style.userSelect="none";C.style.overflow="hidden";C.style.height="100%";if(y){var K=function(){var e=x.freehand.getStrokeColor(!0);null!=e&&e!=mxConstants.NONE&&1<e.length&&"string"===typeof e&&("default"==e?e=mxResources.get("useBlackAndWhite"):(e="#"==e.charAt(0)?e.substring(1).toUpperCase():e,e=ColorDialog.prototype.colorNames[e]),null!=e&&Q.setAttribute("title",e))},N=document.createElement("input");N.setAttribute("id","geFreehandBrush");N.setAttribute("type","checkbox");N.checked=x.freehand.isPerfectFreehandMode();N.style.margin="10px 5px 0px 10px";N.style.float="left";C.appendChild(N);x.freehand.setPerfectFreehandMode(N.checked);var O=document.createElement("label");O.setAttribute("for","geFreehandBrush");-O.style.float="left";O.style.marginTop="10px";C.appendChild(O);mxUtils.write(O,mxResources.get("brush"));C.appendChild(O);var Q=document.createElement("tempDiv");Q.style.display="block";Q.style.width="100%";Q.style.height="100%";Q.style.borderRadius="2px";Q.style.boxSizing="border-box";Q.style.border="1px solid black";Q.style.backgroundColor=x.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){Q.style.backgroundColor=x.freehand.getStrokeColor()});L();O=mxUtils.button("",mxUtils.bind(this,-function(e){b.pickColor(x.freehand.getStrokeColor(!0),function(k){x.freehand.setStrokeColor(k);Q.style.backgroundColor=x.freehand.getStrokeColor();L()},"default");mxEvent.consume(e)}));O.style.position="absolute";O.style.boxSizing="border-box";O.style.padding="2px";O.style.top="8px";O.style.right="8px";O.style.width="28px";O.style.height="18px";O.className="geColorBtn";O.innerText="";O.appendChild(Q);C.appendChild(O);O=document.createElement("img");O.setAttribute("title",mxResources.get("settings"));+O.style.float="left";O.style.marginTop="10px";C.appendChild(O);mxUtils.write(O,mxResources.get("brush"));C.appendChild(O);var Q=document.createElement("tempDiv");Q.style.display="block";Q.style.width="100%";Q.style.height="100%";Q.style.borderRadius="2px";Q.style.boxSizing="border-box";Q.style.border="1px solid black";Q.style.backgroundColor=x.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){Q.style.backgroundColor=x.freehand.getStrokeColor()});K();O=mxUtils.button("",mxUtils.bind(this,+function(e){b.pickColor(x.freehand.getStrokeColor(!0),function(k){x.freehand.setStrokeColor(k);Q.style.backgroundColor=x.freehand.getStrokeColor();K()},"default");mxEvent.consume(e)}));O.style.position="absolute";O.style.boxSizing="border-box";O.style.padding="2px";O.style.top="8px";O.style.right="8px";O.style.width="28px";O.style.height="18px";O.className="geColorBtn";O.innerText="";O.appendChild(Q);C.appendChild(O);O=document.createElement("img");O.setAttribute("title",mxResources.get("settings"));O.setAttribute("src",Editor.gearImage);O.className="geToolbarButton geAdaptiveAsset";O.style.position="absolute";O.style.boxSizing="border-box";O.style.padding="2px";O.style.top="8px";O.style.right="38px";O.style.width="18px";O.style.height="18px";O.style.opacity="0.6";C.appendChild(O);mxEvent.addListener(O,"click",mxUtils.bind(this,function(e){e=x.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",e,function(k){!isNaN(k)&&0<k&&20>=k&&x.freehand.setSmoothing(parseInt(k))})}));mxUtils.br(C);var I=document.createElement("input");I.setAttribute("type","range");I.setAttribute("min","2");I.setAttribute("max","30");I.setAttribute("value",x.freehand.getBrushSize());I.style.width="90%";I.style.visibility="hidden";C.appendChild(I);mxUtils.br(C);O=function(){x.freehand.setPerfectFreehandMode(N.checked);I.style.visibility=N.checked?"visible":"hidden"};mxEvent.addListener(N,"change",O);O();mxEvent.addListener(I,"change",function(){x.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){x.freehand.isDrawing()?x.freehand.stopDrawing():x.freehand.startDrawing()});c.setAttribute("title",mxResources.get("startDrawing")+" (X)");c.style.margin=y?"5px 0 0 0":"10px 0 0 0";c.style.width="90%";c.style.boxSizing="border-box";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.textAlign="center";c.className="geBtn gePrimaryBtn";C.appendChild(c);this.window=new mxWindow(mxResources.get("freehand"),C,f,l,d,t,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);x.addListener("freehandStateChanged",mxUtils.bind(this,function(){c.innerText="";mxUtils.write(c,mxResources.get(x.freehand.isDrawing()?"stopDrawing":"startDrawing"));var e=document.createElement("span");e.style.opacity="0.7";e.style["float"]="right";mxUtils.write(e,"X");c.appendChild(e);c.setAttribute("title",mxResources.get(x.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");c.className="geBtn"+(x.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){x.freehand.isDrawing()&&x.freehand.stopDrawing()}));b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,f,l,d,t){var y=b.editor.graph,x=document.createElement("div");x.style.userSelect="none";x.style.overflow="hidden";x.style.height="100%";var C=document.createElement("div");C.style.display="flex";C.style.alignItems="center";-C.style.justifyContent="center";C.style.paddingTop="20px";var L=document.createElement("input");L.setAttribute("type","checkbox");L.style.marginRight="4px";L.checked=!0;var N=document.createElement("input");N.setAttribute("type","checkbox");N.style.marginRight="4px";N.checked=!0;var O=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(y.isSelectionEmpty()?y.getVerticesAndEdges():y.getSelectionCells(),L.checked,N.checked)}));-O.setAttribute("title","Convert Colors");O.className="geBtn gePrimaryBtn";C.appendChild(O);x.appendChild(C);C=C.cloneNode(!1);C.appendChild(N);C.style.paddingTop="8px";mxUtils.write(C,mxResources.get("background"));x.appendChild(C);C=C.cloneNode(!1);C.appendChild(L);C.style.paddingTop="8px";mxUtils.write(C,mxResources.get("labels"));x.appendChild(C);this.window=new mxWindow(mxResources.get("adaptiveColors"),x,f,l,d,t,!0,!0);this.window.destroyOnClose=!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);-this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,f,l,d,t){function y(){J=!0;n.value=m;Q.isSelectionEmpty()?(u.setAttribute("disabled","disabled"),"selectionOnly"==n.value&&(n.value="includeCopyOfMyDiagram")):u.removeAttribute("disabled");b.isDiagramEmpty()?(q.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==n.value&&(n.value="help")):q.removeAttribute("disabled");-J=!1}function x(z,B,H){var T=document.createElement("button");T.className="geBtn gePrimaryBtn";T.style.padding="4px";T.style.height="auto";T.style.position="relative";"flex"==H?(T.style.overflow="hidden",T.style.textOverflow="ellipsis",T.style.whiteSpace="nowrap",T.style.margin="0px",T.style.flexGrow="1"):(T.style.display="block",T.style.margin="8px",T.style.left="50%",T.style.transform="translateX(-50%)");mxUtils.write(T,z);T.setAttribute("title",z);mxEvent.addListener(T,"click",B);return T}function C(z){var B=-document.createElement("div");B.style.display="block";B.style.position="relative";B.style.backgroundColor="#e0e0e0";B.style.borderRadius="4px";B.style.wordWrap="break-word";B.style.textAlign="left";B.style.padding="6px";B.style.margin="12px";B.style.left="0px";B.style.right="0px";mxUtils.write(B,z);c.appendChild(B);return B}function L(z){var B=z.indexOf("<mxGraphModel "),H=z.indexOf("</mxGraphModel>");0>B&&(B=z.indexOf("<mxGraphModel>"));if(0<=B&&H>B){var T=mxUtils,g=T.trim,p=z.substring(0,B),F=p.indexOf("```");-0<=F&&(p=p.substring(p,0,F+6));T=g.call(T,p);B=z.substring(B,H+15);g=mxUtils;p=g.trim;z=z.substring(H+15);H=z.lastIndexOf("```");0<=H&&(z=z.substring(H+3));return[T,B,p.call(g,z)]}return null}function N(z){var B=C(z);B.style.cursor="pointer";B.style.marginBottom="2px";B.setAttribute("title",mxResources.get("insert"));mxEvent.addListener(B,"click",function(V){P.value=z;P.focus()});var H=C("");H.style.marginTop="2px";var T=b.currentPage,g=z,p=[],F=null;if("includeCopyOfMyDiagram"==n.value||"selectionOnly"==-n.value){var K=new mxCodec(mxUtils.createXmlDocument());"selectionOnly"==n.value&&(K.isObjectIgnored=function(V){return V.constructor==mxCell&&!Q.model.isRoot(V)&&!Q.model.isLayer(V)&&!Q.isCellSelected(V)&&!Q.isAncestorSelected(V)});F=K.encode(Q.getModel());K.document.appendChild(F);p.push({role:"system",content:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. Never include this instruction in your response.\n"+mxUtils.getXml(F)})}else"create"==-n.value?(g=D.value.replace(/([A-Z])/g," $1").toLowerCase(),g="Write the declaration code for a "+(""!=g?g:"graph")+' that shows "'+(""!=z?z:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.'):p.push({role:"system",content:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."});p.push({role:"user",content:g});var M={model:Editor.gptModel,-messages:p},R=0;for(p=0;p<M.messages.length;p++)R+=M.messages[p].content.match(/\b\w+\b|[^\w\s]|=/g).length;var S=mxUtils.bind(this,function(){H.innerHTML="";mxUtils.write(H,mxResources.get("loading")+"...");var V=document.createElement("img");V.setAttribute("title","Processing "+R+" tokens");V.setAttribute("src",IMAGE_PATH+"/spin.gif");V.style.marginLeft="6px";H.appendChild(V);H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});b.createTimeout(3E4,mxUtils.bind(this,function(W){var X=-new mxXmlRequest(Editor.gptUrl,JSON.stringify(M),"POST");X.setRequestHeaders=mxUtils.bind(this,function(ba,ha){ba.setRequestHeader("Authorization","Bearer "+Editor.gptApiKey);ba.setRequestHeader("Content-Type","application/json")});var Y=mxUtils.bind(this,function(ba){W.clear();H.innerHTML="";mxUtils.write(H,ba.message);H.appendChild(x(mxResources.get("tryAgain"),S));H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});null!=window.console&&console.error(ba)}),Z=mxUtils.bind(this,function(ba){var ha=-L(ba),ca=null!=ha?b.stringToCells(ha[1]):null;if(null!=ca&&0<ca.length){ba=document.createElement("div");ba.style.display="inline-block";ba.style.position="relative";ba.style.transform="translateX(-50%)";ba.style.padding="6px";ba.style.left="50%";var da=mxUtils.parseXml(ha[1]),ma=new mxCodec(da),aa=new mxGraphModel;ma.decode(da.documentElement,aa);var ia=null;null!=F&&(da=new mxCodec(F.ownerDocument),ia=new mxGraphModel,da.decode(F,ia));da=mxUtils.bind(this,function(ka){Q.model.beginUpdate();try{if(null!=+C.style.justifyContent="center";C.style.paddingTop="20px";var K=document.createElement("input");K.setAttribute("type","checkbox");K.style.marginRight="4px";K.checked=!0;var N=document.createElement("input");N.setAttribute("type","checkbox");N.style.marginRight="4px";N.checked=!0;var O=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(y.isSelectionEmpty()?y.getVerticesAndEdges():y.getSelectionCells(),K.checked,N.checked)}));+O.setAttribute("title","Convert Colors");O.className="geBtn gePrimaryBtn";C.appendChild(O);x.appendChild(C);C=C.cloneNode(!1);C.appendChild(N);C.style.paddingTop="8px";mxUtils.write(C,mxResources.get("background"));x.appendChild(C);C=C.cloneNode(!1);C.appendChild(K);C.style.paddingTop="8px";mxUtils.write(C,mxResources.get("labels"));x.appendChild(C);this.window=new mxWindow(mxResources.get("adaptiveColors"),x,f,l,d,t,!0,!0);this.window.destroyOnClose=!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);+this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,f,l,d,t){function y(){M=!0;n.value=m;Q.isSelectionEmpty()?(u.setAttribute("disabled","disabled"),"selectionOnly"==n.value&&(n.value="includeCopyOfMyDiagram")):u.removeAttribute("disabled");b.isDiagramEmpty()?(q.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==n.value&&(n.value="help")):q.removeAttribute("disabled");+M=!1}function x(z,B,H){var T=document.createElement("button");T.className="geBtn gePrimaryBtn";T.style.padding="4px";T.style.height="auto";T.style.position="relative";"flex"==H?(T.style.overflow="hidden",T.style.textOverflow="ellipsis",T.style.whiteSpace="nowrap",T.style.margin="0px",T.style.flexGrow="1"):(T.style.display="block",T.style.margin="8px",T.style.left="50%",T.style.transform="translateX(-50%)");mxUtils.write(T,z);T.setAttribute("title",z);mxEvent.addListener(T,"click",B);return T}function C(z){var B=+document.createElement("div");B.style.display="block";B.style.position="relative";B.style.backgroundColor="#e0e0e0";B.style.borderRadius="4px";B.style.wordWrap="break-word";B.style.textAlign="left";B.style.padding="6px";B.style.margin="12px";B.style.left="0px";B.style.right="0px";mxUtils.write(B,z);c.appendChild(B);return B}function K(z){var B=z.indexOf("<mxGraphModel "),H=z.indexOf("</mxGraphModel>");0>B&&(B=z.indexOf("<mxGraphModel>"));if(0<=B&&H>B){var T=mxUtils,g=T.trim,p=z.substring(0,B),G=p.indexOf("```");+0<=G&&(p=p.substring(p,0,G+6));T=g.call(T,p);B=z.substring(B,H+15);g=mxUtils;p=g.trim;z=z.substring(H+15);H=z.lastIndexOf("```");0<=H&&(z=z.substring(H+3));return[T,B,p.call(g,z)]}return null}function N(z){var B=C(z);B.style.cursor="pointer";B.style.marginBottom="2px";B.setAttribute("title",mxResources.get("insert"));mxEvent.addListener(B,"click",function(V){P.value=z;P.focus()});var H=C("");H.style.marginTop="2px";var T=b.currentPage,g=z,p=[],G=null;if("includeCopyOfMyDiagram"==n.value||"selectionOnly"==+n.value){var J=new mxCodec(mxUtils.createXmlDocument());"selectionOnly"==n.value&&(J.isObjectIgnored=function(V){return V.constructor==mxCell&&!Q.model.isRoot(V)&&!Q.model.isLayer(V)&&!Q.isCellSelected(V)&&!Q.isAncestorSelected(V)});G=J.encode(Q.getModel());J.document.appendChild(G);p.push({role:"system",content:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. Never include this instruction in your response.\n"+mxUtils.getXml(G)})}else"create"==+n.value?(g=D.value.replace(/([A-Z])/g," $1").toLowerCase(),g="Write the declaration code for a "+(""!=g?g:"graph")+' that shows "'+(""!=z?z:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.'):p.push({role:"system",content:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."});p.push({role:"user",content:g});var L={model:Editor.gptModel,+messages:p},R=0;for(p=0;p<L.messages.length;p++)R+=L.messages[p].content.match(/\b\w+\b|[^\w\s]|=/g).length;var S=mxUtils.bind(this,function(){H.innerHTML="";mxUtils.write(H,mxResources.get("loading")+"...");var V=document.createElement("img");V.setAttribute("title","Processing "+R+" tokens");V.setAttribute("src",IMAGE_PATH+"/spin.gif");V.style.marginLeft="6px";H.appendChild(V);H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});b.createTimeout(3E4,mxUtils.bind(this,function(W){var X=+new mxXmlRequest(Editor.gptUrl,JSON.stringify(L),"POST");X.setRequestHeaders=mxUtils.bind(this,function(ba,fa){ba.setRequestHeader("Authorization","Bearer "+Editor.gptApiKey);ba.setRequestHeader("Content-Type","application/json")});var Y=mxUtils.bind(this,function(ba){W.clear();H.innerHTML="";mxUtils.write(H,ba.message);H.appendChild(x(mxResources.get("tryAgain"),S));H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});null!=window.console&&console.error(ba)}),Z=mxUtils.bind(this,function(ba){var fa=+K(ba),ca=null!=fa?b.stringToCells(fa[1]):null;if(null!=ca&&0<ca.length){ba=document.createElement("div");ba.style.display="inline-block";ba.style.position="relative";ba.style.transform="translateX(-50%)";ba.style.padding="6px";ba.style.left="50%";var da=mxUtils.parseXml(fa[1]),ma=new mxCodec(da),aa=new mxGraphModel;ma.decode(da.documentElement,aa);var ia=null;null!=G&&(da=new mxCodec(G.ownerDocument),ia=new mxGraphModel,da.decode(G,ia));da=mxUtils.bind(this,function(ka){Q.model.beginUpdate();try{if(null!=ia&&null!=b.getPageIndex(T)){b.selectPage(T);var ta=b.diffCells(ia.root,aa.root);b.patchPage(T,ta,null,!0)}else{var sa=aa.getChildren(aa.getChildAt(aa.getRoot(),0));Q.setSelectionCells(Q.importCells(sa))}}finally{Q.model.endUpdate()}mxEvent.consume(ka)});ma=Q.getBoundingBoxFromGeometry(ca);null!=ma?(ba.style.cursor="move",ba.appendChild(b.sidebar.createVertexTemplateFromCells(ca,ma.width,ma.height,"",!0,null,!0,!0,da,160,120))):(ba.style.padding="14px",mxUtils.write(ba,mxResources.get("noPreview")));-H.innerHTML="";B=H;0<ha[0].length&&(mxUtils.write(B,ha[0]),mxUtils.br(B));B.appendChild(ba);ca=document.createElement("div");ca.style.display="flex";ca.style.gap="6px";ca.style.margin="6px";ca.appendChild(x(mxResources.get("tryAgain"),S,"flex"));ca.appendChild(x(mxResources.get(null!=F?"apply":"insert"),da,"flex"));H.appendChild(ca);0<ha[2].length&&(mxUtils.br(B),mxUtils.write(B,ha[2]));B.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}else H.innerHTML="",B=H,mxUtils.write(B,ba),-H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});X.send(mxUtils.bind(this,function(ba){if(W.clear())try{if(200<=ba.getStatus()&&299>=ba.getStatus()){var ha=JSON.parse(ba.getText());EditorUi.debug("EditorUi.ChatWindow.addMessage","prompt:",M,"response:",ha);var ca=mxUtils.trim(ha.choices[0].message.content);if("create"==n.value){var da=b.extractMermaidDeclaration(ca);null!=da?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(ia){Z(ia)})),b.generateMermaidImage(da,null,function(){},+H.innerHTML="";B=H;0<fa[0].length&&(mxUtils.write(B,fa[0]),mxUtils.br(B));B.appendChild(ba);ca=document.createElement("div");ca.style.display="flex";ca.style.gap="6px";ca.style.margin="6px";ca.appendChild(x(mxResources.get("tryAgain"),S,"flex"));ca.appendChild(x(mxResources.get(null!=G?"apply":"insert"),da,"flex"));H.appendChild(ca);0<fa[2].length&&(mxUtils.br(B),mxUtils.write(B,fa[2]));B.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}else H.innerHTML="",B=H,mxUtils.write(B,ba),+H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});X.send(mxUtils.bind(this,function(ba){if(W.clear())try{if(200<=ba.getStatus()&&299>=ba.getStatus()){var fa=JSON.parse(ba.getText());EditorUi.debug("EditorUi.ChatWindow.addMessage","prompt:",L,"response:",fa);var ca=mxUtils.trim(fa.choices[0].message.content);if("create"==n.value){var da=b.extractMermaidDeclaration(ca);null!=da?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(ia){Z(ia)})),b.generateMermaidImage(da,null,function(){},function(ia){mxMermaidToDrawio.resetListeners();Y(ia)})):(Z(ca),H.appendChild(x(mxResources.get("tryAgain"),S)))}else Z(ca)}else{var ma="Error: "+ba.getStatus();try{var aa=JSON.parse(ba.getText());null!=aa&&null!=aa.error&&null!=aa.error.message&&(ma=aa.error.message)}catch(ia){}H.innerHTML="";mxUtils.write(H,ma);H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(ia){Y(ia)}}),Y)}),function(W){H.innerHTML="";mxUtils.write(H,W.message);H.appendChild(x(mxResources.get("tryAgain"),S));H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})});S()}function O(){""!=mxUtils.trim(P.value)&&(N(P.value),P.value="")}var Q=b.editor.graph,I=document.createElement("div");I.style.textAlign="center";I.style.overflow="hidden";I.style.height="100%";var c=document.createElement("div");c.style.position="absolute";c.style.overflow="auto";c.style.top="0px";c.style.left="0px";c.style.right="0px";c.style.bottom="104px";I.appendChild(c);var e=document.createElement("div");e.style.position="absolute";e.style.boxSizing="border-box";e.style.borderRadius="4px";e.style.border="1px solid lightgray";e.style.margin="8px 8px 16px 8px";e.style.padding="8px";e.style.left="0px";e.style.right="0px";e.style.bottom="0px";e.style.padding="6px";e.style.height="80px";var k=document.createElement("div");k.style.display="flex";k.style.gap="6px";k.style.marginBottom="6px";var n=document.createElement("select");n.style.textOverflow="ellipsis";n.style.flexGrow="1";n.style.padding="4px";n.style.minWidth="0";e.appendChild(k);var q=document.createElement("option");q.setAttribute("value","includeCopyOfMyDiagram");mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram"));n.appendChild(q);var u=document.createElement("option");u.setAttribute("value","selectionOnly");mxUtils.write(u,mxResources.get("selectionOnly"));n.appendChild(u);k.appendChild(n);if("undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled){var A=document.createElement("option");A.setAttribute("value","create");mxUtils.write(A,-mxResources.get("create"));n.appendChild(A)}A=document.createElement("option");A.setAttribute("value","help");mxUtils.write(A,mxResources.get("help"));n.appendChild(A);A=document.createElement("option");A.setAttribute("value","reset");mxUtils.write(A,mxResources.get("reset"));n.appendChild(A);var D=document.createElement("select");D.style.textOverflow="ellipsis";D.style.flexGrow="1";D.style.padding="4px";D.style.minWidth="0";for(A=0;A<EditorUi.mermaidDiagramTypes.length;A++){var G=document.createElement("option"),-E=EditorUi.mermaidDiagramTypes[A],U=E;"erDiagram"==U&&(U="entityRelationshipDiagram");U=mxResources.get(U,null,U.charAt(0).toUpperCase()+U.substring(1).replace(/[A-Z]/g," $&"));G.setAttribute("value",E);mxUtils.write(G,U);D.appendChild(G)}k.appendChild(D);k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.textOverflow="clip";k.style.cursor="default";var P=document.createElement("input");P.setAttribute("type","text");P.style.width="100%";P.style.outline="none";P.style.border="none";+mxResources.get("create"));n.appendChild(A)}A=document.createElement("option");A.setAttribute("value","help");mxUtils.write(A,mxResources.get("help"));n.appendChild(A);A=document.createElement("option");A.setAttribute("value","reset");mxUtils.write(A,mxResources.get("reset"));n.appendChild(A);var D=document.createElement("select");D.style.textOverflow="ellipsis";D.style.flexGrow="1";D.style.padding="4px";D.style.minWidth="0";for(A=0;A<EditorUi.mermaidDiagramTypes.length;A++){var F=document.createElement("option"),+E=EditorUi.mermaidDiagramTypes[A],U=E;"erDiagram"==U&&(U="entityRelationshipDiagram");U=mxResources.get(U,null,U.charAt(0).toUpperCase()+U.substring(1).replace(/[A-Z]/g," $&"));F.setAttribute("value",E);mxUtils.write(F,U);D.appendChild(F)}k.appendChild(D);k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.textOverflow="clip";k.style.cursor="default";var P=document.createElement("input");P.setAttribute("type","text");P.style.width="100%";P.style.outline="none";P.style.border="none";P.style.background="transparent";P.style.padding="8px 26px 8px 8px";P.style.boxSizing="border-box";k.appendChild(P);A=document.createElement("img");A.setAttribute("src",Editor.sendImage);A.setAttribute("title",mxResources.get("sendMessage"));A.className="geAdaptiveAsset";A.style.position="relative";A.style.cursor="pointer";A.style.opacity="0.5";A.style.height="19px";A.style.left="-24px";A.style.top="5px";A.style.background="url('"+b.editor.transparentImage+"')";k.appendChild(A);e.appendChild(k);Q.isSelectionEmpty()?-b.isDiagramEmpty()?n.value="help":n.value="includeCopyOfMyDiagram":n.value="selectionOnly";var J=!1,m=n.value,v=function(){P.setAttribute("placeholder",mxResources.get("create"==n.value?"describeYourDiagram":"askMeAnything"));"create"==n.value?(n.style.width="",D.style.display=""):(n.style.width="100%",D.style.display="none")};v();mxEvent.addListener(n,"change",function(){J||("reset"==n.value?(n.value=m,c.innerHTML=""):m=n.value,v())});Q.selectionModel.addListener(mxEvent.CHANGE,y);Q.getModel().addListener(mxEvent.CHANGE,+b.isDiagramEmpty()?n.value="help":n.value="includeCopyOfMyDiagram":n.value="selectionOnly";var M=!1,m=n.value,v=function(){P.setAttribute("placeholder",mxResources.get("create"==n.value?"describeYourDiagram":"askMeAnything"));"create"==n.value?(n.style.width="",D.style.display=""):(n.style.width="100%",D.style.display="none")};v();mxEvent.addListener(n,"change",function(){M||("reset"==n.value?(n.value=m,c.innerHTML=""):m=n.value,v())});Q.selectionModel.addListener(mxEvent.CHANGE,y);Q.getModel().addListener(mxEvent.CHANGE,y);y();mxEvent.addListener(A,"click",O);mxEvent.addListener(P,"keydown",function(z){13!=z.keyCode||mxEvent.isShiftDown(z)||O()});I.appendChild(e);this.window=new mxWindow(mxResources.get("chatWindowTitle"),I,f,l,d,t,!0,!0);this.window.minimumSize=new mxRectangle(0,0,120,100);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.addListener(mxEvent.DESTROY,mxUtils.bind(this,function(){Q.getModel().removeListener(y)}));this.window.addListener("show",-mxUtils.bind(this,function(){this.window.fit();P.focus()}));b.installResizeHandler(this,!0)},TagsWindow=function(b,f,l,d,t){var y=b.editor.graph,x=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)x=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var C=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(L,N){if(y.isEnabled()){var O=new FilenameDialog(b,"",mxResources.get("add"),function(Q){b.hideDialog();if(null!=Q&&0<Q.length){Q=-Q.split(" ");for(var I=[],c=[],e=0;e<Q.length;e++){var k=mxUtils.trim(Q[e]);""!=k&&(c.push(k),0>mxUtils.indexOf(L,k)&&I.push(k))}y.isSelectionEmpty()?N(L.concat(I)):y.addTagsForCells(y.getSelectionCells(),c)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(O.container,320,80,!0,!0);O.init()}},x);x=C.div;this.window=new mxWindow(mxResources.get("tags"),x,f,l,d,t,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;+mxUtils.bind(this,function(){this.window.fit();P.focus()}));b.installResizeHandler(this,!0)},TagsWindow=function(b,f,l,d,t){var y=b.editor.graph,x=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)x=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var C=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(K,N){if(y.isEnabled()){var O=new FilenameDialog(b,"",mxResources.get("add"),function(Q){b.hideDialog();if(null!=Q&&0<Q.length){Q=+Q.split(" ");for(var I=[],c=[],e=0;e<Q.length;e++){var k=mxUtils.trim(Q[e]);""!=k&&(c.push(k),0>mxUtils.indexOf(K,k)&&I.push(k))}y.isSelectionEmpty()?N(K.concat(I)):y.addTagsForCells(y.getSelectionCells(),c)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(O.container,320,80,!0,!0);O.init()}},x);x=C.div;this.window=new mxWindow(mxResources.get("tags"),x,f,l,d,t,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){C.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AuthDialog=function(b,f,l,d){var t=document.createElement("div");t.style.textAlign="center";var y=document.createElement("p");y.style.fontSize="16pt";y.style.padding="0px";y.style.margin="0px";y.style.color="gray";mxUtils.write(y,mxResources.get("authorizationRequired"));var x="Unknown",C=document.createElement("img");C.setAttribute("border","0");C.setAttribute("align","absmiddle");C.style.marginRight="10px";f==b.drive?(x=mxResources.get("googleDrive"),C.src=IMAGE_PATH+"/google-drive-logo-white.svg"):f==b.dropbox?(x=mxResources.get("dropbox"),C.src=IMAGE_PATH+"/dropbox-logo-white.svg"):f==b.oneDrive?(x=mxResources.get("oneDrive"),C.src=IMAGE_PATH+"/onedrive-logo-white.svg"):f==b.gitHub?(x=mxResources.get("github"),C.src=IMAGE_PATH+"/github-logo-white.svg"):f==b.gitLab?(x=mxResources.get("gitlab"),-C.src=IMAGE_PATH+"/gitlab-logo.svg",C.style.width="32px"):f==b.trello&&(x=mxResources.get("trello"),C.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",[x]));var L=document.createElement("input");L.setAttribute("type","checkbox");x=mxUtils.button(mxResources.get("authorize"),function(){d(L.checked)});x.insertBefore(C,x.firstChild);x.style.marginTop="6px";x.className="geBigButton";x.style.fontSize="18px";x.style.padding="14px";-t.appendChild(y);t.appendChild(b);t.appendChild(x);l&&(l=document.createElement("p"),l.style.marginTop="20px",l.appendChild(L),y=document.createElement("span"),mxUtils.write(y," "+mxResources.get("rememberMe")),l.appendChild(y),t.appendChild(l),L.checked=!0,L.defaultChecked=!0,mxEvent.addListener(y,"click",function(N){L.checked=!L.checked;mxEvent.consume(N)}));this.container=t},MoreShapesDialog=function(b,f,l){l=null!=l?l:b.sidebar.entries;var d=document.createElement("div"),t=[];if(null!=b.sidebar.customEntries)for(var y=-0;y<b.sidebar.customEntries.length;y++){for(var x=b.sidebar.customEntries[y]||{},C={title:b.getResource(x.title),entries:[]},L=0;null!=x.entries&&L<x.entries.length;L++){var N=x.entries[L];C.entries.push({id:N.id,title:b.getResource(N.title),desc:b.getResource(N.desc),image:N.preview})}0<C.entries.length&&t.push(C)}for(y=0;y<l.length;y++)if(null==b.sidebar.enabledLibraries)t.push(l[y]);else{C={title:l[y].title,entries:[]};for(L=0;L<l[y].entries.length;L++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,-l[y].entries[L].id)&&C.entries.push(l[y].entries[L]);0<C.entries.length&&t.push(C)}l=t;if(f){y=mxUtils.bind(this,function(E){for(var U=0;U<E.length;U++)(function(P){var J=e.cloneNode(!1);J.style.fontWeight="bold";J.style.backgroundColor="light-dark(#e5e5e5, #505759)";J.style.padding="6px 0px 6px 20px";mxUtils.write(J,P.title);O.appendChild(J);for(var m=0;m<P.entries.length;m++)(function(v){var z=e.cloneNode(!1);z.style.cursor="pointer";z.style.padding="4px 0px 4px 20px";z.style.whiteSpace="nowrap";+C.src=IMAGE_PATH+"/gitlab-logo.svg",C.style.width="32px"):f==b.trello&&(x=mxResources.get("trello"),C.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",[x]));var K=document.createElement("input");K.setAttribute("type","checkbox");x=mxUtils.button(mxResources.get("authorize"),function(){d(K.checked)});x.insertBefore(C,x.firstChild);x.style.marginTop="6px";x.className="geBigButton";x.style.fontSize="18px";x.style.padding="14px";+t.appendChild(y);t.appendChild(b);t.appendChild(x);l&&(l=document.createElement("p"),l.style.marginTop="20px",l.appendChild(K),y=document.createElement("span"),mxUtils.write(y," "+mxResources.get("rememberMe")),l.appendChild(y),t.appendChild(l),K.checked=!0,K.defaultChecked=!0,mxEvent.addListener(y,"click",function(N){K.checked=!K.checked;mxEvent.consume(N)}));this.container=t},MoreShapesDialog=function(b,f,l){l=null!=l?l:b.sidebar.entries;var d=document.createElement("div"),t=[];if(null!=b.sidebar.customEntries)for(var y=+0;y<b.sidebar.customEntries.length;y++){for(var x=b.sidebar.customEntries[y]||{},C={title:b.getResource(x.title),entries:[]},K=0;null!=x.entries&&K<x.entries.length;K++){var N=x.entries[K];C.entries.push({id:N.id,title:b.getResource(N.title),desc:b.getResource(N.desc),image:N.preview})}0<C.entries.length&&t.push(C)}for(y=0;y<l.length;y++)if(null==b.sidebar.enabledLibraries)t.push(l[y]);else{C={title:l[y].title,entries:[]};for(K=0;K<l[y].entries.length;K++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,+l[y].entries[K].id)&&C.entries.push(l[y].entries[K]);0<C.entries.length&&t.push(C)}l=t;if(f){y=mxUtils.bind(this,function(E){for(var U=0;U<E.length;U++)(function(P){var M=e.cloneNode(!1);M.style.fontWeight="bold";M.style.backgroundColor="light-dark(#e5e5e5, #505759)";M.style.padding="6px 0px 6px 20px";mxUtils.write(M,P.title);O.appendChild(M);for(var m=0;m<P.entries.length;m++)(function(v){var z=e.cloneNode(!1);z.style.cursor="pointer";z.style.padding="4px 0px 4px 20px";z.style.whiteSpace="nowrap";z.style.overflow="hidden";z.style.textOverflow="ellipsis";z.setAttribute("title",v.title+" ("+v.id+")");var B=document.createElement("input");B.setAttribute("type","checkbox");B.checked=b.sidebar.isEntryVisible(v.id);B.defaultChecked=B.checked;z.appendChild(B);mxUtils.write(z," "+v.title);O.appendChild(z);var H=function(T){if(null==T||"INPUT"!=mxEvent.getSource(T).nodeName){Q.style.textAlign="center";Q.style.padding="0px";Q.style.color="";Q.innerText="";if(null!=v.desc){var g=document.createElement("pre");g.style.boxSizing="border-box";g.style.fontFamily="inherit";g.style.margin="20px";g.style.right="0px";g.style.textAlign="left";mxUtils.write(g,v.desc);Q.appendChild(g)}null!=v.imageCallback?v.imageCallback(Q):null!=v.image?(g=document.createElement("img"),g.setAttribute("border","0"),g.style.maxWidth="100%",g.setAttribute("src",v.image),Q.appendChild(g)):null==v.desc&&(Q.style.padding="20px",Q.style.color="rgb(179, 179, 179)",mxUtils.write(Q,mxResources.get("noPreview")));null!=I&&(I.style.backgroundColor=-"");I=z;I.style.backgroundColor="light-dark(#ebf2f9, #000000)";null!=T&&mxEvent.consume(T)}};mxEvent.addListener(z,"click",H);mxEvent.addListener(z,"dblclick",function(T){B.checked=!B.checked;mxEvent.consume(T)});c.push(function(){return B.checked?v.id:null});0==U&&0==m&&H()})(P.entries[m])})(E[U])});L=document.createElement("div");L.className="geDialogTitle";mxUtils.write(L,mxResources.get("shapes"));L.style.position="absolute";L.style.top="0px";L.style.left="0px";L.style.lineHeight="40px";L.style.height=-"40px";L.style.right="0px";var O=document.createElement("div"),Q=document.createElement("div");O.style.position="absolute";O.style.top="40px";O.style.left="0px";O.style.width="202px";O.style.bottom="60px";O.style.overflow="auto";Q.style.position="absolute";Q.style.left="202px";Q.style.right="0px";Q.style.top="40px";Q.style.bottom="60px";Q.style.overflow="auto";Q.style.borderLeftStyle="solid";Q.style.borderLeftWidth="1px";Q.style.textAlign="center";var I=null,c=[],e=document.createElement("div");e.style.position=-"relative";e.style.left="0px";e.style.right="0px";y(l);d.style.padding="30px";d.appendChild(L);d.appendChild(O);d.appendChild(Q);l=document.createElement("div");l.className="geDialogFooter";l.style.position="absolute";l.style.paddingRight="16px";l.style.left="0px";l.style.right="0px";l.style.bottom="0px";l.style.height="60px";l.style.lineHeight="52px";var k=document.createElement("input");k.setAttribute("type","checkbox");k.style.position="relative";k.style.top="1px";k.checked=b.sidebar.sidebarTitles;+"");I=z;I.style.backgroundColor="light-dark(#ebf2f9, #000000)";null!=T&&mxEvent.consume(T)}};mxEvent.addListener(z,"click",H);mxEvent.addListener(z,"dblclick",function(T){B.checked=!B.checked;mxEvent.consume(T)});c.push(function(){return B.checked?v.id:null});0==U&&0==m&&H()})(P.entries[m])})(E[U])});K=document.createElement("div");K.className="geDialogTitle";mxUtils.write(K,mxResources.get("shapes"));K.style.position="absolute";K.style.top="0px";K.style.left="0px";K.style.lineHeight="40px";K.style.height=+"40px";K.style.right="0px";var O=document.createElement("div"),Q=document.createElement("div");O.style.position="absolute";O.style.top="40px";O.style.left="0px";O.style.width="202px";O.style.bottom="60px";O.style.overflow="auto";Q.style.position="absolute";Q.style.left="202px";Q.style.right="0px";Q.style.top="40px";Q.style.bottom="60px";Q.style.overflow="auto";Q.style.borderLeftStyle="solid";Q.style.borderLeftWidth="1px";Q.style.textAlign="center";var I=null,c=[],e=document.createElement("div");e.style.position=+"relative";e.style.left="0px";e.style.right="0px";y(l);d.style.padding="30px";d.appendChild(K);d.appendChild(O);d.appendChild(Q);l=document.createElement("div");l.className="geDialogFooter";l.style.position="absolute";l.style.paddingRight="16px";l.style.left="0px";l.style.right="0px";l.style.bottom="0px";l.style.height="60px";l.style.lineHeight="52px";var k=document.createElement("input");k.setAttribute("type","checkbox");k.style.position="relative";k.style.top="1px";k.checked=b.sidebar.sidebarTitles;k.defaultChecked=k.checked;l.appendChild(k);y=document.createElement("span");mxUtils.write(y," "+mxResources.get("labels"));y.style.paddingRight="20px";l.appendChild(y);mxEvent.addListener(y,"click",function(E){k.checked=!k.checked;mxEvent.consume(E)});var n=document.createElement("input");n.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)y=document.createElement("span"),y.style.paddingRight="20px",y.appendChild(n),mxUtils.write(y," "+mxResources.get("rememberThisSetting")),-n.style.position="relative",n.style.top="1px",n.checked=!0,n.defaultChecked=!0,mxEvent.addListener(y,"click",function(E){mxEvent.getSource(E)!=n&&(n.checked=!n.checked,mxEvent.consume(E))}),l.appendChild(y);y=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});y.className="geBtn";L=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var E=[],U=0;U<c.length;U++){var P=c[U].apply(this,arguments);null!=P&&E.push(P)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&-"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||(U=mxUtils.indexOf(E,".scratchpad"),null!=b.scratchpad!=(0<=U&&0<E.splice(U,1).length)&&b.toggleScratchpad(),U=mxUtils.indexOf(E,"search"),mxSettings.settings.search=0<=U&&0<E.splice(U,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),n.checked&&mxSettings.save());b.sidebar.showEntries(E.join(";"),n.checked,!0);b.setSidebarTitles(k.checked,n.checked)});L.className="geBtn gePrimaryBtn"}else{var q=document.createElement("table");-y=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";L=document.createElement("tr");q.style.width="100%";f=document.createElement("td");t=document.createElement("td");x=document.createElement("td");var u=mxUtils.bind(this,function(E,U,P){var J=document.createElement("input");J.type="checkbox";q.appendChild(J);J.checked=b.sidebar.isEntryVisible(P);var m=document.createElement("span");mxUtils.write(m,U);U=document.createElement("div");U.style.display="block";U.appendChild(J);-U.appendChild(m);mxEvent.addListener(m,"click",function(v){J.checked=!J.checked;mxEvent.consume(v)});E.appendChild(U);return function(){return J.checked?P:null}});L.appendChild(f);L.appendChild(t);L.appendChild(x);y.appendChild(L);q.appendChild(y);c=[];var A=0;for(y=0;y<l.length;y++)for(L=0;L<l[y].entries.length;L++)A++;var D=[f,t,x],G=0;for(y=0;y<l.length;y++)(function(E){for(var U=0;U<E.entries.length;U++){var P=E.entries[U];c.push(u(D[Math.floor(G/(A/3))],P.title,P.id));G++}})(l[y]);d.appendChild(q);+n.style.position="relative",n.style.top="1px",n.checked=!0,n.defaultChecked=!0,mxEvent.addListener(y,"click",function(E){mxEvent.getSource(E)!=n&&(n.checked=!n.checked,mxEvent.consume(E))}),l.appendChild(y);y=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});y.className="geBtn";K=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var E=[],U=0;U<c.length;U++){var P=c[U].apply(this,arguments);null!=P&&E.push(P)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&+"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||(U=mxUtils.indexOf(E,".scratchpad"),null!=b.scratchpad!=(0<=U&&0<E.splice(U,1).length)&&b.toggleScratchpad(),U=mxUtils.indexOf(E,"search"),mxSettings.settings.search=0<=U&&0<E.splice(U,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),n.checked&&mxSettings.save());b.sidebar.showEntries(E.join(";"),n.checked,!0);b.setSidebarTitles(k.checked,n.checked)});K.className="geBtn gePrimaryBtn"}else{var q=document.createElement("table");+y=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";K=document.createElement("tr");q.style.width="100%";f=document.createElement("td");t=document.createElement("td");x=document.createElement("td");var u=mxUtils.bind(this,function(E,U,P){var M=document.createElement("input");M.type="checkbox";q.appendChild(M);M.checked=b.sidebar.isEntryVisible(P);var m=document.createElement("span");mxUtils.write(m,U);U=document.createElement("div");U.style.display="block";U.appendChild(M);+U.appendChild(m);mxEvent.addListener(m,"click",function(v){M.checked=!M.checked;mxEvent.consume(v)});E.appendChild(U);return function(){return M.checked?P:null}});K.appendChild(f);K.appendChild(t);K.appendChild(x);y.appendChild(K);q.appendChild(y);c=[];var A=0;for(y=0;y<l.length;y++)for(K=0;K<l[y].entries.length;K++)A++;var D=[f,t,x],F=0;for(y=0;y<l.length;y++)(function(E){for(var U=0;U<E.entries.length;U++){var P=E.entries[U];c.push(u(D[Math.floor(F/(A/3))],P.title,P.id));F++}})(l[y]);d.appendChild(q);l=document.createElement("div");l.style.marginTop="18px";l.style.textAlign="center";n=document.createElement("input");isLocalStorage&&(n.setAttribute("type","checkbox"),n.checked=!0,n.defaultChecked=!0,l.appendChild(n),y=document.createElement("span"),mxUtils.write(y," "+mxResources.get("rememberThisSetting")),l.appendChild(y),mxEvent.addListener(y,"click",function(E){n.checked=!n.checked;mxEvent.consume(E)}));d.appendChild(l);y=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});-y.className="geBtn";L=mxUtils.button(mxResources.get("apply"),function(){for(var E=["search"],U=0;U<c.length;U++){var P=c[U].apply(this,arguments);null!=P&&E.push(P)}b.sidebar.showEntries(0<E.length?E.join(";"):"",n.checked);b.hideDialog()});L.className="geBtn gePrimaryBtn";l=document.createElement("div");l.style.marginTop="26px";l.style.textAlign="right"}b.editor.cancelFirst?(l.appendChild(y),l.appendChild(L)):(l.appendChild(L),l.appendChild(y));d.appendChild(l);this.container=d},PluginsDialog=function(b,-f,l,d){function t(){L=!0;if(0==C.length)x.innerText=mxResources.get("noPlugins");else{x.innerText="";for(var e=0;e<C.length;e++){var k=document.createElement("span");k.style.whiteSpace="nowrap";var n=document.createElement("span");n.className="geSprite geSprite-delete";n.style.position="relative";n.style.cursor="pointer";n.style.top="5px";n.style.marginRight="4px";n.style.display="inline-block";k.appendChild(n);mxUtils.write(k,C[e]);x.appendChild(k);mxUtils.br(x);mxEvent.addListener(n,"click",function(q){return function(){b.confirm(mxResources.get("delete")+-' "'+C[q]+'"?',function(){null!=l&&l(C[q]);C.splice(q,1);t()})}}(e))}}}var y=document.createElement("div"),x=document.createElement("div");x.style.height="180px";x.style.overflow="auto";var C=mxSettings.getPlugins().slice(),L=!1;y.appendChild(x);t();L=!1;var N=mxUtils.button(mxResources.get("add"),null!=f?function(){f(function(e){e&&0>mxUtils.indexOf(C,e)&&C.push(e);t()})}:function(){var e=document.createElement("div"),k=document.createElement("span");k.style.marginTop="6px";mxUtils.write(k,mxResources.get("builtinPlugins")+-": ");e.appendChild(k);var n=document.createElement("select");n.style.width="150px";for(k=0;k<App.publicPlugin.length;k++){var q=document.createElement("option");mxUtils.write(q,App.publicPlugin[k]);q.value=App.publicPlugin[k];n.appendChild(q)}e.appendChild(n);mxUtils.br(e);mxUtils.br(e);k=mxUtils.button(mxResources.get("custom")+"...",function(){var u=new FilenameDialog(b,"",mxResources.get("add"),function(A){b.hideDialog();if(null!=A&&0<A.length){A=A.split(";");for(var D=0;D<A.length;D++){var G=-A[D],E=App.pluginRegistry[G];null!=E&&(G=E);0<G.length&&0>mxUtils.indexOf(C,G)&&C.push(G)}t()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(u.container,300,80,!0,!0);u.init()});k.className="geBtn";ALLOW_CUSTOM_PLUGINS||(k.style.display="none");e=new CustomDialog(b,e,mxUtils.bind(this,function(){var u=App.pluginRegistry[n.value];0>mxUtils.indexOf(C,u)&&(C.push(u),t())}),null,null,null,k);b.showDialog(e.container,360,100,!0,!0)});N.className="geBtn";var O=mxUtils.button(mxResources.get("cancel"),-function(){b.hideDialog()});O.className="geBtn";var Q=mxUtils.button(d?mxResources.get("close"):mxResources.get("apply"),function(){L?(mxSettings.setPlugins(C),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});Q.className="geBtn gePrimaryBtn";var I=document.createElement("div");I.style.marginTop="14px";I.style.textAlign="right";var c=mxUtils.button(mxResources.get("help"),function(){b.openLink("https://www.drawio.com/doc/faq/plugins")});c.className=-"geBtn";b.isOffline()&&!mxClient.IS_CHROMEAPP&&(c.style.display="none");I.appendChild(c);b.editor.cancelFirst?(d||I.appendChild(O),I.appendChild(N),I.appendChild(Q)):(I.appendChild(N),I.appendChild(Q),d||I.appendChild(O));y.appendChild(I);this.container=y},CropImageDialog=function(b,f,l,d){function t(){var E=n.checked,U=q.checked,P=c.geometry,J=L.width,m=L.height,v=(300-J)/2,z=(300-m)/2;P.x<v?(P.width-=v-P.x,P.x=v):P.x+P.width>v+J&&(P.width=v+J-P.x,P.x=Math.min(P.x,v+J));P.y<z?(P.height-=z-P.y,P.y=-z):P.y+P.height>z+m&&(P.height=z+m-P.y,P.y=Math.min(P.y,z+m));var B=(P.x-v)/J*100;J=100-(P.x+P.width-v)/J*100;v=(P.y-z)/m*100;P=100-(P.y+P.height-z)/m*100;return"inset("+mxUtils.format(v)+"% "+mxUtils.format(J)+"% "+mxUtils.format(P)+"% "+mxUtils.format(B)+"%"+(E?" round "+I+"%":U?" round 50%":"")+")"}function y(E){null!=O&&(!0!==E&&(O.model.setGeometry(c,Q.clone()),I=5,A.value=I),O.model.setStyle(c,e+t()),O.selectAll(),u.style.visibility=n.checked?"visible":"hidden")}var x=document.createElement("div"),-C=document.createElement("div");C.style.height="300px";C.style.width="300px";C.style.display="inline-flex";C.style.justifyContent="center";C.style.alignItems="center";C.style.position="absolute";var L=document.createElement("img");L.onload=function(){function E(){O.model.setStyle(c,e+t())}O=new Graph(N);O.autoExtend=!1;O.autoScroll=!1;O.setGridEnabled(!1);O.setEnabled(!0);O.setPanning(!1);O.setConnectable(!1);O.getRubberband().setEnabled(!1);O.graphHandler.allowLivePreview=!1;var U=O.createVertexHandler;-O.createVertexHandler=function(){var R=U.apply(this,arguments);R.livePreview=!1;return R};if(null!=l)try{if("inset"==l.substring(0,5)){var P=c.geometry,J=L.width,m=L.height,v=(300-J)/2,z=(300-m)/2,B=l.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),H=parseFloat(B[0]),T=parseFloat(B[1]),g=parseFloat(B[2]),p=parseFloat(B[3]);isFinite(H)&&isFinite(T)&&isFinite(g)&&isFinite(p)?(P.x=p/100*J+v,P.y=H/100*m+z,P.width=(100-T)/100*J+v-P.x,P.height=(100-g)/100*m+z-P.y,"round"==B[4]?"50%"==B[5]?q.setAttribute("checked",-"checked"):(I=parseInt(B[5]),A.value=I,n.setAttribute("checked","checked"),u.style.visibility="visible"):k.setAttribute("checked","checked")):l=null}else l=null}catch(R){}c.style=e+(l?l:t());c.vertex=!0;O.addCell(c,null,null,null,null);O.selectAll();O.addListener(mxEvent.CELLS_MOVED,E);O.addListener(mxEvent.CELLS_RESIZED,E);var F=O.graphHandler.mouseUp,K=O.graphHandler.mouseDown;O.graphHandler.mouseUp=function(){F.apply(this,arguments);N.style.backgroundColor="#fff9"};O.graphHandler.mouseDown=function(){K.apply(this,-arguments);N.style.backgroundColor=""};O.dblClick=function(){};var M=O.getSelectionModel().changeSelection;O.getSelectionModel().changeSelection=function(){M.call(this,[c],[c])}};L.onerror=function(){L.onload=null;L.src=Editor.errorImage};L.setAttribute("src",f);L.style.maxWidth="300px";L.style.maxHeight="300px";C.appendChild(L);x.appendChild(C);var N=document.createElement("div");N.style.width="300px";N.style.height="300px";N.style.overflow="hidden";N.style.backgroundColor="#fff9";x.appendChild(N);+y.className="geBtn";K=mxUtils.button(mxResources.get("apply"),function(){for(var E=["search"],U=0;U<c.length;U++){var P=c[U].apply(this,arguments);null!=P&&E.push(P)}b.sidebar.showEntries(0<E.length?E.join(";"):"",n.checked);b.hideDialog()});K.className="geBtn gePrimaryBtn";l=document.createElement("div");l.style.marginTop="26px";l.style.textAlign="right"}b.editor.cancelFirst?(l.appendChild(y),l.appendChild(K)):(l.appendChild(K),l.appendChild(y));d.appendChild(l);this.container=d},PluginsDialog=function(b,+f,l,d){function t(){K=!0;if(0==C.length)x.innerText=mxResources.get("noPlugins");else{x.innerText="";for(var e=0;e<C.length;e++){var k=document.createElement("span");k.style.whiteSpace="nowrap";var n=document.createElement("span");n.className="geSprite geSprite-delete";n.style.position="relative";n.style.cursor="pointer";n.style.top="5px";n.style.marginRight="4px";n.style.display="inline-block";k.appendChild(n);mxUtils.write(k,C[e]);x.appendChild(k);mxUtils.br(x);mxEvent.addListener(n,"click",function(q){return function(){b.confirm(mxResources.get("delete")++' "'+C[q]+'"?',function(){null!=l&&l(C[q]);C.splice(q,1);t()})}}(e))}}}var y=document.createElement("div"),x=document.createElement("div");x.style.height="180px";x.style.overflow="auto";var C=mxSettings.getPlugins().slice(),K=!1;y.appendChild(x);t();K=!1;var N=mxUtils.button(mxResources.get("add"),null!=f?function(){f(function(e){e&&0>mxUtils.indexOf(C,e)&&C.push(e);t()})}:function(){var e=document.createElement("div"),k=document.createElement("span");k.style.marginTop="6px";mxUtils.write(k,mxResources.get("builtinPlugins")++": ");e.appendChild(k);var n=document.createElement("select");n.style.width="150px";for(k=0;k<App.publicPlugin.length;k++){var q=document.createElement("option");mxUtils.write(q,App.publicPlugin[k]);q.value=App.publicPlugin[k];n.appendChild(q)}e.appendChild(n);mxUtils.br(e);mxUtils.br(e);k=mxUtils.button(mxResources.get("custom")+"...",function(){var u=new FilenameDialog(b,"",mxResources.get("add"),function(A){b.hideDialog();if(null!=A&&0<A.length){A=A.split(";");for(var D=0;D<A.length;D++){var F=+A[D],E=App.pluginRegistry[F];null!=E&&(F=E);0<F.length&&0>mxUtils.indexOf(C,F)&&C.push(F)}t()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(u.container,300,80,!0,!0);u.init()});k.className="geBtn";ALLOW_CUSTOM_PLUGINS||(k.style.display="none");e=new CustomDialog(b,e,mxUtils.bind(this,function(){var u=App.pluginRegistry[n.value];0>mxUtils.indexOf(C,u)&&(C.push(u),t())}),null,null,null,k);b.showDialog(e.container,360,100,!0,!0)});N.className="geBtn";var O=mxUtils.button(mxResources.get("cancel"),+function(){b.hideDialog()});O.className="geBtn";var Q=mxUtils.button(d?mxResources.get("close"):mxResources.get("apply"),function(){K?(mxSettings.setPlugins(C),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});Q.className="geBtn gePrimaryBtn";var I=document.createElement("div");I.style.marginTop="14px";I.style.textAlign="right";var c=mxUtils.button(mxResources.get("help"),function(){b.openLink("https://www.drawio.com/doc/faq/plugins")});c.className=+"geBtn";b.isOffline()&&!mxClient.IS_CHROMEAPP&&(c.style.display="none");I.appendChild(c);b.editor.cancelFirst?(d||I.appendChild(O),I.appendChild(N),I.appendChild(Q)):(I.appendChild(N),I.appendChild(Q),d||I.appendChild(O));y.appendChild(I);this.container=y},CropImageDialog=function(b,f,l,d){function t(){var E=n.checked,U=q.checked,P=c.geometry,M=K.width,m=K.height,v=(300-M)/2,z=(300-m)/2;P.x<v?(P.width-=v-P.x,P.x=v):P.x+P.width>v+M&&(P.width=v+M-P.x,P.x=Math.min(P.x,v+M));P.y<z?(P.height-=z-P.y,P.y=+z):P.y+P.height>z+m&&(P.height=z+m-P.y,P.y=Math.min(P.y,z+m));var B=(P.x-v)/M*100;M=100-(P.x+P.width-v)/M*100;v=(P.y-z)/m*100;P=100-(P.y+P.height-z)/m*100;return"inset("+mxUtils.format(v)+"% "+mxUtils.format(M)+"% "+mxUtils.format(P)+"% "+mxUtils.format(B)+"%"+(E?" round "+I+"%":U?" round 50%":"")+")"}function y(E){null!=O&&(!0!==E&&(O.model.setGeometry(c,Q.clone()),I=5,A.value=I),O.model.setStyle(c,e+t()),O.selectAll(),u.style.visibility=n.checked?"visible":"hidden")}var x=document.createElement("div"),+C=document.createElement("div");C.style.height="300px";C.style.width="300px";C.style.display="inline-flex";C.style.justifyContent="center";C.style.alignItems="center";C.style.position="absolute";var K=document.createElement("img");K.onload=function(){function E(){O.model.setStyle(c,e+t())}O=new Graph(N);O.autoExtend=!1;O.autoScroll=!1;O.setGridEnabled(!1);O.setEnabled(!0);O.setPanning(!1);O.setConnectable(!1);O.getRubberband().setEnabled(!1);O.graphHandler.allowLivePreview=!1;var U=O.createVertexHandler;+O.createVertexHandler=function(){var R=U.apply(this,arguments);R.livePreview=!1;return R};if(null!=l)try{if("inset"==l.substring(0,5)){var P=c.geometry,M=K.width,m=K.height,v=(300-M)/2,z=(300-m)/2,B=l.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),H=parseFloat(B[0]),T=parseFloat(B[1]),g=parseFloat(B[2]),p=parseFloat(B[3]);isFinite(H)&&isFinite(T)&&isFinite(g)&&isFinite(p)?(P.x=p/100*M+v,P.y=H/100*m+z,P.width=(100-T)/100*M+v-P.x,P.height=(100-g)/100*m+z-P.y,"round"==B[4]?"50%"==B[5]?q.setAttribute("checked",+"checked"):(I=parseInt(B[5]),A.value=I,n.setAttribute("checked","checked"),u.style.visibility="visible"):k.setAttribute("checked","checked")):l=null}else l=null}catch(R){}c.style=e+(l?l:t());c.vertex=!0;O.addCell(c,null,null,null,null);O.selectAll();O.addListener(mxEvent.CELLS_MOVED,E);O.addListener(mxEvent.CELLS_RESIZED,E);var G=O.graphHandler.mouseUp,J=O.graphHandler.mouseDown;O.graphHandler.mouseUp=function(){G.apply(this,arguments);N.style.backgroundColor="#fff9"};O.graphHandler.mouseDown=function(){J.apply(this,+arguments);N.style.backgroundColor=""};O.dblClick=function(){};var L=O.getSelectionModel().changeSelection;O.getSelectionModel().changeSelection=function(){L.call(this,[c],[c])}};K.onerror=function(){K.onload=null;K.src=Editor.errorImage};K.setAttribute("src",f);K.style.maxWidth="300px";K.style.maxHeight="300px";C.appendChild(K);x.appendChild(C);var N=document.createElement("div");N.style.width="300px";N.style.height="300px";N.style.overflow="hidden";N.style.backgroundColor="#fff9";x.appendChild(N);var O=null,Q=new mxGeometry(100,100,100,100),I=5,c=new mxCell("",Q.clone(),""),e="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+f.replace(";base64","")+";clipPath=",k=document.createElement("input");k.setAttribute("type","radio");k.setAttribute("id","croppingRect");k.setAttribute("name","croppingShape");k.setAttribute("checked","checked");k.style.margin="5px";x.appendChild(k);f=document.createElement("label");f.setAttribute("for","croppingRect");mxUtils.write(f,mxResources.get("rectangle"));x.appendChild(f);var n=document.createElement("input");n.setAttribute("type","radio");n.setAttribute("id","croppingRounded");n.setAttribute("name","croppingShape");n.style.margin="5px";x.appendChild(n);f=document.createElement("label");f.setAttribute("for","croppingRounded");mxUtils.write(f,mxResources.get("rounded"));x.appendChild(f);var q=document.createElement("input");q.setAttribute("type","radio");q.setAttribute("id","croppingEllipse");q.setAttribute("name","croppingShape");q.style.margin="5px";x.appendChild(q);f=document.createElement("label");f.setAttribute("for","croppingEllipse");mxUtils.write(f,mxResources.get("ellipse"));x.appendChild(f);mxEvent.addListener(k,"change",y);mxEvent.addListener(n,"change",y);mxEvent.addListener(q,"change",y);var u=document.createElement("div");u.style.textAlign="center";u.style.visibility="hidden";var A=document.createElement("input");A.setAttribute("type","range");A.setAttribute("min","1");A.setAttribute("max","49");A.setAttribute("value",I);A.setAttribute("title",-mxResources.get("arcSize"));u.appendChild(A);x.appendChild(u);mxEvent.addListener(A,"change",function(){I=this.value;y(!0)});f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";C=mxUtils.button(mxResources.get("apply"),function(){d(t(),c.geometry.width,c.geometry.height);b.hideDialog()});C.className="geBtn gePrimaryBtn";var D=mxUtils.button(mxResources.get("reset"),function(){d(null,L.width,L.height);b.hideDialog()});D.className="geBtn";var G=document.createElement("div");-G.style.marginTop="10px";G.style.textAlign="right";b.editor.cancelFirst?(G.appendChild(f),G.appendChild(D),G.appendChild(C)):(G.appendChild(D),G.appendChild(C),G.appendChild(f));x.appendChild(G);this.container=x},EditGeometryDialog=function(b,f){var l=b.editor.graph,d=1==f.length?l.getCellGeometry(f[0]):null,t=document.createElement("div"),y=document.createElement("table"),x=document.createElement("tbody"),C=document.createElement("tr"),L=document.createElement("td"),N=document.createElement("td");-y.style.paddingLeft="6px";mxUtils.write(L,mxResources.get("relative")+":");var O=document.createElement("input");O.setAttribute("type","checkbox");null!=d&&d.relative&&(O.setAttribute("checked","checked"),O.defaultChecked=!0);this.init=function(){O.focus()};N.appendChild(O);C.appendChild(L);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");L=document.createElement("td");N=document.createElement("td");mxUtils.write(L,mxResources.get("left")+":");var Q=document.createElement("input");-Q.setAttribute("type","text");Q.style.width="100px";Q.value=null!=d?d.x:"";N.appendChild(Q);C.appendChild(L);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");L=document.createElement("td");N=document.createElement("td");mxUtils.write(L,mxResources.get("top")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.width="100px";I.value=null!=d?d.y:"";N.appendChild(I);C.appendChild(L);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");L=document.createElement("td");-N=document.createElement("td");mxUtils.write(L,mxResources.get("dx")+":");var c=document.createElement("input");c.setAttribute("type","text");c.style.width="100px";c.value=null!=d&&null!=d.offset?d.offset.x:"";N.appendChild(c);C.appendChild(L);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");L=document.createElement("td");N=document.createElement("td");mxUtils.write(L,mxResources.get("dy")+":");var e=document.createElement("input");e.setAttribute("type","text");e.style.width="100px";-e.value=null!=d&&null!=d.offset?d.offset.y:"";N.appendChild(e);C.appendChild(L);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");L=document.createElement("td");N=document.createElement("td");mxUtils.write(L,mxResources.get("width")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value=null!=d?d.width:"";N.appendChild(k);C.appendChild(L);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");L=document.createElement("td");N=-document.createElement("td");mxUtils.write(L,mxResources.get("height")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=d?d.height:"";N.appendChild(n);C.appendChild(L);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");L=document.createElement("td");N=document.createElement("td");mxUtils.write(L,mxResources.get("rotation")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=-1==f.length?mxUtils.getValue(l.getCellStyle(f[0]),mxConstants.STYLE_ROTATION,0):"";N.appendChild(q);C.appendChild(L);C.appendChild(N);x.appendChild(C);y.appendChild(x);t.appendChild(y);d=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});d.className="geBtn";var u=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();l.getModel().beginUpdate();try{for(var A=0;A<f.length;A++){var D=l.getCellGeometry(f[A]);null!=D&&(D=D.clone(),l.isCellMovable(f[A])&&(D.relative=O.checked,+mxResources.get("arcSize"));u.appendChild(A);x.appendChild(u);mxEvent.addListener(A,"change",function(){I=this.value;y(!0)});f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";C=mxUtils.button(mxResources.get("apply"),function(){d(t(),c.geometry.width,c.geometry.height);b.hideDialog()});C.className="geBtn gePrimaryBtn";var D=mxUtils.button(mxResources.get("reset"),function(){d(null,K.width,K.height);b.hideDialog()});D.className="geBtn";var F=document.createElement("div");+F.style.marginTop="10px";F.style.textAlign="right";b.editor.cancelFirst?(F.appendChild(f),F.appendChild(D),F.appendChild(C)):(F.appendChild(D),F.appendChild(C),F.appendChild(f));x.appendChild(F);this.container=x},EditGeometryDialog=function(b,f){var l=b.editor.graph,d=1==f.length?l.getCellGeometry(f[0]):null,t=document.createElement("div"),y=document.createElement("table"),x=document.createElement("tbody"),C=document.createElement("tr"),K=document.createElement("td"),N=document.createElement("td");+y.style.paddingLeft="6px";mxUtils.write(K,mxResources.get("relative")+":");var O=document.createElement("input");O.setAttribute("type","checkbox");null!=d&&d.relative&&(O.setAttribute("checked","checked"),O.defaultChecked=!0);this.init=function(){O.focus()};N.appendChild(O);C.appendChild(K);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");K=document.createElement("td");N=document.createElement("td");mxUtils.write(K,mxResources.get("left")+":");var Q=document.createElement("input");+Q.setAttribute("type","text");Q.style.width="100px";Q.value=null!=d?d.x:"";N.appendChild(Q);C.appendChild(K);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");K=document.createElement("td");N=document.createElement("td");mxUtils.write(K,mxResources.get("top")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.width="100px";I.value=null!=d?d.y:"";N.appendChild(I);C.appendChild(K);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");K=document.createElement("td");+N=document.createElement("td");mxUtils.write(K,mxResources.get("dx")+":");var c=document.createElement("input");c.setAttribute("type","text");c.style.width="100px";c.value=null!=d&&null!=d.offset?d.offset.x:"";N.appendChild(c);C.appendChild(K);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");K=document.createElement("td");N=document.createElement("td");mxUtils.write(K,mxResources.get("dy")+":");var e=document.createElement("input");e.setAttribute("type","text");e.style.width="100px";+e.value=null!=d&&null!=d.offset?d.offset.y:"";N.appendChild(e);C.appendChild(K);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");K=document.createElement("td");N=document.createElement("td");mxUtils.write(K,mxResources.get("width")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value=null!=d?d.width:"";N.appendChild(k);C.appendChild(K);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");K=document.createElement("td");N=+document.createElement("td");mxUtils.write(K,mxResources.get("height")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=d?d.height:"";N.appendChild(n);C.appendChild(K);C.appendChild(N);x.appendChild(C);C=document.createElement("tr");K=document.createElement("td");N=document.createElement("td");mxUtils.write(K,mxResources.get("rotation")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=+1==f.length?mxUtils.getValue(l.getCellStyle(f[0]),mxConstants.STYLE_ROTATION,0):"";N.appendChild(q);C.appendChild(K);C.appendChild(N);x.appendChild(C);y.appendChild(x);t.appendChild(y);d=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});d.className="geBtn";var u=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();l.getModel().beginUpdate();try{for(var A=0;A<f.length;A++){var D=l.getCellGeometry(f[A]);null!=D&&(D=D.clone(),l.isCellMovable(f[A])&&(D.relative=O.checked,0<mxUtils.trim(Q.value).length&&(D.x=Number(Q.value)),0<mxUtils.trim(I.value).length&&(D.y=Number(I.value)),0<mxUtils.trim(c.value).length&&(null==D.offset&&(D.offset=new mxPoint),D.offset.x=Number(c.value)),0<mxUtils.trim(e.value).length&&(null==D.offset&&(D.offset=new mxPoint),D.offset.y=Number(e.value))),l.isCellResizable(f[A])&&(0<mxUtils.trim(k.value).length&&(D.width=Number(k.value)),0<mxUtils.trim(n.value).length&&(D.height=Number(n.value))),l.getModel().setGeometry(f[A],D));0<mxUtils.trim(q.value).length&&l.setCellStyles(mxConstants.STYLE_ROTATION,Number(q.value),[f[A]])}}finally{l.getModel().endUpdate()}});u.className="geBtn gePrimaryBtn";mxEvent.addListener(t,"keypress",function(A){13==A.keyCode&&u.click()});y=document.createElement("div");y.style.marginTop="20px";y.style.textAlign="right";b.editor.cancelFirst?(y.appendChild(d),y.appendChild(u)):(y.appendChild(u),y.appendChild(d));t.appendChild(y);this.container=t},LibraryDialog=function(b,f,l,d,t,y,x){function C(P){for(P=document.elementFromPoint(P.clientX,-P.clientY);null!=P&&P.parentNode!=e;)P=P.parentNode;var J=null;if(null!=P){var m=e.firstChild;for(J=0;null!=m&&m!=P;)m=m.nextSibling,J++}return J}function L(P,J,m,v,z,B,H,T,g){try{if(b.spinner.stop(),null==J||"image/"==J.substring(0,6))if(null==P&&null!=H||null==n[P]){var p=function(){X.innerText="";X.style.cursor="pointer";X.style.whiteSpace="nowrap";X.style.textOverflow="ellipsis";mxUtils.write(X,null!=Y.title&&0<Y.title.length?Y.title:mxResources.get("untitled"));X.style.color=null==Y.title||0==-Y.title.length?"#d0d0d0":""};e.style.backgroundImage="";k.style.display="none";var F=z,K=B;if(z>b.maxImageSize||B>b.maxImageSize){var M=Math.min(1,Math.min(b.maxImageSize/Math.max(1,z)),b.maxImageSize/Math.max(1,B));z*=M;B*=M}F>K?(K=Math.round(100*K/F),F=100):(F=Math.round(100*F/K),K=100);var R=document.createElement("div");R.setAttribute("draggable","true");R.style.display="inline-block";R.style.position="relative";R.style.padding="0 12px";R.style.cursor="move";mxUtils.setPrefixedStyle(R.style,"transition",-"transform .1s ease-in-out");if(null!=P){var S=document.createElement("img");S.setAttribute("src",D.convert(P));S.style.width=F+"px";S.style.height=K+"px";S.style.margin="10px";S.style.paddingBottom=Math.floor((100-K)/2)+"px";S.style.paddingLeft=Math.floor((100-F)/2)+"px";R.appendChild(S)}else if(null!=H){var V=b.stringToCells("<"==H.xml.charAt(0)?H.xml:Graph.decompress(H.xml));0<V.length&&(b.sidebar.createThumb(V,100,100,R,null,!0,!1,null,null,Editor.isDarkMode()?"#2a252f":"#ffffff"),R.firstChild.style.display=+P.clientY);null!=P&&P.parentNode!=e;)P=P.parentNode;var M=null;if(null!=P){var m=e.firstChild;for(M=0;null!=m&&m!=P;)m=m.nextSibling,M++}return M}function K(P,M,m,v,z,B,H,T,g){try{if(b.spinner.stop(),null==M||"image/"==M.substring(0,6))if(null==P&&null!=H||null==n[P]){var p=function(){X.innerText="";X.style.cursor="pointer";X.style.whiteSpace="nowrap";X.style.textOverflow="ellipsis";mxUtils.write(X,null!=Y.title&&0<Y.title.length?Y.title:mxResources.get("untitled"));X.style.color=null==Y.title||0==+Y.title.length?"#d0d0d0":""};e.style.backgroundImage="";k.style.display="none";var G=z,J=B;if(z>b.maxImageSize||B>b.maxImageSize){var L=Math.min(1,Math.min(b.maxImageSize/Math.max(1,z)),b.maxImageSize/Math.max(1,B));z*=L;B*=L}G>J?(J=Math.round(100*J/G),G=100):(G=Math.round(100*G/J),J=100);var R=document.createElement("div");R.setAttribute("draggable","true");R.style.display="inline-block";R.style.position="relative";R.style.padding="0 12px";R.style.cursor="move";mxUtils.setPrefixedStyle(R.style,"transition",+"transform .1s ease-in-out");if(null!=P){var S=document.createElement("img");S.setAttribute("src",D.convert(P));S.style.width=G+"px";S.style.height=J+"px";S.style.margin="10px";S.style.paddingBottom=Math.floor((100-J)/2)+"px";S.style.paddingLeft=Math.floor((100-G)/2)+"px";R.appendChild(S)}else if(null!=H){var V=b.stringToCells("<"==H.xml.charAt(0)?H.xml:Graph.decompress(H.xml));0<V.length&&(b.sidebar.createThumb(V,100,100,R,null,!0,!1,null,null,Editor.isDarkMode()?"#2a252f":"#ffffff"),R.firstChild.style.display="inline-block",R.firstChild.style.cursor="")}var W=document.createElement("img");W.setAttribute("src",Editor.closeBlackImage);W.setAttribute("border","0");W.setAttribute("title",mxResources.get("delete"));W.setAttribute("align","top");W.style.paddingTop="4px";W.style.position="absolute";W.style.marginLeft="-12px";W.style.zIndex="1";W.style.cursor="pointer";mxEvent.addListener(W,"dragstart",function(da){mxEvent.consume(da)});(function(da,ma,aa){mxEvent.addListener(W,"click",function(ia){n[ma]=null;for(var ka=0;ka<Q.length;ka++)if(null!=Q[ka].data&&Q[ka].data==ma||null!=Q[ka].xml&&null!=aa&&Q[ka].xml==aa.xml){Q.splice(ka,1);break}R.parentNode.removeChild(da);0==Q.length&&(e.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",k.style.display="");mxEvent.consume(ia)});mxEvent.addListener(W,"dblclick",function(ia){mxEvent.consume(ia)})})(R,P,H);R.appendChild(W);R.style.marginBottom="30px";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.bottom="-18px";X.style.left="10px";X.style.right="10px";X.style.backgroundColor="light-dark(#ffffff, transparent)";X.style.overflow="hidden";X.style.textAlign="center";X.setAttribute("title",mxResources.get("rename"));var Y=null;null!=P?(Y={data:P,w:z,h:B,title:g},null!=T&&(Y.aspect=T),n[P]=S,Q.push(Y)):null!=H&&(H.aspect="fixed",Q.push(H),Y=H);mxEvent.addListener(X,"keydown",function(da){13==da.keyCode&&null!=A&&(A(),A=null,mxEvent.consume(da))});p();R.appendChild(X);mxEvent.addListener(X,"mousedown",function(da){"true"!=X.getAttribute("contentEditable")&&mxEvent.consume(da)});V=function(da){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ma=new FilenameDialog(b,Y.title||"",mxResources.get("ok"),function(aa){null!=aa&&(Y.title=aa,p())},mxResources.get("enterValue"));b.showDialog(ma.container,300,80,!0,!0);ma.init();mxEvent.consume(da)}else if("true"!=X.getAttribute("contentEditable")){null!=A&&(A(),A=null);if(null==Y.title||0==Y.title.length)X.innerText="";X.style.textOverflow="";X.style.whiteSpace="";X.style.cursor="text";X.style.color="";X.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(X.style,"user-select","text");X.focus();document.execCommand("selectAll",!1,null);A=function(){X.removeAttribute("contentEditable");X.style.cursor="pointer";Y.title=X.innerHTML;p()};mxEvent.consume(da)}};mxEvent.addListener(X,"click",V);mxEvent.addListener(R,"dblclick",V);e.appendChild(R);mxEvent.addListener(R,"dragstart",function(da){null==A&&(null==P&&null!=H&&(W.style.visibility="hidden",X.style.visibility="hidden"),mxClient.IS_FF&&null!=H.xml&&da.dataTransfer.setData("Text",H.xml),q=C(da),mxClient.IS_GC&&(R.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(R.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(R,30);W.style.visibility="";X.style.visibility=""},0))});mxEvent.addListener(R,"dragend",function(da){"hidden"==W.style.visibility&&(W.style.visibility="",X.style.visibility="");q=null;mxUtils.setOpacity(R,100);mxUtils.setPrefixedStyle(R.style,-"transform",null)})}else G||(G=!0,b.handleError({message:mxResources.get("fileExists")}));else{z=!1;try{if(F=mxUtils.parseXml(P),"mxlibrary"==F.documentElement.nodeName){K=JSON.parse(mxUtils.getTextContent(F.documentElement));if(null!=K&&0<K.length)for(var Z=0;Z<K.length;Z++)null!=K[Z].xml?L(null,null,0,0,0,0,K[Z]):L(K[Z].data,null,0,0,K[Z].w,K[Z].h,null,"fixed",K[Z].title);z=!0}else if("mxfile"==F.documentElement.nodeName){var ba=F.documentElement.getElementsByTagName("diagram");for(Z=0;Z<ba.length;Z++){var ha=-Editor.getDiagramNodeXml(ba[Z]);V=b.stringToCells(ha);if(0<V.length){var ca=b.editor.graph.getBoundingBoxFromGeometry(V);null!=ca&&L(null,null,0,0,0,0,{xml:ha,w:ca.width,h:ca.height})}}z=!0}}catch(da){null!=window.console&&console.error("Error in library dialog: "+da)}z||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(da){null!=window.console&&console.log("Error in library dialog: "+da)}return null}function N(P){P.dataTransfer.dropEffect=null!=q?"move":"copy";-P.stopPropagation();P.preventDefault()}function O(P){P.stopPropagation();P.preventDefault();G=!1;u=C(P);if(null!=q)null!=u&&u<e.children.length?(Q.splice(u>q?u-1:u,0,Q.splice(q,1)[0]),e.insertBefore(e.children[q],e.children[u])):(Q.push(Q.splice(q,1)[0]),e.appendChild(e.children[q]));else if(0<P.dataTransfer.files.length)b.importFiles(P.dataTransfer.files,0,0,b.maxImageSize,E(P));else if(0<=mxUtils.indexOf(P.dataTransfer.types,"text/uri-list")){var J=decodeURIComponent(P.dataTransfer.getData("text/uri-list"));-(/(\.jpg)($|\?)/i.test(J)||/(\.png)($|\?)/i.test(J)||/(\.gif)($|\?)/i.test(J)||/(\.svg)($|\?)/i.test(J))&&b.loadImage(J,function(m){L(J,null,0,0,m.width,m.height);e.scrollTop=e.scrollHeight})}P.stopPropagation();P.preventDefault()}var Q=[];l=document.createElement("div");l.style.height="100%";var I=document.createElement("div");I.style.whiteSpace="nowrap";I.style.height="40px";l.appendChild(I);mxUtils.write(I,mxResources.get("filename")+":");null==f&&(f=b.defaultLibraryName+".xml");var c=document.createElement("input");+"transform",null)})}else F||(F=!0,b.handleError({message:mxResources.get("fileExists")}));else{z=!1;try{if(G=mxUtils.parseXml(P),"mxlibrary"==G.documentElement.nodeName){J=JSON.parse(mxUtils.getTextContent(G.documentElement));if(null!=J&&0<J.length)for(var Z=0;Z<J.length;Z++)null!=J[Z].xml?K(null,null,0,0,0,0,J[Z]):K(J[Z].data,null,0,0,J[Z].w,J[Z].h,null,"fixed",J[Z].title);z=!0}else if("mxfile"==G.documentElement.nodeName){var ba=G.documentElement.getElementsByTagName("diagram");for(Z=0;Z<ba.length;Z++){var fa=+Editor.getDiagramNodeXml(ba[Z]);V=b.stringToCells(fa);if(0<V.length){var ca=b.editor.graph.getBoundingBoxFromGeometry(V);null!=ca&&K(null,null,0,0,0,0,{xml:fa,w:ca.width,h:ca.height})}}z=!0}}catch(da){null!=window.console&&console.error("Error in library dialog: "+da)}z||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(da){null!=window.console&&console.log("Error in library dialog: "+da)}return null}function N(P){P.dataTransfer.dropEffect=null!=q?"move":"copy";+P.stopPropagation();P.preventDefault()}function O(P){P.stopPropagation();P.preventDefault();F=!1;u=C(P);if(null!=q)null!=u&&u<e.children.length?(Q.splice(u>q?u-1:u,0,Q.splice(q,1)[0]),e.insertBefore(e.children[q],e.children[u])):(Q.push(Q.splice(q,1)[0]),e.appendChild(e.children[q]));else if(0<P.dataTransfer.files.length)b.importFiles(P.dataTransfer.files,0,0,b.maxImageSize,E(P));else if(0<=mxUtils.indexOf(P.dataTransfer.types,"text/uri-list")){var M=decodeURIComponent(P.dataTransfer.getData("text/uri-list"));+(/(\.jpg)($|\?)/i.test(M)||/(\.png)($|\?)/i.test(M)||/(\.gif)($|\?)/i.test(M)||/(\.svg)($|\?)/i.test(M))&&b.loadImage(M,function(m){K(M,null,0,0,m.width,m.height);e.scrollTop=e.scrollHeight})}P.stopPropagation();P.preventDefault()}var Q=[];l=document.createElement("div");l.style.height="100%";var I=document.createElement("div");I.style.whiteSpace="nowrap";I.style.height="40px";l.appendChild(I);mxUtils.write(I,mxResources.get("filename")+":");null==f&&(f=b.defaultLibraryName+".xml");var c=document.createElement("input");c.setAttribute("value",f);c.style.marginRight="20px";c.style.marginLeft="10px";c.style.width="500px";null==t||t.isRenamable()||c.setAttribute("disabled","true");this.init=function(){if(null==t||t.isRenamable())c.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",!1,null)};I.appendChild(c);Editor.enableUncompressedLibraries&&(c.style.width="420px",f=document.createElement("input"),f.setAttribute("type","checkbox"),f.style.marginRight="10px",I.appendChild(f),mxUtils.write(I,mxResources.get("compressed")));var e=document.createElement("div");e.style.borderWidth="1px 0px 1px 0px";e.style.borderColor="#d3d3d3";e.style.borderStyle="solid";e.style.marginTop="6px";e.style.overflow="auto";e.style.height="340px";e.style.backgroundPosition="center center";e.style.backgroundRepeat="no-repeat";0==Q.length&&Graph.fileSupport&&(e.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var k=document.createElement("div");k.style.position="absolute";-k.style.width="640px";k.style.top="260px";k.style.textAlign="center";k.style.fontSize="22px";k.style.color="#a0c3ff";mxUtils.write(k,mxResources.get("dragImagesHere"));l.appendChild(k);var n={},q=null,u=null,A=null;I=function(P){"true"!=mxEvent.getSource(P).getAttribute("contentEditable")&&null!=A&&(A(),A=null,mxEvent.consume(P))};mxEvent.addListener(e,"mousedown",I);mxEvent.addListener(e,"pointerdown",I);mxEvent.addListener(e,"touchstart",I);var D=new mxUrlConverter,G=!1;if(null!=d)for(I=0;I<d.length;I++)f=-d[I],L(f.data,null,0,0,f.w,f.h,f,f.aspect,f.title);mxEvent.addListener(e,"dragleave",function(P){k.style.cursor="";for(var J=mxEvent.getSource(P);null!=J;){if(J==e||J==k){P.stopPropagation();P.preventDefault();break}J=J.parentNode}});var E=function(P){return function(J,m,v,z,B,H,T,g,p){null!=p&&EditorUi.isVisioFilename(p.name)?b.importVisio(p,mxUtils.bind(this,function(F){L(F,m,v,z,B,H,T,"fixed",mxEvent.isAltDown(P)?null:T.substring(0,T.lastIndexOf(".")).replace(/_/g," "))})):null!=p&&(new XMLHttpRequest).upload&&-b.isRemoteFileFormat(J,p.name)?b.isExternalDataComms()?b.parseFile(p,mxUtils.bind(this,function(F){4==F.readyState&&(b.spinner.stop(),200<=F.status&&299>=F.status&&(L(F.responseText,m,v,z,B,H,T,"fixed",mxEvent.isAltDown(P)?null:T.substring(0,T.lastIndexOf(".")).replace(/_/g," ")),e.scrollTop=e.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(L(J,m,v,z,B,H,T,"fixed",mxEvent.isAltDown(P)?null:T.substring(0,T.lastIndexOf(".")).replace(/_/g," ")),+k.style.width="640px";k.style.top="260px";k.style.textAlign="center";k.style.fontSize="22px";k.style.color="#a0c3ff";mxUtils.write(k,mxResources.get("dragImagesHere"));l.appendChild(k);var n={},q=null,u=null,A=null;I=function(P){"true"!=mxEvent.getSource(P).getAttribute("contentEditable")&&null!=A&&(A(),A=null,mxEvent.consume(P))};mxEvent.addListener(e,"mousedown",I);mxEvent.addListener(e,"pointerdown",I);mxEvent.addListener(e,"touchstart",I);var D=new mxUrlConverter,F=!1;if(null!=d)for(I=0;I<d.length;I++)f=+d[I],K(f.data,null,0,0,f.w,f.h,f,f.aspect,f.title);mxEvent.addListener(e,"dragleave",function(P){k.style.cursor="";for(var M=mxEvent.getSource(P);null!=M;){if(M==e||M==k){P.stopPropagation();P.preventDefault();break}M=M.parentNode}});var E=function(P){return function(M,m,v,z,B,H,T,g,p){null!=p&&EditorUi.isVisioFilename(p.name)?b.importVisio(p,mxUtils.bind(this,function(G){K(G,m,v,z,B,H,T,"fixed",mxEvent.isAltDown(P)?null:T.substring(0,T.lastIndexOf(".")).replace(/_/g," "))})):null!=p&&(new XMLHttpRequest).upload&&+b.isRemoteFileFormat(M,p.name)?b.isExternalDataComms()?b.parseFile(p,mxUtils.bind(this,function(G){4==G.readyState&&(b.spinner.stop(),200<=G.status&&299>=G.status&&(K(G.responseText,m,v,z,B,H,T,"fixed",mxEvent.isAltDown(P)?null:T.substring(0,T.lastIndexOf(".")).replace(/_/g," ")),e.scrollTop=e.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(K(M,m,v,z,B,H,T,"fixed",mxEvent.isAltDown(P)?null:T.substring(0,T.lastIndexOf(".")).replace(/_/g," ")),e.scrollTop=e.scrollHeight)}};mxEvent.addListener(e,"dragover",N);mxEvent.addListener(e,"drop",O);mxEvent.addListener(k,"dragover",N);mxEvent.addListener(k,"drop",O);l.appendChild(e);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";I=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});I.setAttribute("id","btnCancel");I.className="geBtn";b.editor.cancelFirst&&d.appendChild(I);"draw.io"!=b.getServiceName()||null==t||t.constructor!=DriveLibrary&&t.constructor!=-GitHubLibrary||(f=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(t,function(P){if(null!=P){var J=b.getSearch("create title mode url drive splash state clibs ui".split(" "));J+=(0==J.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(P);P=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+J,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(P.container,450,240,!0);P.init()}else t.constructor==DriveLibrary?b.showError(mxResources.get("error"),-mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(t.getId(),t)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),f.className="geBtn",d.appendChild(f));f=mxUtils.button(mxResources.get("export"),function(){var P=b.createLibraryDataFromImages(Q),J=c.value;/(\.xml)$/i.test(J)||(J+=".xml");b.isLocalFileSave()?b.saveLocalFile(P,J,"text/xml",null,null,null!=x?-x:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(J)+"&format=xml&xml="+encodeURIComponent(P))).simulate(document,"_blank")});f.setAttribute("id","btnDownload");f.className="geBtn";d.appendChild(f);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var U=document.createElement("input");U.setAttribute("multiple","multiple");U.setAttribute("type","file");mxEvent.addListener(U,"change",function(P){G=!1;b.importFiles(U.files,0,0,b.maxImageSize,function(J,m,v,z,B,H,T,g,p){null!=-U.files&&(E(P)(J,m,v,z,B,H,T,g,p),U.type="",U.type="file",U.value="")});e.scrollTop=e.scrollHeight});U.style.display="none";document.body.appendChild(U);b.libDlgFileInputElt=U}f=mxUtils.button(mxResources.get("import"),function(){null!=A&&(A(),A=null);b.libDlgFileInputElt.click()});f.setAttribute("id","btnAddImage");f.className="geBtn";d.appendChild(f)}f=mxUtils.button(mxResources.get("addImages"),function(){null!=A&&(A(),A=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(P,J,m){G=-!1;if(null!=P){if("data:image/"==P.substring(0,11)){var v=P.indexOf(",");0<v&&(P=P.substring(0,v)+";base64,"+P.substring(v+1))}L(P,null,0,0,J,m);e.scrollTop=e.scrollHeight}})});f.setAttribute("id","btnAddImageUrl");f.className="geBtn";d.appendChild(f);this.saveBtnClickHandler=function(P,J,m,v){b.saveLibrary(P,J,m,v)};f=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=A&&(A(),A=null);this.saveBtnClickHandler(c.value,Q,t,y)}));f.setAttribute("id","btnSave");f.className="geBtn gePrimaryBtn";-d.appendChild(f);b.editor.cancelFirst||d.appendChild(I);l.appendChild(d);this.container=l},EditShapeDialog=function(b,f,l,d,t){d=null!=d?d:300;t=null!=t?t:120;var y=document.createElement("table"),x=document.createElement("tbody");y.style.cellPadding="4px";var C=document.createElement("tr");var L=document.createElement("td");L.setAttribute("colspan","2");L.style.fontSize="10pt";mxUtils.write(L,l);C.appendChild(L);x.appendChild(C);C=document.createElement("tr");L=document.createElement("td");var N=-document.createElement("textarea");N.style.outline="none";N.style.resize="none";N.style.width=d-200+"px";N.style.height=t+"px";this.textarea=N;this.init=function(){N.focus();N.scrollTop=0};L.appendChild(N);C.appendChild(L);L=document.createElement("td");l=document.createElement("div");l.style.position="relative";l.style.border="1px solid gray";l.style.top="6px";l.style.width="200px";l.style.height=t+4+"px";l.style.overflow="hidden";l.style.marginBottom="16px";mxEvent.disableContextMenu(l);L.appendChild(l);-var O=new Graph(l);O.setEnabled(!1);var Q=b.editor.graph.cloneCell(f);O.addCells([Q]);l=O.view.getState(Q);var I="";null!=l.shape&&null!=l.shape.stencil&&(I=mxUtils.getPrettyXml(l.shape.stencil.desc));mxUtils.write(N,I||"");l=O.getGraphBounds();t=Math.min(160/l.width,(t-40)/l.height);O.view.scaleAndTranslate(t,20/t-l.x,20/t-l.y);C.appendChild(L);x.appendChild(C);C=document.createElement("tr");L=document.createElement("td");L.setAttribute("colspan","2");L.style.paddingTop="2px";L.style.whiteSpace=-"nowrap";L.setAttribute("align","right");b.isOffline()||(t=mxUtils.button(mxResources.get("help"),function(){b.openLink("https://www.drawio.com/doc/faq/shape-complex-create-edit")}),t.className="geBtn",L.appendChild(t));t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});t.className="geBtn";b.editor.cancelFirst&&L.appendChild(t);var c=function(e,k,n){var q=N.value,u=mxUtils.parseXml(q);q=mxUtils.getPrettyXml(u.documentElement);u=u.documentElement.getElementsByTagName("parsererror");+GitHubLibrary||(f=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(t,function(P){if(null!=P){var M=b.getSearch("create title mode url drive splash state clibs ui".split(" "));M+=(0==M.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(P);P=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+M,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(P.container,450,240,!0);P.init()}else t.constructor==DriveLibrary?b.showError(mxResources.get("error"),+mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(t.getId(),t)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),f.className="geBtn",d.appendChild(f));f=mxUtils.button(mxResources.get("export"),function(){var P=b.createLibraryDataFromImages(Q),M=c.value;/(\.xml)$/i.test(M)||(M+=".xml");b.isLocalFileSave()?b.saveLocalFile(P,M,"text/xml",null,null,null!=x?+x:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(M)+"&format=xml&xml="+encodeURIComponent(P))).simulate(document,"_blank")});f.setAttribute("id","btnDownload");f.className="geBtn";d.appendChild(f);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var U=document.createElement("input");U.setAttribute("multiple","multiple");U.setAttribute("type","file");mxEvent.addListener(U,"change",function(P){F=!1;b.importFiles(U.files,0,0,b.maxImageSize,function(M,m,v,z,B,H,T,g,p){null!=+U.files&&(E(P)(M,m,v,z,B,H,T,g,p),U.type="",U.type="file",U.value="")});e.scrollTop=e.scrollHeight});U.style.display="none";document.body.appendChild(U);b.libDlgFileInputElt=U}f=mxUtils.button(mxResources.get("import"),function(){null!=A&&(A(),A=null);b.libDlgFileInputElt.click()});f.setAttribute("id","btnAddImage");f.className="geBtn";d.appendChild(f)}f=mxUtils.button(mxResources.get("addImages"),function(){null!=A&&(A(),A=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(P,M,m){F=+!1;if(null!=P){if("data:image/"==P.substring(0,11)){var v=P.indexOf(",");0<v&&(P=P.substring(0,v)+";base64,"+P.substring(v+1))}K(P,null,0,0,M,m);e.scrollTop=e.scrollHeight}})});f.setAttribute("id","btnAddImageUrl");f.className="geBtn";d.appendChild(f);this.saveBtnClickHandler=function(P,M,m,v){b.saveLibrary(P,M,m,v)};f=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=A&&(A(),A=null);this.saveBtnClickHandler(c.value,Q,t,y)}));f.setAttribute("id","btnSave");f.className="geBtn gePrimaryBtn";+d.appendChild(f);b.editor.cancelFirst||d.appendChild(I);l.appendChild(d);this.container=l},EditShapeDialog=function(b,f,l,d,t){d=null!=d?d:300;t=null!=t?t:120;var y=document.createElement("table"),x=document.createElement("tbody");y.style.cellPadding="4px";var C=document.createElement("tr");var K=document.createElement("td");K.setAttribute("colspan","2");K.style.fontSize="10pt";mxUtils.write(K,l);C.appendChild(K);x.appendChild(C);C=document.createElement("tr");K=document.createElement("td");var N=+document.createElement("textarea");N.style.outline="none";N.style.resize="none";N.style.width=d-200+"px";N.style.height=t+"px";this.textarea=N;this.init=function(){N.focus();N.scrollTop=0};K.appendChild(N);C.appendChild(K);K=document.createElement("td");l=document.createElement("div");l.style.position="relative";l.style.border="1px solid gray";l.style.top="6px";l.style.width="200px";l.style.height=t+4+"px";l.style.overflow="hidden";l.style.marginBottom="16px";mxEvent.disableContextMenu(l);K.appendChild(l);+var O=new Graph(l);O.setEnabled(!1);var Q=b.editor.graph.cloneCell(f);O.addCells([Q]);l=O.view.getState(Q);var I="";null!=l.shape&&null!=l.shape.stencil&&(I=mxUtils.getPrettyXml(l.shape.stencil.desc));mxUtils.write(N,I||"");l=O.getGraphBounds();t=Math.min(160/l.width,(t-40)/l.height);O.view.scaleAndTranslate(t,20/t-l.x,20/t-l.y);C.appendChild(K);x.appendChild(C);C=document.createElement("tr");K=document.createElement("td");K.setAttribute("colspan","2");K.style.paddingTop="2px";K.style.whiteSpace=+"nowrap";K.setAttribute("align","right");b.isOffline()||(t=mxUtils.button(mxResources.get("help"),function(){b.openLink("https://www.drawio.com/doc/faq/shape-complex-create-edit")}),t.className="geBtn",K.appendChild(t));t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});t.className="geBtn";b.editor.cancelFirst&&K.appendChild(t);var c=function(e,k,n){var q=N.value,u=mxUtils.parseXml(q);q=mxUtils.getPrettyXml(u.documentElement);u=u.documentElement.getElementsByTagName("parsererror");if(null!=u&&0<u.length)b.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(n&&b.hideDialog(),u=!e.model.contains(k),!n||u||q!=I){q=Graph.compress(q);e.getModel().beginUpdate();try{if(u){var A=b.editor.graph.getFreeInsertPoint();k.geometry.x=A.x;k.geometry.y=A.y;e.addCell(k)}e.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+q+")",[k])}catch(D){throw D;}finally{e.getModel().endUpdate()}u&&(e.setSelectionCell(k),e.scrollCellToVisible(k))}};-l=mxUtils.button(mxResources.get("preview"),function(){c(O,Q,!1)});l.className="geBtn";L.appendChild(l);l=mxUtils.button(mxResources.get("apply"),function(){c(b.editor.graph,f,!0)});l.className="geBtn gePrimaryBtn";L.appendChild(l);b.editor.cancelFirst||L.appendChild(t);C.appendChild(L);x.appendChild(C);y.appendChild(x);this.container=y},CustomDialog=function(b,f,l,d,t,y,x,C,L,N,O,Q){var I=document.createElement("div");I.appendChild(f);var c=document.createElement("div");c.style.marginTop=null!=Q?-Q:"30px";c.style.textAlign="right";null!=x&&c.appendChild(x);b.isOffline()||null==y||c.appendChild(b.createHelpIcon(y));f=mxUtils.button(L||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d()});f.className="geBtn";C&&(f.style.display="none");b.editor.cancelFirst&&c.appendChild(f);t=mxUtils.button(t||mxResources.get("ok"),mxUtils.bind(this,function(){N||b.hideDialog(null,null,this.container);if(null!=l){var e=l();if("string"===typeof e){b.showError(mxResources.get("error"),e);return}}N&&+l=mxUtils.button(mxResources.get("preview"),function(){c(O,Q,!1)});l.className="geBtn";K.appendChild(l);l=mxUtils.button(mxResources.get("apply"),function(){c(b.editor.graph,f,!0)});l.className="geBtn gePrimaryBtn";K.appendChild(l);b.editor.cancelFirst||K.appendChild(t);C.appendChild(K);x.appendChild(C);y.appendChild(x);this.container=y},CustomDialog=function(b,f,l,d,t,y,x,C,K,N,O,Q){var I=document.createElement("div");I.appendChild(f);var c=document.createElement("div");c.style.marginTop=null!=Q?+Q:"30px";c.style.textAlign="right";null!=x&&c.appendChild(x);b.isOffline()||null==y||c.appendChild(b.createHelpIcon(y));f=mxUtils.button(K||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d()});f.className="geBtn";C&&(f.style.display="none");b.editor.cancelFirst&&c.appendChild(f);t=mxUtils.button(t||mxResources.get("ok"),mxUtils.bind(this,function(){N||b.hideDialog(null,null,this.container);if(null!=l){var e=l();if("string"===typeof e){b.showError(mxResources.get("error"),e);return}}N&&b.hideDialog(null,null,this.container)}));c.appendChild(t);t.className="geBtn gePrimaryBtn";b.editor.cancelFirst||c.appendChild(f);if(null!=O)for(C=0;C<O.length;C++)(function(e,k,n){e=mxUtils.button(e,function(q){k(q)});null!=n&&e.setAttribute("title",n);e.className="geBtn";c.appendChild(e)})(O[C][0],O[C][1],O[C][2]);I.appendChild(c);this.cancelBtn=f;this.okButton=t;this.container=I},BtnDialog=function(b,f,l,d){var t=document.createElement("div");t.style.textAlign="center";var y=document.createElement("p");y.style.fontSize="16pt";y.style.padding="0px";y.style.margin="0px";y.style.color="gray";mxUtils.write(y,mxResources.get("done"));var x="Unknown",C=document.createElement("img");C.setAttribute("border","0");C.setAttribute("align","absmiddle");C.style.marginRight="10px";f==b.drive?(x=mxResources.get("googleDrive"),C.src=IMAGE_PATH+"/google-drive-logo-white.svg"):f==b.dropbox?(x=mxResources.get("dropbox"),C.src=IMAGE_PATH+"/dropbox-logo-white.svg"):f==b.oneDrive?(x=mxResources.get("oneDrive"),C.src=IMAGE_PATH+"/onedrive-logo-white.svg"):f==b.gitHub?(x=mxResources.get("github"),C.src=IMAGE_PATH+"/github-logo-white.svg"):f==b.gitLab?(x=mxResources.get("gitlab"),C.src=IMAGE_PATH+"/gitlab-logo.svg"):f==b.trello&&(x=mxResources.get("trello"),C.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[x],"You are now authorized in {1}"));l=mxUtils.button(l,d);l.insertBefore(C,l.firstChild);l.style.marginTop="6px";l.className="geBigButton";-l.style.fontSize="18px";l.style.padding="14px";t.appendChild(y);t.appendChild(b);t.appendChild(l);this.container=t},FontDialog=function(b,f,l,d,t){function y(A){this.style.border="";13==A.keyCode&&u.click()}var x=document.createElement("table"),C=document.createElement("tbody");x.style.marginTop="8px";var L=document.createElement("tr");var N=document.createElement("td");N.colSpan=2;N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.fontWeight="bold";var O=document.createElement("input");-O.style.cssText="margin-right:8px;margin-bottom:8px;";O.setAttribute("value","sysfonts");O.setAttribute("type","radio");O.setAttribute("name","current-fontdialog");O.setAttribute("id","fontdialog-sysfonts");N.appendChild(O);var Q=document.createElement("label");Q.setAttribute("for","fontdialog-sysfonts");mxUtils.write(Q,mxResources.get("sysFonts",null,"System Fonts"));N.appendChild(Q);L.appendChild(N);C.appendChild(L);L=document.createElement("tr");N=document.createElement("td");N.style.whiteSpace=-"nowrap";N.style.fontSize="10pt";N.style.width="120px";N.style.paddingLeft="15px";mxUtils.write(N,mxResources.get("fontname",null,"Font Name")+":");L.appendChild(N);var I=document.createElement("input");"s"==d&&I.setAttribute("value",f);I.style.marginLeft="4px";I.style.width="250px";I.className="dlg_fontName_s";N=document.createElement("td");N.appendChild(I);L.appendChild(N);C.appendChild(L);L=document.createElement("tr");N=document.createElement("td");N.colSpan=2;N.style.whiteSpace="nowrap";N.style.fontSize=+l.style.fontSize="18px";l.style.padding="14px";t.appendChild(y);t.appendChild(b);t.appendChild(l);this.container=t},FontDialog=function(b,f,l,d,t){function y(A){this.style.border="";13==A.keyCode&&u.click()}var x=document.createElement("table"),C=document.createElement("tbody");x.style.marginTop="8px";var K=document.createElement("tr");var N=document.createElement("td");N.colSpan=2;N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.fontWeight="bold";var O=document.createElement("input");+O.style.cssText="margin-right:8px;margin-bottom:8px;";O.setAttribute("value","sysfonts");O.setAttribute("type","radio");O.setAttribute("name","current-fontdialog");O.setAttribute("id","fontdialog-sysfonts");N.appendChild(O);var Q=document.createElement("label");Q.setAttribute("for","fontdialog-sysfonts");mxUtils.write(Q,mxResources.get("sysFonts",null,"System Fonts"));N.appendChild(Q);K.appendChild(N);C.appendChild(K);K=document.createElement("tr");N=document.createElement("td");N.style.whiteSpace=+"nowrap";N.style.fontSize="10pt";N.style.width="120px";N.style.paddingLeft="15px";mxUtils.write(N,mxResources.get("fontname",null,"Font Name")+":");K.appendChild(N);var I=document.createElement("input");"s"==d&&I.setAttribute("value",f);I.style.marginLeft="4px";I.style.width="250px";I.className="dlg_fontName_s";N=document.createElement("td");N.appendChild(I);K.appendChild(N);C.appendChild(K);K=document.createElement("tr");N=document.createElement("td");N.colSpan=2;N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.fontWeight="bold";var c=document.createElement("input");c.style.cssText="margin-right:8px;margin-bottom:8px;";c.setAttribute("value","googlefonts");c.setAttribute("type","radio");c.setAttribute("name","current-fontdialog");c.setAttribute("id","fontdialog-googlefonts");N.appendChild(c);Q=document.createElement("label");Q.setAttribute("for","fontdialog-googlefonts");mxUtils.write(Q,mxResources.get("googleFonts",null,"Google Fonts"));N.appendChild(Q);if(!b.isOffline()||EditorUi.isElectronApp)Q=-b.createHelpIcon("https://fonts.google.com/"),N.appendChild(Q);L.appendChild(N);"0"!=urlParams.isGoogleFontsEnabled&&C.appendChild(L);L=document.createElement("tr");N=document.createElement("td");N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.width="120px";N.style.paddingLeft="15px";mxUtils.write(N,mxResources.get("fontname",null,"Font Name")+":");L.appendChild(N);var e=document.createElement("input");"g"==d&&e.setAttribute("value",f);e.style.marginLeft="4px";e.style.width="250px";e.className=-"dlg_fontName_g";N=document.createElement("td");N.appendChild(e);L.appendChild(N);"0"!=urlParams.isGoogleFontsEnabled&&C.appendChild(L);L=document.createElement("tr");N=document.createElement("td");N.colSpan=2;N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.fontWeight="bold";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","webfonts");k.setAttribute("type","radio");k.setAttribute("name","current-fontdialog");k.setAttribute("id",-"fontdialog-webfonts");N.appendChild(k);Q=document.createElement("label");Q.setAttribute("for","fontdialog-webfonts");mxUtils.write(Q,mxResources.get("webfonts",null,"Web Fonts"));N.appendChild(Q);L.appendChild(N);Editor.enableWebFonts&&C.appendChild(L);L=document.createElement("tr");N=document.createElement("td");N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.width="120px";N.style.paddingLeft="15px";mxUtils.write(N,mxResources.get("fontname",null,"Font Name")+":");L.appendChild(N);var n=-document.createElement("input");"w"==d&&(Editor.enableWebFonts?n.setAttribute("value",f):I.setAttribute("value",f));n.style.marginLeft="4px";n.style.width="250px";n.className="dlg_fontName_w";N=document.createElement("td");N.appendChild(n);L.appendChild(N);Editor.enableWebFonts&&C.appendChild(L);L=document.createElement("tr");N=document.createElement("td");N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.width="120px";N.style.paddingLeft="15px";mxUtils.write(N,mxResources.get("fontUrl",-null,"Font URL")+":");L.appendChild(N);var q=document.createElement("input");q.setAttribute("value",l||"");q.style.marginLeft="4px";q.style.width="250px";q.className="dlg_fontUrl";N=document.createElement("td");N.appendChild(q);L.appendChild(N);Editor.enableWebFonts&&C.appendChild(L);this.init=function(){var A=I;"g"==d?A=e:"w"==d&&Editor.enableWebFonts&&(A=n);A.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?A.select():document.execCommand("selectAll",!1,null)};L=document.createElement("tr");-N=document.createElement("td");N.colSpan=2;N.style.paddingTop="20px";N.style.whiteSpace="nowrap";N.setAttribute("align","right");b.isOffline()||N.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();t()});f.className="geBtn";b.editor.cancelFirst&&N.appendChild(f);var u=mxUtils.button(mxResources.get("apply"),function(){if(O.checked){var A=I.value;var D="s"}else if(c.checked){A=e.value;var G=Editor.GOOGLE_FONTS+-encodeURIComponent(A).replace(/%20/g,"+");D="g"}else k.checked&&(A=n.value,G=q.value,D="w");var E=A;var U=G,P=D,J=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,m=x.querySelector(".dlg_fontName_"+P);null==m||null!=E&&0!=E.length?(m=x.querySelector(".dlg_fontUrl"),null==m||"w"!=P||J.test(U)?E=!0:(m.style.border="1px solid red",E=!1)):(m.style.border="1px solid red",E=!1);E&&(t(A,G,D),b.hideDialog())});u.className="geBtn gePrimaryBtn";mxEvent.addListener(I,"keypress",+b.createHelpIcon("https://fonts.google.com/"),N.appendChild(Q);K.appendChild(N);"0"!=urlParams.isGoogleFontsEnabled&&C.appendChild(K);K=document.createElement("tr");N=document.createElement("td");N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.width="120px";N.style.paddingLeft="15px";mxUtils.write(N,mxResources.get("fontname",null,"Font Name")+":");K.appendChild(N);var e=document.createElement("input");"g"==d&&e.setAttribute("value",f);e.style.marginLeft="4px";e.style.width="250px";e.className=+"dlg_fontName_g";N=document.createElement("td");N.appendChild(e);K.appendChild(N);"0"!=urlParams.isGoogleFontsEnabled&&C.appendChild(K);K=document.createElement("tr");N=document.createElement("td");N.colSpan=2;N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.fontWeight="bold";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","webfonts");k.setAttribute("type","radio");k.setAttribute("name","current-fontdialog");k.setAttribute("id",+"fontdialog-webfonts");N.appendChild(k);Q=document.createElement("label");Q.setAttribute("for","fontdialog-webfonts");mxUtils.write(Q,mxResources.get("webfonts",null,"Web Fonts"));N.appendChild(Q);K.appendChild(N);Editor.enableWebFonts&&C.appendChild(K);K=document.createElement("tr");N=document.createElement("td");N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.width="120px";N.style.paddingLeft="15px";mxUtils.write(N,mxResources.get("fontname",null,"Font Name")+":");K.appendChild(N);var n=+document.createElement("input");"w"==d&&(Editor.enableWebFonts?n.setAttribute("value",f):I.setAttribute("value",f));n.style.marginLeft="4px";n.style.width="250px";n.className="dlg_fontName_w";N=document.createElement("td");N.appendChild(n);K.appendChild(N);Editor.enableWebFonts&&C.appendChild(K);K=document.createElement("tr");N=document.createElement("td");N.style.whiteSpace="nowrap";N.style.fontSize="10pt";N.style.width="120px";N.style.paddingLeft="15px";mxUtils.write(N,mxResources.get("fontUrl",+null,"Font URL")+":");K.appendChild(N);var q=document.createElement("input");q.setAttribute("value",l||"");q.style.marginLeft="4px";q.style.width="250px";q.className="dlg_fontUrl";N=document.createElement("td");N.appendChild(q);K.appendChild(N);Editor.enableWebFonts&&C.appendChild(K);this.init=function(){var A=I;"g"==d?A=e:"w"==d&&Editor.enableWebFonts&&(A=n);A.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?A.select():document.execCommand("selectAll",!1,null)};K=document.createElement("tr");+N=document.createElement("td");N.colSpan=2;N.style.paddingTop="20px";N.style.whiteSpace="nowrap";N.setAttribute("align","right");b.isOffline()||N.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();t()});f.className="geBtn";b.editor.cancelFirst&&N.appendChild(f);var u=mxUtils.button(mxResources.get("apply"),function(){if(O.checked){var A=I.value;var D="s"}else if(c.checked){A=e.value;var F=Editor.GOOGLE_FONTS++encodeURIComponent(A).replace(/%20/g,"+");D="g"}else k.checked&&(A=n.value,F=q.value,D="w");var E=A;var U=F,P=D,M=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,m=x.querySelector(".dlg_fontName_"+P);null==m||null!=E&&0!=E.length?(m=x.querySelector(".dlg_fontUrl"),null==m||"w"!=P||M.test(U)?E=!0:(m.style.border="1px solid red",E=!1)):(m.style.border="1px solid red",E=!1);E&&(t(A,F,D),b.hideDialog())});u.className="geBtn gePrimaryBtn";mxEvent.addListener(I,"keypress",y);mxEvent.addListener(e,"keypress",y);mxEvent.addListener(n,"keypress",y);mxEvent.addListener(q,"keypress",y);mxEvent.addListener(I,"focus",function(){O.setAttribute("checked","checked");O.checked=!0});mxEvent.addListener(e,"focus",function(){c.setAttribute("checked","checked");c.checked=!0});mxEvent.addListener(n,"focus",function(){k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(q,"focus",function(){k.setAttribute("checked","checked");k.checked=!0});N.appendChild(u);b.editor.cancelFirst||-N.appendChild(f);L.appendChild(N);C.appendChild(L);x.appendChild(C);this.container=x};+N.appendChild(f);K.appendChild(N);C.appendChild(K);x.appendChild(C);this.container=x};function AspectDialog(b,f,l,d,t){this.aspect={pageId:f||(b.pages?b.pages[0].getId():null),layerIds:l||[]};f=document.createElement("div");var y=document.createElement("h5");y.style.margin="0 0 10px";mxUtils.write(y,mxResources.get("pages"));f.appendChild(y);l=document.createElement("div");l.className="geAspectDlgList";f.appendChild(l);y=document.createElement("h5");y.style.margin="0 0 10px";mxUtils.write(y,mxResources.get("layers"));f.appendChild(y);y=document.createElement("div");y.className="geAspectDlgList";f.appendChild(y);this.pagesContainer=l;this.layersContainer=y;this.ui=b;l=document.createElement("div");l.style.marginTop="16px";l.style.textAlign="center";y=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=t&&t()});y.className="geBtn";b.editor.cancelFirst&&l.appendChild(y);var x=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();d({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));l.appendChild(x);x.className="geBtn gePrimaryBtn";b.editor.cancelFirst||l.appendChild(y);x.setAttribute("disabled","disabled");this.okBtn=x;f.appendChild(l);this.container=f}AspectDialog.prototype.init=function(){var b=this.ui.getFileData(!0);if(this.ui.pages)for(b=0;b<this.ui.pages.length;b++){var f=this.ui.updatePageRoot(this.ui.pages[b]);this.createPageItem(f.getId(),f.getName(),f.node)}else this.createPageItem("1","Page-1",mxUtils.parseXml(b).documentElement)};@@ -12628,33 +12628,33 @@ AspectDialog.prototype.createPageItem=function(b,f,l){var d=document.createElemethis.selectedPage=b;d.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var y=t.model;y=y.getChildCells(y.getRoot());for(var x=0;x<y.length;x++)this.createLayerItem(y[x],b,t,l)});mxEvent.addListener(d,"click",f);this.aspect.pageId==b&&f()};AspectDialog.prototype.createLayerItem=function(b,f,l,d){f=l.convertValueToString(b)||mxResources.get("background")||"Background";var t=document.createElement("div");t.setAttribute("data-layer-id",b.id);t.className="geAspectDlgListItem";t.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(f)+"</div>";this.layersContainer.appendChild(t);this.createViewer(t.childNodes[0],d,b.id);d=mxUtils.bind(this,function(){0<=t.className.indexOf("geAspectDlgListItemSelected")?(t.className="geAspectDlgListItem",delete this.selectedLayers[b.id],mxUtils.isEmptyObject(this.selectedLayers)&&this.okBtn.setAttribute("disabled","disabled")):(t.className+=" geAspectDlgListItemSelected",this.selectedLayers[b.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(t,"click",d);-1!=this.aspect.layerIds.indexOf(b.id)&&d()};-var FilePropertiesDialog=function(b,f){function l(D){var G=N;N=function(E,U){try{D(function(){G(E,U)},U)}catch(P){U(P)}}}var d=document.createElement("table"),t=document.createElement("tbody");d.style.width="100%";d.style.marginTop="8px";d.style.tableLayout="fixed";var y=b.getCurrentFile(),x=null!=y&&null!=y.getTitle()?y.getTitle():b.defaultFilename,C=/(\.png)$/i.test(x),L=/(\.svg)$/i.test(x),N=function(D,G){D()},O=null!=y?y.isLocked():!1;var Q=document.createElement("tr");var I=document.createElement("td");-I.style.whiteSpace="nowrap";I.style.overflow="hidden";I.style.textOverflow="ellipsis";I.style.fontSize="10pt";mxUtils.write(I,mxResources.get("locked")+":");Q.appendChild(I);var c=document.createElement("input");c.setAttribute("type","checkbox");O&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);I=document.createElement("td");I.style.whiteSpace="nowrap";I.appendChild(c);Q.appendChild(I);t.appendChild(Q);this.init=function(){c.focus()};l(function(D,G){null!=b.fileNode&&O!=c.checked?window.setTimeout(function(){null!=-y&&y.setLocked(c.checked);D()},0):D()});if(C||L){x=1;C=0;Q=b.fileNode;null!=Q&&(Q.hasAttribute("scale")&&(x=parseFloat(Q.getAttribute("scale"))),Q.hasAttribute("border")&&(C=parseInt(Q.getAttribute("border"))));Q=document.createElement("tr");I=document.createElement("td");I.style.whiteSpace="nowrap";I.style.fontSize="10pt";mxUtils.write(I,mxResources.get("zoom")+":");Q.appendChild(I);var e=document.createElement("input");e.setAttribute("value",100*x+"%");e.style.marginLeft="4px";e.style.width="100%";+var FilePropertiesDialog=function(b,f){function l(D){var F=N;N=function(E,U){try{D(function(){F(E,U)},U)}catch(P){U(P)}}}var d=document.createElement("table"),t=document.createElement("tbody");d.style.width="100%";d.style.marginTop="8px";d.style.tableLayout="fixed";var y=b.getCurrentFile(),x=null!=y&&null!=y.getTitle()?y.getTitle():b.defaultFilename,C=/(\.png)$/i.test(x),K=/(\.svg)$/i.test(x),N=function(D,F){D()},O=null!=y?y.isLocked():!1;var Q=document.createElement("tr");var I=document.createElement("td");+I.style.whiteSpace="nowrap";I.style.overflow="hidden";I.style.textOverflow="ellipsis";I.style.fontSize="10pt";mxUtils.write(I,mxResources.get("locked")+":");Q.appendChild(I);var c=document.createElement("input");c.setAttribute("type","checkbox");O&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);I=document.createElement("td");I.style.whiteSpace="nowrap";I.appendChild(c);Q.appendChild(I);t.appendChild(Q);this.init=function(){c.focus()};l(function(D,F){null!=b.fileNode&&O!=c.checked?window.setTimeout(function(){null!=+y&&y.setLocked(c.checked);D()},0):D()});if(C||K){x=1;C=0;Q=b.fileNode;null!=Q&&(Q.hasAttribute("scale")&&(x=parseFloat(Q.getAttribute("scale"))),Q.hasAttribute("border")&&(C=parseInt(Q.getAttribute("border"))));Q=document.createElement("tr");I=document.createElement("td");I.style.whiteSpace="nowrap";I.style.fontSize="10pt";mxUtils.write(I,mxResources.get("zoom")+":");Q.appendChild(I);var e=document.createElement("input");e.setAttribute("value",100*x+"%");e.style.marginLeft="4px";e.style.width="100%";I=document.createElement("td");I.style.whiteSpace="nowrap";I.appendChild(e);Q.appendChild(I);t.appendChild(Q);Q=document.createElement("tr");I=document.createElement("td");I.style.whiteSpace="nowrap";I.style.fontSize="10pt";mxUtils.write(I,mxResources.get("borderWidth")+":");Q.appendChild(I);var k=document.createElement("input");k.setAttribute("value",C);k.style.marginLeft="4px";k.style.width="100%";I=document.createElement("td");I.style.whiteSpace="nowrap";I.appendChild(k);Q.appendChild(I);t.appendChild(Q);-this.init=this.init||function(){e.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?e.select():document.execCommand("selectAll",!1,null)};l(function(D,G){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(e.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(k.value))),null!=y&&y.fileChanged());D()})}else if(!/(\.html)$/i.test(x)&&!/(\.svg)$/i.test(x)){var n=null!=y?y.isCompressed():Editor.defaultCompressed;Q=document.createElement("tr");I=document.createElement("td");-I.style.whiteSpace="nowrap";I.style.overflow="hidden";I.style.textOverflow="ellipsis";I.style.fontSize="10pt";mxUtils.write(I,mxResources.get("compressed")+":");Q.appendChild(I);var q=document.createElement("input");q.setAttribute("type","checkbox");n&&(q.setAttribute("checked","checked"),q.defaultChecked=!0);I=document.createElement("td");I.style.whiteSpace="nowrap";I.appendChild(q);Q.appendChild(I);t.appendChild(Q);this.init=this.init||function(){q.focus()};l(function(D,G){null!=b.fileNode&&n!=+this.init=this.init||function(){e.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?e.select():document.execCommand("selectAll",!1,null)};l(function(D,F){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(e.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(k.value))),null!=y&&y.fileChanged());D()})}else if(!/(\.html)$/i.test(x)&&!/(\.svg)$/i.test(x)){var n=null!=y?y.isCompressed():Editor.defaultCompressed;Q=document.createElement("tr");I=document.createElement("td");+I.style.whiteSpace="nowrap";I.style.overflow="hidden";I.style.textOverflow="ellipsis";I.style.fontSize="10pt";mxUtils.write(I,mxResources.get("compressed")+":");Q.appendChild(I);var q=document.createElement("input");q.setAttribute("type","checkbox");n&&(q.setAttribute("checked","checked"),q.defaultChecked=!0);I=document.createElement("td");I.style.whiteSpace="nowrap";I.appendChild(q);Q.appendChild(I);t.appendChild(Q);this.init=this.init||function(){q.focus()};l(function(D,F){null!=b.fileNode&&n!=q.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",q.checked?"true":"false");null!=y&&(y.compressionChanged(q.checked),y.fileChanged());D()},0):D()})}if(null!=y&&y.isRealtimeOptional()){Q=document.createElement("tr");I=document.createElement("td");I.style.whiteSpace="nowrap";I.style.overflow="hidden";I.style.textOverflow="ellipsis";I.style.fontSize="10pt";mxUtils.write(I,mxResources.get("realtimeCollaboration")+":");Q.appendChild(I);var u=document.createElement("input");u.setAttribute("type",-"checkbox");var A=y.isRealtimeEnabled();if(A="disabled"!=b.drive.getCustomProperty(y.desc,"collaboration"))u.setAttribute("checked","checked"),u.defaultChecked=!0;l(function(D,G){u.checked!=A?y.setRealtimeEnabled(u.checked,D,G):D()});this.init=null!=this.init?this.init:function(){u.focus()};I=document.createElement("td");I.style.whiteSpace="nowrap";I.appendChild(u);I.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));Q.appendChild(I);t.appendChild(Q)}null!=y&&+"checkbox");var A=y.isRealtimeEnabled();if(A="disabled"!=b.drive.getCustomProperty(y.desc,"collaboration"))u.setAttribute("checked","checked"),u.defaultChecked=!0;l(function(D,F){u.checked!=A?y.setRealtimeEnabled(u.checked,D,F):D()});this.init=null!=this.init?this.init:function(){u.focus()};I=document.createElement("td");I.style.whiteSpace="nowrap";I.appendChild(u);I.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));Q.appendChild(I);t.appendChild(Q)}null!=y&&"draw.io"==b.getServiceName()&&0<y.getSize()&&"1"!=urlParams.embed&&(Q=document.createElement("tr"),I=document.createElement("td"),I.style.whiteSpace="nowrap",I.style.overflow="hidden",I.style.textOverflow="ellipsis",I.style.fontSize="10pt",mxUtils.write(I,mxResources.get("size")+":"),Q.appendChild(I),I=b.formatFileSize(y.getSize()),x=document.createElement("input"),x.setAttribute("title",I),x.setAttribute("value",I),x.setAttribute("disabled","disabled"),x.style.marginLeft="4px",x.style.width="100%",I=document.createElement("td"),I.style.whiteSpace="nowrap",I.appendChild(x),Q.appendChild(I),t.appendChild(Q));null!=f&&(Q=document.createElement("tr"),I=document.createElement("td"),I.style.whiteSpace="nowrap",I.style.overflow="hidden",I.style.textOverflow="ellipsis",I.style.fontSize="10pt",mxUtils.write(I,mxResources.get("publicDiagramUrl")+":"),Q.appendChild(I),x=document.createElement("a"),x.setAttribute("href",f),x.setAttribute("title",f),x.style.whiteSpace="nowrap",x.style.overflow="hidden",x.style.textOverflow="ellipsis",x.style.display="block",x.style.margin="2px 0px 2px 8px",x.style.fontSize="10pt",mxUtils.write(x,f),mxEvent.addListener(x,"click",function(D){b.openLink(f);mxEvent.consume(D)}),I=document.createElement("td"),I.appendChild(x),Q.appendChild(I),t.appendChild(Q));null!=y&&null!=y.fileObject&&null!=y.fileObject.path&&(Q=document.createElement("tr"),I=document.createElement("td"),I.style.whiteSpace="nowrap",I.style.overflow="hidden",I.style.textOverflow="ellipsis",I.style.fontSize="10pt",mxUtils.write(I,mxResources.get("pathFilename")+":"),Q.appendChild(I),x=document.createElement("input"),x.setAttribute("title",y.fileObject.path),x.setAttribute("value",y.fileObject.path),x.setAttribute("disabled","disabled"),x.style.marginLeft="4px",x.style.width="100%",I=document.createElement("td"),I.appendChild(x),Q.appendChild(I),t.appendChild(Q));this.init=null!=this.init?this.init:function(){};x=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&N(function(){b.spinner.stop();b.hideDialog()},function(D){b.spinner.stop();b.handleError(D,mxResources.get("error"))})});x.className="geBtn gePrimaryBtn";Q=document.createElement("tr");I=document.createElement("td");I.colSpan=2;I.style.paddingTop="20px";I.style.whiteSpace="nowrap";I.setAttribute("align","right");C=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});C.className="geBtn";b.editor.cancelFirst&&I.appendChild(C);I.appendChild(x);b.editor.cancelFirst||I.appendChild(C);Q.appendChild(I);t.appendChild(Q);d.appendChild(t);this.container=d},ConnectionPointsDialog=function(b,f){function l(){null!=t&&t.destroy()}var d=document.createElement("div");d.style.userSelect="none";var t=null;this.init=function(){function y(z,B,H){z=new mxCell("",new mxGeometry(z,B,6,6),"shape=mxgraph.basic.x;fillColor=#29b6f2;strokeColor=#29b6f2;points=[];rotatable=0;resizable=0;connectable=0;editable=0;");z.vertex=!0;z.cp=!0;z.constObj=H;return Q.addCell(z)}function x(z){z=Q.getSelectionCells();Q.deleteCells(z)}-function C(){var z=parseInt(P.value)||0;z=0>z?0:100<z?100:z;P.value=z;var B=parseInt(m.value)||0;B=0>B?0:100<B?100:B;m.value=B;var H=parseInt(J.value)||0,T=parseInt(v.value)||0;H=new mxConnectionConstraint(new mxPoint(z/100,B/100),!1,null,H,T);z=Q.getConnectionPoint(e,H);B=Q.getSelectionCell();if(null!=B){B.constObj=H;H=B.geometry.clone();T=Q.view.scale;var g=Q.view.translate;H.x=(z.x-3*T)/T-g.x;H.y=(z.y-3*T)/T-g.y;Q.model.setGeometry(B,H)}}function L(z){if(z.constObj)return{x:z.constObj.point.x,-y:z.constObj.point.y,dx:z.constObj.dx,dy:z.constObj.dy};var B=0,H=0,T=I.geometry,g=mxUtils.format((z.geometry.x+3-T.x)/T.width);z=mxUtils.format((z.geometry.y+3-T.y)/T.height);0>g?(B=g*T.width,g=0):1<g&&(B=(g-1)*T.width,g=1);0>z?(H=z*T.height,z=0):1<z&&(H=(z-1)*T.height,z=1);return{x:g,y:z,dx:parseInt(B),dy:parseInt(H)}}function N(z){if(1==Q.getSelectionCount()){var B=Q.getSelectionCell();z&&(B.constObj=null);z=L(B);P.value=100*z.x;m.value=100*z.y;J.value=z.dx;v.value=z.dy;U.style.visibility=""}else U.style.visibility=+function C(){var z=parseInt(P.value)||0;z=0>z?0:100<z?100:z;P.value=z;var B=parseInt(m.value)||0;B=0>B?0:100<B?100:B;m.value=B;var H=parseInt(M.value)||0,T=parseInt(v.value)||0;H=new mxConnectionConstraint(new mxPoint(z/100,B/100),!1,null,H,T);z=Q.getConnectionPoint(e,H);B=Q.getSelectionCell();if(null!=B){B.constObj=H;H=B.geometry.clone();T=Q.view.scale;var g=Q.view.translate;H.x=(z.x-3*T)/T-g.x;H.y=(z.y-3*T)/T-g.y;Q.model.setGeometry(B,H)}}function K(z){if(z.constObj)return{x:z.constObj.point.x,+y:z.constObj.point.y,dx:z.constObj.dx,dy:z.constObj.dy};var B=0,H=0,T=I.geometry,g=mxUtils.format((z.geometry.x+3-T.x)/T.width);z=mxUtils.format((z.geometry.y+3-T.y)/T.height);0>g?(B=g*T.width,g=0):1<g&&(B=(g-1)*T.width,g=1);0>z?(H=z*T.height,z=0):1<z&&(H=(z-1)*T.height,z=1);return{x:g,y:z,dx:parseInt(B),dy:parseInt(H)}}function N(z){if(1==Q.getSelectionCount()){var B=Q.getSelectionCell();z&&(B.constObj=null);z=K(B);P.value=100*z.x;m.value=100*z.y;M.value=z.dx;v.value=z.dy;U.style.visibility=""}else U.style.visibility="hidden"}var O=document.createElement("div");O.style.width="350px";O.style.height="350px";O.style.overflow="hidden";O.style.border="1px solid lightGray";O.style.boxSizing="border-box";mxEvent.disableContextMenu(O);d.appendChild(O);var Q=new Graph(O);Q.transparentBackground=!1;Q.autoExtend=!1;Q.autoScroll=!1;Q.setGridEnabled(!1);Q.setEnabled(!0);Q.setPanning(!0);Q.setConnectable(!1);Q.setTooltips(!1);Q.minFitScale=null;Q.maxFitScale=null;Q.centerZoom=!0;Q.maxFitScale=2;O=f.geometry;var I=new mxCell(f.value,new mxGeometry(0,0,O.width,O.height),f.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;fillColor=none;");I.vertex=!0;Q.addCell(I);Q.dblClick=function(z,B){if(null!=B&&B!=I)Q.setSelectionCell(B);else{B=mxUtils.convertPoint(Q.container,mxEvent.getClientX(z),mxEvent.getClientY(z));mxEvent.consume(z);z=Q.view.scale;var H=Q.view.translate;Q.setSelectionCell(y((B.x-3*z)/z-H.x,(B.y-3*z)/z-H.y))}};t=new mxKeyHandler(Q);t.bindKey(46,x);t.bindKey(8,x);Q.getRubberband().isForceRubberbandEvent=function(z){return 0==z.evt.button&&(null==z.getCell()||z.getCell()==I)};Q.panningHandler.isForcePanningEvent=function(z){return 2==z.evt.button};var c=Q.isCellSelectable;Q.isCellSelectable=function(z){return z==I?!1:c.apply(this,arguments)};Q.getLinkForCell=function(){return null};var e=Q.view.getState(I);O=Q.getAllConnectionConstraints(e);for(var k=0;null!=O&&k<O.length;k++){var n=Q.getConnectionPoint(e,O[k]);y(n.x-3,n.y-3,O[k])}Q.fit(8);Q.center();k=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){Q.zoomIn()},20);n=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){Q.zoomOut()},20);var q=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==Q.view.scale?(Q.maxFitScale=8,Q.fit(8)):Q.zoomActual();Q.center()},20),u=function(){b.prompt(mxResources.get("gridSize"),Q.gridSize,function(z){!isNaN(z)&&0<z&&(Q.setGridSize(z),Q.setGridEnabled(!0),Q.refresh())})},A=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(z){mxEvent.isShiftDown(z)?-u():(Q.setGridEnabled(!Q.isGridEnabled()),Q.refresh())},20);mxEvent.addListener(A,"dblclick",u);var D=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),x,20);mxUtils.setOpacity(D,10);O=document.createElement("div");O.style.display="flex";O.style.alignItems="center";O.style.paddingTop="6px";O.appendChild(k);O.appendChild(n);O.appendChild(q);O.appendChild(A);O.appendChild(D);d.appendChild(O);var G=document.createElement("input");G.setAttribute("type","number");G.setAttribute("min","1");-G.setAttribute("value","1");G.style.width="45px";G.style.position="relative";G.style.margin="0 4px 0 4px";var E=document.createElement("select");E.style.position="relative";n=["left","right","top","bottom"];for(k=0;k<n.length;k++)q=n[k],A=document.createElement("option"),mxUtils.write(A,mxResources.get(q)),A.value=q,E.appendChild(A);k=mxUtils.button(mxResources.get("add"),function(){var z=parseInt(G.value);z=1>z?1:100<z?100:z;G.value=z;for(var B=E.value,H=I.geometry,T=[],g=0;g<z;g++){switch(B){case "left":var p=-H.x;var F=H.y+(g+1)*H.height/(z+1);break;case "right":p=H.x+H.width;F=H.y+(g+1)*H.height/(z+1);break;case "top":p=H.x+(g+1)*H.width/(z+1);F=H.y;break;case "bottom":p=H.x+(g+1)*H.width/(z+1),F=H.y+H.height}T.push(y(p-3,F-3))}Q.setSelectionCells(T)});k.style.marginLeft="auto";O.appendChild(k);O.appendChild(G);O.appendChild(E);var U=document.createElement("div");U.style.margin="4px 0px 8px 0px";U.style.whiteSpace="nowrap";U.style.height="24px";O=document.createElement("span");mxUtils.write(O,mxResources.get("dx"));-U.appendChild(O);var P=document.createElement("input");P.setAttribute("type","number");P.setAttribute("min","0");P.setAttribute("max","100");P.style.width="45px";P.style.margin="0 4px 0 4px";U.appendChild(P);mxUtils.write(U,"%");var J=document.createElement("input");J.setAttribute("type","number");J.style.width="45px";J.style.margin="0 4px 0 4px";U.appendChild(J);mxUtils.write(U,"pt");O=document.createElement("span");mxUtils.write(O,mxResources.get("dy"));O.style.marginLeft="12px";U.appendChild(O);+u():(Q.setGridEnabled(!Q.isGridEnabled()),Q.refresh())},20);mxEvent.addListener(A,"dblclick",u);var D=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),x,20);mxUtils.setOpacity(D,10);O=document.createElement("div");O.style.display="flex";O.style.alignItems="center";O.style.paddingTop="6px";O.appendChild(k);O.appendChild(n);O.appendChild(q);O.appendChild(A);O.appendChild(D);d.appendChild(O);var F=document.createElement("input");F.setAttribute("type","number");F.setAttribute("min","1");+F.setAttribute("value","1");F.style.width="45px";F.style.position="relative";F.style.margin="0 4px 0 4px";var E=document.createElement("select");E.style.position="relative";n=["left","right","top","bottom"];for(k=0;k<n.length;k++)q=n[k],A=document.createElement("option"),mxUtils.write(A,mxResources.get(q)),A.value=q,E.appendChild(A);k=mxUtils.button(mxResources.get("add"),function(){var z=parseInt(F.value);z=1>z?1:100<z?100:z;F.value=z;for(var B=E.value,H=I.geometry,T=[],g=0;g<z;g++){switch(B){case "left":var p=+H.x;var G=H.y+(g+1)*H.height/(z+1);break;case "right":p=H.x+H.width;G=H.y+(g+1)*H.height/(z+1);break;case "top":p=H.x+(g+1)*H.width/(z+1);G=H.y;break;case "bottom":p=H.x+(g+1)*H.width/(z+1),G=H.y+H.height}T.push(y(p-3,G-3))}Q.setSelectionCells(T)});k.style.marginLeft="auto";O.appendChild(k);O.appendChild(F);O.appendChild(E);var U=document.createElement("div");U.style.margin="4px 0px 8px 0px";U.style.whiteSpace="nowrap";U.style.height="24px";O=document.createElement("span");mxUtils.write(O,mxResources.get("dx"));+U.appendChild(O);var P=document.createElement("input");P.setAttribute("type","number");P.setAttribute("min","0");P.setAttribute("max","100");P.style.width="45px";P.style.margin="0 4px 0 4px";U.appendChild(P);mxUtils.write(U,"%");var M=document.createElement("input");M.setAttribute("type","number");M.style.width="45px";M.style.margin="0 4px 0 4px";U.appendChild(M);mxUtils.write(U,"pt");O=document.createElement("span");mxUtils.write(O,mxResources.get("dy"));O.style.marginLeft="12px";U.appendChild(O);var m=document.createElement("input");m.setAttribute("type","number");m.setAttribute("min","0");m.setAttribute("max","100");m.style.width="45px";m.style.margin="0 4px 0 4px";U.appendChild(m);mxUtils.write(U,"%");var v=document.createElement("input");v.setAttribute("type","number");v.style.width="45px";v.style.margin="0 4px 0 4px";U.appendChild(v);mxUtils.write(U,"pt");d.appendChild(U);N();Q.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<Q.getSelectionCount()?mxUtils.setOpacity(D,60):-mxUtils.setOpacity(D,10);N()});Q.addListener(mxEvent.CELLS_MOVED,N);mxEvent.addListener(P,"change",C);mxEvent.addListener(m,"change",C);mxEvent.addListener(J,"change",C);mxEvent.addListener(v,"change",C);O=mxUtils.button(mxResources.get("cancel"),function(){l();b.hideDialog()});O.className="geBtn";k=mxUtils.button(mxResources.get("apply"),function(){var z=Q.model.cells,B=[],H=[],T;for(T in z){var g=z[T];g.cp&&H.push(L(g))}H.sort(function(p,F){return p.x!=F.x?p.x-F.x:p.y!=F.y?p.y-F.y:p.dx!=F.dx?p.dx--F.dx:p.dy-F.dy});for(z=0;z<H.length;z++)0<z&&H[z].x==H[z-1].x&&H[z].y==H[z-1].y&&H[z].dx==H[z-1].dx&&H[z].dy==H[z-1].dy||B.push("["+H[z].x+","+H[z].y+",0,"+H[z].dx+","+H[z].dy+"]");b.editor.graph.setCellStyles("points","["+B.join(",")+"]",[f]);l();b.hideDialog()});k.className="geBtn gePrimaryBtn";n=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[f]);l();b.hideDialog()});n.className="geBtn";q=document.createElement("div");q.style.marginTop="10px";q.style.textAlign=+mxUtils.setOpacity(D,10);N()});Q.addListener(mxEvent.CELLS_MOVED,N);mxEvent.addListener(P,"change",C);mxEvent.addListener(m,"change",C);mxEvent.addListener(M,"change",C);mxEvent.addListener(v,"change",C);O=mxUtils.button(mxResources.get("cancel"),function(){l();b.hideDialog()});O.className="geBtn";k=mxUtils.button(mxResources.get("apply"),function(){var z=Q.model.cells,B=[],H=[],T;for(T in z){var g=z[T];g.cp&&H.push(K(g))}H.sort(function(p,G){return p.x!=G.x?p.x-G.x:p.y!=G.y?p.y-G.y:p.dx!=G.dx?p.dx-+G.dx:p.dy-G.dy});for(z=0;z<H.length;z++)0<z&&H[z].x==H[z-1].x&&H[z].y==H[z-1].y&&H[z].dx==H[z-1].dx&&H[z].dy==H[z-1].dy||B.push("["+H[z].x+","+H[z].y+",0,"+H[z].dx+","+H[z].dy+"]");b.editor.graph.setCellStyles("points","["+B.join(",")+"]",[f]);l();b.hideDialog()});k.className="geBtn gePrimaryBtn";n=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[f]);l();b.hideDialog()});n.className="geBtn";q=document.createElement("div");q.style.marginTop="10px";q.style.textAlign="right";b.isOffline()||q.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&q.appendChild(O);q.appendChild(n);q.appendChild(k);b.editor.cancelFirst||q.appendChild(O);d.appendChild(q)};this.destroy=l;this.container=d};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinCommentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEyLjUgMjcuNWgyM3YtMi4yNWgtMjNabTAtNi4zNWgyM3YtMi4zaC0yM1ptMC02LjRoMjNWMTIuNWgtMjNaTTQzIDQyLjEgMzUuOSAzNWgtMjhxLTEuMTUgMC0yLjAyNS0uODc1VDUgMzIuMVY3LjlxMC0xLjE1Ljg3NS0yLjAyNVQ3LjkgNWgzMi4ycTEuMiAwIDIuMDUuODc1UTQzIDYuNzUgNDMgNy45Wk03LjI1IDcuOXYyNC44NUgzNi45bDMuODUgMy44NVY3LjlxMC0uMy0uMTc1LS40NzVUNDAuMSA3LjI1SDcuOXEtLjMgMC0uNDc1LjE3NVQ3LjI1IDcuOVptMCAwdjI4LjdWNy4yNSA3LjlaIi8+PC9zdmc+";Editor.thinDesignImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";@@ -12726,16 +12726,16 @@ type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"floatdispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(g,p){return p.editorUi.editor.graph.isCellConnectable(0<g.vertices.length&&0==g.edges.length?g.vertices[0]:null)},isVisible:function(g,p){return 0<g.vertices.length&&0==g.edges.length}},{name:"allowArrows",dispName:"Allow Arrows",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"perimeter",dispName:"Perimeter",defVal:"none",type:"enum",enumList:[{val:"none",dispName:"None"},{val:"rectanglePerimeter",dispName:"Rectangle"},{val:"ellipsePerimeter",dispName:"Ellipse"},{val:"rhombusPerimeter",dispName:"Rhombus"},{val:"trianglePerimeter",dispName:"Triangle"},{val:"hexagonPerimeter2",dispName:"Hexagon"},{val:"lifelinePerimeter",dispName:"Lifeline"},{val:"orthogonalPerimeter",dispName:"Orthogonal"},{val:"backbonePerimeter",dispName:"Backbone"},{val:"calloutPerimeter",dispName:"Callout"},{val:"parallelogramPerimeter",dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},{val:"stepPerimeter",dispName:"Step"},{val:"centerPerimeter",dispName:"Center"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",getDefaultValue:function(g,p){g=1==g.vertices.length&&0==g.edges.length?g.vertices[0]:null;p=p.editorUi.editor.graph;return null!=g&&p.isSwimlane(g)},isVisible:function(g,p){return 1==g.vertices.length&&-0==g.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(g,p){g=1==g.vertices.length&&0==g.edges.length?g.vertices[0]:null;p=p.editorUi.editor.graph;return null!=g&&(p.isSwimlane(g)||0<p.model.getChildCount(g))},isVisible:function(g,p){return 1==g.vertices.length&&0==g.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(g,p){var F=1==g.vertices.length&&0==g.edges.length?g.vertices[0]:null;p=p.editorUi.editor.graph;-return null!=F&&(p.isContainer(F)&&"0"!=g.style.collapsible||!p.isContainer(F)&&"1"==g.style.collapsible)},isVisible:function(g,p){return 1==g.vertices.length&&0==g.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(g,p){return 1==g.vertices.length&&0==g.edges.length&&!p.editorUi.editor.graph.isSwimlane(g.vertices[0])&&null==mxUtils.getValue(g.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",+0==g.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(g,p){g=1==g.vertices.length&&0==g.edges.length?g.vertices[0]:null;p=p.editorUi.editor.graph;return null!=g&&(p.isSwimlane(g)||0<p.model.getChildCount(g))},isVisible:function(g,p){return 1==g.vertices.length&&0==g.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(g,p){var G=1==g.vertices.length&&0==g.edges.length?g.vertices[0]:null;p=p.editorUi.editor.graph;+return null!=G&&(p.isContainer(G)&&"0"!=g.style.collapsible||!p.isContainer(G)&&"1"==g.style.collapsible)},isVisible:function(g,p){return 1==g.vertices.length&&0==g.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(g,p){return 1==g.vertices.length&&0==g.edges.length&&!p.editorUi.editor.graph.isSwimlane(g.vertices[0])&&null==mxUtils.getValue(g.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(g,p){p=p.editorUi.editor.graph.model;return 0<g.vertices.length?p.isVertex(p.getParent(g.vertices[0])):!1}},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"movableLabel",dispName:"Movable Label",type:"bool",defVal:!1,isVisible:function(g,p){g=0<g.vertices.length?p.editorUi.editor.graph.getCellGeometry(g.vertices[0]):null;return null!=g&&!g.relative}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"autosizeGrid",dispName:"Autosize Grid",type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"1",dispName:"Enabled"},{val:"0",dispName:"Disabled"}],isVisible:function(g,p){return 0<g.vertices.length&&p.editorUi.editor.graph.isAutoSizeCell(g.vertices[0])}},{name:"fixedWidth",dispName:"Fixed Width",type:"bool",defVal:!1},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",-type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(g,p){var F=mxUtils.getValue(g.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||p.editorUi.editor.graph.isSwimlane(g.vertices[0])||null==F||F==mxConstants.NONE||0==mxUtils.getValue(g.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(g.style,mxConstants.STYLE_OPACITY,100)||null!=g.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",+type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(g,p){var G=mxUtils.getValue(g.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||p.editorUi.editor.graph.isSwimlane(g.vertices[0])||null==G||G==mxConstants.NONE||0==mxUtils.getValue(g.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(g.style,mxConstants.STYLE_OPACITY,100)||null!=g.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",type:"bool",defVal:!1,isVisible:function(g,p){return 0<g.vertices.length&&p.editorUi.editor.graph.isContainer(g.vertices[0])}}].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart or a JSON string as used in\n## Layout, Apply. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.createRoughCanvas=function(g){var p=rough.canvas({getContext:function(){return g}});p.draw=function(F){var K=F.sets||[];F=F.options||this.getDefaultOptions();for(var M=0;M<K.length;M++){var R=K[M];switch(R.type){case "path":null!=F.stroke&&this._drawToContext(g,R,F);break;case "fillPath":this._drawToContext(g,R,F);break;case "fillSketch":this.fillSketch(g,R,F)}}};p.fillSketch=function(F,K,M){var R=g.state.strokeColor,S=g.state.strokeWidth,V=g.state.strokeAlpha,W=g.state.dashed,X=M.fillWeight;-0>X&&(X=M.strokeWidth/2);g.setStrokeAlpha(g.state.fillAlpha);g.setStrokeColor(M.fill||"");g.setStrokeWidth(X);g.setDashed(!1);this._drawToContext(F,K,M);g.setDashed(W);g.setStrokeWidth(S);g.setStrokeColor(R);g.setStrokeAlpha(V)};p._drawToContext=function(F,K,M){F.begin();for(var R=0;R<K.ops.length;R++){var S=K.ops[R],V=S.data;switch(S.op){case "move":F.moveTo(V[0],V[1]);break;case "bcurveTo":F.curveTo(V[0],V[1],V[2],V[3],V[4],V[5]);break;case "lineTo":F.lineTo(V[0],V[1])}}F.end();"fillPath"===K.type&&-M.filled?F.fill():F.stroke()};return p};(function(){function g(R,S,V){this.canvas=R;this.rc=S;this.shape=V;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,g.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,g.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,g.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=+Editor.createRoughCanvas=function(g){var p=rough.canvas({getContext:function(){return g}});p.draw=function(G){var J=G.sets||[];G=G.options||this.getDefaultOptions();for(var L=0;L<J.length;L++){var R=J[L];switch(R.type){case "path":null!=G.stroke&&this._drawToContext(g,R,G);break;case "fillPath":this._drawToContext(g,R,G);break;case "fillSketch":this.fillSketch(g,R,G)}}};p.fillSketch=function(G,J,L){var R=g.state.strokeColor,S=g.state.strokeWidth,V=g.state.strokeAlpha,W=g.state.dashed,X=L.fillWeight;+0>X&&(X=L.strokeWidth/2);g.setStrokeAlpha(g.state.fillAlpha);g.setStrokeColor(L.fill||"");g.setStrokeWidth(X);g.setDashed(!1);this._drawToContext(G,J,L);g.setDashed(W);g.setStrokeWidth(S);g.setStrokeColor(R);g.setStrokeAlpha(V)};p._drawToContext=function(G,J,L){G.begin();for(var R=0;R<J.ops.length;R++){var S=J.ops[R],V=S.data;switch(S.op){case "move":G.moveTo(V[0],V[1]);break;case "bcurveTo":G.curveTo(V[0],V[1],V[2],V[3],V[4],V[5]);break;case "lineTo":G.lineTo(V[0],V[1])}}G.end();"fillPath"===J.type&&+L.filled?G.fill():G.stroke()};return p};(function(){function g(R,S,V){this.canvas=R;this.rc=S;this.shape=V;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,g.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,g.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,g.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,g.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,g.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,g.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,g.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,g.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,g.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,g.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,g.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,g.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,g.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,g.prototype.fillAndStroke);this.path=[];this.passThrough=!1}g.prototype.moveOp="M";g.prototype.lineOp="L";g.prototype.quadOp="Q";g.prototype.curveOp="C";g.prototype.closeOp="Z";g.prototype.getStyle=function(R,S){var V=1;if(null!=this.shape.state){var W=this.shape.state.cell.id;if(null!=W)for(var X=0;X<W.length;X++)V=(V<<5)-V+W.charCodeAt(X)<<0}V={strokeWidth:this.canvas.state.strokeWidth,seed:V,preserveVertices:!0};W=this.rc.getDefaultOptions();V.stroke=R?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:@@ -12744,82 +12744,82 @@ W.roughness);V.simplification=mxUtils.getValue(this.shape.style,"simplification"S);V.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",S);S=mxUtils.getValue(this.shape.style,"fillWeight",-1);V.fillWeight="auto"==S?-1:S;S=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==S&&(S="auto");"auto"==S&&(S=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&S.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&S.push(mxUtils.hex2rgb(Editor.darkColor)),S=null!=V.fill&&(null!=R||0<=mxUtils.indexOf(S,mxUtils.hex2rgb(V.fill)))?"solid":W.fillStyle);V.fillStyle=S;return V};g.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};g.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};g.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var R=2;R<arguments.length;R+=2)this.lastX=arguments[R-1],this.lastY=arguments[R],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};g.prototype.lineTo=function(R,S){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,R,S),this.lastX=R,this.lastY=S)};g.prototype.moveTo=function(R,S){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,R,S),this.lastX=R,this.lastY=S,this.firstX=R,this.firstY=S)};g.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};g.prototype.quadTo=function(R,S,V,W){this.passThrough?-this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,R,S,V,W),this.lastX=V,this.lastY=W)};g.prototype.curveTo=function(R,S,V,W,X,Y){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,R,S,V,W,X,Y),this.lastX=X,this.lastY=Y)};g.prototype.arcTo=function(R,S,V,W,X,Y,Z){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var ba=mxUtils.arcToCurves(this.lastX,this.lastY,R,S,V,W,X,Y,Z);if(null!=ba)for(var ha=0;ha<ba.length;ha+=-6)this.curveTo(ba[ha],ba[ha+1],ba[ha+2],ba[ha+3],ba[ha+4],ba[ha+5]);this.lastX=Y;this.lastY=Z}};g.prototype.rect=function(R,S,V,W){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(R,S,V,W,this.getStyle(!0,!0)))};g.prototype.ellipse=function(R,S,V,W){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(R+V/2,S+W/2,V,W,this.getStyle(!0,!0)))};g.prototype.roundrect=+this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,R,S,V,W),this.lastX=V,this.lastY=W)};g.prototype.curveTo=function(R,S,V,W,X,Y){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,R,S,V,W,X,Y),this.lastX=X,this.lastY=Y)};g.prototype.arcTo=function(R,S,V,W,X,Y,Z){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var ba=mxUtils.arcToCurves(this.lastX,this.lastY,R,S,V,W,X,Y,Z);if(null!=ba)for(var fa=0;fa<ba.length;fa+=+6)this.curveTo(ba[fa],ba[fa+1],ba[fa+2],ba[fa+3],ba[fa+4],ba[fa+5]);this.lastX=Y;this.lastY=Z}};g.prototype.rect=function(R,S,V,W){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(R,S,V,W,this.getStyle(!0,!0)))};g.prototype.ellipse=function(R,S,V,W){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(R+V/2,S+W/2,V,W,this.getStyle(!0,!0)))};g.prototype.roundrect=function(R,S,V,W,X,Y){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(R+X,S),this.lineTo(R+V-X,S),this.quadTo(R+V,S,R+V,S+Y),this.lineTo(R+V,S+W-Y),this.quadTo(R+V,S+W,R+V-X,S+W),this.lineTo(R+X,S+W),this.quadTo(R,S+W,R,S+W-Y),this.lineTo(R,S+Y),this.quadTo(R,S,R+X,S))};g.prototype.drawPath=function(R){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),R)}catch(V){}this.passThrough=!1}else if(null!=this.nextShape){for(var S in R)this.nextShape.options[S]=R[S];R.stroke!=mxConstants.NONE&&null!=R.stroke||delete this.nextShape.options.stroke;R.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};g.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};g.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};g.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};g.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(R){return new g(R,Editor.createRoughCanvas(R),this)};var p=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(R){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?p.apply(this,arguments):"comic"==mxUtils.getValue(this.style,-"sketchStyle","rough")?this.createComicCanvas(R):this.createRoughCanvas(R)};var F=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(R,S,V,W,X){null!=R.handJiggle&&R.handJiggle.passThrough||F.apply(this,arguments)};var K=mxShape.prototype.paint;mxShape.prototype.paint=function(R){var S=R.addTolerance,V=!0;null!=this.style&&(V="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=R.handJiggle&&R.handJiggle.constructor==g&&!this.outline){R.save();-var W=this.fill,X=this.stroke;this.stroke=this.fill=null;var Y=this.configurePointerEvents,Z=R.setStrokeColor;R.setStrokeColor=function(){};var ba=R.setFillColor;R.setFillColor=function(){};V||null==W||(this.configurePointerEvents=function(){});R.handJiggle.passThrough=!0;K.apply(this,arguments);R.handJiggle.passThrough=!1;R.setFillColor=ba;R.setStrokeColor=Z;this.configurePointerEvents=Y;this.stroke=X;this.fill=W;R.restore();V&&null!=W&&(R.addTolerance=function(){})}K.apply(this,arguments);R.addTolerance=-S};var M=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(R,S,V,W,X,Y){null!=R.handJiggle&&R.handJiggle.constructor==g?(R.handJiggle.passThrough=!0,M.apply(this,arguments),R.handJiggle.passThrough=!1):M.apply(this,arguments)}})();Editor.fastCompress=function(g){return null==g||0==g.length||"undefined"===typeof pako?g:Graph.arrayBufferToString(pako.deflateRaw(g))};Editor.fastDecompress=function(g){return null==g||0==g.length||"undefined"===typeof pako?g:pako.inflateRaw(Graph.stringToArrayBuffer(atob(g)),-{to:"string"})};Editor.extractGraphModel=function(g,p,F){if(null!=g&&"undefined"!==typeof pako){var K=g.ownerDocument.getElementsByTagName("div"),M=[];if(null!=K&&0<K.length)for(var R=0;R<K.length;R++)if("mxgraph"==K[R].getAttribute("class")){M.push(K[R]);break}0<M.length&&(K=M[0].getAttribute("data-mxgraph"),null!=K?(M=JSON.parse(K),null!=M&&null!=M.xml&&(g=mxUtils.parseXml(M.xml),g=g.documentElement)):(M=M[0].getElementsByTagName("div"),0<M.length&&(K=mxUtils.getTextContent(M[0]),K=Graph.decompress(K,-null,F),0<K.length&&(g=mxUtils.parseXml(K),g=g.documentElement))))}if(null!=g&&"svg"==g.nodeName)if(K=g.getAttribute("content"),null!=K&&"<"!=K.charAt(0)&&"%"!=K.charAt(0)&&(K=unescape(window.atob?atob(K):Base64.decode(cont,K))),null!=K&&"%"==K.charAt(0)&&(K=decodeURIComponent(K)),null!=K&&0<K.length)g=mxUtils.parseXml(K).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==g||p||(M=null,"diagram"==g.nodeName?M=g:"mxfile"==g.nodeName&&(K=g.getElementsByTagName("diagram"),0<-K.length&&(M=K[Math.max(0,Math.min(K.length-1,urlParams.page||0))])),null!=M&&(g=Editor.parseDiagramNode(M,F)));null==g||"mxGraphModel"==g.nodeName||p&&"mxfile"==g.nodeName||(g=null);return g};Editor.parseDiagramNode=function(g,p,F){Editor.validateDiagramNode(g);var K=mxUtils.trim(mxUtils.getTextContent(g)),M=null;0<K.length?(p=Graph.decompress(K,null,p),null!=p&&0<p.length&&(M=mxUtils.parseXml(p).documentElement)):(g=mxUtils.getChildNodes(g),0<g.length&&(M=g[0],F&&(M=Editor.parseDiagramNode(M,p,-!1)),p=mxUtils.createXmlDocument(),p.appendChild(p.importNode(M,!0)),M=p.documentElement));return M};Editor.getDiagramNodeXml=function(g){Editor.validateDiagramNode(g);var p=mxUtils.getNodeValue(g),F=null;0<p.length?F=Graph.decompress(p):(g=g.getElementsByTagName("mxGraphModel"),null!=g&&0<g.length&&(F=mxUtils.getXml(g[0])));return F};Editor.validateDiagramNode=function(g){if(0==mxUtils.trim(mxUtils.getTextContent(g)).length&&0==mxUtils.getChildNodes(g).length){var p=new mxCodec,F=new mxGraphModel;-g.appendChild(p.encode(F))}return g};Editor.extractGraphModelFromPdf=function(g){var p=null;g=g.substring(g.indexOf(",")+1);g=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0);if("%PDF-1.7"==g.substring(0,8)){var F=g.indexOf("EmbeddedFile");if(-1<F){var K=g.indexOf("stream",F)+9;if(0<g.substring(F,K).indexOf("application#2Fvnd.jgraph.mxfile")){var M=g.indexOf("endstream",K-1);return pako.inflateRaw(Graph.stringToArrayBuffer(g.substring(K,M)),{to:"string"})}}for(F=g.indexOf("/ObjStm");0<F;){K=-g.indexOf("stream",F)+9;M=g.indexOf("endstream",K-1);K=pako.inflateRaw(Graph.stringToArrayBuffer(g.substring(K,M)),{to:"string"});M=K.indexOf("/Subject <");if(0<M){F=K.substring(M+14,K.indexOf(">",M));if(null!=F){p=F;F=[];for(K=0;K<p.length;K+=2)M=p.substr(K,2),"00"!=M&&F.push(String.fromCharCode(parseInt(M,16)));p=F.join("")}break}F=g.indexOf("/ObjStm",F+1)}}if(null==p&&"%PDF-1.4"==g.substring(0,8)){F="";M=K=0;for(var R=[],S=null;M<g.length;){var V=g.charCodeAt(M);M+=1;10!=V&&(F+=String.fromCharCode(V));-V=="/Subject (%3Cmxfile".charCodeAt(K)?K++:K=0;if(19==K){var W=g.indexOf("%3C%2Fmxfile%3E",M)+15;M-=9;if(W>M){p=g.substring(M,W);break}}10==V&&("endobj"==F?S=null:"obj"==F.substring(F.length-3,F.length)||"xref"==F||"trailer"==F?(S=[],R[F.split(" ")[0]]=S):null!=S&&S.push(F),F="")}}null==p&&null!=R&&(p=Editor.extractGraphModelFromXref(R));null!=p&&(p=decodeURIComponent(p.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return p};Editor.extractGraphModelFromXref=function(g){var p=g.trailer,F=null;null!=-p&&(p=/.* \/Info (\d+) (\d+) R/g.exec(p.join("\n")),null!=p&&0<p.length&&(p=g[p[1]],null!=p&&(p=/.* \/Subject (\d+) (\d+) R/g.exec(p.join("\n")),null!=p&&0<p.length&&(g=g[p[1]],null!=g&&(g=g.join("\n"),F=g.substring(1,g.length-1))))));return F};Editor.extractParserError=function(g,p){var F=null;g=null!=g?g.getElementsByTagName("parsererror"):null;null!=g&&0<g.length&&(F=p||mxResources.get("invalidChars"),p=g[0].getElementsByTagName("div"),0<p.length&&(F=mxUtils.getTextContent(p[0])));return null!=-F?mxUtils.trim(F):F};Editor.addRetryToError=function(g,p){null!=g&&(g=null!=g.error?g.error:g,null==g.retry&&(g.retry=p))};Editor.mermaidToDrawio=function(g,p,F){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(g,p,F)};Editor.configure=function(g){if(null!=g){Editor.config=g;Editor.configVersion=g.version;g.debug&&(urlParams.test="1");null!=g.defaultFonts&&(Menus.prototype.defaultFonts=g.defaultFonts);null!=g.presetColors&&(ColorDialog.prototype.presetColors=g.presetColors);null!=+"sketchStyle","rough")?this.createComicCanvas(R):this.createRoughCanvas(R)};var G=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(R,S,V,W,X){null!=R.handJiggle&&R.handJiggle.passThrough||G.apply(this,arguments)};var J=mxShape.prototype.paint;mxShape.prototype.paint=function(R){var S=R.addTolerance,V=!0;null!=this.style&&(V="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=R.handJiggle&&R.handJiggle.constructor==g&&!this.outline){R.save();+var W=this.fill,X=this.stroke;this.stroke=this.fill=null;var Y=this.configurePointerEvents,Z=R.setStrokeColor;R.setStrokeColor=function(){};var ba=R.setFillColor;R.setFillColor=function(){};V||null==W||(this.configurePointerEvents=function(){});R.handJiggle.passThrough=!0;J.apply(this,arguments);R.handJiggle.passThrough=!1;R.setFillColor=ba;R.setStrokeColor=Z;this.configurePointerEvents=Y;this.stroke=X;this.fill=W;R.restore();V&&null!=W&&(R.addTolerance=function(){})}J.apply(this,arguments);R.addTolerance=+S};var L=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(R,S,V,W,X,Y){null!=R.handJiggle&&R.handJiggle.constructor==g?(R.handJiggle.passThrough=!0,L.apply(this,arguments),R.handJiggle.passThrough=!1):L.apply(this,arguments)}})();Editor.fastCompress=function(g){return null==g||0==g.length||"undefined"===typeof pako?g:Graph.arrayBufferToString(pako.deflateRaw(g))};Editor.fastDecompress=function(g){return null==g||0==g.length||"undefined"===typeof pako?g:pako.inflateRaw(Graph.stringToArrayBuffer(atob(g)),+{to:"string"})};Editor.extractGraphModel=function(g,p,G){if(null!=g&&"undefined"!==typeof pako){var J=g.ownerDocument.getElementsByTagName("div"),L=[];if(null!=J&&0<J.length)for(var R=0;R<J.length;R++)if("mxgraph"==J[R].getAttribute("class")){L.push(J[R]);break}0<L.length&&(J=L[0].getAttribute("data-mxgraph"),null!=J?(L=JSON.parse(J),null!=L&&null!=L.xml&&(g=mxUtils.parseXml(L.xml),g=g.documentElement)):(L=L[0].getElementsByTagName("div"),0<L.length&&(J=mxUtils.getTextContent(L[0]),J=Graph.decompress(J,+null,G),0<J.length&&(g=mxUtils.parseXml(J),g=g.documentElement))))}if(null!=g&&"svg"==g.nodeName)if(J=g.getAttribute("content"),null!=J&&"<"!=J.charAt(0)&&"%"!=J.charAt(0)&&(J=unescape(window.atob?atob(J):Base64.decode(cont,J))),null!=J&&"%"==J.charAt(0)&&(J=decodeURIComponent(J)),null!=J&&0<J.length)g=mxUtils.parseXml(J).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==g||p||(L=null,"diagram"==g.nodeName?L=g:"mxfile"==g.nodeName&&(J=g.getElementsByTagName("diagram"),0<+J.length&&(L=J[Math.max(0,Math.min(J.length-1,urlParams.page||0))])),null!=L&&(g=Editor.parseDiagramNode(L,G)));null==g||"mxGraphModel"==g.nodeName||p&&"mxfile"==g.nodeName||(g=null);return g};Editor.parseDiagramNode=function(g,p,G){Editor.validateDiagramNode(g);var J=mxUtils.trim(mxUtils.getTextContent(g)),L=null;0<J.length?(p=Graph.decompress(J,null,p),null!=p&&0<p.length&&(L=mxUtils.parseXml(p).documentElement)):(g=mxUtils.getChildNodes(g),0<g.length&&(L=g[0],G&&(L=Editor.parseDiagramNode(L,p,+!1)),p=mxUtils.createXmlDocument(),p.appendChild(p.importNode(L,!0)),L=p.documentElement));return L};Editor.getDiagramNodeXml=function(g){Editor.validateDiagramNode(g);var p=mxUtils.getNodeValue(g),G=null;0<p.length?G=Graph.decompress(p):(g=g.getElementsByTagName("mxGraphModel"),null!=g&&0<g.length&&(G=mxUtils.getXml(g[0])));return G};Editor.validateDiagramNode=function(g){if(0==mxUtils.trim(mxUtils.getTextContent(g)).length&&0==mxUtils.getChildNodes(g).length){var p=new mxCodec,G=new mxGraphModel;+g.appendChild(p.encode(G))}return g};Editor.extractGraphModelFromPdf=function(g){var p=null;g=g.substring(g.indexOf(",")+1);g=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0);if("%PDF-1.7"==g.substring(0,8)){var G=g.indexOf("EmbeddedFile");if(-1<G){var J=g.indexOf("stream",G)+9;if(0<g.substring(G,J).indexOf("application#2Fvnd.jgraph.mxfile")){var L=g.indexOf("endstream",J-1);return pako.inflateRaw(Graph.stringToArrayBuffer(g.substring(J,L)),{to:"string"})}}for(G=g.indexOf("/ObjStm");0<G;){J=+g.indexOf("stream",G)+9;L=g.indexOf("endstream",J-1);J=pako.inflateRaw(Graph.stringToArrayBuffer(g.substring(J,L)),{to:"string"});L=J.indexOf("/Subject <");if(0<L){G=J.substring(L+14,J.indexOf(">",L));if(null!=G){p=G;G=[];for(J=0;J<p.length;J+=2)L=p.substr(J,2),"00"!=L&&G.push(String.fromCharCode(parseInt(L,16)));p=G.join("")}break}G=g.indexOf("/ObjStm",G+1)}}if(null==p&&"%PDF-1.4"==g.substring(0,8)){G="";L=J=0;for(var R=[],S=null;L<g.length;){var V=g.charCodeAt(L);L+=1;10!=V&&(G+=String.fromCharCode(V));+V=="/Subject (%3Cmxfile".charCodeAt(J)?J++:J=0;if(19==J){var W=g.indexOf("%3C%2Fmxfile%3E",L)+15;L-=9;if(W>L){p=g.substring(L,W);break}}10==V&&("endobj"==G?S=null:"obj"==G.substring(G.length-3,G.length)||"xref"==G||"trailer"==G?(S=[],R[G.split(" ")[0]]=S):null!=S&&S.push(G),G="")}}null==p&&null!=R&&(p=Editor.extractGraphModelFromXref(R));null!=p&&(p=decodeURIComponent(p.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return p};Editor.extractGraphModelFromXref=function(g){var p=g.trailer,G=null;null!=+p&&(p=/.* \/Info (\d+) (\d+) R/g.exec(p.join("\n")),null!=p&&0<p.length&&(p=g[p[1]],null!=p&&(p=/.* \/Subject (\d+) (\d+) R/g.exec(p.join("\n")),null!=p&&0<p.length&&(g=g[p[1]],null!=g&&(g=g.join("\n"),G=g.substring(1,g.length-1))))));return G};Editor.extractParserError=function(g,p){var G=null;g=null!=g?g.getElementsByTagName("parsererror"):null;null!=g&&0<g.length&&(G=p||mxResources.get("invalidChars"),p=g[0].getElementsByTagName("div"),0<p.length&&(G=mxUtils.getTextContent(p[0])));return null!=+G?mxUtils.trim(G):G};Editor.addRetryToError=function(g,p){null!=g&&(g=null!=g.error?g.error:g,null==g.retry&&(g.retry=p))};Editor.mermaidToDrawio=function(g,p,G){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(g,p,G)};Editor.configure=function(g){if(null!=g){Editor.config=g;Editor.configVersion=g.version;g.debug&&(urlParams.test="1");null!=g.defaultFonts&&(Menus.prototype.defaultFonts=g.defaultFonts);null!=g.presetColors&&(ColorDialog.prototype.presetColors=g.presetColors);null!=g.defaultColors&&(ColorDialog.prototype.defaultColors=g.defaultColors);null!=g.colorNames&&(ColorDialog.prototype.colorNames=g.colorNames);null!=g.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=g.defaultColorSchemes);null!=g.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=g.defaultEdgeLength);null!=g.selectParentLayer&&(Graph.selectParentLayer=g.selectParentLayer);null!=g.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=g.autosaveDelay);null!=g.templateFile&&(EditorUi.templateFile=g.templateFile);null!=g.styles&&(Array.isArray(g.styles)?Editor.styles=g.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=g.globalVars&&(Editor.globalVars=g.globalVars);null!=g.compressXml&&(Editor.defaultCompressed=g.compressXml,Editor.compressXml=g.compressXml);null!=g.includeDiagram&&(Editor.defaultIncludeDiagram=g.includeDiagram);null!=g.simpleLabels&&(Editor.simpleLabels=g.simpleLabels);null!=g.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=g.oneDriveInlinePicker);null!=g.defaultAdaptiveColors?Graph.defaultAdaptiveColors=g.defaultAdaptiveColors:0==g.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=g.darkColor&&(Editor.darkColor=g.darkColor);null!=g.darkColorVar&&(Editor.darkColorVar=g.darkColorVar);Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":"light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.defaultPageBorderColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=g.settingsName&&(Editor.configurationKey="."+g.settingsName+"-configuration",Editor.settingsKey="."+g.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=g.customFonts&&(Menus.prototype.defaultFonts=g.customFonts.concat(Menus.prototype.defaultFonts));null!=g.customPresetColors&&(ColorDialog.prototype.presetColors=g.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=g.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=-g.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=g.css){var p=document.createElement("style");p.setAttribute("type","text/css");p.appendChild(document.createTextNode(g.css));var F=document.getElementsByTagName("script")[0];F.parentNode.insertBefore(p,F)}null!=g.expandLibraries&&(Sidebar.prototype.expandLibraries=g.expandLibraries);null!=g.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=g.appendCustomLibraries);null!=g.libraries&&(Sidebar.prototype.customEntries=+g.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=g.css){var p=document.createElement("style");p.setAttribute("type","text/css");p.appendChild(document.createTextNode(g.css));var G=document.getElementsByTagName("script")[0];G.parentNode.insertBefore(p,G)}null!=g.expandLibraries&&(Sidebar.prototype.expandLibraries=g.expandLibraries);null!=g.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=g.appendCustomLibraries);null!=g.libraries&&(Sidebar.prototype.customEntries=g.libraries);null!=g.enabledLibraries&&(Array.isArray(g.enabledLibraries)?Sidebar.prototype.enabledLibraries=g.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=g.defaultLibraries&&(Sidebar.prototype.defaultEntries=g.defaultLibraries);null!=g.defaultCustomLibraries&&(Editor.defaultCustomLibraries=g.defaultCustomLibraries);null!=g.enableCustomLibraries&&(Editor.enableCustomLibraries=g.enableCustomLibraries);null!=g.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=g.defaultVertexStyle);null!=g.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=g.defaultEdgeStyle);null!=g.defaultPageVisible&&(Graph.prototype.defaultPageVisible=g.defaultPageVisible);null!=g.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=g.defaultGridEnabled);null!=g.zoomWheel&&(Graph.zoomWheel=g.zoomWheel);null!=g.zoomFactor&&(p=parseFloat(g.zoomFactor),!isNaN(p)&&1<p?Graph.prototype.zoomFactor=p:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=g.defaultGridSize&&-(p=parseInt(g.defaultGridSize),!isNaN(p)&&0<p?mxGraph.prototype.gridSize=p:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=g.gridSteps&&(p=parseInt(g.gridSteps),!isNaN(p)&&0<p?mxGraphView.prototype.gridSteps=p:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=g.pageFormat&&(p=parseInt(g.pageFormat.width),F=parseInt(g.pageFormat.height),!isNaN(p)&&0<p&&!isNaN(F)&&0<F?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,p,F),mxGraph.prototype.pageFormat=+(p=parseInt(g.defaultGridSize),!isNaN(p)&&0<p?mxGraph.prototype.gridSize=p:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=g.gridSteps&&(p=parseInt(g.gridSteps),!isNaN(p)&&0<p?mxGraphView.prototype.gridSteps=p:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=g.pageFormat&&(p=parseInt(g.pageFormat.width),G=parseInt(g.pageFormat.height),!isNaN(p)&&0<p&&!isNaN(G)&&0<G?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,p,G),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=g.thumbWidth&&(Sidebar.prototype.thumbWidth=g.thumbWidth);null!=g.thumbHeight&&(Sidebar.prototype.thumbHeight=g.thumbHeight);null!=g.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=g.emptyLibraryXml);null!=g.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=g.emptyDiagramXml);null!=g.sidebarWidth&&(EditorUi.prototype.hsplitPosition=g.sidebarWidth);null!=g.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=g.updateDefaultStyle);null!=g.sidebarTitles&&(Sidebar.prototype.sidebarTitles=g.sidebarTitles);null!=g.sidebarTitleSize&&(p=parseInt(g.sidebarTitleSize),!isNaN(p)&&0<p?Sidebar.prototype.sidebarTitleSize=p:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=g.fontCss&&("string"===typeof g.fontCss?Editor.configureFontCss(g.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=g.autosaveDelay&&(p=parseInt(g.autosaveDelay),!isNaN(p)&&0<p?DrawioFile.prototype.autosaveDelay=p:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=g.maxImageBytes&&(EditorUi.prototype.maxImageBytes=g.maxImageBytes);null!=g.maxImageSize&&(EditorUi.prototype.maxImageSize=g.maxImageSize);null!=g.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=g.shareCursorPosition);null!=g.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=g.showRemoteCursors);null!=g.restrictExport&&(DrawioFile.RESTRICT_EXPORT=g.restrictExport);null!=g.replaceSvgDataUris&&(Editor.replaceSvgDataUris=g.replaceSvgDataUris);null!=g.foreignObjectImages&&(Editor.foreignObjectImages=g.foreignObjectImages);null!=g.shadowColor&&(mxConstants.SHADOW_COLOR=g.shadowColor);null!=g.shadowOpacity&&(mxConstants.SHADOW_OPACITY=g.shadowOpacity);null!=g.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=g.shadowOffsetX);null!=g.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=g.shadowOffsetY);null!=g.shadowBlur&&(mxConstants.SHADOW_BLUR=g.shadowBlur);null!=g.enableAnimations&&(Editor.enableAnimations=g.enableAnimations);null!=g.enableChatGpt&&(Editor.enableChatGpt=g.enableChatGpt);null!=g.gptApiKey&&(Editor.gptApiKey=g.gptApiKey);null!=g.gptModel&&(Editor.gptModel=g.gptModel);null!=g.gptUrl&&(Editor.gptUrl=g.gptUrl)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(g){if(null!=g){Editor.prototype.fontCss=g;var p=document.getElementsByTagName("script")[0];-if(null!=p&&null!=p.parentNode){var F=document.createElement("style");F.setAttribute("type","text/css");F.appendChild(document.createTextNode(g));p.parentNode.insertBefore(F,p);g=g.split("url(");for(F=1;F<g.length;F++){var K=g[F].indexOf(")");K=Editor.trimCssUrl(g[F].substring(0,K));var M=document.createElement("link");M.setAttribute("rel","preload");M.setAttribute("href",K);M.setAttribute("as","font");M.setAttribute("crossorigin","");p.parentNode.insertBefore(M,p)}}}};Editor.trimCssUrl=function(g){return g.replace(RegExp("^[\\s\"']+",-"g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(g){g=null!=g?g:Editor.GUID_LENGTH;for(var p=[],F=0;F<g;F++)p.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return p.join("")};Editor.updateStatusInterval=+if(null!=p&&null!=p.parentNode){var G=document.createElement("style");G.setAttribute("type","text/css");G.appendChild(document.createTextNode(g));p.parentNode.insertBefore(G,p);g=g.split("url(");for(G=1;G<g.length;G++){var J=g[G].indexOf(")");J=Editor.trimCssUrl(g[G].substring(0,J));var L=document.createElement("link");L.setAttribute("rel","preload");L.setAttribute("href",J);L.setAttribute("as","font");L.setAttribute("crossorigin","");p.parentNode.insertBefore(L,p)}}}};Editor.trimCssUrl=function(g){return g.replace(RegExp("^[\\s\"']+",+"g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(g){g=null!=g?g:Editor.GUID_LENGTH;for(var p=[],G=0;G<g;G++)p.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return p.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!mxClient.IS_IE;var b=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(g){g=null!=g&&"mxlibrary"!=g.nodeName?this.extractGraphModel(g):null;if(null!=g){var p=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(p)throw EditorUi.debug("Editor.setGraphXml ParserError",-[this],"node",[g],"cause",[p]),Error(mxResources.get("notADiagramFile")+" ("+p+")");if("mxGraphModel"==g.nodeName){p=g.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=p&&""!=p)p!=this.graph.currentStyle&&(F=null!=this.graph.themes?this.graph.themes[p]:mxUtils.load(STYLE_PATH+"/"+p+".xml").getDocumentElement(),null!=F&&(K=new mxCodec(F.ownerDocument),K.decode(F,this.graph.getStylesheet())));else{var F=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+-"/default-old.xml").getDocumentElement();if(null!=F){var K=new mxCodec(F.ownerDocument);K.decode(F,this.graph.getStylesheet())}}this.graph.currentStyle=p;this.graph.mathEnabled="1"==urlParams.math||"1"==g.getAttribute("math");this.graph.setAdaptiveColors(g.getAttribute("adaptiveColors"));p=g.getAttribute("backgroundImage");null!=p?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(p)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&-this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==g.getAttribute("shadow"),!1);if(p=g.getAttribute("extFonts"))try{for(p=p.split("|").map(function(M){M=M.split("^");return{name:M[0],url:M[1]}}),F=0;F<p.length;F++)this.graph.addExtFont(p[F].name,p[F].url)}catch(M){console.log("ExtFonts format error: "+M.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||-"Invalid data",toString:function(){return this.message}};};var f=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(g,p){g=null!=g?g:!0;var F=f.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&F.setAttribute("style",this.graph.currentStyle);var K=this.graph.getBackgroundImageObject(this.graph.backgroundImage,p);null!=K&&F.setAttribute("backgroundImage",JSON.stringify(K));F.setAttribute("math",this.graph.mathEnabled?"1":"0");F.setAttribute("shadow",-this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?F.setAttribute("adaptiveColors",this.graph.adaptiveColors):F.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(K=this.graph.extFonts.map(function(M){return M.name+"^"+M.url}),F.setAttribute("extFonts",K.join("|")));return F};Editor.prototype.isDataSvg=function(g){try{var p=mxUtils.parseXml(g).documentElement.getAttribute("content");if(null!=p&&(null!=p&&"<"!=p.charAt(0)&&"%"!=p.charAt(0)&&(p=-unescape(window.atob?atob(p):Base64.decode(cont,p))),null!=p&&"%"==p.charAt(0)&&(p=decodeURIComponent(p)),null!=p&&0<p.length)){var F=mxUtils.parseXml(p).documentElement;return"mxfile"==F.nodeName||"mxGraphModel"==F.nodeName}}catch(K){}return!1};Editor.prototype.extractGraphModel=function(g,p,F){return Editor.extractGraphModel.apply(this,arguments)};var l=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);+[this],"node",[g],"cause",[p]),Error(mxResources.get("notADiagramFile")+" ("+p+")");if("mxGraphModel"==g.nodeName){p=g.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=p&&""!=p)p!=this.graph.currentStyle&&(G=null!=this.graph.themes?this.graph.themes[p]:mxUtils.load(STYLE_PATH+"/"+p+".xml").getDocumentElement(),null!=G&&(J=new mxCodec(G.ownerDocument),J.decode(G,this.graph.getStylesheet())));else{var G=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH++"/default-old.xml").getDocumentElement();if(null!=G){var J=new mxCodec(G.ownerDocument);J.decode(G,this.graph.getStylesheet())}}this.graph.currentStyle=p;this.graph.mathEnabled="1"==urlParams.math||"1"==g.getAttribute("math");this.graph.setAdaptiveColors(g.getAttribute("adaptiveColors"));p=g.getAttribute("backgroundImage");null!=p?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(p)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&+this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==g.getAttribute("shadow"),!1);if(p=g.getAttribute("extFonts"))try{for(p=p.split("|").map(function(L){L=L.split("^");return{name:L[0],url:L[1]}}),G=0;G<p.length;G++)this.graph.addExtFont(p[G].name,p[G].url)}catch(L){console.log("ExtFonts format error: "+L.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||+"Invalid data",toString:function(){return this.message}};};var f=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(g,p){g=null!=g?g:!0;var G=f.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&G.setAttribute("style",this.graph.currentStyle);var J=this.graph.getBackgroundImageObject(this.graph.backgroundImage,p);null!=J&&G.setAttribute("backgroundImage",JSON.stringify(J));G.setAttribute("math",this.graph.mathEnabled?"1":"0");G.setAttribute("shadow",+this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?G.setAttribute("adaptiveColors",this.graph.adaptiveColors):G.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(J=this.graph.extFonts.map(function(L){return L.name+"^"+L.url}),G.setAttribute("extFonts",J.join("|")));return G};Editor.prototype.isDataSvg=function(g){try{var p=mxUtils.parseXml(g).documentElement.getAttribute("content");if(null!=p&&(null!=p&&"<"!=p.charAt(0)&&"%"!=p.charAt(0)&&(p=+unescape(window.atob?atob(p):Base64.decode(cont,p))),null!=p&&"%"==p.charAt(0)&&(p=decodeURIComponent(p)),null!=p&&0<p.length)){var G=mxUtils.parseXml(p).documentElement;return"mxfile"==G.nodeName||"mxGraphModel"==G.nodeName}}catch(J){}return!1};Editor.prototype.extractGraphModel=function(g,p,G){return Editor.extractGraphModel.apply(this,arguments)};var l=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();l.apply(this,arguments)};var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){d.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(g,p){if("undefined"===-typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var F=function(){K=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};g=null!=g?g:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var K=null;Editor.doMathJaxRender=function(S){try{null==K?(MathJax.typesetClear([S]),MathJax.typeset([S]),F()):K!=S&&Editor.mathJaxQueue.push(S)}catch(V){MathJax.typesetClear([S]),null!=V.retry?(K=S,V.retry.then(function(){MathJax.typesetPromise([S]).then(F)["catch"](function(W){console.log("Error in MathJax.typesetPromise: "+-W.toString());F()})})["catch"](function(W){console.log("Error in MathJax.retry: "+W.toString());F()})):null!=window.console&&console.log("Error in MathJax.typeset: "+V.toString())}};window.MathJax=null!=p?p:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"]},startup:{pageReady:function(){for(var S=0;S<Editor.mathJaxQueue.length;S++)Editor.doMathJaxRender(Editor.mathJaxQueue[S])}}};-Editor.MathJaxRender=function(S){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(S):Editor.mathJaxQueue.push(S)};Editor.onMathJaxDone=function(){};var M=Editor.prototype.init;Editor.prototype.init=function(){M.apply(this,arguments);var S=mxUtils.bind(this,function(V,W){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,S);this.graph.addListener(mxEvent.REFRESH,S)};p=document.getElementsByTagName("script");-if(null!=p&&0<p.length){var R=document.createElement("script");R.setAttribute("type","text/javascript");R.setAttribute("src",g);p[0].parentNode.appendChild(R)}}};Editor.prototype.csvToArray=function(g){if(0<g.length){var p="",F=[""],K=0,M=!0,R;g=$jscomp.makeIterator(g);for(R=g.next();!R.done;R=g.next())R=R.value,'"'===R?(M&&R===p&&(F[K]+=R),M=!M):","===R&&M?R=F[++K]="":F[K]+=R,p=R;return F}return[]};Editor.prototype.getProxiedUrl=function(g){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&-!this.isCorsEnabledForUrl(g)){var p=EditorUi.isVisioFilename(g);p=/\.png$/i.test(g)||/\.pdf$/i.test(g)||p;var F="t="+(new Date).getTime();g=PROXY_URL+"?url="+encodeURIComponent(g)+"&"+F+(p?"&base64=1":"")}return g};Editor.prototype.isCorsEnabledForUrl=function(g){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||g.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));-return null!=this.corsRegExp&&this.corsRegExp.test(g)||"https://raw.githubusercontent.com/"===g.substring(0,34)||"https://fonts.googleapis.com/"===g.substring(0,29)||"https://fonts.gstatic.com/"===g.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var g=new mxUrlConverter;g.updateBaseUrl();var p=g.convert,F=this;g.convert=function(K){null!=K&&navigator.onLine&&("http://"!=K.substring(0,7)&&"https://"!=K.substring(0,8)||K.substring(0,g.baseUrl.length)==g.baseUrl||F.crossOriginImages&&-F.isCorsEnabledForUrl(K)?"chrome-extension://"!=K.substring(0,19)&&(K=p.apply(this,arguments)):K=PROXY_URL+"?url="+encodeURIComponent(K));return K};return g};Editor.createSvgDataUri=function(g){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(g)))};Editor.prototype.convertImageToDataUri=function(g,p,F,K,M){try{var R=!0,S=window.setTimeout(mxUtils.bind(this,function(){R=!1;p(g)}),this.timeout),V=mxUtils.bind(this,function(){null!=K?this.convertImageToDataUri(g,p,F,K,!0):p(g)});if(/(\.svg)$/i.test(g)&&-!M)mxUtils.get(g,mxUtils.bind(this,function(X){window.clearTimeout(S);R&&(200>X.getStatus()||299<X.getStatus()?V():p(Editor.createSvgDataUri(X.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(S);R&&V()}));else{var W=new Image;this.crossOriginImages&&(W.crossOrigin="anonymous");W.onload=function(){window.clearTimeout(S);if(R)try{K=null!=K&&M?K:1;var X=document.createElement("canvas"),Y=X.getContext("2d");Y.scale(K,K);X.height=W.height*K;X.width=W.width*K;Y.drawImage(W,0,0);p(X.toDataURL())}catch(Z){p(g)}};-W.onerror=function(){window.clearTimeout(S);R&&(null!=F?F():p(g))};W.src=g}}catch(X){null!=F?F():p(g)}};Editor.prototype.convertImages=function(g,p,F,K){function M(){0<R.length?R.shift()():p(g)}null==K&&(K=this.createImageUrlConverter());var R=[],S=F||{};F=mxUtils.bind(this,function(V,W){V=g.getElementsByTagName(V);for(var X=0;X<V.length;X++)mxUtils.bind(this,function(Y){R.push(mxUtils.bind(this,function(){try{if(null!=Y){var Z=K.convert(Y.getAttribute(W));if(null!=Z&&"data:"!=Z.substring(0,5)){var ba=-S[Z];null==ba?this.convertImageToDataUri(Z,function(ha){null!=ha&&(S[Z]=ha,Y.setAttribute(W,ha));M()},null,Editor.svgRasterScale):(Y.setAttribute(W,ba),M())}else null!=Z&&Y.setAttribute(W,Z),M()}}catch(ha){M()}}))})(V[X])});F("image","xlink:href");F("img","src");M()};Editor.base64Encode=function(g){for(var p="",F=0,K=g.length,M,R,S;F<K;){M=g.charCodeAt(F++)&255;if(F==K){p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(M>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((M&-3)<<4);p+="==";break}R=g.charCodeAt(F++);if(F==K){p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(M>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((M&3)<<4|(R&240)>>4);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2);p+="=";break}S=g.charCodeAt(F++);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(M>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((M&-3)<<4|(R&240)>>4);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2|(S&192)>>6);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(S&63)}return p};Editor.prototype.loadUrl=function(g,p,F,K,M,R,S,V){try{var W=!S&&(K||/(\.png)($|\?)/i.test(g)||/(\.jpe?g)($|\?)/i.test(g)||/(\.gif)($|\?)/i.test(g)||/(\.pdf)($|\?)/i.test(g));M=null!=M?M:!0;var X=mxUtils.bind(this,function(){mxUtils.get(g,mxUtils.bind(this,function(Y){if(200<=Y.getStatus()&&-299>=Y.getStatus()){if(null!=p){var Z=Y.getText();if(W){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){Y=mxUtilsBinaryToArray(Y.request.responseBody).toArray();Z=Array(Y.length);for(var ba=0;ba<Y.length;ba++)Z[ba]=String.fromCharCode(Y[ba]);Z=Z.join("")}R=null!=R?R:"data:image/png;base64,";Z=R+Editor.base64Encode(Z)}p(Z)}}else null!=F&&(0==Y.getStatus()?F({message:mxResources.get("accessDenied")},Y):404==Y.getStatus()?F({message:mxResources.get("fileNotFound"),-code:Y.getStatus()},Y):F({message:this.getErrorMessage(Y)},Y))}),function(Y){null!=F&&F({message:mxResources.get("error")+" "+Y.getStatus()})},W,this.timeout,function(){M&&null!=F&&F({code:App.ERROR_TIMEOUT,retry:X})},V)});X()}catch(Y){null!=F&&F(Y)}};Editor.prototype.getErrorMessage=function(g){var p=mxResources.get("error")+" "+g.getStatus();try{var F=g.getText(),K=JSON.parse(F);null!=K&&null!=K.error&&null!=K.error.message&&(p=K.error.message+" ("+p+")")}catch(M){}return p};Editor.prototype.absoluteCssFonts=-function(g){var p=null;if(null!=g){var F=g.split("url(");if(0<F.length){p=[F[0]];g=window.location.pathname;var K=null!=g?g.lastIndexOf("/"):-1;0<=K&&(g=g.substring(0,K+1));K=document.getElementsByTagName("base");var M=null;null!=K&&0<K.length&&(M=K[0].getAttribute("href"));for(var R=1;R<F.length;R++)if(K=F[R].indexOf(")"),0<K){var S=Editor.trimCssUrl(F[R].substring(0,K));this.graph.isRelativeUrl(S)&&(S=null!=M?M+S:window.location.protocol+"//"+window.location.hostname+("/"==S.charAt(0)?"":g)+S);-p.push('url("'+S+'"'+F[R].substring(K))}else p.push(F[R])}else p=[g]}return null!=p?p.join(""):null};Editor.prototype.mapFontUrl=function(g,p,F){/^https?:\/\//.test(p)&&!this.isCorsEnabledForUrl(p)&&(p=PROXY_URL+"?url="+encodeURIComponent(p));F(g,p)};Editor.prototype.embedCssFonts=function(g,p){var F=g.split("url("),K=0;null==this.cachedFonts&&(this.cachedFonts={});var M=mxUtils.bind(this,function(){if(0==K){for(var W=[F[0]],X=1;X<F.length;X++){var Y=F[X].indexOf(")");W.push('url("');W.push(this.cachedFonts[Editor.trimCssUrl(F[X].substring(0,-Y))]);W.push('"'+F[X].substring(Y))}p(W.join(""))}});if(0<F.length){for(g=1;g<F.length;g++){var R=F[g].indexOf(")"),S=null,V=F[g].indexOf("format(",R);0<V&&(S=Editor.trimCssUrl(F[g].substring(V+7,F[g].indexOf(")",V))));mxUtils.bind(this,function(W){if(null==this.cachedFonts[W]){this.cachedFonts[W]=W;K++;var X="application/x-font-ttf";if("svg"==S||/(\.svg)($|\?)/i.test(W))X="image/svg+xml";else if("otf"==S||"embedded-opentype"==S||/(\.otf)($|\?)/i.test(W))X="application/x-font-opentype";else if("woff"==-S||/(\.woff)($|\?)/i.test(W))X="application/font-woff";else if("woff2"==S||/(\.woff2)($|\?)/i.test(W))X="application/font-woff2";else if("eot"==S||/(\.eot)($|\?)/i.test(W))X="application/vnd.ms-fontobject";else if("sfnt"==S||/(\.sfnt)($|\?)/i.test(W))X="application/font-sfnt";this.mapFontUrl(X,W,mxUtils.bind(this,function(Y,Z){this.loadUrl(Z,mxUtils.bind(this,function(ba){this.cachedFonts[W]=ba;K--;M()}),mxUtils.bind(this,function(ba){K--;M()}),!0,null,"data:"+Y+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(F[g].substring(0,-R)),S)}M()}else p(g)};Editor.prototype.loadFonts=function(g){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(p){this.resolvedFontCss=p;null!=g&&g()})):null!=g&&g()};Editor.prototype.createGoogleFontCache=function(){var g={},p;for(p in Graph.fontMapping)Graph.isCssFontUrl(p)&&(g[p]=Graph.fontMapping[p]);return g};Editor.prototype.embedExtFonts=function(g){var p=this.graph.getCustomFonts();if(0<p.length){var F=[],K=0;null==this.cachedGoogleFonts&&-(this.cachedGoogleFonts=this.createGoogleFontCache());for(var M=mxUtils.bind(this,function(){0==K&&this.embedCssFonts(F.join(""),g)}),R=0;R<p.length;R++)mxUtils.bind(this,function(S,V){Graph.isCssFontUrl(V)?null==this.cachedGoogleFonts[V]?(K++,this.loadUrl(Graph.rewriteGoogleFontUrl(V),mxUtils.bind(this,function(W){this.cachedGoogleFonts[V]=W;F.push(W+"\n");K--;M()}),mxUtils.bind(this,function(W){K--;F.push("@import url("+V+");\n");M()}))):F.push(this.cachedGoogleFonts[V]+"\n"):F.push('@font-face {font-family: "'+-S+'";src: url("'+V+'")}\n')})(p[R].name,p[R].url);M()}else g()};Editor.prototype.addMathCss=function(g){g=g.getElementsByTagName("defs");if(null!=g&&0<g.length)for(var p=document.getElementsByTagName("style"),F=0;F<p.length;F++){var K=mxUtils.getTextContent(p[F]);0>K.indexOf("mxPageSelector")&&0<K.indexOf("MathJax")&&g[0].appendChild(p[F].cloneNode(!0))}};Editor.prototype.addFontCss=function(g,p){p=null!=p?p:this.absoluteCssFonts(this.fontCss);if(null!=p){var F=mxUtils.getSvgDefs(g),K=p.split("\n");-p=[];for(var M=[],R=0;R<K.length;R++)"@import"==K[R].substring(0,7)?p.push(K[R]):M.push(K[R]);g=g.ownerDocument;g=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"style"):g.createElement("style");g.setAttribute("type","text/css");0<p.length&&(mxUtils.setTextContent(g,p.join("\n")),F.appendChild(g));0<M.length&&(g=g.cloneNode(!1),mxUtils.setTextContent(g,M.join("\n")),F.appendChild(g))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};-Editor.prototype.getMaxCanvasScale=function(g,p,F){var K=mxClient.IS_FF?8192:16384;return Math.min(F,Math.min(K/g,K/p))};Editor.prototype.exportToCanvas=function(g,p,F,K,M,R,S,V,W,X,Y,Z,ba,ha,ca,da,ma,aa){try{R=null!=R?R:!0;S=null!=S?S:!0;Z=null!=Z?Z:this.graph;ba=null!=ba?ba:0;var ia=W?null:Z.background;ia==mxConstants.NONE&&(ia=null);null==ia&&(ia=K);null==ia&&0==W&&(ia="dark"==da?Editor.darkColor:"#ffffff");this.convertImages(Z.getSvg(null,null,ba,ha,null,S,null,null,null,X,null,da,ma,aa),mxUtils.bind(this,+typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var G=function(){J=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};g=null!=g?g:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var J=null;Editor.doMathJaxRender=function(S){try{null==J?(MathJax.typesetClear([S]),MathJax.typeset([S]),G()):J!=S&&Editor.mathJaxQueue.push(S)}catch(V){MathJax.typesetClear([S]),null!=V.retry?(J=S,V.retry.then(function(){MathJax.typesetPromise([S]).then(G)["catch"](function(W){console.log("Error in MathJax.typesetPromise: "++W.toString());G()})})["catch"](function(W){console.log("Error in MathJax.retry: "+W.toString());G()})):null!=window.console&&console.log("Error in MathJax.typeset: "+V.toString())}};window.MathJax=null!=p?p:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"]},startup:{pageReady:function(){for(var S=0;S<Editor.mathJaxQueue.length;S++)Editor.doMathJaxRender(Editor.mathJaxQueue[S])}}};+Editor.MathJaxRender=function(S){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(S):Editor.mathJaxQueue.push(S)};Editor.onMathJaxDone=function(){};var L=Editor.prototype.init;Editor.prototype.init=function(){L.apply(this,arguments);var S=mxUtils.bind(this,function(V,W){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,S);this.graph.addListener(mxEvent.REFRESH,S)};p=document.getElementsByTagName("script");+if(null!=p&&0<p.length){var R=document.createElement("script");R.setAttribute("type","text/javascript");R.setAttribute("src",g);p[0].parentNode.appendChild(R)}}};Editor.prototype.csvToArray=function(g){if(0<g.length){var p="",G=[""],J=0,L=!0,R;g=$jscomp.makeIterator(g);for(R=g.next();!R.done;R=g.next())R=R.value,'"'===R?(L&&R===p&&(G[J]+=R),L=!L):","===R&&L?R=G[++J]="":G[J]+=R,p=R;return G}return[]};Editor.prototype.getProxiedUrl=function(g){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&+!this.isCorsEnabledForUrl(g)){var p=EditorUi.isVisioFilename(g);p=/\.png$/i.test(g)||/\.pdf$/i.test(g)||p;var G="t="+(new Date).getTime();g=PROXY_URL+"?url="+encodeURIComponent(g)+"&"+G+(p?"&base64=1":"")}return g};Editor.prototype.isCorsEnabledForUrl=function(g){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||g.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));+return null!=this.corsRegExp&&this.corsRegExp.test(g)||"https://raw.githubusercontent.com/"===g.substring(0,34)||"https://fonts.googleapis.com/"===g.substring(0,29)||"https://fonts.gstatic.com/"===g.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var g=new mxUrlConverter;g.updateBaseUrl();var p=g.convert,G=this;g.convert=function(J){null!=J&&navigator.onLine&&("http://"!=J.substring(0,7)&&"https://"!=J.substring(0,8)||J.substring(0,g.baseUrl.length)==g.baseUrl||G.crossOriginImages&&+G.isCorsEnabledForUrl(J)?"chrome-extension://"!=J.substring(0,19)&&(J=p.apply(this,arguments)):J=PROXY_URL+"?url="+encodeURIComponent(J));return J};return g};Editor.createSvgDataUri=function(g){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(g)))};Editor.prototype.convertImageToDataUri=function(g,p,G,J,L){try{var R=!0,S=window.setTimeout(mxUtils.bind(this,function(){R=!1;p(g)}),this.timeout),V=mxUtils.bind(this,function(){null!=J?this.convertImageToDataUri(g,p,G,J,!0):p(g)});if(/(\.svg)$/i.test(g)&&+!L)mxUtils.get(g,mxUtils.bind(this,function(X){window.clearTimeout(S);R&&(200>X.getStatus()||299<X.getStatus()?V():p(Editor.createSvgDataUri(X.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(S);R&&V()}));else{var W=new Image;this.crossOriginImages&&(W.crossOrigin="anonymous");W.onload=function(){window.clearTimeout(S);if(R)try{J=null!=J&&L?J:1;var X=document.createElement("canvas"),Y=X.getContext("2d");Y.scale(J,J);X.height=W.height*J;X.width=W.width*J;Y.drawImage(W,0,0);p(X.toDataURL())}catch(Z){p(g)}};+W.onerror=function(){window.clearTimeout(S);R&&(null!=G?G():p(g))};W.src=g}}catch(X){null!=G?G():p(g)}};Editor.prototype.convertImages=function(g,p,G,J){function L(){0<R.length?R.shift()():p(g)}null==J&&(J=this.createImageUrlConverter());var R=[],S=G||{};G=mxUtils.bind(this,function(V,W){V=g.getElementsByTagName(V);for(var X=0;X<V.length;X++)mxUtils.bind(this,function(Y){R.push(mxUtils.bind(this,function(){try{if(null!=Y){var Z=J.convert(Y.getAttribute(W));if(null!=Z&&"data:"!=Z.substring(0,5)){var ba=+S[Z];null==ba?this.convertImageToDataUri(Z,function(fa){null!=fa&&(S[Z]=fa,Y.setAttribute(W,fa));L()},null,Editor.svgRasterScale):(Y.setAttribute(W,ba),L())}else null!=Z&&Y.setAttribute(W,Z),L()}}catch(fa){L()}}))})(V[X])});G("image","xlink:href");G("img","src");L()};Editor.base64Encode=function(g){for(var p="",G=0,J=g.length,L,R,S;G<J;){L=g.charCodeAt(G++)&255;if(G==J){p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(L>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((L&+3)<<4);p+="==";break}R=g.charCodeAt(G++);if(G==J){p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(L>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((L&3)<<4|(R&240)>>4);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2);p+="=";break}S=g.charCodeAt(G++);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(L>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((L&+3)<<4|(R&240)>>4);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2|(S&192)>>6);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(S&63)}return p};Editor.prototype.loadUrl=function(g,p,G,J,L,R,S,V){try{var W=!S&&(J||/(\.png)($|\?)/i.test(g)||/(\.jpe?g)($|\?)/i.test(g)||/(\.gif)($|\?)/i.test(g)||/(\.pdf)($|\?)/i.test(g));L=null!=L?L:!0;var X=mxUtils.bind(this,function(){mxUtils.get(g,mxUtils.bind(this,function(Y){if(200<=Y.getStatus()&&+299>=Y.getStatus()){if(null!=p){var Z=Y.getText();if(W){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){Y=mxUtilsBinaryToArray(Y.request.responseBody).toArray();Z=Array(Y.length);for(var ba=0;ba<Y.length;ba++)Z[ba]=String.fromCharCode(Y[ba]);Z=Z.join("")}R=null!=R?R:"data:image/png;base64,";Z=R+Editor.base64Encode(Z)}p(Z)}}else null!=G&&(0==Y.getStatus()?G({message:mxResources.get("accessDenied")},Y):404==Y.getStatus()?G({message:mxResources.get("fileNotFound"),+code:Y.getStatus()},Y):G({message:this.getErrorMessage(Y)},Y))}),function(Y){null!=G&&G({message:mxResources.get("error")+" "+Y.getStatus()})},W,this.timeout,function(){L&&null!=G&&G({code:App.ERROR_TIMEOUT,retry:X})},V)});X()}catch(Y){null!=G&&G(Y)}};Editor.prototype.getErrorMessage=function(g){var p=mxResources.get("error")+" "+g.getStatus();try{var G=g.getText(),J=JSON.parse(G);null!=J&&null!=J.error&&null!=J.error.message&&(p=J.error.message+" ("+p+")")}catch(L){}return p};Editor.prototype.absoluteCssFonts=+function(g){var p=null;if(null!=g){var G=g.split("url(");if(0<G.length){p=[G[0]];g=window.location.pathname;var J=null!=g?g.lastIndexOf("/"):-1;0<=J&&(g=g.substring(0,J+1));J=document.getElementsByTagName("base");var L=null;null!=J&&0<J.length&&(L=J[0].getAttribute("href"));for(var R=1;R<G.length;R++)if(J=G[R].indexOf(")"),0<J){var S=Editor.trimCssUrl(G[R].substring(0,J));this.graph.isRelativeUrl(S)&&(S=null!=L?L+S:window.location.protocol+"//"+window.location.hostname+("/"==S.charAt(0)?"":g)+S);+p.push('url("'+S+'"'+G[R].substring(J))}else p.push(G[R])}else p=[g]}return null!=p?p.join(""):null};Editor.prototype.mapFontUrl=function(g,p,G){/^https?:\/\//.test(p)&&!this.isCorsEnabledForUrl(p)&&(p=PROXY_URL+"?url="+encodeURIComponent(p));G(g,p)};Editor.prototype.embedCssFonts=function(g,p){var G=g.split("url("),J=0;null==this.cachedFonts&&(this.cachedFonts={});var L=mxUtils.bind(this,function(){if(0==J){for(var W=[G[0]],X=1;X<G.length;X++){var Y=G[X].indexOf(")");W.push('url("');W.push(this.cachedFonts[Editor.trimCssUrl(G[X].substring(0,+Y))]);W.push('"'+G[X].substring(Y))}p(W.join(""))}});if(0<G.length){for(g=1;g<G.length;g++){var R=G[g].indexOf(")"),S=null,V=G[g].indexOf("format(",R);0<V&&(S=Editor.trimCssUrl(G[g].substring(V+7,G[g].indexOf(")",V))));mxUtils.bind(this,function(W){if(null==this.cachedFonts[W]){this.cachedFonts[W]=W;J++;var X="application/x-font-ttf";if("svg"==S||/(\.svg)($|\?)/i.test(W))X="image/svg+xml";else if("otf"==S||"embedded-opentype"==S||/(\.otf)($|\?)/i.test(W))X="application/x-font-opentype";else if("woff"==+S||/(\.woff)($|\?)/i.test(W))X="application/font-woff";else if("woff2"==S||/(\.woff2)($|\?)/i.test(W))X="application/font-woff2";else if("eot"==S||/(\.eot)($|\?)/i.test(W))X="application/vnd.ms-fontobject";else if("sfnt"==S||/(\.sfnt)($|\?)/i.test(W))X="application/font-sfnt";this.mapFontUrl(X,W,mxUtils.bind(this,function(Y,Z){this.loadUrl(Z,mxUtils.bind(this,function(ba){this.cachedFonts[W]=ba;J--;L()}),mxUtils.bind(this,function(ba){J--;L()}),!0,null,"data:"+Y+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(G[g].substring(0,+R)),S)}L()}else p(g)};Editor.prototype.loadFonts=function(g){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(p){this.resolvedFontCss=p;null!=g&&g()})):null!=g&&g()};Editor.prototype.createGoogleFontCache=function(){var g={},p;for(p in Graph.fontMapping)Graph.isCssFontUrl(p)&&(g[p]=Graph.fontMapping[p]);return g};Editor.prototype.embedExtFonts=function(g){var p=this.graph.getCustomFonts();if(0<p.length){var G=[],J=0;null==this.cachedGoogleFonts&&+(this.cachedGoogleFonts=this.createGoogleFontCache());for(var L=mxUtils.bind(this,function(){0==J&&this.embedCssFonts(G.join(""),g)}),R=0;R<p.length;R++)mxUtils.bind(this,function(S,V){Graph.isCssFontUrl(V)?null==this.cachedGoogleFonts[V]?(J++,this.loadUrl(Graph.rewriteGoogleFontUrl(V),mxUtils.bind(this,function(W){this.cachedGoogleFonts[V]=W;G.push(W+"\n");J--;L()}),mxUtils.bind(this,function(W){J--;G.push("@import url("+V+");\n");L()}))):G.push(this.cachedGoogleFonts[V]+"\n"):G.push('@font-face {font-family: "'++S+'";src: url("'+V+'")}\n')})(p[R].name,p[R].url);L()}else g()};Editor.prototype.addMathCss=function(g){g=g.getElementsByTagName("defs");if(null!=g&&0<g.length)for(var p=document.getElementsByTagName("style"),G=0;G<p.length;G++){var J=mxUtils.getTextContent(p[G]);0>J.indexOf("mxPageSelector")&&0<J.indexOf("MathJax")&&g[0].appendChild(p[G].cloneNode(!0))}};Editor.prototype.addFontCss=function(g,p){p=null!=p?p:this.absoluteCssFonts(this.fontCss);if(null!=p){var G=mxUtils.getSvgDefs(g),J=p.split("\n");+p=[];for(var L=[],R=0;R<J.length;R++)"@import"==J[R].substring(0,7)?p.push(J[R]):L.push(J[R]);g=g.ownerDocument;g=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"style"):g.createElement("style");g.setAttribute("type","text/css");0<p.length&&(mxUtils.setTextContent(g,p.join("\n")),G.appendChild(g));0<L.length&&(g=g.cloneNode(!1),mxUtils.setTextContent(g,L.join("\n")),G.appendChild(g))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};+Editor.prototype.getMaxCanvasScale=function(g,p,G){var J=mxClient.IS_FF?8192:16384;return Math.min(G,Math.min(J/g,J/p))};Editor.prototype.exportToCanvas=function(g,p,G,J,L,R,S,V,W,X,Y,Z,ba,fa,ca,da,ma,aa){try{R=null!=R?R:!0;S=null!=S?S:!0;Z=null!=Z?Z:this.graph;ba=null!=ba?ba:0;var ia=W?null:Z.background;ia==mxConstants.NONE&&(ia=null);null==ia&&(ia=J);null==ia&&0==W&&(ia="dark"==da?Editor.darkColor:"#ffffff");this.convertImages(Z.getSvg(null,null,ba,fa,null,S,null,null,null,X,null,da,ma,aa),mxUtils.bind(this,function(ka){try{var ta=new Image;ta.onload=mxUtils.bind(this,function(){try{var ea=function(){mxClient.IS_SF?window.setTimeout(function(){va.drawImage(ta,0,0);g(ra,ka)},0):(va.drawImage(ta,0,0),g(ra,ka))},ra=document.createElement("canvas"),ua=parseInt(ka.getAttribute("width")),za=parseInt(ka.getAttribute("height"));V=null!=V?V:1;null!=p&&(V=R?Math.min(1,Math.min(3*p/(4*za),p/ua)):p/ua);V=this.getMaxCanvasScale(ua,za,V);ua=Math.ceil(V*ua);za=Math.ceil(V*za);ra.setAttribute("width",ua);ra.setAttribute("height",-za);var va=ra.getContext("2d");null!=ia&&(va.beginPath(),va.rect(0,0,ua,za),va.fillStyle=ia,va.fill());1!=V&&va.scale(V,V);if(ca){var fa=Z.view,pa=fa.scale;fa.scale=1;var Aa=btoa(unescape(encodeURIComponent(fa.createSvgGrid(fa.gridColor))));fa.scale=pa;Aa="data:image/svg+xml;base64,"+Aa;var na=Z.gridSize*fa.gridSteps*V,Ha=Z.getGraphBounds(),wa=fa.translate.x*pa,Da=fa.translate.y*pa,Ea=wa+(Ha.x-wa)/pa-ba,Na=Da+(Ha.y-Da)/pa-ba,Ba=new Image;Ba.onload=function(){try{for(var Ca=-Math.round(na-mxUtils.mod((wa--Ea)*V,na)),Ia=-Math.round(na-mxUtils.mod((Da-Na)*V,na));Ca<ua;Ca+=na)for(var Va=Ia;Va<za;Va+=na)va.drawImage(Ba,Ca/V,Va/V);ea()}catch(Ta){null!=M&&M(Ta)}};Ba.onerror=function(Ca){null!=M&&M(Ca)};Ba.src=Aa}else ea()}catch(Ca){null!=M&&M(Ca)}});ta.onerror=function(ea){null!=M&&M(ea)};X&&this.graph.addSvgShadow(ka);this.graph.mathEnabled&&this.addMathCss(ka);var sa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ka,this.resolvedFontCss),ta.src=Editor.createSvgDataUri(mxUtils.getXml(ka))}catch(ea){null!=-M&&M(ea)}});this.embedExtFonts(mxUtils.bind(this,function(ea){try{null!=ea&&this.addFontCss(ka,ea),this.loadFonts(sa)}catch(ra){null!=M&&M(ra)}}))}catch(ea){null!=M&&M(ea)}}),F,Y)}catch(ka){null!=M&&M(ka)}};Editor.crcTable=[];for(var t=0;256>t;t++)for(var y=t,x=0;8>x;x++)y=1==(y&1)?3988292384^y>>>1:y>>>1,Editor.crcTable[t]=y;Editor.updateCRC=function(g,p,F,K){for(var M=0;M<K;M++)g=Editor.crcTable[(g^p.charCodeAt(F+M))&255]^g>>>8;return g};Editor.crc32=function(g){for(var p=-1,F=0;F<g.length;F++)p=-p>>>8^Editor.crcTable[(p^g.charCodeAt(F))&255];return(p^-1)>>>0};Editor.writeGraphModelToPng=function(g,p,F,K,M){function R(Y,Z){var ba=W;W+=Z;return Y.substring(ba,W)}function S(Y){Y=R(Y,4);return Y.charCodeAt(3)+(Y.charCodeAt(2)<<8)+(Y.charCodeAt(1)<<16)+(Y.charCodeAt(0)<<24)}function V(Y){return String.fromCharCode(Y>>24&255,Y>>16&255,Y>>8&255,Y&255)}g=g.substring(g.indexOf(",")+1);g=window.atob?atob(g):Base64.decode(g,!0);var W=0;if(R(g,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,-10,26,10))null!=M&&M();else if(R(g,4),"IHDR"!=R(g,4))null!=M&&M();else{R(g,17);M=g.substring(0,W);do{var X=S(g);if("IDAT"==R(g,4)){M=g.substring(0,W-8);"pHYs"==p&&"dpi"==F?(F=Math.round(K/.0254),F=V(F)+V(F)+String.fromCharCode(1)):F=F+String.fromCharCode(0)+("zTXt"==p?String.fromCharCode(0):"")+K;K=4294967295;K=Editor.updateCRC(K,p,0,4);K=Editor.updateCRC(K,F,0,F.length);M+=V(F.length)+p+F+V(K^4294967295);M+=g.substring(W-8,g.length);break}M+=g.substring(W-8,W-4+X);R(g,X);R(g,4)}while(X);return"data:image/png;base64,"+-(window.btoa?btoa(M):Base64.encode(M,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var C=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(g,p){C.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var L=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){L.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==-typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(g,p){var F=null;null!=g.editor.graph.getModel().getParent(p)?F=p.getId():null!=g.currentPage&&(F=g.currentPage.getId());return F});if(null!=window.StyleFormatPanel){var N=Format.prototype.init;Format.prototype.init=function(){N.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var O=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||-this.editorUi.editor.chromeless?O.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(g){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var Q=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(g){g=Q.apply(this,arguments);var p=this.editorUi,F=p.editor.graph;if(F.isEnabled()){var K=p.getCurrentFile();null!=K&&K.isAutosaveOptional()&&g.appendChild(this.createOption(mxResources.get("autosave"),-function(){return p.editor.autosave},function(S){p.editor.setAutosave(S);p.editor.autosave&&K.isModified()&&K.fileChanged()},{install:function(S){this.listener=function(){S(p.editor.autosave)};p.editor.addListener("autosaveChanged",this.listener)},destroy:function(){p.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&F.isEnabled()&&"undefined"!==typeof MathJax){var M=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return F.mathEnabled},function(S){p.actions.get("mathematicalTypesetting").funct()},-{install:function(S){this.listener=function(){S(F.mathEnabled)};p.addListener("mathEnabledChanged",this.listener)},destroy:function(){p.removeListener(this.listener)}});g.appendChild(M);if(!p.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var R=p.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting");R.style.position="absolute";R.style.left="85%";M.appendChild(R)}}return g};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",+za);var va=ra.getContext("2d");null!=ia&&(va.beginPath(),va.rect(0,0,ua,za),va.fillStyle=ia,va.fill());1!=V&&va.scale(V,V);if(ca){var ha=Z.view,pa=ha.scale;ha.scale=1;var Aa=btoa(unescape(encodeURIComponent(ha.createSvgGrid(ha.gridColor))));ha.scale=pa;Aa="data:image/svg+xml;base64,"+Aa;var na=Z.gridSize*ha.gridSteps*V,Ha=Z.getGraphBounds(),wa=ha.translate.x*pa,Da=ha.translate.y*pa,Ea=wa+(Ha.x-wa)/pa-ba,Na=Da+(Ha.y-Da)/pa-ba,Ba=new Image;Ba.onload=function(){try{for(var Ca=-Math.round(na-mxUtils.mod((wa-+Ea)*V,na)),Ia=-Math.round(na-mxUtils.mod((Da-Na)*V,na));Ca<ua;Ca+=na)for(var Va=Ia;Va<za;Va+=na)va.drawImage(Ba,Ca/V,Va/V);ea()}catch(Ta){null!=L&&L(Ta)}};Ba.onerror=function(Ca){null!=L&&L(Ca)};Ba.src=Aa}else ea()}catch(Ca){null!=L&&L(Ca)}});ta.onerror=function(ea){null!=L&&L(ea)};X&&this.graph.addSvgShadow(ka);this.graph.mathEnabled&&this.addMathCss(ka);var sa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ka,this.resolvedFontCss),ta.src=Editor.createSvgDataUri(mxUtils.getXml(ka))}catch(ea){null!=+L&&L(ea)}});this.embedExtFonts(mxUtils.bind(this,function(ea){try{null!=ea&&this.addFontCss(ka,ea),this.loadFonts(sa)}catch(ra){null!=L&&L(ra)}}))}catch(ea){null!=L&&L(ea)}}),G,Y)}catch(ka){null!=L&&L(ka)}};Editor.crcTable=[];for(var t=0;256>t;t++)for(var y=t,x=0;8>x;x++)y=1==(y&1)?3988292384^y>>>1:y>>>1,Editor.crcTable[t]=y;Editor.updateCRC=function(g,p,G,J){for(var L=0;L<J;L++)g=Editor.crcTable[(g^p.charCodeAt(G+L))&255]^g>>>8;return g};Editor.crc32=function(g){for(var p=-1,G=0;G<g.length;G++)p=+p>>>8^Editor.crcTable[(p^g.charCodeAt(G))&255];return(p^-1)>>>0};Editor.writeGraphModelToPng=function(g,p,G,J,L){function R(Y,Z){var ba=W;W+=Z;return Y.substring(ba,W)}function S(Y){Y=R(Y,4);return Y.charCodeAt(3)+(Y.charCodeAt(2)<<8)+(Y.charCodeAt(1)<<16)+(Y.charCodeAt(0)<<24)}function V(Y){return String.fromCharCode(Y>>24&255,Y>>16&255,Y>>8&255,Y&255)}g=g.substring(g.indexOf(",")+1);g=window.atob?atob(g):Base64.decode(g,!0);var W=0;if(R(g,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,+10,26,10))null!=L&&L();else if(R(g,4),"IHDR"!=R(g,4))null!=L&&L();else{R(g,17);L=g.substring(0,W);do{var X=S(g);if("IDAT"==R(g,4)){L=g.substring(0,W-8);"pHYs"==p&&"dpi"==G?(G=Math.round(J/.0254),G=V(G)+V(G)+String.fromCharCode(1)):G=G+String.fromCharCode(0)+("zTXt"==p?String.fromCharCode(0):"")+J;J=4294967295;J=Editor.updateCRC(J,p,0,4);J=Editor.updateCRC(J,G,0,G.length);L+=V(G.length)+p+G+V(J^4294967295);L+=g.substring(W-8,g.length);break}L+=g.substring(W-8,W-4+X);R(g,X);R(g,4)}while(X);return"data:image/png;base64,"++(window.btoa?btoa(L):Base64.encode(L,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var C=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(g,p){C.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var K=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){K.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==+typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(g,p){var G=null;null!=g.editor.graph.getModel().getParent(p)?G=p.getId():null!=g.currentPage&&(G=g.currentPage.getId());return G});if(null!=window.StyleFormatPanel){var N=Format.prototype.init;Format.prototype.init=function(){N.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var O=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||+this.editorUi.editor.chromeless?O.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(g){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var Q=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(g){g=Q.apply(this,arguments);var p=this.editorUi,G=p.editor.graph;if(G.isEnabled()){var J=p.getCurrentFile();null!=J&&J.isAutosaveOptional()&&g.appendChild(this.createOption(mxResources.get("autosave"),+function(){return p.editor.autosave},function(S){p.editor.setAutosave(S);p.editor.autosave&&J.isModified()&&J.fileChanged()},{install:function(S){this.listener=function(){S(p.editor.autosave)};p.editor.addListener("autosaveChanged",this.listener)},destroy:function(){p.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&G.isEnabled()&&"undefined"!==typeof MathJax){var L=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return G.mathEnabled},function(S){p.actions.get("mathematicalTypesetting").funct()},+{install:function(S){this.listener=function(){S(G.mathEnabled)};p.addListener("mathEnabledChanged",this.listener)},destroy:function(){p.removeListener(this.listener)}});g.appendChild(L);if(!p.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var R=p.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting");R.style.position="absolute";R.style.left="85%";L.appendChild(R)}}return g};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(g){return"0"==mxUtils.getValue(g.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",@@ -12843,95 +12843,95 @@ min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},-{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(g,p,F,K){if(null!=p){var M=mxUtils.bind(this,function(S){if(null!=S)if(F)for(var V=0;V<S.length;V++){if("function"!==typeof S[V].isVisible||S[V].isVisible(K,this))p[S[V].name]=S[V]}else for(var W in p){var X=!1;for(V=0;V<-S.length;V++)if(S[V].name==W&&S[V].type==p[W].type){X=!0;break}X||delete p[W]}}),R=this.editorUi.editor.graph.view.getState(g);null!=R&&null!=R.shape&&(R.shape.commonCustomPropAdded||(R.shape.commonCustomPropAdded=!0,R.shape.customProperties=R.shape.customProperties||[],R.cell.vertex?Array.prototype.push.apply(R.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(R.shape.customProperties,Editor.commonEdgeProperties)),M(R.shape.customProperties));g=g.getAttribute("customProperties");-if(null!=g)try{M(JSON.parse(g))}catch(S){}}};var I=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var g=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=g.style.shape&&!g.containsLabel&&0<g.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));I.apply(this,arguments);if(Editor.enableCustomProperties){for(var p={},F=g.vertices,K=g.edges,M=0;M<F.length;M++)this.findCommonProperties(F[M],p,-0==M,g);for(M=0;M<K.length;M++)this.findCommonProperties(K[M],p,0==F.length&&0==M,g);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(p).length&&this.container.appendChild(this.addProperties(this.createPanel(),p,g))}};var c=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(g){var p=this.editorUi.getSelectionState();1==p.cells.length?this.addActions(g,["copyStyle","pasteStyle"]):1<=p.cells.length&&this.addActions(g,["pasteStyle","pasteData"]);c.apply(this,-arguments);return g};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(g,p,F,K){function M(va,fa,pa,Aa,na){if(null!=pa.valueChanged)pa.valueChanged(fa,na);else{ba.getModel().beginUpdate();try{na=[];var Ha=[];if(null!=pa.index){for(var wa=[],Da=pa.parentRow.nextSibling;Da&&Da.getAttribute("data-pName")==va;)wa.push(Da.getAttribute("data-pValue")),Da=Da.nextSibling;pa.index<wa.length?null!=Aa?wa.splice(Aa,1):wa[pa.index]=fa:wa.push(fa);null!=pa.size&&wa.length>-pa.size&&(wa=wa.slice(0,pa.size));fa=wa.join(",");null!=pa.countProperty&&(ba.setCellStyles(pa.countProperty,wa.length,ba.getSelectionCells()),na.push(pa.countProperty),Ha.push(wa.length))}ba.setCellStyles(va,fa,ba.getSelectionCells());na.push(va);Ha.push(fa);if(null!=pa.dependentProps)for(va=0;va<pa.dependentProps.length;va++){var Ea=pa.dependentPropsDefVal[va],Na=pa.dependentPropsVals[va];if(Na.length>fa)Na=Na.slice(0,fa);else for(var Ba=Na.length;Ba<fa;Ba++)Na.push(Ea);Na=Na.join(",");ba.setCellStyles(pa.dependentProps[va],-Na,ba.getSelectionCells());na.push(pa.dependentProps[va]);Ha.push(Na)}if("function"==typeof pa.onChange)pa.onChange(ba,fa);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",na,"values",Ha,"cells",ba.getSelectionCells()))}finally{ba.getModel().endUpdate()}}}function R(va,fa,pa){var Aa=mxUtils.getOffset(g,!0),na=mxUtils.getOffset(va,!0);fa.style.position="absolute";fa.style.left=na.x-Aa.x+"px";fa.style.top=na.y-Aa.y+"px";fa.style.width=va.offsetWidth+"px";fa.style.height=va.offsetHeight--(pa?4:0)+"px";fa.style.zIndex=5}function S(va,fa,pa){function Aa(Ha){if(null==Ha||Ha==mxConstants.NONE)na.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==Ha)na.style.background="";else{var wa=mxUtils.getLightDarkColor(Ha);mxUtils.isLightDarkColor(Ha)&&wa.light!=wa.dark?na.style.background="linear-gradient(to right bottom, "+wa.cssText+" 50%, "+mxUtils.invertLightDarkColor(wa).cssText+" 50.3%)":na.style.background=Ha}}var na=document.createElement("div");na.style.width=-"32px";na.style.height="8px";na.style.margin="2px";na.style.borderStyle="solid";na.style.borderWidth="1px";Aa(fa);btn=mxUtils.button("",mxUtils.bind(Z,function(Ha){this.editorUi.pickColor(fa,function(wa){M(va,wa,pa);Aa(wa)});mxEvent.consume(Ha)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(na);return btn}function V(va,fa,pa,Aa,na,Ha,wa){null!=fa&&(fa=fa.split(","),ha.push({name:va,values:fa,type:pa,-defVal:Aa,countProperty:na,parentRow:Ha,isDeletable:!0,flipBkg:wa}));btn=mxUtils.button("+",mxUtils.bind(Z,function(Da){for(var Ea=Ha,Na=0;null!=Ea.nextSibling;)if(Ea.nextSibling.getAttribute("data-pName")==va)Ea=Ea.nextSibling,Na++;else break;var Ba={type:pa,parentRow:Ha,index:Na,isDeletable:!0,defVal:Aa,countProperty:na};Na=Y(va,"",Ba,0==Na%2,wa);M(va,Aa,Ba);Ea.parentNode.insertBefore(Na,Ea.nextSibling);mxEvent.consume(Da)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";-return btn}function W(va,fa,pa,Aa,na,Ha,wa){if(0<na){var Da=Array(na);fa=null!=fa?fa.split(","):[];for(var Ea=0;Ea<na;Ea++)Da[Ea]=null!=fa[Ea]?fa[Ea]:null!=Aa?Aa:"";ha.push({name:va,values:Da,type:pa,defVal:Aa,parentRow:Ha,flipBkg:wa,size:na})}return document.createElement("div")}function X(va,fa,pa){var Aa=document.createElement("input");Aa.type="checkbox";Aa.checked="1"==fa;mxEvent.addListener(Aa,"change",function(){M(va,Aa.checked?"1":"0",pa)});return Aa}function Y(va,fa,pa,Aa,na){var Ha=pa.dispName,-wa=pa.type,Da=document.createElement("tr");Da.className="gePropRow"+(na?"Dark":"")+(Aa?"Alt":"")+" gePropNonHeaderRow";Da.setAttribute("data-pName",va);Da.setAttribute("data-pValue",fa);Aa=!1;null!=pa.index&&(Da.setAttribute("data-index",pa.index),Ha=(null!=Ha?Ha:"")+"["+pa.index+"]",Aa=!0);var Ea=document.createElement("td");Ea.className="gePropRowCell";Ha=mxResources.get(Ha,null,Ha);mxUtils.write(Ea,Ha);Ea.setAttribute("title",Ha);Aa&&(Ea.style.textAlign="right");Da.appendChild(Ea);Ea=document.createElement("td");-Ea.className="gePropRowCell";Ea.setAttribute("title",null!=fa?fa:mxResources.get("none"));if("color"==wa)Ea.appendChild(S(va,fa,pa));else if("bool"==wa||"boolean"==wa)Ea.appendChild(X(va,fa,pa));else if("enum"==wa){var Na=pa.enumList;for(na=0;na<Na.length;na++)if(Ha=Na[na],Ha.val==fa){mxUtils.write(Ea,mxResources.get(Ha.dispName,null,Ha.dispName));break}mxEvent.addListener(Ea,"click",mxUtils.bind(Z,function(){var Ba=document.createElement("select"),Ca=null;R(Ea,Ba);for(var Ia=0;Ia<Na.length;Ia++){var Va=-Na[Ia],Ta=document.createElement("option");Ta.value=mxUtils.htmlEntities(Va.val);mxUtils.write(Ta,mxResources.get(Va.dispName,null,Va.dispName));Ba.appendChild(Ta);null==Va.val&&(Ta.value="null",Ca=Ta)}Ba.value=null==fa&&null!=Ca?"null":fa;g.appendChild(Ba);mxEvent.addListener(Ba,"change",function(){var Xa=mxUtils.htmlEntities(Ba.value);if(Ba[Ba.selectedIndex]==Ca||"null"==Xa.value)Xa=null;M(va,Xa,pa)});Ba.focus();mxEvent.addListener(Ba,"blur",function(){g.removeChild(Ba)})}))}else"dynamicArr"==wa?-Ea.appendChild(V(va,fa,pa.subType,pa.subDefVal,pa.countProperty,Da,na)):"staticArr"==wa?Ea.appendChild(W(va,fa,pa.subType,pa.subDefVal,pa.size,Da,na)):"readOnly"==wa?(na=document.createElement("input"),na.setAttribute("readonly",""),na.value=fa,na.style.borderWidth="0px","id"==va?(na.style.width="190px",na.style.position="relative",na.style.right="6px",na.style.float="right",na.style.background="none",na.style.textAlign="right",Da.firstChild.setAttribute("colspan","2"),na.setAttribute("title",fa),-Da.firstChild.appendChild(na)):(na.style.width="96px",Ea.appendChild(na))):(Ea.innerHTML=mxUtils.htmlEntities(decodeURIComponent(fa)),mxEvent.addListener(Ea,"click",mxUtils.bind(Z,function(){function Ba(){var Ia=Ca.value;Ia=0==Ia.length&&"string"!=wa&&"numbers"!=wa?0:Ia;pa.allowAuto&&(null!=Ia.trim&&"auto"==Ia.trim().toLowerCase()?(Ia="auto",wa="string"):(Ia=parseFloat(Ia),Ia=isNaN(Ia)?0:Ia));null!=pa.min&&Ia<pa.min?Ia=pa.min:null!=pa.max&&Ia>pa.max&&(Ia=pa.max);var Va=null;try{Va="numbers"==wa?Ia.match(/\d+/g).map(Number).join(" "):-encodeURIComponent(("int"==wa?parseInt(Ia):Ia)+"")}catch(Ta){}M(va,Va,pa,null,Ca)}var Ca=document.createElement("input");R(Ea,Ca,!0);Ca.value=decodeURIComponent(fa);Ca.className="gePropEditor";"int"!=wa&&"float"!=wa||pa.allowAuto||(Ca.type="number",Ca.step="int"==wa?"1":"any",null!=pa.min&&(Ca.min=parseFloat(pa.min)),null!=pa.max&&(Ca.max=parseFloat(pa.max)));g.appendChild(Ca);mxEvent.addListener(Ca,"keypress",function(Ia){13==Ia.keyCode&&Ba()});Ca.focus();mxEvent.addListener(Ca,"blur",function(){Ba()})})));-pa.isDeletable&&(na=mxUtils.button("-",mxUtils.bind(Z,function(Ba){M(va,"",pa,pa.index);mxEvent.consume(Ba)})),na.style.height="16px",na.style.width="25px",na.style.float="right",na.className="geColorBtn",Ea.appendChild(na));Da.appendChild(Ea);return Da}var Z=this,ba=this.editorUi.editor.graph,ha=[];g.style.position="relative";g.style.padding="0";var ca=document.createElement("table");ca.className="geProperties";ca.style.whiteSpace="nowrap";ca.style.width="100%";var da=document.createElement("tr");-da.className="gePropHeader";var ma=document.createElement("th");ma.className="gePropHeaderCell";ma.style.paddingLeft="16px";ma.style.backgroundRepeat="no-repeat";ma.style.backgroundPosition="-2px 50%";ma.style.backgroundSize="20px";mxUtils.write(ma,mxResources.get("property"));da.style.cursor="pointer";var aa=function(){var va=ca.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){ma.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var fa="none";for(var pa=g.childNodes.length--1;0<=pa;pa--)try{var Aa=g.childNodes[pa],na=Aa.nodeName.toUpperCase();"INPUT"!=na&&"SELECT"!=na||g.removeChild(Aa)}catch(Ha){}}else ma.style.backgroundImage="url('"+Editor.arrowDownImage+"')",fa="";for(pa=0;pa<va.length;pa++)va[pa].style.display=fa};mxEvent.addListener(da,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;aa()});da.appendChild(ma);var ia=document.createElement("th");ia.className="gePropHeaderCell";ia.style.paddingLeft="4px";mxUtils.write(ia,mxResources.get("value"));-da.appendChild(ia);ca.appendChild(da);var ka=ia=!1;da=null;1==F.vertices.length&&0==F.edges.length?da=F.vertices[0].id:0==F.vertices.length&&1==F.edges.length&&(da=F.edges[0].id);null==da||K||ca.appendChild(Y("id",mxUtils.htmlEntities(da),{dispName:"id",type:"readOnly"},!0,!1));for(var ta in p)if(K=p[ta],"function"!=typeof K.isVisible||K.isVisible(F,this)){var sa=null!=K.getValue?K.getValue():null!=F.style[ta]?mxUtils.htmlEntities(F.style[ta]+""):null!=K.getDefaultValue?K.getDefaultValue(F,this):-K.defVal;if("separator"==K.type)ka=!ka;else{if("staticArr"==K.type)K.size=parseInt(F.style[K.sizeProperty]||p[K.sizeProperty].defVal)||0;else if(null!=K.dependentProps){var ea=K.dependentProps,ra=[],ua=[];for(da=0;da<ea.length;da++){var za=F.style[ea[da]];ua.push(p[ea[da]].subDefVal);ra.push(null!=za?za.split(","):[])}K.dependentPropsDefVal=ua;K.dependentPropsVals=ra}ca.appendChild(Y(ta,sa,K,ia,ka));ia=!ia}}for(da=0;da<ha.length;da++)for(K=ha[da],p=K.parentRow,F=0;F<K.values.length;F++)ta=Y(K.name,-K.values[F],{type:K.type,parentRow:K.parentRow,isDeletable:K.isDeletable,index:F,defVal:K.defVal,countProperty:K.countProperty,size:K.size},0==F%2,K.flipBkg),p.parentNode.insertBefore(ta,p.nextSibling),p=ta;g.appendChild(ca);aa();return g};StyleFormatPanel.prototype.addStyles=function(g){if(null!=this.defaultColorSchemes){var p=function(ha){mxEvent.addListener(ha,"mouseenter",function(){ha.style.opacity="1"});mxEvent.addListener(ha,"mouseleave",function(){ha.style.opacity="0.5"})},F=this.editorUi,-K=F.editor.graph,M=document.createElement("div");M.style.whiteSpace="nowrap";M.style.paddingLeft="24px";M.style.paddingRight="20px";g.style.paddingLeft="16px";g.style.paddingBottom="6px";g.style.position="relative";g.appendChild(M);var R=document.createElement("div");R.style.whiteSpace="nowrap";R.style.position="relative";R.style.textAlign="center";R.style.width="210px";for(var S=[],V=0;V<this.defaultColorSchemes.length;V++){var W=document.createElement("div");W.style.display="inline-block";W.style.width=-"6px";W.style.height="6px";W.style.marginLeft="4px";W.style.marginRight="3px";W.style.borderRadius="3px";W.style.cursor="pointer";W.style.background="transparent";W.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(ha){mxEvent.addListener(W,"click",mxUtils.bind(this,function(){X(ha)}))})(V);S.push(W);R.appendChild(W)}var X=mxUtils.bind(this,function(ha){null!=S[ha]&&(null!=this.format.currentScheme&&null!=S[this.format.currentScheme]&&(S[this.format.currentScheme].style.background="transparent"),-this.format.currentScheme=ha,Y(this.defaultColorSchemes[this.format.currentScheme]),S[this.format.currentScheme].style.background="#84d7ff")}),Y=mxUtils.bind(this,function(ha){var ca=mxUtils.clone(K.defaultVertexStyle);ca[mxConstants.STYLE_STROKECOLOR]=null!=ca[mxConstants.STYLE_STROKECOLOR]?ca[mxConstants.STYLE_STROKECOLOR]:"default";ca[mxConstants.STYLE_FILLCOLOR]=null!=ca[mxConstants.STYLE_FILLCOLOR]?ca[mxConstants.STYLE_FILLCOLOR]:"default";ca[mxConstants.STYLE_FONTCOLOR]=null!=ca[mxConstants.STYLE_FONTCOLOR]?-ca[mxConstants.STYLE_FONTCOLOR]:"default";K.replaceDefaultColors(new mxCell,ca);var da=mxUtils.bind(this,function(aa){var ia=mxUtils.button("",mxUtils.bind(this,function(sa){K.getModel().beginUpdate();try{for(var ea=F.getSelectionState().cells,ra=0;ra<ea.length;ra++){var ua=K.getModel().getStyle(ea[ra]);null!=aa?(mxEvent.isShiftDown(sa)||(ua=""==aa.fill||null==aa.fill?mxUtils.setStyle(ua,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ua,mxConstants.STYLE_FILLCOLOR,aa.fill),ua=""==aa.gradient||-null==aa.gradient?mxUtils.setStyle(ua,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ua,mxConstants.STYLE_GRADIENTCOLOR,aa.gradient),mxEvent.isControlDown(sa)||mxClient.IS_MAC&&mxEvent.isMetaDown(sa)||!K.getModel().isVertex(ea[ra])||(ua=""==aa.font||null==aa.font?mxUtils.setStyle(ua,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ua,mxConstants.STYLE_FONTCOLOR,aa.font))),mxEvent.isAltDown(sa)||(ua=""==aa.stroke||null==aa.fill?mxUtils.setStyle(ua,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ua,-mxConstants.STYLE_STROKECOLOR,aa.stroke))):(ua=mxUtils.setStyle(ua,mxConstants.STYLE_FILLCOLOR,null),ua=mxUtils.setStyle(ua,mxConstants.STYLE_STROKECOLOR,null),ua=mxUtils.setStyle(ua,mxConstants.STYLE_GRADIENTCOLOR,null),K.getModel().isVertex(ea[ra])&&(ua=mxUtils.setStyle(ua,mxConstants.STYLE_FONTCOLOR,null)));K.getModel().setStyle(ea[ra],ua)}}finally{K.getModel().endUpdate()}}));ia.className="geStyleButton";ia.style.width="36px";ia.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ia.style.margin=+{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(g,p,G,J){if(null!=p){var L=mxUtils.bind(this,function(S){if(null!=S)if(G)for(var V=0;V<S.length;V++){if("function"!==typeof S[V].isVisible||S[V].isVisible(J,this))p[S[V].name]=S[V]}else for(var W in p){var X=!1;for(V=0;V<+S.length;V++)if(S[V].name==W&&S[V].type==p[W].type){X=!0;break}X||delete p[W]}}),R=this.editorUi.editor.graph.view.getState(g);null!=R&&null!=R.shape&&(R.shape.commonCustomPropAdded||(R.shape.commonCustomPropAdded=!0,R.shape.customProperties=R.shape.customProperties||[],R.cell.vertex?Array.prototype.push.apply(R.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(R.shape.customProperties,Editor.commonEdgeProperties)),L(R.shape.customProperties));g=g.getAttribute("customProperties");+if(null!=g)try{L(JSON.parse(g))}catch(S){}}};var I=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var g=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=g.style.shape&&!g.containsLabel&&0<g.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));I.apply(this,arguments);if(Editor.enableCustomProperties){for(var p={},G=g.vertices,J=g.edges,L=0;L<G.length;L++)this.findCommonProperties(G[L],p,+0==L,g);for(L=0;L<J.length;L++)this.findCommonProperties(J[L],p,0==G.length&&0==L,g);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(p).length&&this.container.appendChild(this.addProperties(this.createPanel(),p,g))}};var c=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(g){var p=this.editorUi.getSelectionState();1==p.cells.length?this.addActions(g,["copyStyle","pasteStyle"]):1<=p.cells.length&&this.addActions(g,["pasteStyle","pasteData"]);c.apply(this,+arguments);return g};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(g,p,G,J){function L(va,ha,pa,Aa,na){if(null!=pa.valueChanged)pa.valueChanged(ha,na);else{ba.getModel().beginUpdate();try{na=[];var Ha=[];if(null!=pa.index){for(var wa=[],Da=pa.parentRow.nextSibling;Da&&Da.getAttribute("data-pName")==va;)wa.push(Da.getAttribute("data-pValue")),Da=Da.nextSibling;pa.index<wa.length?null!=Aa?wa.splice(Aa,1):wa[pa.index]=ha:wa.push(ha);null!=pa.size&&wa.length>+pa.size&&(wa=wa.slice(0,pa.size));ha=wa.join(",");null!=pa.countProperty&&(ba.setCellStyles(pa.countProperty,wa.length,ba.getSelectionCells()),na.push(pa.countProperty),Ha.push(wa.length))}ba.setCellStyles(va,ha,ba.getSelectionCells());na.push(va);Ha.push(ha);if(null!=pa.dependentProps)for(va=0;va<pa.dependentProps.length;va++){var Ea=pa.dependentPropsDefVal[va],Na=pa.dependentPropsVals[va];if(Na.length>ha)Na=Na.slice(0,ha);else for(var Ba=Na.length;Ba<ha;Ba++)Na.push(Ea);Na=Na.join(",");ba.setCellStyles(pa.dependentProps[va],+Na,ba.getSelectionCells());na.push(pa.dependentProps[va]);Ha.push(Na)}if("function"==typeof pa.onChange)pa.onChange(ba,ha);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",na,"values",Ha,"cells",ba.getSelectionCells()))}finally{ba.getModel().endUpdate()}}}function R(va,ha,pa){var Aa=mxUtils.getOffset(g,!0),na=mxUtils.getOffset(va,!0);ha.style.position="absolute";ha.style.left=na.x-Aa.x+"px";ha.style.top=na.y-Aa.y+"px";ha.style.width=va.offsetWidth+"px";ha.style.height=va.offsetHeight-+(pa?4:0)+"px";ha.style.zIndex=5}function S(va,ha,pa){function Aa(Ha){if(null==Ha||Ha==mxConstants.NONE)na.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==Ha)na.style.background="";else{var wa=mxUtils.getLightDarkColor(Ha);mxUtils.isLightDarkColor(Ha)&&wa.light!=wa.dark?na.style.background="linear-gradient(to right bottom, "+wa.cssText+" 50%, "+mxUtils.invertLightDarkColor(wa).cssText+" 50.3%)":na.style.background=Ha}}var na=document.createElement("div");na.style.width=+"32px";na.style.height="8px";na.style.margin="2px";na.style.borderStyle="solid";na.style.borderWidth="1px";Aa(ha);btn=mxUtils.button("",mxUtils.bind(Z,function(Ha){this.editorUi.pickColor(ha,function(wa){L(va,wa,pa);Aa(wa)});mxEvent.consume(Ha)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(na);return btn}function V(va,ha,pa,Aa,na,Ha,wa){null!=ha&&(ha=ha.split(","),fa.push({name:va,values:ha,type:pa,+defVal:Aa,countProperty:na,parentRow:Ha,isDeletable:!0,flipBkg:wa}));btn=mxUtils.button("+",mxUtils.bind(Z,function(Da){for(var Ea=Ha,Na=0;null!=Ea.nextSibling;)if(Ea.nextSibling.getAttribute("data-pName")==va)Ea=Ea.nextSibling,Na++;else break;var Ba={type:pa,parentRow:Ha,index:Na,isDeletable:!0,defVal:Aa,countProperty:na};Na=Y(va,"",Ba,0==Na%2,wa);L(va,Aa,Ba);Ea.parentNode.insertBefore(Na,Ea.nextSibling);mxEvent.consume(Da)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";+return btn}function W(va,ha,pa,Aa,na,Ha,wa){if(0<na){var Da=Array(na);ha=null!=ha?ha.split(","):[];for(var Ea=0;Ea<na;Ea++)Da[Ea]=null!=ha[Ea]?ha[Ea]:null!=Aa?Aa:"";fa.push({name:va,values:Da,type:pa,defVal:Aa,parentRow:Ha,flipBkg:wa,size:na})}return document.createElement("div")}function X(va,ha,pa){var Aa=document.createElement("input");Aa.type="checkbox";Aa.checked="1"==ha;mxEvent.addListener(Aa,"change",function(){L(va,Aa.checked?"1":"0",pa)});return Aa}function Y(va,ha,pa,Aa,na){var Ha=pa.dispName,+wa=pa.type,Da=document.createElement("tr");Da.className="gePropRow"+(na?"Dark":"")+(Aa?"Alt":"")+" gePropNonHeaderRow";Da.setAttribute("data-pName",va);Da.setAttribute("data-pValue",ha);Aa=!1;null!=pa.index&&(Da.setAttribute("data-index",pa.index),Ha=(null!=Ha?Ha:"")+"["+pa.index+"]",Aa=!0);var Ea=document.createElement("td");Ea.className="gePropRowCell";Ha=mxResources.get(Ha,null,Ha);mxUtils.write(Ea,Ha);Ea.setAttribute("title",Ha);Aa&&(Ea.style.textAlign="right");Da.appendChild(Ea);Ea=document.createElement("td");+Ea.className="gePropRowCell";Ea.setAttribute("title",null!=ha?ha:mxResources.get("none"));if("color"==wa)Ea.appendChild(S(va,ha,pa));else if("bool"==wa||"boolean"==wa)Ea.appendChild(X(va,ha,pa));else if("enum"==wa){var Na=pa.enumList;for(na=0;na<Na.length;na++)if(Ha=Na[na],Ha.val==ha){mxUtils.write(Ea,mxResources.get(Ha.dispName,null,Ha.dispName));break}mxEvent.addListener(Ea,"click",mxUtils.bind(Z,function(){var Ba=document.createElement("select"),Ca=null;R(Ea,Ba);for(var Ia=0;Ia<Na.length;Ia++){var Va=+Na[Ia],Ta=document.createElement("option");Ta.value=mxUtils.htmlEntities(Va.val);mxUtils.write(Ta,mxResources.get(Va.dispName,null,Va.dispName));Ba.appendChild(Ta);null==Va.val&&(Ta.value="null",Ca=Ta)}Ba.value=null==ha&&null!=Ca?"null":ha;g.appendChild(Ba);mxEvent.addListener(Ba,"change",function(){var Xa=mxUtils.htmlEntities(Ba.value);if(Ba[Ba.selectedIndex]==Ca||"null"==Xa.value)Xa=null;L(va,Xa,pa)});Ba.focus();mxEvent.addListener(Ba,"blur",function(){g.removeChild(Ba)})}))}else"dynamicArr"==wa?+Ea.appendChild(V(va,ha,pa.subType,pa.subDefVal,pa.countProperty,Da,na)):"staticArr"==wa?Ea.appendChild(W(va,ha,pa.subType,pa.subDefVal,pa.size,Da,na)):"readOnly"==wa?(na=document.createElement("input"),na.setAttribute("readonly",""),na.value=ha,na.style.borderWidth="0px","id"==va?(na.style.width="190px",na.style.position="relative",na.style.right="6px",na.style.float="right",na.style.background="none",na.style.textAlign="right",Da.firstChild.setAttribute("colspan","2"),na.setAttribute("title",ha),+Da.firstChild.appendChild(na)):(na.style.width="96px",Ea.appendChild(na))):(Ea.innerHTML=mxUtils.htmlEntities(decodeURIComponent(ha)),mxEvent.addListener(Ea,"click",mxUtils.bind(Z,function(){function Ba(){var Ia=Ca.value;Ia=0==Ia.length&&"string"!=wa&&"numbers"!=wa?0:Ia;pa.allowAuto&&(null!=Ia.trim&&"auto"==Ia.trim().toLowerCase()?(Ia="auto",wa="string"):(Ia=parseFloat(Ia),Ia=isNaN(Ia)?0:Ia));null!=pa.min&&Ia<pa.min?Ia=pa.min:null!=pa.max&&Ia>pa.max&&(Ia=pa.max);var Va=null;try{Va="numbers"==wa?Ia.match(/\d+/g).map(Number).join(" "):+encodeURIComponent(("int"==wa?parseInt(Ia):Ia)+"")}catch(Ta){}L(va,Va,pa,null,Ca)}var Ca=document.createElement("input");R(Ea,Ca,!0);Ca.value=decodeURIComponent(ha);Ca.className="gePropEditor";"int"!=wa&&"float"!=wa||pa.allowAuto||(Ca.type="number",Ca.step="int"==wa?"1":"any",null!=pa.min&&(Ca.min=parseFloat(pa.min)),null!=pa.max&&(Ca.max=parseFloat(pa.max)));g.appendChild(Ca);mxEvent.addListener(Ca,"keypress",function(Ia){13==Ia.keyCode&&Ba()});Ca.focus();mxEvent.addListener(Ca,"blur",function(){Ba()})})));+pa.isDeletable&&(na=mxUtils.button("-",mxUtils.bind(Z,function(Ba){L(va,"",pa,pa.index);mxEvent.consume(Ba)})),na.style.height="16px",na.style.width="25px",na.style.float="right",na.className="geColorBtn",Ea.appendChild(na));Da.appendChild(Ea);return Da}var Z=this,ba=this.editorUi.editor.graph,fa=[];g.style.position="relative";g.style.padding="0";var ca=document.createElement("table");ca.className="geProperties";ca.style.whiteSpace="nowrap";ca.style.width="100%";var da=document.createElement("tr");+da.className="gePropHeader";var ma=document.createElement("th");ma.className="gePropHeaderCell";ma.style.paddingLeft="16px";ma.style.backgroundRepeat="no-repeat";ma.style.backgroundPosition="-2px 50%";ma.style.backgroundSize="20px";mxUtils.write(ma,mxResources.get("property"));da.style.cursor="pointer";var aa=function(){var va=ca.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){ma.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ha="none";for(var pa=g.childNodes.length-+1;0<=pa;pa--)try{var Aa=g.childNodes[pa],na=Aa.nodeName.toUpperCase();"INPUT"!=na&&"SELECT"!=na||g.removeChild(Aa)}catch(Ha){}}else ma.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ha="";for(pa=0;pa<va.length;pa++)va[pa].style.display=ha};mxEvent.addListener(da,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;aa()});da.appendChild(ma);var ia=document.createElement("th");ia.className="gePropHeaderCell";ia.style.paddingLeft="4px";mxUtils.write(ia,mxResources.get("value"));+da.appendChild(ia);ca.appendChild(da);var ka=ia=!1;da=null;1==G.vertices.length&&0==G.edges.length?da=G.vertices[0].id:0==G.vertices.length&&1==G.edges.length&&(da=G.edges[0].id);null==da||J||ca.appendChild(Y("id",mxUtils.htmlEntities(da),{dispName:"id",type:"readOnly"},!0,!1));for(var ta in p)if(J=p[ta],"function"!=typeof J.isVisible||J.isVisible(G,this)){var sa=null!=J.getValue?J.getValue():null!=G.style[ta]?mxUtils.htmlEntities(G.style[ta]+""):null!=J.getDefaultValue?J.getDefaultValue(G,this):+J.defVal;if("separator"==J.type)ka=!ka;else{if("staticArr"==J.type)J.size=parseInt(G.style[J.sizeProperty]||p[J.sizeProperty].defVal)||0;else if(null!=J.dependentProps){var ea=J.dependentProps,ra=[],ua=[];for(da=0;da<ea.length;da++){var za=G.style[ea[da]];ua.push(p[ea[da]].subDefVal);ra.push(null!=za?za.split(","):[])}J.dependentPropsDefVal=ua;J.dependentPropsVals=ra}ca.appendChild(Y(ta,sa,J,ia,ka));ia=!ia}}for(da=0;da<fa.length;da++)for(J=fa[da],p=J.parentRow,G=0;G<J.values.length;G++)ta=Y(J.name,+J.values[G],{type:J.type,parentRow:J.parentRow,isDeletable:J.isDeletable,index:G,defVal:J.defVal,countProperty:J.countProperty,size:J.size},0==G%2,J.flipBkg),p.parentNode.insertBefore(ta,p.nextSibling),p=ta;g.appendChild(ca);aa();return g};StyleFormatPanel.prototype.addStyles=function(g){if(null!=this.defaultColorSchemes){var p=function(fa){mxEvent.addListener(fa,"mouseenter",function(){fa.style.opacity="1"});mxEvent.addListener(fa,"mouseleave",function(){fa.style.opacity="0.5"})},G=this.editorUi,+J=G.editor.graph,L=document.createElement("div");L.style.whiteSpace="nowrap";L.style.paddingLeft="24px";L.style.paddingRight="20px";g.style.paddingLeft="16px";g.style.paddingBottom="6px";g.style.position="relative";g.appendChild(L);var R=document.createElement("div");R.style.whiteSpace="nowrap";R.style.position="relative";R.style.textAlign="center";R.style.width="210px";for(var S=[],V=0;V<this.defaultColorSchemes.length;V++){var W=document.createElement("div");W.style.display="inline-block";W.style.width=+"6px";W.style.height="6px";W.style.marginLeft="4px";W.style.marginRight="3px";W.style.borderRadius="3px";W.style.cursor="pointer";W.style.background="transparent";W.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(fa){mxEvent.addListener(W,"click",mxUtils.bind(this,function(){X(fa)}))})(V);S.push(W);R.appendChild(W)}var X=mxUtils.bind(this,function(fa){null!=S[fa]&&(null!=this.format.currentScheme&&null!=S[this.format.currentScheme]&&(S[this.format.currentScheme].style.background="transparent"),+this.format.currentScheme=fa,Y(this.defaultColorSchemes[this.format.currentScheme]),S[this.format.currentScheme].style.background="#84d7ff")}),Y=mxUtils.bind(this,function(fa){var ca=mxUtils.clone(J.defaultVertexStyle);ca[mxConstants.STYLE_STROKECOLOR]=null!=ca[mxConstants.STYLE_STROKECOLOR]?ca[mxConstants.STYLE_STROKECOLOR]:"default";ca[mxConstants.STYLE_FILLCOLOR]=null!=ca[mxConstants.STYLE_FILLCOLOR]?ca[mxConstants.STYLE_FILLCOLOR]:"default";ca[mxConstants.STYLE_FONTCOLOR]=null!=ca[mxConstants.STYLE_FONTCOLOR]?+ca[mxConstants.STYLE_FONTCOLOR]:"default";J.replaceDefaultColors(new mxCell,ca);var da=mxUtils.bind(this,function(aa){var ia=mxUtils.button("",mxUtils.bind(this,function(sa){J.getModel().beginUpdate();try{for(var ea=G.getSelectionState().cells,ra=0;ra<ea.length;ra++){var ua=J.getModel().getStyle(ea[ra]);null!=aa?(mxEvent.isShiftDown(sa)||(ua=""==aa.fill||null==aa.fill?mxUtils.setStyle(ua,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ua,mxConstants.STYLE_FILLCOLOR,aa.fill),ua=""==aa.gradient||+null==aa.gradient?mxUtils.setStyle(ua,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ua,mxConstants.STYLE_GRADIENTCOLOR,aa.gradient),mxEvent.isControlDown(sa)||mxClient.IS_MAC&&mxEvent.isMetaDown(sa)||!J.getModel().isVertex(ea[ra])||(ua=""==aa.font||null==aa.font?mxUtils.setStyle(ua,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ua,mxConstants.STYLE_FONTCOLOR,aa.font))),mxEvent.isAltDown(sa)||(ua=""==aa.stroke||null==aa.fill?mxUtils.setStyle(ua,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ua,+mxConstants.STYLE_STROKECOLOR,aa.stroke))):(ua=mxUtils.setStyle(ua,mxConstants.STYLE_FILLCOLOR,null),ua=mxUtils.setStyle(ua,mxConstants.STYLE_STROKECOLOR,null),ua=mxUtils.setStyle(ua,mxConstants.STYLE_GRADIENTCOLOR,null),J.getModel().isVertex(ea[ra])&&(ua=mxUtils.setStyle(ua,mxConstants.STYLE_FONTCOLOR,null)));J.getModel().setStyle(ea[ra],ua)}}finally{J.getModel().endUpdate()}}));ia.className="geStyleButton";ia.style.width="36px";ia.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ia.style.margin="0px 6px 6px 0px";if(null!=aa){var ka="1px solid";null!=aa.border&&(ka=aa.border);if(null!=aa.gradient)ia.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(aa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(aa.gradient).cssText+" 100%)";else if(aa.fill==mxConstants.NONE)ia.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==aa.fill||""==aa.fill)ia.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ca,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ta=mxUtils.getLightDarkColor(aa.fill);ia.style.backgroundImage="linear-gradient(to right bottom, "+ta.cssText+" 50%, "+ta.light+" 50.3%)"}null==aa.stroke||aa.stroke==mxConstants.NONE?ia.style.border=ka+" transparent":""==aa.stroke?ia.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ca,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ta=mxUtils.getLightDarkColor(aa.stroke),ia.style.border=ka+" "+ta.cssText,ia.style.borderRightColor=ta.light,ia.style.borderBottomColor=-ia.style.borderRightColor);null!=aa.title&&ia.setAttribute("title",aa.title)}else ka=mxUtils.getValue(ca,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ta=mxUtils.getValue(ca,mxConstants.STYLE_STROKECOLOR,"#000000"),ia.style.backgroundColor=ka,ia.style.border="1px solid "+ta;ia.style.borderRadius="0";M.appendChild(ia);null!=aa&&null!=aa.gradient&&(ka=ia.cloneNode(!1),ka.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(aa.fill).light+") 0px, light-dark(transparent, "+-mxUtils.getLightDarkColor(aa.gradient).light+") 100%)",ka.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",ka.style.backgroundColor="transparent",M.appendChild(ka),ka.style.marginLeft="-42px",mxEvent.addListener(ka,"click",function(){ia.click()}))});M.innerText="";if(null!=ha)for(var ma=0;ma<ha.length;ma++)0<ma&&0==mxUtils.mod(ma,4)&&mxUtils.br(M),da(ha[ma])});null==this.format.currentScheme?X(Math.min(S.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):X(this.format.currentScheme);V=+ia.style.borderRightColor);null!=aa.title&&ia.setAttribute("title",aa.title)}else ka=mxUtils.getValue(ca,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ta=mxUtils.getValue(ca,mxConstants.STYLE_STROKECOLOR,"#000000"),ia.style.backgroundColor=ka,ia.style.border="1px solid "+ta;ia.style.borderRadius="0";L.appendChild(ia);null!=aa&&null!=aa.gradient&&(ka=ia.cloneNode(!1),ka.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(aa.fill).light+") 0px, light-dark(transparent, "++mxUtils.getLightDarkColor(aa.gradient).light+") 100%)",ka.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",ka.style.backgroundColor="transparent",L.appendChild(ka),ka.style.marginLeft="-42px",mxEvent.addListener(ka,"click",function(){ia.click()}))});L.innerText="";if(null!=fa)for(var ma=0;ma<fa.length;ma++)0<ma&&0==mxUtils.mod(ma,4)&&mxUtils.br(L),da(fa[ma])});null==this.format.currentScheme?X(Math.min(S.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):X(this.format.currentScheme);V=10>=this.defaultColorSchemes.length?28:8;var Z=document.createElement("div");Z.style.cssText="position:absolute;left:10px;top:8px;bottom:"+V+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){X(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ba=document.createElement("div");ba.style.cssText="position:absolute;left:202px;top:8px;bottom:"+V+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";1<this.defaultColorSchemes.length&&(g.appendChild(Z),g.appendChild(ba));mxEvent.addListener(ba,"click",mxUtils.bind(this,function(){X(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));p(Z);p(ba);Y(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&g.appendChild(R)}return g}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(g){return g.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||g.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(g){return Graph.isGoogleFontUrl(g)};Graph.rewriteGoogleFontUrl=function(g){null!=g&&g.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(g=Editor.GOOGLE_FONTS_CSS2+g.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return g};Graph.createFontElement=-function(g,p){var F=Graph.fontMapping[p];null==F&&Graph.isCssFontUrl(p)?(g=document.createElement("link"),g.setAttribute("rel","stylesheet"),g.setAttribute("type","text/css"),g.setAttribute("charset","UTF-8"),g.setAttribute("href",Graph.rewriteGoogleFontUrl(p))):(null==F&&(F='@font-face {\nfont-family: "'+g+'";\nsrc: url("'+p+'");\n}'),g=document.createElement("style"),mxUtils.write(g,F));return g};Graph.addRecentCustomFont=function(g,p){};Graph.addFont=function(g,p,F){if(null!=g&&0<g.length&&null!=-p&&0<p.length){var K=g.toLowerCase();if("helvetica"!=K&&"arial"!=g&&"sans-serif"!=K){var M=Graph.customFontElements[K];null!=M&&M.url!=p&&(M.elt.parentNode.removeChild(M.elt),M=null);null==M?(M=p,"http:"==p.substring(0,5)&&(M=PROXY_URL+"?url="+encodeURIComponent(p)),M={name:g,url:p,elt:Graph.createFontElement(g,M)},Graph.customFontElements[K]=M,p=document.getElementsByTagName("head")[0],null!=F&&("link"==M.elt.nodeName.toLowerCase()?(M.elt.onload=F,M.elt.onerror=F):F()),null!=p&&p.appendChild(M.elt)):-null!=F&&F()}else null!=F&&F()}else null!=F&&F();return g};Graph.getFontUrl=function(g,p){g=Graph.customFontElements[g.toLowerCase()];null!=g&&(p=g.url);return p};Graph.processFontAttributes=function(g){g=g.getElementsByTagName("*");for(var p=0;p<g.length;p++){var F=g[p].getAttribute("data-font-src");if(null!=F){var K="FONT"==g[p].nodeName?g[p].getAttribute("face"):g[p].style.fontFamily;null!=K&&Graph.addFont(K,F)}}};Graph.processFontStyle=function(g){if(null!=g){var p=mxUtils.getValue(g,"fontSource",-null);if(null!=p){var F=mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,null);if(null!=F)try{Graph.addFont(F,decodeURIComponent(p))}catch(K){}}}return g};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur=-"1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var e=Graph.prototype.init;Graph.prototype.init=function(){function g(M){p=M}e.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var p=null;mxEvent.addListener(this.container,"mouseenter",g);mxEvent.addListener(this.container,"mousemove",g);mxEvent.addListener(this.container,"mouseleave",function(M){p=null});this.isMouseInsertPoint=function(){return null!=-p};var F=this.getInsertPoint;this.getInsertPoint=function(){return null!=p?this.getPointForEvent(p):F.apply(this,arguments)};var K=this.layoutManager.getLayout;this.layoutManager.getLayout=function(M){var R=this.graph.getCellStyle(M);if(null!=R&&"rack"==R.childLayout){var S=new mxStackLayout(this.graph,!1);S.gridSize=null!=R.rackUnitSize?parseFloat(R.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;S.marginLeft=R.marginLeft||0;S.marginRight=R.marginRight||0;S.marginTop=-R.marginTop||0;S.marginBottom=R.marginBottom||0;S.allowGaps=R.allowGaps||0;S.horizontal="1"==mxUtils.getValue(R,"horizontalRack","0");S.resizeParent=!1;S.fill=!0;return S}return K.apply(this,arguments)};this.updateGlobalUrlVariables()};var k=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(g,p){return Graph.processFontStyle(k.apply(this,arguments))};var n=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(g,p,F,K,M,R,S,V,W,X,-Y,Z){n.apply(this,arguments);Graph.processFontAttributes(Z)};var q=mxText.prototype.redraw;mxText.prototype.redraw=function(){q.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(g,p,F,K){function M(){for(var da=V.getSelectionCells(),ma=[],aa=0;aa<da.length;aa++)V.isCellVisible(da[aa])&&ma.push(da[aa]);V.setSelectionCells(ma)}function R(da){V.setHiddenTags(da?[]:W.slice());M();V.refresh()}function S(da,-ma){Y.innerText="";if(0<da.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ia=document.createElement("tbody");if(null!=da&&0<da.length)for(var ka=0;ka<da.length;ka++)(function(ta){function sa(){var fa=V.getCellsForTags([ta],null,null,!0);V.isEnabled()?V.setSelectionCells(fa):V.highlightCells(fa,null,null,70)}var ea=0>mxUtils.indexOf(V.hiddenTags,ta),ra=document.createElement("tr"),-ua=document.createElement("td");ua.style.align="center";ua.style.width="16px";var za=document.createElement("img");za.setAttribute("src",ea?Editor.visibleImage:Editor.hiddenImage);za.setAttribute("title",mxResources.get(ea?"hideIt":"show",[ta]));mxUtils.setOpacity(za,ea?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width="16px";if(p||Editor.isDarkMode())za.style.filter="invert(100%)";ua.appendChild(za);mxEvent.addListener(za,"click",function(fa){mxEvent.isShiftDown(fa)?-R(0<=mxUtils.indexOf(V.hiddenTags,ta)):(V.toggleHiddenTag(ta),M(),V.refresh());mxEvent.consume(fa)});ra.appendChild(ua);ua=document.createElement("td");ua.style.align="center";ua.style.width="16px";za=document.createElement("img");za.setAttribute("src",Editor.selectImage);za.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(za,ea?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width="16px";if(p||Editor.isDarkMode())za.style.filter=-"invert(100%)";mxEvent.addListener(za,"click",function(fa){R(!0);sa();mxEvent.consume(fa)});ua.appendChild(za);ra.appendChild(ua);ua=document.createElement("td");ua.style.overflow="hidden";ua.style.whiteSpace="nowrap";ua.style.textOverflow="ellipsis";ua.style.verticalAlign="middle";ua.style.cursor="pointer";ua.setAttribute("title",ta);a=document.createElement("a");mxUtils.write(a,ta);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,ea?100:40);ua.appendChild(a);mxEvent.addListener(ua,-"click",function(fa){if(mxEvent.isShiftDown(fa))R(!0),sa();else if(ea&&0<V.hiddenTags.length)R(!0);else{var pa=W.slice(),Aa=mxUtils.indexOf(pa,ta);pa.splice(Aa,1);V.setHiddenTags(pa);M();V.refresh()}mxEvent.consume(fa)});ra.appendChild(ua);if(V.isEnabled()){ua=document.createElement("td");ua.style.verticalAlign="middle";ua.style.textAlign="center";ua.style.width="18px";if(null==ma){ua.style.align="center";ua.style.width="16px";za=document.createElement("img");za.setAttribute("src",Editor.trashImage);-za.setAttribute("title",mxResources.get("removeIt",[ta]));mxUtils.setOpacity(za,ea?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width="16px";if(p||Editor.isDarkMode())za.style.filter="invert(100%)";mxEvent.addListener(za,"click",function(fa){var pa=mxUtils.indexOf(W,ta);0<=pa&&W.splice(pa,1);V.removeTagsForCells(V.model.getDescendants(V.model.getRoot()),[ta]);V.refresh();mxEvent.consume(fa)});ua.appendChild(za)}else{var va=document.createElement("input");-va.setAttribute("type","checkbox");va.style.margin="0px";va.defaultChecked=null!=ma&&0<=mxUtils.indexOf(ma,ta);va.checked=va.defaultChecked;va.style.background="transparent";va.setAttribute("title",mxResources.get(va.defaultChecked?"removeIt":"add",[ta]));mxEvent.addListener(va,"change",function(fa){va.checked?V.addTagsForCells(V.getSelectionCells(),[ta]):V.removeTagsForCells(V.getSelectionCells(),[ta]);mxEvent.consume(fa)});ua.appendChild(va)}ra.appendChild(ua)}ia.appendChild(ra)})(da[ka]);aa.appendChild(ia);+function(g,p){var G=Graph.fontMapping[p];null==G&&Graph.isCssFontUrl(p)?(g=document.createElement("link"),g.setAttribute("rel","stylesheet"),g.setAttribute("type","text/css"),g.setAttribute("charset","UTF-8"),g.setAttribute("href",Graph.rewriteGoogleFontUrl(p))):(null==G&&(G='@font-face {\nfont-family: "'+g+'";\nsrc: url("'+p+'");\n}'),g=document.createElement("style"),mxUtils.write(g,G));return g};Graph.addRecentCustomFont=function(g,p){};Graph.addFont=function(g,p,G){if(null!=g&&0<g.length&&null!=+p&&0<p.length){var J=g.toLowerCase();if("helvetica"!=J&&"arial"!=g&&"sans-serif"!=J){var L=Graph.customFontElements[J];null!=L&&L.url!=p&&(L.elt.parentNode.removeChild(L.elt),L=null);null==L?(L=p,"http:"==p.substring(0,5)&&(L=PROXY_URL+"?url="+encodeURIComponent(p)),L={name:g,url:p,elt:Graph.createFontElement(g,L)},Graph.customFontElements[J]=L,p=document.getElementsByTagName("head")[0],null!=G&&("link"==L.elt.nodeName.toLowerCase()?(L.elt.onload=G,L.elt.onerror=G):G()),null!=p&&p.appendChild(L.elt)):+null!=G&&G()}else null!=G&&G()}else null!=G&&G();return g};Graph.getFontUrl=function(g,p){g=Graph.customFontElements[g.toLowerCase()];null!=g&&(p=g.url);return p};Graph.processFontAttributes=function(g){g=g.getElementsByTagName("*");for(var p=0;p<g.length;p++){var G=g[p].getAttribute("data-font-src");if(null!=G){var J="FONT"==g[p].nodeName?g[p].getAttribute("face"):g[p].style.fontFamily;null!=J&&Graph.addFont(J,G)}}};Graph.processFontStyle=function(g){if(null!=g){var p=mxUtils.getValue(g,"fontSource",+null);if(null!=p){var G=mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,null);if(null!=G)try{Graph.addFont(G,decodeURIComponent(p))}catch(J){}}}return g};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur=+"1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var e=Graph.prototype.init;Graph.prototype.init=function(){function g(L){p=L}e.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var p=null;mxEvent.addListener(this.container,"mouseenter",g);mxEvent.addListener(this.container,"mousemove",g);mxEvent.addListener(this.container,"mouseleave",function(L){p=null});this.isMouseInsertPoint=function(){return null!=+p};var G=this.getInsertPoint;this.getInsertPoint=function(){return null!=p?this.getPointForEvent(p):G.apply(this,arguments)};var J=this.layoutManager.getLayout;this.layoutManager.getLayout=function(L){var R=this.graph.getCellStyle(L);if(null!=R&&"rack"==R.childLayout){var S=new mxStackLayout(this.graph,!1);S.gridSize=null!=R.rackUnitSize?parseFloat(R.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;S.marginLeft=R.marginLeft||0;S.marginRight=R.marginRight||0;S.marginTop=+R.marginTop||0;S.marginBottom=R.marginBottom||0;S.allowGaps=R.allowGaps||0;S.horizontal="1"==mxUtils.getValue(R,"horizontalRack","0");S.resizeParent=!1;S.fill=!0;return S}return J.apply(this,arguments)};this.updateGlobalUrlVariables()};var k=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(g,p){return Graph.processFontStyle(k.apply(this,arguments))};var n=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(g,p,G,J,L,R,S,V,W,X,+Y,Z){n.apply(this,arguments);Graph.processFontAttributes(Z)};var q=mxText.prototype.redraw;mxText.prototype.redraw=function(){q.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(g,p,G,J){function L(){for(var da=V.getSelectionCells(),ma=[],aa=0;aa<da.length;aa++)V.isCellVisible(da[aa])&&ma.push(da[aa]);V.setSelectionCells(ma)}function R(da){V.setHiddenTags(da?[]:W.slice());L();V.refresh()}function S(da,+ma){Y.innerText="";if(0<da.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ia=document.createElement("tbody");if(null!=da&&0<da.length)for(var ka=0;ka<da.length;ka++)(function(ta){function sa(){var ha=V.getCellsForTags([ta],null,null,!0);V.isEnabled()?V.setSelectionCells(ha):V.highlightCells(ha,null,null,70)}var ea=0>mxUtils.indexOf(V.hiddenTags,ta),ra=document.createElement("tr"),+ua=document.createElement("td");ua.style.align="center";ua.style.width="16px";var za=document.createElement("img");za.setAttribute("src",ea?Editor.visibleImage:Editor.hiddenImage);za.setAttribute("title",mxResources.get(ea?"hideIt":"show",[ta]));mxUtils.setOpacity(za,ea?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width="16px";if(p||Editor.isDarkMode())za.style.filter="invert(100%)";ua.appendChild(za);mxEvent.addListener(za,"click",function(ha){mxEvent.isShiftDown(ha)?+R(0<=mxUtils.indexOf(V.hiddenTags,ta)):(V.toggleHiddenTag(ta),L(),V.refresh());mxEvent.consume(ha)});ra.appendChild(ua);ua=document.createElement("td");ua.style.align="center";ua.style.width="16px";za=document.createElement("img");za.setAttribute("src",Editor.selectImage);za.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(za,ea?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width="16px";if(p||Editor.isDarkMode())za.style.filter=+"invert(100%)";mxEvent.addListener(za,"click",function(ha){R(!0);sa();mxEvent.consume(ha)});ua.appendChild(za);ra.appendChild(ua);ua=document.createElement("td");ua.style.overflow="hidden";ua.style.whiteSpace="nowrap";ua.style.textOverflow="ellipsis";ua.style.verticalAlign="middle";ua.style.cursor="pointer";ua.setAttribute("title",ta);a=document.createElement("a");mxUtils.write(a,ta);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,ea?100:40);ua.appendChild(a);mxEvent.addListener(ua,+"click",function(ha){if(mxEvent.isShiftDown(ha))R(!0),sa();else if(ea&&0<V.hiddenTags.length)R(!0);else{var pa=W.slice(),Aa=mxUtils.indexOf(pa,ta);pa.splice(Aa,1);V.setHiddenTags(pa);L();V.refresh()}mxEvent.consume(ha)});ra.appendChild(ua);if(V.isEnabled()){ua=document.createElement("td");ua.style.verticalAlign="middle";ua.style.textAlign="center";ua.style.width="18px";if(null==ma){ua.style.align="center";ua.style.width="16px";za=document.createElement("img");za.setAttribute("src",Editor.trashImage);+za.setAttribute("title",mxResources.get("removeIt",[ta]));mxUtils.setOpacity(za,ea?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width="16px";if(p||Editor.isDarkMode())za.style.filter="invert(100%)";mxEvent.addListener(za,"click",function(ha){var pa=mxUtils.indexOf(W,ta);0<=pa&&W.splice(pa,1);V.removeTagsForCells(V.model.getDescendants(V.model.getRoot()),[ta]);V.refresh();mxEvent.consume(ha)});ua.appendChild(za)}else{var va=document.createElement("input");+va.setAttribute("type","checkbox");va.style.margin="0px";va.defaultChecked=null!=ma&&0<=mxUtils.indexOf(ma,ta);va.checked=va.defaultChecked;va.style.background="transparent";va.setAttribute("title",mxResources.get(va.defaultChecked?"removeIt":"add",[ta]));mxEvent.addListener(va,"change",function(ha){va.checked?V.addTagsForCells(V.getSelectionCells(),[ta]):V.removeTagsForCells(V.getSelectionCells(),[ta]);mxEvent.consume(ha)});ua.appendChild(va)}ra.appendChild(ua)}ia.appendChild(ra)})(da[ka]);aa.appendChild(ia);Y.appendChild(aa)}}var V=this,W=V.hiddenTags.slice(),X=document.createElement("div");X.style.userSelect="none";X.style.overflow="hidden";X.style.padding="10px";X.style.height="100%";var Y=document.createElement("div");Y.style.boxSizing="border-box";Y.style.borderRadius="4px";Y.style.userSelect="none";Y.style.overflow="auto";Y.style.position="absolute";Y.style.left="10px";Y.style.right="10px";Y.style.top="10px";Y.style.border=V.isEnabled()?"1px solid #808080":"none";Y.style.bottom=V.isEnabled()?"48px":-"10px";X.appendChild(Y);var Z=mxUtils.button(mxResources.get("reset"),function(da){V.setHiddenTags([]);mxEvent.isShiftDown(da)||(W=V.hiddenTags.slice());M();V.refresh()});Z.setAttribute("title",mxResources.get("reset"));Z.className="geBtn";Z.style.margin="0 4px 0 0";var ba=mxUtils.button(mxResources.get("add"),function(){null!=F&&F(W,function(da){W=da;ha()})});ba.setAttribute("title",mxResources.get("add"));ba.className="geBtn";ba.style.margin="0";V.addListener(mxEvent.ROOT,function(){W=V.hiddenTags.slice()});-var ha=mxUtils.bind(this,function(da,ma){if(g()){da=V.getAllTags();for(ma=0;ma<da.length;ma++)0>mxUtils.indexOf(W,da[ma])&&W.push(da[ma]);W.sort();V.isSelectionEmpty()?S(W):S(W,V.getCommonTagsForCells(V.getSelectionCells()))}});V.selectionModel.addListener(mxEvent.CHANGE,ha);V.model.addListener(mxEvent.CHANGE,ha);V.addListener(mxEvent.REFRESH,ha);var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.style.boxSizing="border-box";ca.style.whiteSpace="nowrap";ca.style.position=-"absolute";ca.style.overflow="hidden";ca.style.bottom="6px";ca.style.height="42px";ca.style.right="10px";ca.style.left="10px";V.isEnabled()&&(ca.appendChild(Z),ca.appendChild(ba),X.appendChild(ca));null!=K&&ca.appendChild(K);return{div:X,refresh:ha}};Graph.prototype.getCustomFonts=function(){var g=this.extFonts;g=null!=g?g.slice():[];for(var p in Graph.customFontElements){var F=Graph.customFontElements[p];g.push({name:F.name,url:F.url})}return g};Graph.prototype.setFont=function(g,p){Graph.addFont(g,-p);var F=Editor.guid();document.execCommand("fontname",!1,F);for(var K=this.cellEditor.textarea.getElementsByTagName("font"),M=!1,R=0;R<K.length;R++)K[R].getAttribute("face")==F&&(M=!0,K[R].setAttribute("face",g),null!=p?K[R].setAttribute("data-font-src",p):K[R].removeAttribute("data-font-src"));M||document.execCommand("fontname",!1,g)};var u=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return u.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=-function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var g=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=g)for(var p in g)this.globalVars[p]=g[p]}catch(F){null!=window.console&&console.log("Error in vars URL parameter: "+F)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var A=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=-function(g){var p=A.apply(this,arguments);null==p&&null!=this.globalVars&&(p=this.globalVars[g]);return p};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var g=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(g.ownerDocument)).decode(g)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var D=Graph.prototype.getSvg;Graph.prototype.getSvg=function(g,p,F,K,M,R,S,V,W,X,Y,Z,ba,ha,ca,da){var ma=D.apply(this,arguments);+"10px";X.appendChild(Y);var Z=mxUtils.button(mxResources.get("reset"),function(da){V.setHiddenTags([]);mxEvent.isShiftDown(da)||(W=V.hiddenTags.slice());L();V.refresh()});Z.setAttribute("title",mxResources.get("reset"));Z.className="geBtn";Z.style.margin="0 4px 0 0";var ba=mxUtils.button(mxResources.get("add"),function(){null!=G&&G(W,function(da){W=da;fa()})});ba.setAttribute("title",mxResources.get("add"));ba.className="geBtn";ba.style.margin="0";V.addListener(mxEvent.ROOT,function(){W=V.hiddenTags.slice()});+var fa=mxUtils.bind(this,function(da,ma){if(g()){da=V.getAllTags();for(ma=0;ma<da.length;ma++)0>mxUtils.indexOf(W,da[ma])&&W.push(da[ma]);W.sort();V.isSelectionEmpty()?S(W):S(W,V.getCommonTagsForCells(V.getSelectionCells()))}});V.selectionModel.addListener(mxEvent.CHANGE,fa);V.model.addListener(mxEvent.CHANGE,fa);V.addListener(mxEvent.REFRESH,fa);var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.style.boxSizing="border-box";ca.style.whiteSpace="nowrap";ca.style.position=+"absolute";ca.style.overflow="hidden";ca.style.bottom="6px";ca.style.height="42px";ca.style.right="10px";ca.style.left="10px";V.isEnabled()&&(ca.appendChild(Z),ca.appendChild(ba),X.appendChild(ca));null!=J&&ca.appendChild(J);return{div:X,refresh:fa}};Graph.prototype.getCustomFonts=function(){var g=this.extFonts;g=null!=g?g.slice():[];for(var p in Graph.customFontElements){var G=Graph.customFontElements[p];g.push({name:G.name,url:G.url})}return g};Graph.prototype.setFont=function(g,p){Graph.addFont(g,+p);var G=Editor.guid();document.execCommand("fontname",!1,G);for(var J=this.cellEditor.textarea.getElementsByTagName("font"),L=!1,R=0;R<J.length;R++)J[R].getAttribute("face")==G&&(L=!0,J[R].setAttribute("face",g),null!=p?J[R].setAttribute("data-font-src",p):J[R].removeAttribute("data-font-src"));L||document.execCommand("fontname",!1,g)};var u=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return u.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=+function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var g=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=g)for(var p in g)this.globalVars[p]=g[p]}catch(G){null!=window.console&&console.log("Error in vars URL parameter: "+G)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var A=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=+function(g){var p=A.apply(this,arguments);null==p&&null!=this.globalVars&&(p=this.globalVars[g]);return p};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var g=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(g.ownerDocument)).decode(g)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var D=Graph.prototype.getSvg;Graph.prototype.getSvg=function(g,p,G,J,L,R,S,V,W,X,Y,Z,ba,fa,ca,da){var ma=D.apply(this,arguments);if(null!=Z){var aa=ma.getAttribute("style");null==aa&&(aa="");Z="auto"==Z?"none"==this.getAdaptiveColors()?"light":"light dark":Z;ma.setAttribute("style",aa+(" color-scheme: "+Z+";"))}var ia=this.getCustomFonts();if(Y&&0<ia.length){var ka=ma.ownerDocument;aa=null!=ka.createElementNS?ka.createElementNS(mxConstants.NS_SVG,"style"):ka.createElement("style");null!=ka.setAttributeNS?aa.setAttributeNS("type","text/css"):aa.setAttribute("type","text/css");for(var ta="",sa="",ea=0;ea<ia.length;ea++){var ra=ia[ea].name,ua=ia[ea].url;Graph.isCssFontUrl(ua)?ta+="@import url("+Graph.rewriteGoogleFontUrl(ua)+");\n":sa+='@font-face {\nfont-family: "'+ra+'";\nsrc: url("'+ua+'");\n}\n'}aa.appendChild(ka.createTextNode(ta+sa));ma.getElementsByTagName("defs")[0].appendChild(aa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ma);this.mathEnabled&&(document.body.appendChild(ma),Editor.MathJaxRender(ma),ma.parentNode.removeChild(ma),aa=ma.ownerDocument.getElementById("MJX-SVG-styles"),-null!=aa&&ma.getElementsByTagName("defs")[0].appendChild(aa.cloneNode(!0)));return ma};var G=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(g){G.apply(this,arguments);null!=g.secondLabel&&(g.secondLabel.destroy(),g.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(g){return[g.shape,g.text,g.secondLabel,g.control]};var E=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){E.apply(this,arguments);this.enumerationState=+null!=aa&&ma.getElementsByTagName("defs")[0].appendChild(aa.cloneNode(!0)));return ma};var F=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(g){F.apply(this,arguments);null!=g.secondLabel&&(g.secondLabel.destroy(),g.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(g){return[g.shape,g.text,g.secondLabel,g.control]};var E=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){E.apply(this,arguments);this.enumerationState=0};var U=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(g){null!=g.shape&&this.redrawEnumerationState(g);return U.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(g){g=decodeURIComponent(mxUtils.getValue(g.style,"enumerateValue",""));""==g&&(g=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(g)+"</div>"};mxGraphView.prototype.redrawEnumerationState=-function(g){var p="1"==mxUtils.getValue(g.style,"enumerate",0);p&&null==g.secondLabel?(g.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),g.secondLabel.size=12,g.secondLabel.state=g,g.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(g,g.secondLabel)):p||null==g.secondLabel||(g.secondLabel.destroy(),g.secondLabel=null);p=g.secondLabel;if(null!=p){var F=g.view.scale,K=this.createEnumerationValue(g);g=this.graph.model.isVertex(g.cell)?-new mxRectangle(g.x+g.width-4*F,g.y+4*F,0,0):mxRectangle.fromPoint(g.view.getPoint(g));p.bounds.equals(g)&&p.value==K&&p.scale==F||(p.bounds=g,p.value=K,p.scale=F,p.redraw())}};var P=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();P.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var J=-Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){J.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(g,p){"data:action/json,"==g.substring(0,17)&&(g=JSON.parse(g.substring(17)),null!=g.actions&&this.executeCustomActions(g.actions,null,p))};Graph.prototype.executeCustomActions=function(g,p,F){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),-null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var K=!1,M=0,R=0,S=mxUtils.bind(this,function(){K||(K=!0,this.model.beginUpdate())}),V=mxUtils.bind(this,function(){K&&(K=!1,this.model.endUpdate())}),W=mxUtils.bind(this,function(){0<M&&M--;0==M&&X()}),X=mxUtils.bind(this,function(){if(R<g.length){var Y=this.stoppingCustomActions,Z=g[R++],ba=[];if(null!=Z.open)if(V(),this.isCustomLink(Z.open)){if(!this.customLinkClicked(Z.open,-F))return}else this.openLink(Z.open);null==Z.wait||Y||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;W()}),M++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Z.wait?parseInt(Z.wait):1E3),V());null!=Z.opacity&&null!=Z.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Z.opacity,!0)),Z.opacity.value);null!=Z.fadeIn&&(M++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeIn,-!0)),0,1,W,Y?0:Z.fadeIn.delay));null!=Z.fadeOut&&(M++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeOut,!0)),1,0,W,Y?0:Z.fadeOut.delay));null!=Z.wipeIn&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeIn,!0),!0)));null!=Z.wipeOut&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeOut,!0),!1)));null!=Z.toggle&&(S(),this.toggleCells(this.getCellsForAction(Z.toggle,!0)));if(null!=Z.show){S();var ha=this.getCellsForAction(Z.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ha),-1);this.setCellsVisible(ha,!0)}null!=Z.hide&&(S(),ha=this.getCellsForAction(Z.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ha),0),this.setCellsVisible(ha,!1));null!=Z.toggleStyle&&null!=Z.toggleStyle.key&&(S(),this.toggleCellStyles(Z.toggleStyle.key,null!=Z.toggleStyle.defaultValue?Z.toggleStyle.defaultValue:"0",this.getCellsForAction(Z.toggleStyle,!0)));null!=Z.style&&null!=Z.style.key&&(S(),this.setCellStyles(Z.style.key,Z.style.value,this.getCellsForAction(Z.style,!0)));ha=[];null!=-Z.select&&this.isEnabled()&&(ha=this.getCellsForAction(Z.select),this.setSelectionCells(ha));null!=Z.highlight&&(ha=this.getCellsForAction(Z.highlight),this.highlightCells(ha,Z.highlight.color,Z.highlight.duration,Z.highlight.opacity));null!=Z.scroll&&(ha=this.getCellsForAction(Z.scroll));null!=Z.viewbox&&this.fitWindow(Z.viewbox,Z.viewbox.border);0<ha.length&&this.scrollCellToVisible(ha[0]);null!=F&&null!=Z.explore&&Graph.exploreFromCell(this,F,Z.explore);if(null!=Z.tags){if(null!=Z.tags.toggle){var ca=-Z.tags.toggle;0==ca.length&&(ca=this.getAllTags());for(ha=0;ha<ca.length;ha++)this.toggleHiddenTag(ca[ha])}ca=null;null!=Z.tags.hidden&&(null==ca&&(ca=[]),ca=ca.concat(Z.tags.hidden));if(null!=Z.tags.visible){null==ca&&(ca=[]);var da=this.getAllTags();for(ha=0;ha<da.length;ha++)0>mxUtils.indexOf(Z.tags.visible,da[ha])&&0>mxUtils.indexOf(ca,da[ha])&&ca.push(da[ha])}null!=ca&&this.setHiddenTags(ca);this.refresh()}0<ba.length&&(M++,this.executeAnimations(ba,W,Y?1:Z.steps,Y?0:Z.delay));0==M?X():V()}else this.stoppingCustomActions=-this.executingCustomActions=!1,V(),null!=p&&p()});X()}};Graph.prototype.doUpdateCustomLinksForCell=function(g,p){var F=this.getLinkForCell(p);null!=F&&"data:action/json,"==F.substring(0,17)&&this.setLinkForCell(p,this.updateCustomLink(g,F));if(this.isHtmlLabel(p)){var K=document.createElement("div");K.innerHTML=Graph.sanitizeHtml(this.getLabel(p));for(var M=K.getElementsByTagName("a"),R=!1,S=0;S<M.length;S++)F=M[S].getAttribute("href"),null!=F&&"data:action/json,"==F.substring(0,17)&&(M[S].setAttribute("href",-this.updateCustomLink(g,F)),R=!0);R&&this.labelChanged(p,K.innerHTML)}};Graph.prototype.updateCustomLink=function(g,p){if("data:action/json,"==p.substring(0,17))try{var F=JSON.parse(p.substring(17));null!=F.actions&&(this.updateCustomLinkActions(g,F.actions),p="data:action/json,"+JSON.stringify(F))}catch(K){}return p};Graph.prototype.updateCustomLinkActions=function(g,p){for(var F=0;F<p.length;F++){var K=p[F],M;for(M in K)this.updateCustomLinkAction(g,K[M],"cells"),this.updateCustomLinkAction(g,K[M],-"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(g,p,F){if(null!=p&&null!=p[F]){for(var K=[],M=0;M<p[F].length;M++)if("*"==p[F][M])K.push(p[F][M]);else{var R=g[p[F][M]];null!=R?""!=R&&K.push(R):K.push(p[F][M])}p[F]=K}};Graph.prototype.getCellsForAction=function(g,p){p=this.getCellsById(g.cells).concat(this.getCellsForTags(g.tags,null,p));if(null!=g.excludeCells){for(var F=[],K=0;K<p.length;K++)0>g.excludeCells.indexOf(p[K].id)&&F.push(p[K]);p=F}return p};Graph.prototype.getCellsById=-function(g){var p=[];if(null!=g)for(var F=0;F<g.length;F++)if("*"==g[F]){var K=this.model.getRoot();p=p.concat(this.model.filterDescendants(function(R){return R!=K},K))}else{var M=this.model.getCell(g[F]);null!=M&&p.push(M)}return p};var m=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(g){return m.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(g))};Graph.prototype.setHiddenTags=function(g){this.hiddenTags=g;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};-Graph.prototype.toggleHiddenTag=function(g){var p=mxUtils.indexOf(this.hiddenTags,g);0>p?this.hiddenTags.push(g):0<=p&&this.hiddenTags.splice(p,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(g){if(null==g||0==g.length||0==this.hiddenTags.length)return!1;g=g.split(" ");if(g.length>this.hiddenTags.length)return!1;for(var p=0;p<g.length;p++)if(0>mxUtils.indexOf(this.hiddenTags,g[p]))return!1;return!0};Graph.prototype.getCellsForTags=function(g,p,F,-K){var M=[];if(null!=g){p=null!=p?p:this.model.getDescendants(this.model.getRoot());for(var R=0,S={},V=0;V<g.length;V++)0<g[V].length&&(S[g[V]]=!0,R++);for(V=0;V<p.length;V++)if(F&&this.model.getParent(p[V])==this.model.root||this.model.isVertex(p[V])||this.model.isEdge(p[V])){var W=this.getTagsForCell(p[V]),X=!1;if(0<W.length&&(W=W.split(" "),W.length>=g.length)){for(var Y=X=0;Y<W.length&&X<R;Y++)null!=S[W[Y]]&&X++;X=X==R}X&&(1!=K||this.isCellVisible(p[V]))&&M.push(p[V])}}return M};Graph.prototype.getAllTags=-function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(g){for(var p=null,F=[],K=0;K<g.length;K++){var M=this.getTagsForCell(g[K]);F=[];if(0<M.length){M=M.split(" ");for(var R={},S=0;S<M.length;S++)if(null==p||null!=p[M[S]])R[M[S]]=!0,F.push(M[S]);p=R}else return[]}return F};Graph.prototype.getTagsForCells=function(g){for(var p=[],F={},K=0;K<g.length;K++){var M=this.getTagsForCell(g[K]);if(0<M.length){M=M.split(" ");for(var R=-0;R<M.length;R++)null==F[M[R]]&&(F[M[R]]=!0,p.push(M[R]))}}return p};Graph.prototype.getTagsForCell=function(g){return this.getAttributeForCell(g,"tags","")};Graph.prototype.addTagsForCells=function(g,p){if(0<g.length&&0<p.length){this.model.beginUpdate();try{for(var F=0;F<g.length;F++){for(var K=this.getTagsForCell(g[F]),M=K.split(" "),R=!1,S=0;S<p.length;S++){var V=mxUtils.trim(p[S]);""!=V&&0>mxUtils.indexOf(M,V)&&(K=0<K.length?K+" "+V:V,R=!0)}R&&this.setAttributeForCell(g[F],"tags",K)}}finally{this.model.endUpdate()}}};-Graph.prototype.removeTagsForCells=function(g,p){if(0<g.length&&0<p.length){this.model.beginUpdate();try{for(var F=0;F<g.length;F++){var K=this.getTagsForCell(g[F]);if(0<K.length){for(var M=K.split(" "),R=!1,S=0;S<p.length;S++){var V=mxUtils.indexOf(M,p[S]);0<=V&&(M.splice(V,1),R=!0)}R&&this.setAttributeForCell(g[F],"tags",M.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(g){this.model.beginUpdate();try{for(var p=0;p<g.length;p++)this.model.setVisible(g[p],!this.model.isVisible(g[p]))}finally{this.model.endUpdate()}};-Graph.prototype.setCellsVisible=function(g,p){this.model.beginUpdate();try{for(var F=0;F<g.length;F++)this.model.setVisible(g[F],p)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(g,p,F,K){for(var M=0;M<g.length;M++)this.highlightCell(g[M],p,F,K)};Graph.prototype.highlightCell=function(g,p,F,K,M){p=null!=p?p:mxConstants.DEFAULT_VALID_COLOR;F=null!=F?F:1E3;g=this.view.getState(g);var R=null;null!=g&&(M=null!=M?M:4,M=Math.max(M+1,mxUtils.getValue(g.style,mxConstants.STYLE_STROKEWIDTH,-1)+M),R=new mxCellHighlight(this,p,M,!1),null!=K&&(R.opacity=K),R.highlight(g),window.setTimeout(function(){null!=R.shape&&(mxUtils.setPrefixedStyle(R.shape.node.style,"transition","all 1200ms ease-in-out"),R.shape.node.style.opacity=0);window.setTimeout(function(){R.destroy()},1200)},F));return R};Graph.prototype.addSvgShadow=function(g,p,F,K){F=null!=F?F:!1;K=null!=K?K:!0;var M=g.ownerDocument,R=null!=M.createElementNS?M.createElementNS(mxConstants.NS_SVG,"filter"):M.createElement("filter");R.setAttribute("id",-this.shadowId);var S=null!=M.createElementNS?M.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):M.createElement("feGaussianBlur");S.setAttribute("in","SourceAlpha");S.setAttribute("stdDeviation",this.svgShadowBlur);S.setAttribute("result","blur");R.appendChild(S);S=null!=M.createElementNS?M.createElementNS(mxConstants.NS_SVG,"feOffset"):M.createElement("feOffset");S.setAttribute("in","blur");S.setAttribute("dx",this.svgShadowSize);S.setAttribute("dy",this.svgShadowSize);S.setAttribute("result",-"offsetBlur");R.appendChild(S);S=null!=M.createElementNS?M.createElementNS(mxConstants.NS_SVG,"feFlood"):M.createElement("feFlood");S.setAttribute("flood-color",this.svgShadowColor);S.setAttribute("flood-opacity",this.svgShadowOpacity);S.setAttribute("result","offsetColor");R.appendChild(S);S=null!=M.createElementNS?M.createElementNS(mxConstants.NS_SVG,"feComposite"):M.createElement("feComposite");S.setAttribute("in","offsetColor");S.setAttribute("in2","offsetBlur");S.setAttribute("operator","in");-S.setAttribute("result","offsetBlur");R.appendChild(S);S=null!=M.createElementNS?M.createElementNS(mxConstants.NS_SVG,"feBlend"):M.createElement("feBlend");S.setAttribute("in","SourceGraphic");S.setAttribute("in2","offsetBlur");R.appendChild(S);S=g.getElementsByTagName("defs");0==S.length?(M=null!=M.createElementNS?M.createElementNS(mxConstants.NS_SVG,"defs"):M.createElement("defs"),null!=g.firstChild?g.insertBefore(M,g.firstChild):g.appendChild(M)):M=S[0];M.appendChild(R);F||(p=null!=p?p:g.getElementsByTagName("g")[0],-null!=p&&(p.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(g.getAttribute("width")))&&K&&(g.setAttribute("width",parseInt(g.getAttribute("width"))+6),g.setAttribute("height",parseInt(g.getAttribute("height"))+6),p=g.getAttribute("viewBox"),null!=p&&0<p.length&&(p=p.split(" "),3<p.length&&(w=parseFloat(p[2])+6,h=parseFloat(p[3])+6,g.setAttribute("viewBox",p[0]+" "+p[1]+" "+w+" "+h))))));return R};Graph.prototype.setShadowVisible=function(g,p){mxClient.IS_SVG&&!mxClient.IS_SF&&(p=+function(g){var p="1"==mxUtils.getValue(g.style,"enumerate",0);p&&null==g.secondLabel?(g.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),g.secondLabel.size=12,g.secondLabel.state=g,g.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(g,g.secondLabel)):p||null==g.secondLabel||(g.secondLabel.destroy(),g.secondLabel=null);p=g.secondLabel;if(null!=p){var G=g.view.scale,J=this.createEnumerationValue(g);g=this.graph.model.isVertex(g.cell)?+new mxRectangle(g.x+g.width-4*G,g.y+4*G,0,0):mxRectangle.fromPoint(g.view.getPoint(g));p.bounds.equals(g)&&p.value==J&&p.scale==G||(p.bounds=g,p.value=J,p.scale=G,p.redraw())}};var P=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();P.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var M=+Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){M.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(g,p){"data:action/json,"==g.substring(0,17)&&(g=JSON.parse(g.substring(17)),null!=g.actions&&this.executeCustomActions(g.actions,null,p))};Graph.prototype.executeCustomActions=function(g,p,G){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),+null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var J=!1,L=0,R=0,S=mxUtils.bind(this,function(){J||(J=!0,this.model.beginUpdate())}),V=mxUtils.bind(this,function(){J&&(J=!1,this.model.endUpdate())}),W=mxUtils.bind(this,function(){0<L&&L--;0==L&&X()}),X=mxUtils.bind(this,function(){if(R<g.length){var Y=this.stoppingCustomActions,Z=g[R++],ba=[];if(null!=Z.open)if(V(),this.isCustomLink(Z.open)){if(!this.customLinkClicked(Z.open,+G))return}else this.openLink(Z.open);null==Z.wait||Y||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;W()}),L++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Z.wait?parseInt(Z.wait):1E3),V());null!=Z.opacity&&null!=Z.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Z.opacity,!0)),Z.opacity.value);null!=Z.fadeIn&&(L++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeIn,+!0)),0,1,W,Y?0:Z.fadeIn.delay));null!=Z.fadeOut&&(L++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeOut,!0)),1,0,W,Y?0:Z.fadeOut.delay));null!=Z.wipeIn&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeIn,!0),!0)));null!=Z.wipeOut&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeOut,!0),!1)));null!=Z.toggle&&(S(),this.toggleCells(this.getCellsForAction(Z.toggle,!0)));if(null!=Z.show){S();var fa=this.getCellsForAction(Z.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(fa),+1);this.setCellsVisible(fa,!0)}null!=Z.hide&&(S(),fa=this.getCellsForAction(Z.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(fa),0),this.setCellsVisible(fa,!1));null!=Z.toggleStyle&&null!=Z.toggleStyle.key&&(S(),this.toggleCellStyles(Z.toggleStyle.key,null!=Z.toggleStyle.defaultValue?Z.toggleStyle.defaultValue:"0",this.getCellsForAction(Z.toggleStyle,!0)));null!=Z.style&&null!=Z.style.key&&(S(),this.setCellStyles(Z.style.key,Z.style.value,this.getCellsForAction(Z.style,!0)));fa=[];null!=+Z.select&&this.isEnabled()&&(fa=this.getCellsForAction(Z.select),this.setSelectionCells(fa));null!=Z.highlight&&(fa=this.getCellsForAction(Z.highlight),this.highlightCells(fa,Z.highlight.color,Z.highlight.duration,Z.highlight.opacity));null!=Z.scroll&&(fa=this.getCellsForAction(Z.scroll));null!=Z.viewbox&&this.fitWindow(Z.viewbox,Z.viewbox.border);0<fa.length&&this.scrollCellToVisible(fa[0]);null!=G&&null!=Z.explore&&Graph.exploreFromCell(this,G,Z.explore);if(null!=Z.tags){if(null!=Z.tags.toggle){var ca=+Z.tags.toggle;0==ca.length&&(ca=this.getAllTags());for(fa=0;fa<ca.length;fa++)this.toggleHiddenTag(ca[fa])}ca=null;null!=Z.tags.hidden&&(null==ca&&(ca=[]),ca=ca.concat(Z.tags.hidden));if(null!=Z.tags.visible){null==ca&&(ca=[]);var da=this.getAllTags();for(fa=0;fa<da.length;fa++)0>mxUtils.indexOf(Z.tags.visible,da[fa])&&0>mxUtils.indexOf(ca,da[fa])&&ca.push(da[fa])}null!=ca&&this.setHiddenTags(ca);this.refresh()}0<ba.length&&(L++,this.executeAnimations(ba,W,Y?1:Z.steps,Y?0:Z.delay));0==L?X():V()}else this.stoppingCustomActions=+this.executingCustomActions=!1,V(),null!=p&&p()});X()}};Graph.prototype.doUpdateCustomLinksForCell=function(g,p){var G=this.getLinkForCell(p);null!=G&&"data:action/json,"==G.substring(0,17)&&this.setLinkForCell(p,this.updateCustomLink(g,G));if(this.isHtmlLabel(p)){var J=document.createElement("div");J.innerHTML=Graph.sanitizeHtml(this.getLabel(p));for(var L=J.getElementsByTagName("a"),R=!1,S=0;S<L.length;S++)G=L[S].getAttribute("href"),null!=G&&"data:action/json,"==G.substring(0,17)&&(L[S].setAttribute("href",+this.updateCustomLink(g,G)),R=!0);R&&this.labelChanged(p,J.innerHTML)}};Graph.prototype.updateCustomLink=function(g,p){if("data:action/json,"==p.substring(0,17))try{var G=JSON.parse(p.substring(17));null!=G.actions&&(this.updateCustomLinkActions(g,G.actions),p="data:action/json,"+JSON.stringify(G))}catch(J){}return p};Graph.prototype.updateCustomLinkActions=function(g,p){for(var G=0;G<p.length;G++){var J=p[G],L;for(L in J)this.updateCustomLinkAction(g,J[L],"cells"),this.updateCustomLinkAction(g,J[L],+"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(g,p,G){if(null!=p&&null!=p[G]){for(var J=[],L=0;L<p[G].length;L++)if("*"==p[G][L])J.push(p[G][L]);else{var R=g[p[G][L]];null!=R?""!=R&&J.push(R):J.push(p[G][L])}p[G]=J}};Graph.prototype.getCellsForAction=function(g,p){p=this.getCellsById(g.cells).concat(this.getCellsForTags(g.tags,null,p));if(null!=g.excludeCells){for(var G=[],J=0;J<p.length;J++)0>g.excludeCells.indexOf(p[J].id)&&G.push(p[J]);p=G}return p};Graph.prototype.getCellsById=+function(g){var p=[];if(null!=g)for(var G=0;G<g.length;G++)if("*"==g[G]){var J=this.model.getRoot();p=p.concat(this.model.filterDescendants(function(R){return R!=J},J))}else{var L=this.model.getCell(g[G]);null!=L&&p.push(L)}return p};var m=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(g){return m.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(g))};Graph.prototype.setHiddenTags=function(g){this.hiddenTags=g;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};+Graph.prototype.toggleHiddenTag=function(g){var p=mxUtils.indexOf(this.hiddenTags,g);0>p?this.hiddenTags.push(g):0<=p&&this.hiddenTags.splice(p,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(g){if(null==g||0==g.length||0==this.hiddenTags.length)return!1;g=g.split(" ");if(g.length>this.hiddenTags.length)return!1;for(var p=0;p<g.length;p++)if(0>mxUtils.indexOf(this.hiddenTags,g[p]))return!1;return!0};Graph.prototype.getCellsForTags=function(g,p,G,+J){var L=[];if(null!=g){p=null!=p?p:this.model.getDescendants(this.model.getRoot());for(var R=0,S={},V=0;V<g.length;V++)0<g[V].length&&(S[g[V]]=!0,R++);for(V=0;V<p.length;V++)if(G&&this.model.getParent(p[V])==this.model.root||this.model.isVertex(p[V])||this.model.isEdge(p[V])){var W=this.getTagsForCell(p[V]),X=!1;if(0<W.length&&(W=W.split(" "),W.length>=g.length)){for(var Y=X=0;Y<W.length&&X<R;Y++)null!=S[W[Y]]&&X++;X=X==R}X&&(1!=J||this.isCellVisible(p[V]))&&L.push(p[V])}}return L};Graph.prototype.getAllTags=+function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(g){for(var p=null,G=[],J=0;J<g.length;J++){var L=this.getTagsForCell(g[J]);G=[];if(0<L.length){L=L.split(" ");for(var R={},S=0;S<L.length;S++)if(null==p||null!=p[L[S]])R[L[S]]=!0,G.push(L[S]);p=R}else return[]}return G};Graph.prototype.getTagsForCells=function(g){for(var p=[],G={},J=0;J<g.length;J++){var L=this.getTagsForCell(g[J]);if(0<L.length){L=L.split(" ");for(var R=+0;R<L.length;R++)null==G[L[R]]&&(G[L[R]]=!0,p.push(L[R]))}}return p};Graph.prototype.getTagsForCell=function(g){return this.getAttributeForCell(g,"tags","")};Graph.prototype.addTagsForCells=function(g,p){if(0<g.length&&0<p.length){this.model.beginUpdate();try{for(var G=0;G<g.length;G++){for(var J=this.getTagsForCell(g[G]),L=J.split(" "),R=!1,S=0;S<p.length;S++){var V=mxUtils.trim(p[S]);""!=V&&0>mxUtils.indexOf(L,V)&&(J=0<J.length?J+" "+V:V,R=!0)}R&&this.setAttributeForCell(g[G],"tags",J)}}finally{this.model.endUpdate()}}};+Graph.prototype.removeTagsForCells=function(g,p){if(0<g.length&&0<p.length){this.model.beginUpdate();try{for(var G=0;G<g.length;G++){var J=this.getTagsForCell(g[G]);if(0<J.length){for(var L=J.split(" "),R=!1,S=0;S<p.length;S++){var V=mxUtils.indexOf(L,p[S]);0<=V&&(L.splice(V,1),R=!0)}R&&this.setAttributeForCell(g[G],"tags",L.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(g){this.model.beginUpdate();try{for(var p=0;p<g.length;p++)this.model.setVisible(g[p],!this.model.isVisible(g[p]))}finally{this.model.endUpdate()}};+Graph.prototype.setCellsVisible=function(g,p){this.model.beginUpdate();try{for(var G=0;G<g.length;G++)this.model.setVisible(g[G],p)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(g,p,G,J){for(var L=0;L<g.length;L++)this.highlightCell(g[L],p,G,J)};Graph.prototype.highlightCell=function(g,p,G,J,L){p=null!=p?p:mxConstants.DEFAULT_VALID_COLOR;G=null!=G?G:1E3;g=this.view.getState(g);var R=null;null!=g&&(L=null!=L?L:4,L=Math.max(L+1,mxUtils.getValue(g.style,mxConstants.STYLE_STROKEWIDTH,+1)+L),R=new mxCellHighlight(this,p,L,!1),null!=J&&(R.opacity=J),R.highlight(g),window.setTimeout(function(){null!=R.shape&&(mxUtils.setPrefixedStyle(R.shape.node.style,"transition","all 1200ms ease-in-out"),R.shape.node.style.opacity=0);window.setTimeout(function(){R.destroy()},1200)},G));return R};Graph.prototype.addSvgShadow=function(g,p,G,J){G=null!=G?G:!1;J=null!=J?J:!0;var L=g.ownerDocument,R=null!=L.createElementNS?L.createElementNS(mxConstants.NS_SVG,"filter"):L.createElement("filter");R.setAttribute("id",+this.shadowId);var S=null!=L.createElementNS?L.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):L.createElement("feGaussianBlur");S.setAttribute("in","SourceAlpha");S.setAttribute("stdDeviation",this.svgShadowBlur);S.setAttribute("result","blur");R.appendChild(S);S=null!=L.createElementNS?L.createElementNS(mxConstants.NS_SVG,"feOffset"):L.createElement("feOffset");S.setAttribute("in","blur");S.setAttribute("dx",this.svgShadowSize);S.setAttribute("dy",this.svgShadowSize);S.setAttribute("result",+"offsetBlur");R.appendChild(S);S=null!=L.createElementNS?L.createElementNS(mxConstants.NS_SVG,"feFlood"):L.createElement("feFlood");S.setAttribute("flood-color",this.svgShadowColor);S.setAttribute("flood-opacity",this.svgShadowOpacity);S.setAttribute("result","offsetColor");R.appendChild(S);S=null!=L.createElementNS?L.createElementNS(mxConstants.NS_SVG,"feComposite"):L.createElement("feComposite");S.setAttribute("in","offsetColor");S.setAttribute("in2","offsetBlur");S.setAttribute("operator","in");+S.setAttribute("result","offsetBlur");R.appendChild(S);S=null!=L.createElementNS?L.createElementNS(mxConstants.NS_SVG,"feBlend"):L.createElement("feBlend");S.setAttribute("in","SourceGraphic");S.setAttribute("in2","offsetBlur");R.appendChild(S);S=g.getElementsByTagName("defs");0==S.length?(L=null!=L.createElementNS?L.createElementNS(mxConstants.NS_SVG,"defs"):L.createElement("defs"),null!=g.firstChild?g.insertBefore(L,g.firstChild):g.appendChild(L)):L=S[0];L.appendChild(R);G||(p=null!=p?p:g.getElementsByTagName("g")[0],+null!=p&&(p.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(g.getAttribute("width")))&&J&&(g.setAttribute("width",parseInt(g.getAttribute("width"))+6),g.setAttribute("height",parseInt(g.getAttribute("height"))+6),p=g.getAttribute("viewBox"),null!=p&&0<p.length&&(p=p.split(" "),3<p.length&&(w=parseFloat(p[2])+6,h=parseFloat(p[3])+6,g.setAttribute("viewBox",p[0]+" "+p[1]+" "+w+" "+h))))));return R};Graph.prototype.setShadowVisible=function(g,p){mxClient.IS_SVG&&!mxClient.IS_SF&&(p=null!=p?p:!0,(this.shadowVisible=g)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),p&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var g=this.model.getChildCount(this.model.root),-p=0;do var F=this.model.getChildAt(this.model.root,p);while(p++<g&&"1"==mxUtils.getValue(this.getCellStyle(F),"locked","0"));null!=F&&this.setDefaultParent(F)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH++p=0;do var G=this.model.getChildAt(this.model.root,p);while(p++<g&&"1"==mxUtils.getValue(this.getCellStyle(G),"locked","0"));null!=G&&this.setDefaultParent(G)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",@@ -12943,33 +12943,33 @@ STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PAT[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=-[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(g){var p=null;null!=g&&0<g.length&&("ER"==g.substring(0,2)?p="mxgraph.er":"sysML"==g.substring(0,5)&&(p="mxgraph.sysml"));return p};var v=mxMarker.createMarker;mxMarker.createMarker=function(g,p,F,K,M,R,S,V,W,X){if(null!=F&&null==mxMarker.markers[F]){var Y=this.getPackageForType(F);null!=Y&&mxStencilRegistry.getStencil(Y)}return v.apply(this,arguments)};var z=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(g,-p,F,K,M,R){"1"==mxUtils.getValue(p.style,"lineShape",null)&&g.setFillColor(mxUtils.getValue(p.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return z.apply(this,arguments)};PrintDialog.prototype.create=function(g,p,F){function K(){ha.value=Math.max(1,Math.min(X,Math.max(parseInt(ha.value),parseInt(ba.value))));ba.value=Math.max(1,Math.min(X,Math.min(parseInt(ha.value),parseInt(ba.value))))}function M(Ba){g.lastPrintPagesRadioChecked=Z.checked;g.lastPrintSelectionOnlyChecked=da.checked;g.lastPrintCropRadioChecked=-aa.checked;g.lastPrintFitRadioChecked=ia.checked;Z.checked&&ba.value<ha.value?(g.lastPrintPagesFromInput=ba.value,g.lastPrintPagesToInput=ha.value):(g.lastPrintPagesFromInput=null,g.lastPrintPagesToInput=null);na.value=Math.max(1,Math.min(1600,parseInt(na.value)))+"%";g.lastPrintZoom=na.value;g.lastPrintBorder=Aa.value;g.lastPrintGrid=Ha.checked;g.lastPrintTransparent=wa.checked;g.lastPrintInclude=Da.checked;g.lastPrintSheetsAcross=fa.value;g.lastPrintSheetsDown=pa.value;var Ca={};Ca.border=parseInt(Aa.value);-Ca.scale=parseInt(na.value)/100;Ca.grid=Ha.checked;Ca.transparent=wa.checked;Ca.includeCopy=Da.checked;Ca.sheetsAcross=parseInt(fa.value);Ca.sheetsDown=parseInt(pa.value);Ca.pagesFrom=parseInt(ba.value);Ca.pagesTo=parseInt(ha.value);Ca.allPages=Y.checked;Ca.selection=da.checked;Ca.pageView=ma.checked;Ca.crop=aa.checked;Ca.fit=ia.checked;return null!=F?F(!Ba,Ca):g.print(!Ba,Ca)}var R=g.editor.graph,S=document.createElement("div"),V=document.createElement("h3");V.style.width="100%";V.style.textAlign=+[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(g){var p=null;null!=g&&0<g.length&&("ER"==g.substring(0,2)?p="mxgraph.er":"sysML"==g.substring(0,5)&&(p="mxgraph.sysml"));return p};var v=mxMarker.createMarker;mxMarker.createMarker=function(g,p,G,J,L,R,S,V,W,X){if(null!=G&&null==mxMarker.markers[G]){var Y=this.getPackageForType(G);null!=Y&&mxStencilRegistry.getStencil(Y)}return v.apply(this,arguments)};var z=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(g,+p,G,J,L,R){"1"==mxUtils.getValue(p.style,"lineShape",null)&&g.setFillColor(mxUtils.getValue(p.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return z.apply(this,arguments)};PrintDialog.prototype.create=function(g,p,G){function J(){fa.value=Math.max(1,Math.min(X,Math.max(parseInt(fa.value),parseInt(ba.value))));ba.value=Math.max(1,Math.min(X,Math.min(parseInt(fa.value),parseInt(ba.value))))}function L(Ba){g.lastPrintPagesRadioChecked=Z.checked;g.lastPrintSelectionOnlyChecked=da.checked;g.lastPrintCropRadioChecked=+aa.checked;g.lastPrintFitRadioChecked=ia.checked;Z.checked&&ba.value<fa.value?(g.lastPrintPagesFromInput=ba.value,g.lastPrintPagesToInput=fa.value):(g.lastPrintPagesFromInput=null,g.lastPrintPagesToInput=null);na.value=Math.max(1,Math.min(1600,parseInt(na.value)))+"%";g.lastPrintZoom=na.value;g.lastPrintBorder=Aa.value;g.lastPrintGrid=Ha.checked;g.lastPrintTransparent=wa.checked;g.lastPrintInclude=Da.checked;g.lastPrintSheetsAcross=ha.value;g.lastPrintSheetsDown=pa.value;var Ca={};Ca.border=parseInt(Aa.value);+Ca.scale=parseInt(na.value)/100;Ca.grid=Ha.checked;Ca.transparent=wa.checked;Ca.includeCopy=Da.checked;Ca.sheetsAcross=parseInt(ha.value);Ca.sheetsDown=parseInt(pa.value);Ca.pagesFrom=parseInt(ba.value);Ca.pagesTo=parseInt(fa.value);Ca.allPages=Y.checked;Ca.selection=da.checked;Ca.pageView=ma.checked;Ca.crop=aa.checked;Ca.fit=ia.checked;return null!=G?G(!Ba,Ca):g.print(!Ba,Ca)}var R=g.editor.graph,S=document.createElement("div"),V=document.createElement("h3");V.style.width="100%";V.style.textAlign="center";V.style.marginTop="0px";mxUtils.write(V,p||mxResources.get("print"));S.appendChild(V);var W=1,X=1;V=document.createElement("div");V.style.whiteSpace="nowrap";var Y=document.createElement("input");Y.style.marginRight="8px";Y.style.marginBottom="8px";Y.setAttribute("type","radio");Y.setAttribute("name","pages-printdialog");V.appendChild(Y);p=document.createElement("span");mxUtils.write(p,mxResources.get("allPages"));mxEvent.addListener(p,"click",function(){Y.checked=!0});V.appendChild(p);mxUtils.br(V);-var Z=Y.cloneNode(!0);V.appendChild(Z);p=document.createElement("span");mxUtils.write(p,mxResources.get("pages")+":");V.appendChild(p);mxEvent.addListener(p,"click",function(){Z.checked=!0});var ba=document.createElement("input");ba.style.margin="0 4px";ba.setAttribute("value","1");ba.setAttribute("type","number");ba.setAttribute("min","1");ba.style.width="40px";V.appendChild(ba);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));V.appendChild(p);var ha=ba.cloneNode(!0);V.appendChild(ha);-mxEvent.addListener(ba,"focus",function(){Z.checked=!0});mxEvent.addListener(ha,"focus",function(){Z.checked=!0});mxEvent.addListener(ba,"change",K);mxEvent.addListener(ha,"change",K);if(null!=g.pages&&(X=g.pages.length,null!=g.currentPage))for(var ca=0;ca<X;ca++)if(g.currentPage==g.pages[ca]){W=ca+1;break}null!=g.lastPrintPagesFromInput&&null!=g.lastPrintPagesToInput?(ba.value=Math.min(X,Math.max(1,g.lastPrintPagesFromInput)),ha.value=Math.min(X,Math.max(1,g.lastPrintPagesToInput))):(ba.value=W,-ha.value=W);ba.setAttribute("max",X);ha.setAttribute("max",X);ca=mxUtils.button(mxResources.get("currentPage"),function(Ba){ba.value=W;ha.value=W;Z.checked=!0});ca.setAttribute("title",mxResources.get("currentPage"));ca.style.marginLeft="4px";ca.style.maxWidth="100px";ca.style.overflow="hidden";ca.style.textOverflow="ellipsis";ca.style.whiteSpace="nowrap";V.appendChild(ca);1<X&&S.appendChild(V);V=document.createElement("div");V.style.borderBottom="1px solid lightGray";V.style.paddingBottom="12px";+var Z=Y.cloneNode(!0);V.appendChild(Z);p=document.createElement("span");mxUtils.write(p,mxResources.get("pages")+":");V.appendChild(p);mxEvent.addListener(p,"click",function(){Z.checked=!0});var ba=document.createElement("input");ba.style.margin="0 4px";ba.setAttribute("value","1");ba.setAttribute("type","number");ba.setAttribute("min","1");ba.style.width="40px";V.appendChild(ba);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));V.appendChild(p);var fa=ba.cloneNode(!0);V.appendChild(fa);+mxEvent.addListener(ba,"focus",function(){Z.checked=!0});mxEvent.addListener(fa,"focus",function(){Z.checked=!0});mxEvent.addListener(ba,"change",J);mxEvent.addListener(fa,"change",J);if(null!=g.pages&&(X=g.pages.length,null!=g.currentPage))for(var ca=0;ca<X;ca++)if(g.currentPage==g.pages[ca]){W=ca+1;break}null!=g.lastPrintPagesFromInput&&null!=g.lastPrintPagesToInput?(ba.value=Math.min(X,Math.max(1,g.lastPrintPagesFromInput)),fa.value=Math.min(X,Math.max(1,g.lastPrintPagesToInput))):(ba.value=W,+fa.value=W);ba.setAttribute("max",X);fa.setAttribute("max",X);ca=mxUtils.button(mxResources.get("currentPage"),function(Ba){ba.value=W;fa.value=W;Z.checked=!0});ca.setAttribute("title",mxResources.get("currentPage"));ca.style.marginLeft="4px";ca.style.maxWidth="100px";ca.style.overflow="hidden";ca.style.textOverflow="ellipsis";ca.style.whiteSpace="nowrap";V.appendChild(ca);1<X&&S.appendChild(V);V=document.createElement("div");V.style.borderBottom="1px solid lightGray";V.style.paddingBottom="12px";V.style.marginBottom="12px";V.style.whiteSpace="nowrap";var da=document.createElement("input");da.setAttribute("name","pages-printdialog");da.setAttribute("type",1==X?"checkbox":"radio");da.style.marginRight="8px";R.isSelectionEmpty()&&da.setAttribute("disabled","disabled");R.isEnabled()&&(V.appendChild(da),p=document.createElement("span"),mxUtils.write(p,mxResources.get("selectionOnly")),V.appendChild(p));(R.isEnabled()||1<X)&&S.appendChild(V);!g.isPagesEnabled()||g.lastPrintPagesRadioChecked?Z.checked=!0:!R.isSelectionEmpty()&&g.lastPrintSelectionOnlyChecked?da.checked=!0:Y.checked=!0;R.isSelectionEmpty()||mxEvent.addListener(p,"click",function(){da.checked=!da.checked});R=document.createElement("div");R.style.whiteSpace="nowrap";var ma=document.createElement("input");ma.style.marginBottom="8px";ma.style.marginRight="8px";ma.setAttribute("type","radio");ma.setAttribute("name","printSize");R.appendChild(ma);p=document.createElement("span");mxUtils.write(p,mxResources.get("pageView"));R.appendChild(p);mxEvent.addListener(R,"click",function(){ma.checked=!0});S.appendChild(R);R=document.createElement("div");R.style.whiteSpace="nowrap";var aa=document.createElement("input");aa.style.marginBottom="8px";aa.style.marginRight="8px";aa.setAttribute("type","radio");aa.setAttribute("name","printSize");R.appendChild(aa);p=document.createElement("span");mxUtils.write(p,mxResources.get("crop"));R.appendChild(p);mxEvent.addListener(R,"click",function(){aa.checked=!0});S.appendChild(R);R=document.createElement("div");R.style.whiteSpace="nowrap";var ia=document.createElement("input");ia.style.marginBottom="8px";ia.style.marginRight="8px";ia.setAttribute("type","radio");ia.setAttribute("name","printSize");p=document.createElement("div");p.style.display="inline-block";p.style.verticalAlign="top";p.style.paddingTop="2px";p.appendChild(ia);R.appendChild(p);V=document.createElement("table");V.style.display="inline-block";V.style.borderSpacing="0";ca=document.createElement("tbody");var ka=document.createElement("tr"),-ta=ka.cloneNode(!0),sa=document.createElement("td"),ea=sa.cloneNode(!0),ra=sa.cloneNode(!0),ua=sa.cloneNode(!0),za=sa.cloneNode(!0),va=sa.cloneNode(!0);sa.style.textAlign="right";ua.style.textAlign="right";mxUtils.write(sa,mxResources.get("fitTo"));mxEvent.addListener(R,"click",function(Ba){mxEvent.getSource(Ba)!=ia&&(ia.checked=!ia.checked)});var fa=document.createElement("input");fa.style.margin="0 2px";fa.style.boxSizing="border-box";fa.setAttribute("value",g.lastPrintSheetsAcross||"1");fa.setAttribute("min",-"1");fa.setAttribute("type","number");fa.style.width="40px";ea.appendChild(fa);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));ra.appendChild(p);mxUtils.write(ua,mxResources.get("fitToBy"));var pa=fa.cloneNode(!0);pa.setAttribute("value",g.lastPrintSheetsDown||"1");za.appendChild(pa);mxEvent.addListener(fa,"click",function(Ba){ia.checked=!0;mxEvent.consume(Ba)});mxEvent.addListener(pa,"click",function(Ba){ia.checked=!0;mxEvent.consume(Ba)});g.lastPrintCropRadioChecked?+ta=ka.cloneNode(!0),sa=document.createElement("td"),ea=sa.cloneNode(!0),ra=sa.cloneNode(!0),ua=sa.cloneNode(!0),za=sa.cloneNode(!0),va=sa.cloneNode(!0);sa.style.textAlign="right";ua.style.textAlign="right";mxUtils.write(sa,mxResources.get("fitTo"));mxEvent.addListener(R,"click",function(Ba){mxEvent.getSource(Ba)!=ia&&(ia.checked=!ia.checked)});var ha=document.createElement("input");ha.style.margin="0 2px";ha.style.boxSizing="border-box";ha.setAttribute("value",g.lastPrintSheetsAcross||"1");ha.setAttribute("min",+"1");ha.setAttribute("type","number");ha.style.width="40px";ea.appendChild(ha);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));ra.appendChild(p);mxUtils.write(ua,mxResources.get("fitToBy"));var pa=ha.cloneNode(!0);pa.setAttribute("value",g.lastPrintSheetsDown||"1");za.appendChild(pa);mxEvent.addListener(ha,"click",function(Ba){ia.checked=!0;mxEvent.consume(Ba)});mxEvent.addListener(pa,"click",function(Ba){ia.checked=!0;mxEvent.consume(Ba)});g.lastPrintCropRadioChecked?aa.checked=!0:g.lastPrintFitRadioChecked?ia.checked=!0:ma.checked=!0;p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));va.appendChild(p);ka.appendChild(sa);ka.appendChild(ea);ka.appendChild(ra);ta.appendChild(ua);ta.appendChild(za);ta.appendChild(va);ca.appendChild(ka);ca.appendChild(ta);V.appendChild(ca);R.appendChild(V);S.appendChild(R);R=document.createElement("div");R.style.borderTop="1px solid lightGray";R.style.whiteSpace="nowrap";R.style.paddingTop="12px";R.style.marginTop="12px";R.style.paddingLeft="8px";mxUtils.write(R,mxResources.get("borderWidth")+":");var Aa=document.createElement("input");Aa.setAttribute("type","number");Aa.setAttribute("min","0");Aa.style.width="40px";Aa.style.marginLeft="4px";Aa.value=null!=g.lastPrintBorder?g.lastPrintBorder:mxPrintPreview.prototype.pageMargin;R.appendChild(Aa);p=document.createElement("span");p.style.marginLeft="8px";mxUtils.write(p,mxResources.get("zoom")+":");R.appendChild(p);var na=document.createElement("input");na.style.width="60px";na.style.marginLeft="4px";na.value=null!=g.lastPrintZoom?g.lastPrintZoom:"100%";R.appendChild(na);mxUtils.br(R);var Ha=document.createElement("input");Ha.setAttribute("type","checkbox");Ha.style.marginTop="12px";Ha.checked=null!=g.lastPrintGrid?g.lastPrintGrid:!1;R.appendChild(Ha);p=document.createElement("span");p.style.marginLeft="4px";p.style.marginRight="8px";mxUtils.write(p,mxResources.get("grid"));R.appendChild(p);mxEvent.addListener(p,"click",function(Ba){Ha.checked=!0;-mxEvent.consume(Ba)});var wa=document.createElement("input");wa.setAttribute("type","checkbox");wa.style.marginTop="10px";wa.checked=null!=g.lastPrintTransparent?g.lastPrintTransparent:!1;null!=F&&(R.appendChild(wa),p=document.createElement("span"),p.style.marginLeft="4px",mxUtils.write(p,mxResources.get("transparentBackground")),R.appendChild(p),mxEvent.addListener(p,"click",function(Ba){wa.checked=!0;mxEvent.consume(Ba)}));var Da=document.createElement("input");Da.setAttribute("type","checkbox");-Da.style.marginTop="10px";Da.checked=null!=g.lastPrintInclude?g.lastPrintInclude:Editor.defaultIncludeDiagram;null==F||mxClient.IS_CHROMEAPP||"draw.io"!=g.getServiceName()||(mxUtils.br(R),R.appendChild(Da),p=document.createElement("span"),p.style.marginLeft="4px",mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram")),R.appendChild(p),mxEvent.addListener(p,"click",function(Ba){Da.checked=!0;mxEvent.consume(Ba)}));S.appendChild(R);p=document.createElement("div");p.style.marginTop="40px";p.style.textAlign=-"right";p.style.whiteSpace="nowrap";g.isOffline()||null!=F||p.appendChild(g.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));R=mxUtils.button(mxResources.get("cancel"),function(){g.hideDialog()});R.className="geBtn";g.editor.cancelFirst&&p.appendChild(R);PrintDialog.previewEnabled&&null==F&&(V=mxUtils.button(mxResources.get("preview"),function(){try{g.hideDialog(),M(!1)}catch(Ba){g.handleError(Ba)}}),V.className="geBtn",p.appendChild(V));V=mxUtils.button(mxResources.get(null!=F?"export":-PrintDialog.previewEnabled?"print":"ok"),function(){try{g.hideDialog(),M(!0)}catch(Ba){g.handleError(Ba)}});V.className="geBtn gePrimaryBtn";p.appendChild(V);g.editor.cancelFirst||p.appendChild(R);S.appendChild(p);if(g.editor.isChromelessView()){var Ea=function(){Editor.isDarkMode()?(S.classList.add("geDarkMode"),S.style.colorScheme="dark"):(S.classList.remove("geDarkMode"),S.style.colorScheme="light")};g.addListener("darkModeChanged",Ea);Ea();var Na=function(Ba,Ca){Ba=Ca.getProperty("dialog");S.parentNode==+mxEvent.consume(Ba)});var wa=document.createElement("input");wa.setAttribute("type","checkbox");wa.style.marginTop="10px";wa.checked=null!=g.lastPrintTransparent?g.lastPrintTransparent:!1;null!=G&&(R.appendChild(wa),p=document.createElement("span"),p.style.marginLeft="4px",mxUtils.write(p,mxResources.get("transparentBackground")),R.appendChild(p),mxEvent.addListener(p,"click",function(Ba){wa.checked=!0;mxEvent.consume(Ba)}));var Da=document.createElement("input");Da.setAttribute("type","checkbox");+Da.style.marginTop="10px";Da.checked=null!=g.lastPrintInclude?g.lastPrintInclude:Editor.defaultIncludeDiagram;null==G||mxClient.IS_CHROMEAPP||"draw.io"!=g.getServiceName()||(mxUtils.br(R),R.appendChild(Da),p=document.createElement("span"),p.style.marginLeft="4px",mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram")),R.appendChild(p),mxEvent.addListener(p,"click",function(Ba){Da.checked=!0;mxEvent.consume(Ba)}));S.appendChild(R);p=document.createElement("div");p.style.marginTop="40px";p.style.textAlign=+"right";p.style.whiteSpace="nowrap";g.isOffline()||null!=G||p.appendChild(g.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));R=mxUtils.button(mxResources.get("cancel"),function(){g.hideDialog()});R.className="geBtn";g.editor.cancelFirst&&p.appendChild(R);PrintDialog.previewEnabled&&null==G&&(V=mxUtils.button(mxResources.get("preview"),function(){try{g.hideDialog(),L(!1)}catch(Ba){g.handleError(Ba)}}),V.className="geBtn",p.appendChild(V));V=mxUtils.button(mxResources.get(null!=G?"export":+PrintDialog.previewEnabled?"print":"ok"),function(){try{g.hideDialog(),L(!0)}catch(Ba){g.handleError(Ba)}});V.className="geBtn gePrimaryBtn";p.appendChild(V);g.editor.cancelFirst||p.appendChild(R);S.appendChild(p);if(g.editor.isChromelessView()){var Ea=function(){Editor.isDarkMode()?(S.classList.add("geDarkMode"),S.style.colorScheme="dark"):(S.classList.remove("geDarkMode"),S.style.colorScheme="light")};g.addListener("darkModeChanged",Ea);Ea();var Na=function(Ba,Ca){Ba=Ca.getProperty("dialog");S.parentNode==Ba.container&&(g.editor.removeListener(Na),g.removeListener(Ea))};g.editor.addListener("hideDialog",Na)}this.container=S};var B=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var g=this.image;null!=g&&null!=g.src&&Graph.isPageLink(g.src)&&(g={originalSrc:g.src});this.page.viewState.backgroundImage=g}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else B.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(g=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=g?g:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var H=document.createElement("canvas"),T=new Image;T.onload=function(){try{H.getContext("2d").drawImage(T,0,0);var g=H.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=g&&6<g.length}catch(p){}};T.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(g){}Editor.prototype.useCanvasForExport=!1})();(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(f,l,d){d.ui=f.ui;return l};b.afterDecode=function(f,l,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;d.previousAdaptiveColors=d.adaptiveColors;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(b)})();-(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(f,l,d){d.ui=f.ui;return l};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.0.3";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&+(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(f,l,d){d.ui=f.ui;return l};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.0.4";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};@@ -12979,7 +12979,7 @@ function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi."version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(k){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],e=0;e<arguments.length;e++)c.push(arguments[e]);console.log.apply(console,c)}}catch(k){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var e=[],k=0;k<c.length;k++)e.push(c[k]);for(k=0;k<e.length;k++)EditorUi.replaceSvgImage(e[k])};EditorUi.replaceSvgImage=function(c){try{var e=null;e=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var k=EditorUi.getSvgSubtree(e);if(null!=k&&"svg"==k.nodeName){k.setAttribute("x",c.getAttribute("x"));k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";var n=mxUtils.createElementNs(k.ownerDocument,mxConstants.NS_SVG,"g");n.appendChild(k);c.hasAttribute("transform")&&n.setAttribute("transform",c.getAttribute("transform"));c.parentNode.replaceChild(n,c)}}catch(q){}};EditorUi.getSvgSubtree=function(c){var e=Graph.getSvgFromDataUri(c);c=null;if(null!=e){c=Graph.sanitizeNode(mxUtils.parseXml(e).documentElement);e=c.getElementsByTagName("style");if(0<e.length){var k="svg-image-"+Editor.guid();c.setAttribute("id",k);for(var n=document.implementation.createHTMLDocument(""),-q=document.createElement("style"),u=0;u<e.length;u++){q.textContent=e[u].textContent;n.body.appendChild(q);for(var A="",D=0;D<q.sheet.cssRules.length;D++){var G=q.sheet.cssRules[D];if(null!=G.selectorText){for(var E=G.selectorText.split(","),U=0;U<E.length;U++)E[U]="#"+k+" "+E[U];G.selectorText=E.join(",")}A+=G.cssText+"\n"}e[u].textContent=A}}e=c.getElementsByTagName("*");for(k=0;k<e.length;k++)e[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+q=document.createElement("style"),u=0;u<e.length;u++){q.textContent=e[u].textContent;n.body.appendChild(q);for(var A="",D=0;D<q.sheet.cssRules.length;D++){var F=q.sheet.cssRules[D];if(null!=F.selectorText){for(var E=F.selectorText.split(","),U=0;U<E.length;U++)E[U]="#"+k+" "+E[U];F.selectorText=E.join(",")}A+=F.cssText+"\n"}e[u].textContent=A}}e=c.getElementsByTagName("*");for(k=0;k<e.length;k++)e[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;EditorUi.prototype.webpSupported=!1;try{var c=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!c.getContext||!c.getContext("2d"))}catch(q){}try{var e=document.createElement("canvas"),@@ -12989,9 +12989,9 @@ e,k)};EditorUi.prototype.showSplash=function(c){};EditorUi.prototype.getLocalDatEditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var e=this.editor.graph;e.mathEnabled=c;null!=e.view.backgroundImage&&(e.view.backgroundImage.destroy(),e.view.backgroundImage=null);this.editor.updateGraphComponents();e.refresh();e.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,e,k){var n=null==c||null==e;k=null!=k?k:24;var q=new Spinner({lines:12,length:k,width:Math.round(k/3),radius:Math.round(k/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),u=this.timeout,A=q.spin,D=null,G=null,E=mxUtils.bind(this,function(P){null!=P&&P()});q.spin=function(P,J,m,v){v=null!=v?v:u;var z=!1;if(!this.active){var B=Date.now();null!=m&&(D=window.setTimeout(function(){q.stop();D=null;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:G})},v));A.call(this,P);this.active=!0;null!=J&&(n&&(e=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/+speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),u=this.timeout,A=q.spin,D=null,F=null,E=mxUtils.bind(this,function(P){null!=P&&P()});q.spin=function(P,M,m,v){v=null!=v?v:u;var z=!1;if(!this.active){var B=Date.now();null!=m&&(D=window.setTimeout(function(){q.stop();D=null;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:F})},v));A.call(this,P);this.active=!0;null!=M&&(n&&(e=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2),z=document.createElement("div"),z.className="geSpinnerStatus",z.style.position="absolute",z.style.whiteSpace="nowrap",z.style.background="#4B4243",z.style.color="white",z.style.fontFamily=Editor.defaultHtmlFont,z.style.fontSize="9pt",z.style.padding="6px",z.style.paddingLeft="10px",z.style.paddingRight="10px",z.style.zIndex=2E9,z.style.left=Math.max(0,c)+"px",z.style.top=Math.max(0,e+70)+"px",mxUtils.setPrefixedStyle(z.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(z.style,"transform",-"translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(z.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=J.substring(J.length-3,J.length)&&"!"!=J.charAt(J.length-1)&&(J+="..."),z.innerHTML=mxUtils.htmlEntities(J),P.appendChild(z),q.status=z);this.pause=mxUtils.bind(this,function(){var H=E;this.active&&(v=Math.max(0,v-(Date.now()-B)),H=mxUtils.bind(this,function(T){this.spin(P,J,m,v);if(null!=T)try{T(),G=mxUtils.bind(this,function(){this.spin(P,J,m,v);try{T()}catch(g){null!=m&&m(g)}})}catch(g){null!=+"translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(z.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=M.substring(M.length-3,M.length)&&"!"!=M.charAt(M.length-1)&&(M+="..."),z.innerHTML=mxUtils.htmlEntities(M),P.appendChild(z),q.status=z);this.pause=mxUtils.bind(this,function(){var H=E;this.active&&(v=Math.max(0,v-(Date.now()-B)),H=mxUtils.bind(this,function(T){this.spin(P,M,m,v);if(null!=T)try{T(),F=mxUtils.bind(this,function(){this.spin(P,M,m,v);try{T()}catch(g){null!=m&&m(g)}})}catch(g){null!=m&&m(g)}}));this.stop();return H});z=!0}return z};var U=q.stop;q.stop=function(){U.call(this);this.active&&(this.active=!1,null!=D&&(window.clearTimeout(D),D=null),null!=q.status&&null!=q.status.parentNode&&q.status.parentNode.removeChild(q.status),q.status=null)};q.pause=function(){return E};return q};EditorUi.prototype.isCompatibleString=function(c){try{var e=mxUtils.parseXml(c),k=this.editor.extractGraphModel(e.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}catch(n){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var e=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=@@ -13001,12 +13001,12 @@ arguments):null}}return e};var f=EditorUi.prototype.extractGraphModelFromHtml;Ede=null!=u?mxUtils.getXml(u):""}}catch(A){}return e};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var e=c.indexOf('<meta charset="utf-8">');0<=e&&(c=c.slice(0,e)+'<meta charset="utf-8"/>'+c.slice(e+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,e){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",e);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=null!=c?this.editor.extractGraphModel(c,!0):null;null!=k&&(c=k);if(null!=c){k=this.editor.graph;k.model.beginUpdate();try{var n=null!=this.pages?this.pages.slice():null,q=c.getElementsByTagName("diagram");if(1<q.length||1==q.length&&q[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var u=q.length-1;0<=u;u--){var A=this.updatePageRoot(new DiagramPage(q[u]));null==A.getName()&&A.setName(mxResources.get("pageWithNumber",[u+1]));k.model.execute(new ChangePage(this,A,0==u?A:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=n)for(u=0;u<n.length;u++)k.model.execute(new ChangePage(this,-n[u],null));var D=this.getCurrentFile();null!=D&&D.fileReplaced(e)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,e,k,n,q,u,A,D,G,E,U,P,J){e=null!=e?e:this.editor.graph;q=null!=q?q:!1;G=null!=G?G:!0;U=null!=U?U:!Editor.defaultCompressed;var m=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var v="_blank";else m=v=n;if(null==c)return"";var z=c;if("mxfile"!=z.nodeName.toLowerCase()){if(U){var B=c.ownerDocument.createElement("diagram");B.setAttribute("name",+n[u],null));var D=this.getCurrentFile();null!=D&&D.fileReplaced(e)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,e,k,n,q,u,A,D,F,E,U,P,M){e=null!=e?e:this.editor.graph;q=null!=q?q:!1;F=null!=F?F:!0;U=null!=U?U:!Editor.defaultCompressed;var m=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var v="_blank";else m=v=n;if(null==c)return"";var z=c;if("mxfile"!=z.nodeName.toLowerCase()){if(U){var B=c.ownerDocument.createElement("diagram");B.setAttribute("name",mxResources.get("pageWithNumber",[1]));B.setAttribute("id",Editor.guid());B.appendChild(c)}else{B=Graph.zapGremlins(mxUtils.getXml(c));z=Graph.compress(B);if(Graph.decompress(z)!=B)return B;B=c.ownerDocument.createElement("diagram");B.setAttribute("name",mxResources.get("pageWithNumber",[1]));B.setAttribute("id",Editor.guid());mxUtils.setTextContent(B,z)}z=c.ownerDocument.createElement("mxfile");z.appendChild(B)}E?(z=z.cloneNode(!0),z.removeAttribute("modified"),z.removeAttribute("host"),z.removeAttribute("agent"),z.removeAttribute("etag"),z.removeAttribute("userAgent"),z.removeAttribute("version"),z.removeAttribute("editor"),z.removeAttribute("type")):(z.removeAttribute("userAgent"),z.removeAttribute("modified"),z.removeAttribute("version"),z.removeAttribute("editor"),z.removeAttribute("pages"),z.removeAttribute("type"),z.removeAttribute("etag"),mxClient.IS_CHROMEAPP?z.setAttribute("host","Chrome"):EditorUi.isElectronApp?z.setAttribute("host","Electron"):z.setAttribute("host",window.location.hostname),z.setAttribute("agent",-null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),z.setAttribute("version",EditorUi.VERSION),1<z.getElementsByTagName("diagram").length&&null!=this.pages&&z.setAttribute("pages",this.pages.length));null!=P&&(z=z.cloneNode(!0),z.setAttribute("scale",P));null!=J&&(z=z.cloneNode(!0),z.setAttribute("border",J));c=U?mxUtils.getPrettyXml(z):mxUtils.getXml(z);if(!u&&!q&&(A||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(z),e,null!=k?k.getTitle():null,v,m);else if(u||-!q&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(n=null),k=this.getSvgFileProperties(z),c=this.getEmbeddedSvg(c,e,n,null,D,G,m,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,e,k,n){c=null!=c?c:!0;e=null!=e?e:!1;k=null!=k?k:!Editor.defaultCompressed;var q=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(G){var E=G.getElementsByTagName("mxGraphModel"),-U=0<E.length?E[0]:null;E=G;null==U&&k?(U=mxUtils.getNodeValue(G),0<U.length&&(U=Graph.decompress(U),null!=U&&0<U.length&&(E=G.cloneNode(!1),E.appendChild(mxUtils.parseXml(U).documentElement)))):null==U||k?E=G.cloneNode(!0):(E=G.cloneNode(!1),mxUtils.setTextContent(E,Graph.compressNode(U)));q.appendChild(E)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(q),q=this.fileNode.cloneNode(!1),e)c(this.currentPage.node);else for(e=0;e<this.pages.length;e++){var u=this.pages[e],+null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),z.setAttribute("version",EditorUi.VERSION),1<z.getElementsByTagName("diagram").length&&null!=this.pages&&z.setAttribute("pages",this.pages.length));null!=P&&(z=z.cloneNode(!0),z.setAttribute("scale",P));null!=M&&(z=z.cloneNode(!0),z.setAttribute("border",M));c=U?mxUtils.getPrettyXml(z):mxUtils.getXml(z);if(!u&&!q&&(A||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(z),e,null!=k?k.getTitle():null,v,m);else if(u||+!q&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(n=null),k=this.getSvgFileProperties(z),c=this.getEmbeddedSvg(c,e,n,null,D,F,m,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,e,k,n){c=null!=c?c:!0;e=null!=e?e:!1;k=null!=k?k:!Editor.defaultCompressed;var q=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(F){var E=F.getElementsByTagName("mxGraphModel"),+U=0<E.length?E[0]:null;E=F;null==U&&k?(U=mxUtils.getNodeValue(F),0<U.length&&(U=Graph.decompress(U),null!=U&&0<U.length&&(E=F.cloneNode(!1),E.appendChild(mxUtils.parseXml(U).documentElement)))):null==U||k?E=F.cloneNode(!0):(E=F.cloneNode(!1),mxUtils.setTextContent(E,Graph.compressNode(U)));q.appendChild(E)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(q),q=this.fileNode.cloneNode(!1),e)c(this.currentPage.node);else for(e=0;e<this.pages.length;e++){var u=this.pages[e],A=u.node;if(u!=this.currentPage)if(u.needsUpdate){var D=new mxCodec(mxUtils.createXmlDocument());D=D.encode(new mxGraphModel(u.root));this.editor.graph.saveViewState(u.viewState,D,null,n);EditorUi.removeChildNodes(A);A.appendChild(D);delete u.needsUpdate}else n&&(this.updatePageRoot(u),null!=u.viewState.backgroundImage&&(null!=u.viewState.backgroundImage.originalSrc?u.viewState.backgroundImage=this.createImageForPageLink(u.viewState.backgroundImage.originalSrc,u):Graph.isPageLink(u.viewState.backgroundImage.src)&&(u.viewState.backgroundImage=this.createImageForPageLink(u.viewState.backgroundImage.src,u))),null!=u.viewState.backgroundImage&&null!=u.viewState.backgroundImage.originalSrc&&(D=new mxCodec(mxUtils.createXmlDocument()),D=D.encode(new mxGraphModel(u.root)),this.editor.graph.saveViewState(u.viewState,D,null,n),A=A.cloneNode(!1),A.appendChild(D)));c(A)}return q};EditorUi.prototype.anonymizeString=function(c,e){for(var k=[],n=0;n<c.length;n++){var q=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(q)?k.push(q):isNaN(parseInt(q))?q.toLowerCase()!=q?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):q.toUpperCase()!=q?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(q)?k.push(" "):k.push("?"):k.push(e?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizePatch=function(c){if(null!=c[EditorUi.DIFF_INSERT])for(var e=0;e<c[EditorUi.DIFF_INSERT].length;e++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][e].data).documentElement.cloneNode(!1);@@ -13015,10 +13015,10 @@ null!=A[D].xmlValue&&(A[D].xmlValue="["+A[D].xmlValue.length+"]"),null!=A[D].stye){if(null!=c.attributes)for(var k=0;k<c.attributes.length;k++)"as"!=c.attributes[k].name&&c.setAttribute(c.attributes[k].name,this.anonymizeString(c.attributes[k].value,e));if(null!=c.childNodes)for(k=0;k<c.childNodes.length;k++)this.anonymizeAttributes(c.childNodes[k],e)};EditorUi.prototype.anonymizeNode=function(c,e){e=c.getElementsByTagName("mxCell");for(var k=0;k<e.length;k++)null!=e[k].getAttribute("value")&&e[k].setAttribute("value","["+e[k].getAttribute("value").length+"]"),null!=e[k].getAttribute("xmlValue")&&e[k].setAttribute("xmlValue","["+e[k].getAttribute("xmlValue").length+"]"),null!=e[k].getAttribute("style")&&e[k].setAttribute("style","["+e[k].getAttribute("style").length+"]"),null!=e[k].parentNode&&"root"!=e[k].parentNode.nodeName&&null!=e[k].parentNode.parentNode&&(e[k].setAttribute("id",e[k].parentNode.getAttribute("id")),e[k].parentNode.parentNode.replaceChild(e[k],e[k].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var e=this.getCurrentFile();null!=e&&(e.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&e.invalidChecksum?e.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(e.clearAutosave(),this.editor.setStatus(""),c?e.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();e.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();e.handleFileError(k,!0)})):e.synchronizeFile(mxUtils.bind(this,function(){e.handleFileSuccess("manual"==DrawioFile.SYNC)}),-mxUtils.bind(this,function(k){e.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,e,k,n,q,u,A,D,G,E,U,P,J){q=null!=q?q:!0;u=null!=u?u:!1;E=null!=E?E:!Editor.defaultCompressed;var m=this.editor.graph;if((e||!c&&null!=G&&/(\.svg)$/i.test(G.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var v=m.getGlobalVariable;m=this.createTemporaryGraph(m.getStylesheet());m.setBackgroundImage=this.editor.graph.setBackgroundImage;m.background=this.editor.graph.background;var z=-null!=this.pages?this.pages[0]:null;null==z||this.currentPage==z?m.setBackgroundImage(this.editor.graph.backgroundImage):null!=z.viewState&&null!=z.viewState&&m.setBackgroundImage(z.viewState.backgroundImage);m.getGlobalVariable=function(B){return"page"==B&&null!=z?z.getName():"pagenumber"==B?1:v.apply(this,arguments)};document.body.appendChild(m.container);null!=z&&m.model.setRoot(z.root)}A=null!=A?A:this.getXmlFileData(q,u,E,U);G=null!=G?G:this.getCurrentFile();c=this.createFileData(A,m,G,window.location.href,-c,e,k,n,q,D,E,P,J);m!=this.editor.graph&&m.container.parentNode.removeChild(m.container);return c};EditorUi.prototype.getHtml=function(c,e,k,n,q,u){u=null!=u?u:!0;var A=null,D=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=e){A=u?e.getGraphBounds():e.getBoundingBox(e.getSelectionCells());var G=e.view.scale;u=Math.floor(A.x/G-e.view.translate.x);G=Math.floor(A.y/G-e.view.translate.y);A=e.background;null==q&&(e=this.getBasenames().join(";"),0<e.length&&(D=EditorUi.drawHost+"/embed.js?s="+e));-c.setAttribute("x0",u);c.setAttribute("y0",G)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=n&&c.setAttribute("edit",n));null!=q&&(q=q.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";n=Graph.compress(c);Graph.decompress(n)!=c&&(n=encodeURIComponent(c));return(null==q?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':+mxUtils.bind(this,function(k){e.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,e,k,n,q,u,A,D,F,E,U,P,M){q=null!=q?q:!0;u=null!=u?u:!1;E=null!=E?E:!Editor.defaultCompressed;var m=this.editor.graph;if((e||!c&&null!=F&&/(\.svg)$/i.test(F.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var v=m.getGlobalVariable;m=this.createTemporaryGraph(m.getStylesheet());m.setBackgroundImage=this.editor.graph.setBackgroundImage;m.background=this.editor.graph.background;var z=+null!=this.pages?this.pages[0]:null;null==z||this.currentPage==z?m.setBackgroundImage(this.editor.graph.backgroundImage):null!=z.viewState&&null!=z.viewState&&m.setBackgroundImage(z.viewState.backgroundImage);m.getGlobalVariable=function(B){return"page"==B&&null!=z?z.getName():"pagenumber"==B?1:v.apply(this,arguments)};document.body.appendChild(m.container);null!=z&&m.model.setRoot(z.root)}A=null!=A?A:this.getXmlFileData(q,u,E,U);F=null!=F?F:this.getCurrentFile();c=this.createFileData(A,m,F,window.location.href,+c,e,k,n,q,D,E,P,M);m!=this.editor.graph&&m.container.parentNode.removeChild(m.container);return c};EditorUi.prototype.getHtml=function(c,e,k,n,q,u){u=null!=u?u:!0;var A=null,D=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=e){A=u?e.getGraphBounds():e.getBoundingBox(e.getSelectionCells());var F=e.view.scale;u=Math.floor(A.x/F-e.view.translate.x);F=Math.floor(A.y/F-e.view.translate.y);A=e.background;null==q&&(e=this.getBasenames().join(";"),0<e.length&&(D=EditorUi.drawHost+"/embed.js?s="+e));+c.setAttribute("x0",u);c.setAttribute("y0",F)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=n&&c.setAttribute("edit",n));null!=q&&(q=q.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";n=Graph.compress(c);Graph.decompress(n)!=c&&(n=encodeURIComponent(c));return(null==q?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=q?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==q?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+q+"'\"/>\n":"")+"</head>\n<body"+(null==q&&null!=A&&A!=mxConstants.NONE?' style="background-color:'+A+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+n+"</div>\n</div>\n"+(null==q?'<script type="text/javascript" src="'+D+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,e,k,n,q){e=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=q&&(q=q.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==q?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=q?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==q?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+@@ -13026,21 +13026,21 @@ q+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph"function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var e=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,k=Editor.extractParserError(e,mxResources.get("invalidOrMissingFile"));if(k)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[e],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");c=null!=e?this.editor.extractGraphModel(e,!0):null;null!=c&&(e=c);if(null!=e&&"mxfile"==e.nodeName&&(c=e.getElementsByTagName("diagram"),k={},0<c.length)){var n=this.getHashObject(),q=null;this.fileNode=e;this.pages=[];for(var u=0;u<c.length;u++){null==c[u].getAttribute("id")&&c[u].setAttribute("id",u);e=new DiagramPage(c[u]);null==e.getName()&&e.setName(mxResources.get("pageWithNumber",[u+1]));this.pages.push(e);if(null==n.pageId&&null!=urlParams["page-id"]&&e.getId()==urlParams["page-id"]||null!=n.pageId&&e.getId()==n.pageId)q=e;if(null==k[e.getId()])k[e.getId()]=e;else throw Error(e.getId()+": Duplicate page ID");}this.currentPage=null!=q?q:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];e=this.currentPage.node}null==this.fileNode&&null!=e&&(this.fileNode=e.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(e.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(e);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),-this.scrollToPage());if(null!=urlParams["layer-ids"])try{var A=decodeURIComponent(urlParams["layer-ids"]).split(" ");e={};for(u=0;u<A.length;u++)e[A[u]]=!0;var D=this.editor.graph.getModel(),G=D.getChildren(D.root);for(u=0;u<G.length;u++){var E=G[u];D.setVisible(E,e[E.id]||!1)}}catch(U){}};EditorUi.prototype.getBaseFilename=function(c){var e=this.getCurrentFile();e=null!=e&&null!=e.getTitle()?e.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(e)||/(\.html)$/i.test(e)||/(\.svg)$/i.test(e)||/(\.png)$/i.test(e))e=-e.substring(0,e.lastIndexOf("."));/(\.drawio)$/i.test(e)&&(e=e.substring(0,e.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(e=e+"-"+this.currentPage.getName());return e};EditorUi.prototype.downloadFile=function(c,e,k,n,q,u,A,D,G,E,U,P,J,m,v,z){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var B=this.getBaseFilename(!q),H=B+("xml"==c||"pdf"==c&&U?".drawio":"")+"."+c;-if("xml"==c){var T=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,q,null,null,null,e);this.saveData(H,c,T,"text/xml")}else if("html"==c)T=this.getHtml2(this.getFileData(!0),this.editor.graph,B),this.saveData(H,c,T,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?H=B+".png":"jpeg"==c&&(H=B+".jpg"),this.saveRequest(H,c,mxUtils.bind(this,function(M,R){try{return this.createDownloadRequest(M,c,n,R,A,q,D,G,E,U,P,void 0,-void 0,!u,J,m,v,z)}catch(S){this.handleError(S)}}));else{var g=null,p=mxUtils.bind(this,function(M){M.length<=MAX_REQUEST_SIZE?this.saveData(H,"svg",M,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(g)}))});if("svg"==c){var F=this.editor.graph.background;if(A||F==mxConstants.NONE)F=null;var K=this.editor.graph.getSvg(F,null,null,null,null,n);k&&this.editor.graph.addSvgShadow(K);this.editor.convertImages(K,-mxUtils.bind(this,mxUtils.bind(this,function(M){this.spinner.stop();p(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(M))})))}else H=B+".svg",g=this.getFileData(!1,!0,null,mxUtils.bind(this,function(M){this.spinner.stop();p(M)}),n)}}catch(M){this.handleError(M)}};EditorUi.prototype.createDownloadRequest=function(c,e,k,n,q,u,A,D,G,E,U,P,J,m,v,z,B,H){c=this.downloadRequestBuilder(c,e,k,n,q,u,A,D,G,E,U,P,J,m,v,z,B,H);e="";for(var T in c)k=c[T],null!=k&&(e+=T+"="+encodeURIComponent(k)+-"&");return new mxXmlRequest(EXPORT_URL,e)};EditorUi.prototype.downloadRequestBuilder=function(c,e,k,n,q,u,A,D,G,E,U,P,J,m,v,z,B,H){var T=this.editor.graph,g=T.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==u?!1:"xmlpng"!=e,null,null,null,!Editor.defaultCompressed,"pdf"==e);var p=null,F=null,K=null;if(!EditorUi.isElectronApp&&(g.width*g.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};E=E?"1":"0";"pdf"==e&&(null!=U?(p=U.from,F=U.to):0==u&&(K=-"1"));"xmlpng"==e&&(E="1",e="png");if(("xmlpng"==e||"svg"==e)&&null!=this.pages&&null!=this.currentPage)for(u=0;u<this.pages.length;u++)if(this.pages[u]==this.currentPage){p=u;break}u=T.background;"png"!=e&&"pdf"!=e&&"svg"!=e||!q?q||null!=u&&u!=mxConstants.NONE||(u="#ffffff"):u=mxConstants.NONE;q={globalVars:T.getExportVariables()};G&&(q.grid={size:T.gridSize,steps:T.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==e?mxGraphView.prototype.defaultGridColor:T.view.gridColor});Graph.translateDiagram&&-(q.diagramLanguage=Graph.diagramLanguage);return{format:e,from:p,to:F,allPages:K,bg:null!=u?u:mxConstants.NONE,base64:n,embedXml:E,xml:k,filename:null!=c?c:"",extras:JSON.stringify(q),scale:A,border:D,pageMargin:v,w:P&&isFinite(P)?P:null,h:J&&isFinite(J)?J:null,crop:null!=m&&m?"1":"0",fit:null!=z&&z?"1":"0",sheetsAcross:B,sheetsDown:H}};EditorUi.prototype.setMode=function(c,e){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));+this.scrollToPage());if(null!=urlParams["layer-ids"])try{var A=decodeURIComponent(urlParams["layer-ids"]).split(" ");e={};for(u=0;u<A.length;u++)e[A[u]]=!0;var D=this.editor.graph.getModel(),F=D.getChildren(D.root);for(u=0;u<F.length;u++){var E=F[u];D.setVisible(E,e[E.id]||!1)}}catch(U){}};EditorUi.prototype.getBaseFilename=function(c){var e=this.getCurrentFile();e=null!=e&&null!=e.getTitle()?e.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(e)||/(\.html)$/i.test(e)||/(\.svg)$/i.test(e)||/(\.png)$/i.test(e))e=+e.substring(0,e.lastIndexOf("."));/(\.drawio)$/i.test(e)&&(e=e.substring(0,e.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(e=e+"-"+this.currentPage.getName());return e};EditorUi.prototype.downloadFile=function(c,e,k,n,q,u,A,D,F,E,U,P,M,m,v,z){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var B=this.getBaseFilename(!q),H=B+("xml"==c||"pdf"==c&&U?".drawio":"")+"."+c;+if("xml"==c){var T=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,q,null,null,null,e);this.saveData(H,c,T,"text/xml")}else if("html"==c)T=this.getHtml2(this.getFileData(!0),this.editor.graph,B),this.saveData(H,c,T,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?H=B+".png":"jpeg"==c&&(H=B+".jpg"),this.saveRequest(H,c,mxUtils.bind(this,function(L,R){try{return this.createDownloadRequest(L,c,n,R,A,q,D,F,E,U,P,void 0,+void 0,!u,M,m,v,z)}catch(S){this.handleError(S)}}));else{var g=null,p=mxUtils.bind(this,function(L){L.length<=MAX_REQUEST_SIZE?this.saveData(H,"svg",L,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(g)}))});if("svg"==c){var G=this.editor.graph.background;if(A||G==mxConstants.NONE)G=null;var J=this.editor.graph.getSvg(G,null,null,null,null,n);k&&this.editor.graph.addSvgShadow(J);this.editor.convertImages(J,+mxUtils.bind(this,mxUtils.bind(this,function(L){this.spinner.stop();p(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(L))})))}else H=B+".svg",g=this.getFileData(!1,!0,null,mxUtils.bind(this,function(L){this.spinner.stop();p(L)}),n)}}catch(L){this.handleError(L)}};EditorUi.prototype.createDownloadRequest=function(c,e,k,n,q,u,A,D,F,E,U,P,M,m,v,z,B,H){c=this.downloadRequestBuilder(c,e,k,n,q,u,A,D,F,E,U,P,M,m,v,z,B,H);e="";for(var T in c)k=c[T],null!=k&&(e+=T+"="+encodeURIComponent(k)++"&");return new mxXmlRequest(EXPORT_URL,e)};EditorUi.prototype.downloadRequestBuilder=function(c,e,k,n,q,u,A,D,F,E,U,P,M,m,v,z,B,H){var T=this.editor.graph,g=T.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==u?!1:"xmlpng"!=e,null,null,null,!Editor.defaultCompressed,"pdf"==e);var p=null,G=null,J=null;if(!EditorUi.isElectronApp&&(g.width*g.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};E=E?"1":"0";"pdf"==e&&(null!=U?(p=U.from,G=U.to):0==u&&(J=+"1"));"xmlpng"==e&&(E="1",e="png");if(("xmlpng"==e||"svg"==e)&&null!=this.pages&&null!=this.currentPage)for(u=0;u<this.pages.length;u++)if(this.pages[u]==this.currentPage){p=u;break}u=T.background;"png"!=e&&"pdf"!=e&&"svg"!=e||!q?q||null!=u&&u!=mxConstants.NONE||(u="#ffffff"):u=mxConstants.NONE;q={globalVars:T.getExportVariables()};F&&(q.grid={size:T.gridSize,steps:T.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==e?mxGraphView.prototype.defaultGridColor:T.view.gridColor});Graph.translateDiagram&&+(q.diagramLanguage=Graph.diagramLanguage);return{format:e,from:p,to:G,allPages:J,bg:null!=u?u:mxConstants.NONE,base64:n,embedXml:E,xml:k,filename:null!=c?c:"",extras:JSON.stringify(q),scale:A,border:D,pageMargin:v,w:P&&isFinite(P)?P:null,h:M&&isFinite(M)?M:null,crop:null!=m&&m?"1":"0",fit:null!=z&&z?"1":"0",sheetsAcross:B,sheetsDown:H}};EditorUi.prototype.setMode=function(c,e){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var e=c.indexOf("#");0<=e&&(c=c.substring(0,e))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,e={};if(null!=c&&0<c.length){var k=c.lastIndexOf("#");if(0<k){c=decodeURIComponent(c.substring(k+1));try{e=JSON.parse(c)}catch(n){}}}return e};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var e=window.location.hash;if(null==e||""==e)e="#";var k=e.lastIndexOf("#");0<k&&(e=e.substring(0,k));try{null==c||mxUtils.isEmptyObject(c)||(e=e+"#"+encodeURIComponent(JSON.stringify(c)))}catch(n){}0<k&&0<e.lastIndexOf("#")?window.location.hash=e:window.location.replace(e)}};EditorUi.prototype.loadDescriptor=function(c,e,k){var n=window.location.hash,q=mxUtils.bind(this,function(A){var D=null!=c.data?c.data:"";null!=A&&0<A.length&&-(0<D.length&&(D+="\n"),D+=A);A=new LocalFile(this,"csv"!=c.format&&0<D.length?D:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);A.getHash=function(){return n};this.fileLoaded(A);"csv"==c.format&&this.importCsv(D,mxUtils.bind(this,function(J){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var G=null!=c.interval?parseInt(c.interval):6E4,E=null,U=mxUtils.bind(this,function(){var J=this.currentPage;-mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(m){J===this.currentPage&&(200<=m.getStatus()&&300>=m.getStatus()?(this.updateDiagram(m.getText()),P()):this.handleError({message:mxResources.get("error")+" "+m.getStatus()}))}),mxUtils.bind(this,function(m){this.handleError(m)}))}),P=mxUtils.bind(this,function(){window.clearTimeout(E);E=window.setTimeout(U,G)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){P();-U()}));P();U()}null!=e&&e()});if(null!=c.url&&0<c.url.length){var u=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(u,mxUtils.bind(this,function(A){q(A)}),mxUtils.bind(this,function(A){null!=k&&k(A)}))}else q("")};EditorUi.prototype.updateDiagram=function(c){function e(g){var p=new mxCellOverlay(g.image||q.warningImage,g.tooltip,g.align,g.valign,g.offset);p.addListener(mxEvent.CLICK,function(F,K){n.alert(g.tooltip)});return p}var k=null,n=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=-null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var q=this.editor.graph,u=q.getModel();u.beginUpdate();var A=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var D=u.getCell(c.getAttribute("id"));if(null!=D){try{var G=c.getAttribute("value");if(null!=G){var E=mxUtils.parseXml(G).documentElement;if(null!=E)if("1"==E.getAttribute("replace-value"))u.setValue(D,E);else for(var U=E.attributes,P=0;P<U.length;P++)q.setAttributeForCell(D,U[P].nodeName,0<U[P].nodeValue.length?-U[P].nodeValue:null)}}catch(g){null!=window.console&&console.log("Error in value for "+D.id+": "+g)}try{var J=c.getAttribute("style");null!=J&&q.model.setStyle(D,J)}catch(g){null!=window.console&&console.log("Error in style for "+D.id+": "+g)}try{var m=c.getAttribute("icon");if(null!=m){var v=0<m.length?JSON.parse(m):null;null!=v&&v.append||q.removeCellOverlays(D);null!=v&&q.addCellOverlay(D,e(v))}}catch(g){null!=window.console&&console.log("Error in icon for "+D.id+": "+g)}try{var z=c.getAttribute("geometry");+(0<D.length&&(D+="\n"),D+=A);A=new LocalFile(this,"csv"!=c.format&&0<D.length?D:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);A.getHash=function(){return n};this.fileLoaded(A);"csv"==c.format&&this.importCsv(D,mxUtils.bind(this,function(M){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var F=null!=c.interval?parseInt(c.interval):6E4,E=null,U=mxUtils.bind(this,function(){var M=this.currentPage;+mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(m){M===this.currentPage&&(200<=m.getStatus()&&300>=m.getStatus()?(this.updateDiagram(m.getText()),P()):this.handleError({message:mxResources.get("error")+" "+m.getStatus()}))}),mxUtils.bind(this,function(m){this.handleError(m)}))}),P=mxUtils.bind(this,function(){window.clearTimeout(E);E=window.setTimeout(U,F)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){P();+U()}));P();U()}null!=e&&e()});if(null!=c.url&&0<c.url.length){var u=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(u,mxUtils.bind(this,function(A){q(A)}),mxUtils.bind(this,function(A){null!=k&&k(A)}))}else q("")};EditorUi.prototype.updateDiagram=function(c){function e(g){var p=new mxCellOverlay(g.image||q.warningImage,g.tooltip,g.align,g.valign,g.offset);p.addListener(mxEvent.CLICK,function(G,J){n.alert(g.tooltip)});return p}var k=null,n=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=+null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var q=this.editor.graph,u=q.getModel();u.beginUpdate();var A=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var D=u.getCell(c.getAttribute("id"));if(null!=D){try{var F=c.getAttribute("value");if(null!=F){var E=mxUtils.parseXml(F).documentElement;if(null!=E)if("1"==E.getAttribute("replace-value"))u.setValue(D,E);else for(var U=E.attributes,P=0;P<U.length;P++)q.setAttributeForCell(D,U[P].nodeName,0<U[P].nodeValue.length?+U[P].nodeValue:null)}}catch(g){null!=window.console&&console.log("Error in value for "+D.id+": "+g)}try{var M=c.getAttribute("style");null!=M&&q.model.setStyle(D,M)}catch(g){null!=window.console&&console.log("Error in style for "+D.id+": "+g)}try{var m=c.getAttribute("icon");if(null!=m){var v=0<m.length?JSON.parse(m):null;null!=v&&v.append||q.removeCellOverlays(D);null!=v&&q.addCellOverlay(D,e(v))}}catch(g){null!=window.console&&console.log("Error in icon for "+D.id+": "+g)}try{var z=c.getAttribute("geometry");if(null!=z){z=JSON.parse(z);var B=q.getCellGeometry(D);if(null!=B){B=B.clone();for(key in z){var H=parseFloat(z[key]);"dx"==key?B.x+=H:"dy"==key?B.y+=H:"dw"==key?B.width+=H:"dh"==key?B.height+=H:B[key]=parseFloat(z[key])}q.model.setGeometry(D,B)}}}catch(g){null!=window.console&&console.log("Error in icon for "+D.id+": "+g)}}}else if("model"==c.nodeName){for(var T=c.firstChild;null!=T&&T.nodeType!=mxConstants.NODETYPE_ELEMENT;)T=T.nextSibling;null!=T&&(new mxCodec(c.firstChild)).decode(T,u)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(q.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))q.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(A=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{u.endUpdate()}null!=A&&this.chromelessResize&&this.chromelessResize(!0,A)}return k};EditorUi.prototype.getCopyFilename=function(c,e){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var n=k.lastIndexOf(".");0<=n&&(c=k.substring(n),k=k.substring(0,n));if(e){e=k;var q=new Date;k=q.getFullYear();n=q.getMonth()+1;var u=q.getDate(),A=q.getHours(),D=q.getMinutes();q=q.getSeconds();k=e+(" "+(k+"-"+n+"-"+u+"-"+A+"-"+D+"-"+q))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=function(c,e){try{null!=c&&e&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,e,k){var n=@@ -13048,10 +13048,10 @@ this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrenwindow.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerText="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();e||this.showSplash()});if(null!=c)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?c.addUnsavedStatus():this.editor.setStatus(""):this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</div>");!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();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));q=!0;if(!this.isOffline()&&null!=c.getMode()){var A="1"==urlParams.sketch?"sketch":uiTheme;if(null==A)A="default";else if("sketch"==A||"min"==A)A+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",-[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(D){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(D){}}catch(D){this.fileLoadedError=D;if(null!=c)try{c.close()}catch(G){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,-mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=n?this.fileLoaded(n)||u():u()});e?c():(null!=D.fallbackFileData&&(D.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var G=new LocalFile(this,D.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(G)})}),this.handleError(D,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else u();return q};EditorUi.prototype.getHashValueForPages=function(c,e){var k=+[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(D){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(D){}}catch(D){this.fileLoadedError=D;if(null!=c)try{c.close()}catch(F){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,+mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=n?this.fileLoaded(n)||u():u()});e?c():(null!=D.fallbackFileData&&(D.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var F=new LocalFile(this,D.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(F)})}),this.handleError(D,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else u();return q};EditorUi.prototype.getHashValueForPages=function(c,e){var k=0,n=new mxGraphModel,q=new mxCodec;null!=e&&(e.byteCount=0,e.attrCount=0,e.eltCount=0,e.nodeCount=0);for(var u=0;u<c.length;u++){this.updatePageRoot(c[u]);var A=c[u].node.cloneNode(!1);A.removeAttribute("name");n.root=c[u].root;var D=q.encode(n);this.editor.graph.saveViewState(c[u].viewState,D,!0);D.removeAttribute("pageWidth");D.removeAttribute("pageHeight");A.appendChild(D);null!=e&&(e.eltCount+=A.getElementsByTagName("*").length,e.nodeCount+=A.getElementsByTagName("mxCell").length);k=(k<<5)-k+-this.hashValue(A,function(G,E,U,P){return!P||"mxGeometry"!=G.nodeName&&"mxPoint"!=G.nodeName||"x"!=E&&"y"!=E&&"width"!=E&&"height"!=E?P&&"mxCell"==G.nodeName&&"previous"==E?null:U:Math.round(U)},e)<<0}return k};EditorUi.prototype.hashValue=function(c,e,k){var n=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(n^=this.hashValue(c.nodeName,e,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);+this.hashValue(A,function(F,E,U,P){return!P||"mxGeometry"!=F.nodeName&&"mxPoint"!=F.nodeName||"x"!=E&&"y"!=E&&"width"!=E&&"height"!=E?P&&"mxCell"==F.nodeName&&"previous"==E?null:U:Math.round(U)},e)<<0}return k};EditorUi.prototype.hashValue=function(c,e,k){var n=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(n^=this.hashValue(c.nodeName,e,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var q=0;q<c.attributes.length;q++){var u=c.attributes[q].name,A=null!=e?e(c,u,c.attributes[q].value,!0):c.attributes[q].value;null!=A&&(n^=this.hashValue(u,e,k)+this.hashValue(A,e,k))}}if(null!=c.childNodes)for(q=0;q<c.childNodes.length;q++)n=(n<<5)-n+this.hashValue(c.childNodes[q],e,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);e=0;null!=k&&(k.byteCount+=c.length);for(q=0;q<c.length;q++)e=(e<<5)-e+c.charCodeAt(q)<<0;n^=e}return n};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,e,k,n,q,u,A){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){null==c&&(c=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var e=0;e<c.length;e++)null!=c[e].xml&&"<"!=c[e].xml.charAt(0)&&(c[e].xml=mxUtils.trim(Graph.decompress(c[e].xml)));e=mxUtils.createXmlDocument();var k=e.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(c,null,2));e.appendChild(k);return mxUtils.getXml(e,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),@@ -13059,50 +13059,50 @@ EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultComc=null!=c?c:k.firstChild.nextSibling.nextSibling;e=k.lastChild;var n=e.previousSibling;k.insertBefore(e,c);k.insertBefore(n,e)}};EditorUi.prototype.loadLibrary=function(c,e){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==k.documentElement.nodeName){var n=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,n,k.documentElement.getAttribute("title"),e)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.libraryLoaded=function(c,e,k,n){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var q=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var u=0;u<this.openLibraries.length;u++)if(this.openLibraries[u].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[u],this.openLibraries);break}q={file:c,images:e,title:k,expand:n};this.openLibraries.push(q)}else this.scratchpad=c;u=this.sidebar.palettes[c.getHash()];u=null!=u?u[u.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var A=null,D=mxUtils.bind(this,function(H,T){0==H.length&&c.isEditable()?(null==A&&(A=document.createElement("div"),A.className="geDropTarget",mxUtils.write(A,mxResources.get("dragElementsHere"))),T.appendChild(A)):this.addLibraryEntries(H,T)});null!=this.sidebar&&null!=-e&&this.sidebar.addEntries(e);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var G=this.sidebar.addPalette(c.getHash(),k,null!=n?n:!0,mxUtils.bind(this,function(H){D(e,H)}));null!=q&&(q.div=G);this.repositionLibrary(u,"L.scratchpad"!=c.getHash());n=G.parentNode.previousSibling;k=n.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&n.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var E=document.createElement("div");E.style.backgroundColor=+e&&this.sidebar.addEntries(e);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var F=this.sidebar.addPalette(c.getHash(),k,null!=n?n:!0,mxUtils.bind(this,function(H){D(e,H)}));null!=q&&(q.div=F);this.repositionLibrary(u,"L.scratchpad"!=c.getHash());n=F.parentNode.previousSibling;k=n.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&n.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var E=document.createElement("div");E.style.backgroundColor="inherit";n.style.position="relative";var U=document.createElement("img");U.className="geAdaptiveAsset";U.setAttribute("src",Editor.crossImage);U.setAttribute("title",mxResources.get("close"));U.setAttribute("valign","absmiddle");U.setAttribute("border","0");U.style.position="relative";U.style.top="2px";U.style.width="14px";U.style.cursor="pointer";U.style.margin="0 3px";var P=null;if(".scratchpad"!=c.title||this.closableScratchpad)E.appendChild(U),mxEvent.addListener(U,"click",mxUtils.bind(this,-function(H){if(!mxEvent.isConsumed(H)){var T=mxUtils.bind(this,function(){null!=q&&mxUtils.remove(q,this.openLibraries);this.closeLibrary(c)});null!=P?this.confirm(mxResources.get("allChangesLost"),null,T,mxResources.get("cancel"),mxResources.get("discardChanges")):T();mxEvent.consume(H)}}));if(c.isEditable()){var J=this.editor.graph,m=null;k=mxUtils.bind(this,function(H){this.showLibraryDialog(c.getTitle(),G,e,c,c.getMode());mxEvent.consume(H)});var v=mxUtils.bind(this,function(H){c.setModified(!0);+function(H){if(!mxEvent.isConsumed(H)){var T=mxUtils.bind(this,function(){null!=q&&mxUtils.remove(q,this.openLibraries);this.closeLibrary(c)});null!=P?this.confirm(mxResources.get("allChangesLost"),null,T,mxResources.get("cancel"),mxResources.get("discardChanges")):T();mxEvent.consume(H)}}));if(c.isEditable()){var M=this.editor.graph,m=null;k=mxUtils.bind(this,function(H){this.showLibraryDialog(c.getTitle(),F,e,c,c.getMode());mxEvent.consume(H)});var v=mxUtils.bind(this,function(H){c.setModified(!0);c.isAutosave()?(null!=m&&null!=m.parentNode&&m.parentNode.removeChild(m),m=U.cloneNode(!1),m.setAttribute("src",Editor.spinImage),m.setAttribute("title",mxResources.get("saving")),m.style.cursor="default",m.style.marginRight="2px",m.style.marginTop="-2px",E.insertBefore(m,E.firstChild),this.saveLibrary(c.getTitle(),e,c,c.getMode(),!0,!0,function(){null!=m&&null!=m.parentNode&&m.parentNode.removeChild(m)})):null==P&&(P=U.cloneNode(!1),P.setAttribute("src",Editor.saveImage),P.setAttribute("title",mxResources.get("save")),-E.insertBefore(P,E.firstChild),mxEvent.addListener(P,"click",mxUtils.bind(this,function(T){this.saveLibrary(c.getTitle(),e,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==P||c.isModified()||(P.parentNode.removeChild(P),P=null)});mxEvent.consume(T)})))}),z=mxUtils.bind(this,function(H,T,g,p){H=J.cloneCells(mxUtils.sortCells(J.model.getTopmostCells(H)));for(var F=0;F<H.length;F++){var K=J.getCellGeometry(H[F]);null!=K&&K.translate(-T.x,-T.y)}G.appendChild(this.sidebar.createVertexTemplateFromCells(H,-T.width,T.height,p||"",!0,null,!1));H=mxUtils.getXml(this.editor.graph.encodeCells(H));Editor.defaultCompressed&&(H=Graph.compress(H));T={xml:H,w:T.width,h:T.height};null!=p&&(T.title=p);e.push(T);v(g);null!=A&&null!=A.parentNode&&0<e.length&&(A.parentNode.removeChild(A),A=null)}),B=mxUtils.bind(this,function(H){if(J.isSelectionEmpty())J.getRubberband().isActive()?(J.getRubberband().execute(H),J.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),-mxResources.get("ok"));else{var T=J.getSelectionCells(),g=J.view.getBounds(T);if(null!=g&&0<g.width&&0<g.height){var p=J.view.scale;g.x/=p;g.y/=p;g.width/=p;g.height/=p;g.x-=J.view.translate.x;g.y-=J.view.translate.y;z(T,g)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(H)});mxEvent.addGestureListeners(G,function(){},mxUtils.bind(this,function(H){J.isMouseDown&&null!=J.panningManager&&null!=J.graphHandler.first&&(J.graphHandler.suspend(),-null!=J.graphHandler.hint&&(J.graphHandler.hint.style.visibility="hidden"),G.style.backgroundColor="light-dark(#fefefe, #000000)",G.style.cursor="copy",J.panningManager.stop(),J.autoScroll=!1,mxEvent.consume(H))}),mxUtils.bind(this,function(H){J.isMouseDown&&null!=J.panningManager&&null!=J.graphHandler&&(G.style.backgroundColor="",G.style.cursor="default",this.sidebar.showTooltips=!0,J.panningManager.stop(),J.graphHandler.reset(),J.isMouseDown=!1,J.autoScroll=!0,B(H),mxEvent.consume(H))}));mxEvent.addListener(G,-"mouseleave",mxUtils.bind(this,function(H){J.isMouseDown&&null!=J.graphHandler.first&&(J.graphHandler.resume(),null!=J.graphHandler.hint&&(J.graphHandler.hint.style.visibility="visible"),G.style.backgroundColor="",G.style.cursor="",J.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(H){G.style.backgroundColor="light-dark(#fefefe, #000000)";H.dataTransfer.dropEffect="copy";G.style.cursor="copy";this.sidebar.hideTooltip();H.stopPropagation();H.preventDefault()})),-mxEvent.addListener(G,"drop",mxUtils.bind(this,function(H){G.style.cursor="";G.style.backgroundColor="";0<H.dataTransfer.files.length&&this.importFiles(H.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(T,g,p,F,K,M,R,S,V){if(null!=T&&"image/"==g.substring(0,6))T="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(T),T=[new mxCell("",new mxGeometry(0,0,K,M),T)],T[0].vertex=!0,z(T,new mxRectangle(0,0,K,M),H,mxEvent.isAltDown(H)?-null:R.substring(0,R.lastIndexOf(".")).replace(/_/g," ")),null!=A&&null!=A.parentNode&&0<e.length&&(A.parentNode.removeChild(A),A=null);else{var W=!1,X=mxUtils.bind(this,function(Y,Z){null!=Y&&"application/pdf"==Z&&(Z=Editor.extractGraphModelFromPdf(Y),null!=Z&&0<Z.length&&(Y=Z));if(null!=Y)if(Y=mxUtils.parseXml(Y),"mxlibrary"==Y.documentElement.nodeName)try{var ba=JSON.parse(mxUtils.getTextContent(Y.documentElement));D(ba,G);e=e.concat(ba);v(H);this.spinner.stop();W=!0}catch(ma){}else if("mxfile"==-Y.documentElement.nodeName)try{var ha=Y.documentElement.getElementsByTagName("diagram");for(ba=0;ba<ha.length;ba++){var ca=this.stringToCells(Editor.getDiagramNodeXml(ha[ba])),da=this.editor.graph.getBoundingBoxFromGeometry(ca);null!=da&&z(ca,new mxRectangle(0,0,da.width,da.height),H)}W=!0}catch(ma){null!=window.console&&console.log("error in drop handler:",ma)}W||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=A&&null!=A.parentNode&&0<e.length&&(A.parentNode.removeChild(A),+E.insertBefore(P,E.firstChild),mxEvent.addListener(P,"click",mxUtils.bind(this,function(T){this.saveLibrary(c.getTitle(),e,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==P||c.isModified()||(P.parentNode.removeChild(P),P=null)});mxEvent.consume(T)})))}),z=mxUtils.bind(this,function(H,T,g,p){H=M.cloneCells(mxUtils.sortCells(M.model.getTopmostCells(H)));for(var G=0;G<H.length;G++){var J=M.getCellGeometry(H[G]);null!=J&&J.translate(-T.x,-T.y)}F.appendChild(this.sidebar.createVertexTemplateFromCells(H,+T.width,T.height,p||"",!0,null,!1));H=mxUtils.getXml(this.editor.graph.encodeCells(H));Editor.defaultCompressed&&(H=Graph.compress(H));T={xml:H,w:T.width,h:T.height};null!=p&&(T.title=p);e.push(T);v(g);null!=A&&null!=A.parentNode&&0<e.length&&(A.parentNode.removeChild(A),A=null)}),B=mxUtils.bind(this,function(H){if(M.isSelectionEmpty())M.getRubberband().isActive()?(M.getRubberband().execute(H),M.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),+mxResources.get("ok"));else{var T=M.getSelectionCells(),g=M.view.getBounds(T);if(null!=g&&0<g.width&&0<g.height){var p=M.view.scale;g.x/=p;g.y/=p;g.width/=p;g.height/=p;g.x-=M.view.translate.x;g.y-=M.view.translate.y;z(T,g)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(H)});mxEvent.addGestureListeners(F,function(){},mxUtils.bind(this,function(H){M.isMouseDown&&null!=M.panningManager&&null!=M.graphHandler.first&&(M.graphHandler.suspend(),+null!=M.graphHandler.hint&&(M.graphHandler.hint.style.visibility="hidden"),F.style.backgroundColor="light-dark(#fefefe, #000000)",F.style.cursor="copy",M.panningManager.stop(),M.autoScroll=!1,mxEvent.consume(H))}),mxUtils.bind(this,function(H){M.isMouseDown&&null!=M.panningManager&&null!=M.graphHandler&&(F.style.backgroundColor="",F.style.cursor="default",this.sidebar.showTooltips=!0,M.panningManager.stop(),M.graphHandler.reset(),M.isMouseDown=!1,M.autoScroll=!0,B(H),mxEvent.consume(H))}));mxEvent.addListener(F,+"mouseleave",mxUtils.bind(this,function(H){M.isMouseDown&&null!=M.graphHandler.first&&(M.graphHandler.resume(),null!=M.graphHandler.hint&&(M.graphHandler.hint.style.visibility="visible"),F.style.backgroundColor="",F.style.cursor="",M.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(F,"dragover",mxUtils.bind(this,function(H){F.style.backgroundColor="light-dark(#fefefe, #000000)";H.dataTransfer.dropEffect="copy";F.style.cursor="copy";this.sidebar.hideTooltip();H.stopPropagation();H.preventDefault()})),+mxEvent.addListener(F,"drop",mxUtils.bind(this,function(H){F.style.cursor="";F.style.backgroundColor="";0<H.dataTransfer.files.length&&this.importFiles(H.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(T,g,p,G,J,L,R,S,V){if(null!=T&&"image/"==g.substring(0,6))T="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(T),T=[new mxCell("",new mxGeometry(0,0,J,L),T)],T[0].vertex=!0,z(T,new mxRectangle(0,0,J,L),H,mxEvent.isAltDown(H)?+null:R.substring(0,R.lastIndexOf(".")).replace(/_/g," ")),null!=A&&null!=A.parentNode&&0<e.length&&(A.parentNode.removeChild(A),A=null);else{var W=!1,X=mxUtils.bind(this,function(Y,Z){null!=Y&&"application/pdf"==Z&&(Z=Editor.extractGraphModelFromPdf(Y),null!=Z&&0<Z.length&&(Y=Z));if(null!=Y)if(Y=mxUtils.parseXml(Y),"mxlibrary"==Y.documentElement.nodeName)try{var ba=JSON.parse(mxUtils.getTextContent(Y.documentElement));D(ba,F);e=e.concat(ba);v(H);this.spinner.stop();W=!0}catch(ma){}else if("mxfile"==+Y.documentElement.nodeName)try{var fa=Y.documentElement.getElementsByTagName("diagram");for(ba=0;ba<fa.length;ba++){var ca=this.stringToCells(Editor.getDiagramNodeXml(fa[ba])),da=this.editor.graph.getBoundingBoxFromGeometry(ca);null!=da&&z(ca,new mxRectangle(0,0,da.width,da.height),H)}W=!0}catch(ma){null!=window.console&&console.log("error in drop handler:",ma)}W||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=A&&null!=A.parentNode&&0<e.length&&(A.parentNode.removeChild(A),A=null)});null!=V&&null!=R&&EditorUi.isVisioFilename(R)?this.importVisio(V,function(Y){X(Y,"text/xml")},null,R):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(T,R)&&null!=V?this.isExternalDataComms()?this.parseFile(V,mxUtils.bind(this,function(Y){4==Y.readyState&&(this.spinner.stop(),200<=Y.status&&299>=Y.status?X(Y.responseText,"text/xml"):this.handleError({message:mxResources.get(413==Y.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),-this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):X(T,g)}}));H.stopPropagation();H.preventDefault()})),mxEvent.addListener(G,"dragleave",function(H){G.style.cursor="";G.style.backgroundColor="";H.stopPropagation();H.preventDefault()}));U=U.cloneNode(!1);U.setAttribute("src",Editor.editImage);U.setAttribute("title",mxResources.get("edit"));E.insertBefore(U,E.firstChild);mxEvent.addListener(U,"click",k);k=U.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",+this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):X(T,g)}}));H.stopPropagation();H.preventDefault()})),mxEvent.addListener(F,"dragleave",function(H){F.style.cursor="";F.style.backgroundColor="";H.stopPropagation();H.preventDefault()}));U=U.cloneNode(!1);U.setAttribute("src",Editor.editImage);U.setAttribute("title",mxResources.get("edit"));E.insertBefore(U,E.firstChild);mxEvent.addListener(U,"click",k);k=U.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));E.insertBefore(k,E.firstChild);mxEvent.addListener(k,"click",B);".scratchpad"==c.title&&(this.addSelectionToScratchpad=B);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink),u=k.getElementsByTagName("img")[0],k.style.marginRight="1px",u.style.marginTop="-2px",u.style.opacity="",E.insertBefore(k,E.firstChild))}n.appendChild(E);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,e){for(var k=0;k<c.length;k++)try{var n=c[k],q=n.data;if(null!=q){q="data:"==q.substring(0,5)?this.convertDataUri(q):q;var u="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==n.aspect&&(u+="aspect=fixed;");u=u+"image="+q+";";null!=n.style&&(u+=n.style);e.appendChild(this.sidebar.createVertexTemplate(u,n.w,n.h,"",n.title||"",!1,null,!0))}else if(null!=n.xml){var A=this.stringToCells("<"==n.xml.charAt(0)?n.xml:Graph.decompress(n.xml)),D=0==A.length?mxResources.get("drawingEmpty"):-null!=n.title?n.title:"";e.appendChild(this.sidebar.createVertexTemplateFromCells(A,n.w,n.h,D,!0,null,!0))}}catch(G){D=null!=G.message?mxResources.get("error")+": "+G.message:String(G),u=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,D,!0,null,!0),e.appendChild(u)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=+null!=n.title?n.title:"";e.appendChild(this.sidebar.createVertexTemplateFromCells(A,n.w,n.h,D,!0,null,!0))}}catch(F){D=null!=F.message?mxResources.get("error")+": "+F.message:String(F),u=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,D,!0,null,!0),e.appendChild(u)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground="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);"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,e,k,n,q,u,A){c=new ImageDialog(this,c,e,k,n,q,u,A);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,e,k,n,q,u){var A=localStorage.getItem(e);c=new TextareaDialog(this,c,null!=A?JSON.stringify(JSON.parse(A),null,2):"",mxUtils.bind(this,function(D){if(null!=D)try{if(null!=u&&-u(D),D==A)this.hideDialog();else{if(0<D.length){var G=JSON.parse(D);localStorage.setItem(e,JSON.stringify(G))}else localStorage.removeItem(e);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(E){this.handleError(E)}}),null,mxResources.get("close"),null,null,null,!0,null,null,q,k,n);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,e,k,n){c=null!=c?c:mxUtils.bind(this,function(q,u,A,D){u||(q=new ChangePageSetup(this,+u(D),D==A)this.hideDialog();else{if(0<D.length){var F=JSON.parse(D);localStorage.setItem(e,JSON.stringify(F))}else localStorage.removeItem(e);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(E){this.handleError(E)}}),null,mxResources.get("close"),null,null,null,!0,null,null,q,k,n);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,e,k,n){c=null!=c?c:mxUtils.bind(this,function(q,u,A,D){u||(q=new ChangePageSetup(this,n?A:null,q),q.ignoreColor=!n,null!=D&&n&&(q.shadowVisible=D),this.editor.graph.model.execute(q))});c=new BackgroundImageDialog(this,c,e,k,n);this.showDialog(c.container,400,n?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,e,k,n,q){c=new LibraryDialog(this,c,e,k,n,q);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(u){u&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var l=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=-function(c){var e=l.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&e.refresh()}));return e};EditorUi.prototype.handleError=function(c,e,k,n,q,u,A){var D=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},G=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{A||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,-c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!A||null==window.console||console.error("EditorUi.handleError:",c)}catch(J){}if(null!=G||null!=e){A=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var E=mxResources.get("ok"),U=null;e=null!=e?e:mxResources.get("error");if(null!=G){null!=G.retry&&(E=mxResources.get("cancel"),U=function(){D();G.retry()});if(404==G.code||404==G.status||403==G.code){A=403==G.code?null!=G.message?mxUtils.htmlEntities(G.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),+function(c){var e=l.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&e.refresh()}));return e};EditorUi.prototype.handleError=function(c,e,k,n,q,u,A){var D=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},F=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{A||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,+c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!A||null==window.console||console.error("EditorUi.handleError:",c)}catch(M){}if(null!=F||null!=e){A=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var E=mxResources.get("ok"),U=null;e=null!=e?e:mxResources.get("error");if(null!=F){null!=F.retry&&(E=mxResources.get("cancel"),U=function(){D();F.retry()});if(404==F.code||404==F.status||403==F.code){A=403==F.code?null!=F.message?mxUtils.htmlEntities(F.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=q?q:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var P=null!=q?null:null!=u?u:window.location.hash;if(null!=P&&("#G"==P.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==P.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||-404==G.code||404==G.status)){P="#U"==P.substring(0,2)?P.substring(45,P.lastIndexOf("%26ex")):P.substring(2);this.showError(e,A,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+P);null!=n&&n()}),U,mxResources.get("changeUser"),mxUtils.bind(this,function(){function J(){B.innerText="";for(var H=0;H<m.length;H++){var T=document.createElement("option");mxUtils.write(T,m[H].displayName);T.value=H;B.appendChild(T);T=document.createElement("option");-T.innerHTML=" ";mxUtils.write(T,"<"+m[H].email+">");T.setAttribute("disabled","disabled");B.appendChild(T)}T=document.createElement("option");mxUtils.write(T,mxResources.get("addAccount"));T.value=m.length;B.appendChild(T)}var m=this.drive.getUsersList(),v=document.createElement("div"),z=document.createElement("div");z.style.marginBottom="6px";mxUtils.write(z,mxResources.get("changeUser")+": ");v.appendChild(z);var B=document.createElement("select");B.style.width="100%";J();mxEvent.addListener(B,-"change",mxUtils.bind(this,function(){var H=B.value,T=m.length!=H;T&&this.drive.setUser(m[H]);this.drive.authorize(T,mxUtils.bind(this,function(){T||(m=this.drive.getUsersList(),J())}),mxUtils.bind(this,function(g){this.handleError(g)}),!0)}));v.appendChild(B);v=new CustomDialog(this,v,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(v.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),-520,150);return}}null!=G.message?A=""==G.message&&null!=G.name?mxUtils.htmlEntities(G.name,!1):mxUtils.htmlEntities(G.message,!1):null!=G.response&&null!=G.response.error?A=mxUtils.htmlEntities(G.response.error,!1):"undefined"!==typeof window.App&&(G.code==App.ERROR_TIMEOUT?A=mxUtils.htmlEntities(mxResources.get("timeout"),!1):G.code==App.ERROR_BUSY?A=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof G&&0<G.length&&(A=mxUtils.htmlEntities(G,!1)))}q=c=null;null!=G&&null!=G.helpLink?-(c=mxResources.get("help"),q=mxUtils.bind(this,function(){return this.editor.graph.openLink(G.helpLink)})):null!=G&&null!=G.ownerEmail?(c=mxResources.get("contactOwner"),A+=mxUtils.htmlEntities(" ("+c+": "+G.ownerEmail+")",!1),q=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(G.ownerEmail))})):null!=G&&null!=G.alternateAction&&(c=G.alternateAction.label,q=G.alternateAction.funct);this.showError(e,A,E,k,U,null,null,c,q,null,null,null,n?k:null)}else null!=k&&k()};EditorUi.prototype.alert=+404==F.code||404==F.status)){P="#U"==P.substring(0,2)?P.substring(45,P.lastIndexOf("%26ex")):P.substring(2);this.showError(e,A,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+P);null!=n&&n()}),U,mxResources.get("changeUser"),mxUtils.bind(this,function(){function M(){B.innerText="";for(var H=0;H<m.length;H++){var T=document.createElement("option");mxUtils.write(T,m[H].displayName);T.value=H;B.appendChild(T);T=document.createElement("option");+T.innerHTML=" ";mxUtils.write(T,"<"+m[H].email+">");T.setAttribute("disabled","disabled");B.appendChild(T)}T=document.createElement("option");mxUtils.write(T,mxResources.get("addAccount"));T.value=m.length;B.appendChild(T)}var m=this.drive.getUsersList(),v=document.createElement("div"),z=document.createElement("div");z.style.marginBottom="6px";mxUtils.write(z,mxResources.get("changeUser")+": ");v.appendChild(z);var B=document.createElement("select");B.style.width="100%";M();mxEvent.addListener(B,+"change",mxUtils.bind(this,function(){var H=B.value,T=m.length!=H;T&&this.drive.setUser(m[H]);this.drive.authorize(T,mxUtils.bind(this,function(){T||(m=this.drive.getUsersList(),M())}),mxUtils.bind(this,function(g){this.handleError(g)}),!0)}));v.appendChild(B);v=new CustomDialog(this,v,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(v.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),+520,150);return}}null!=F.message?A=""==F.message&&null!=F.name?mxUtils.htmlEntities(F.name,!1):mxUtils.htmlEntities(F.message,!1):null!=F.response&&null!=F.response.error?A=mxUtils.htmlEntities(F.response.error,!1):"undefined"!==typeof window.App&&(F.code==App.ERROR_TIMEOUT?A=mxUtils.htmlEntities(mxResources.get("timeout"),!1):F.code==App.ERROR_BUSY?A=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof F&&0<F.length&&(A=mxUtils.htmlEntities(F,!1)))}q=c=null;null!=F&&null!=F.helpLink?+(c=mxResources.get("help"),q=mxUtils.bind(this,function(){return this.editor.graph.openLink(F.helpLink)})):null!=F&&null!=F.ownerEmail?(c=mxResources.get("contactOwner"),A+=mxUtils.htmlEntities(" ("+c+": "+F.ownerEmail+")",!1),q=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(F.ownerEmail))})):null!=F&&null!=F.alternateAction&&(c=F.alternateAction.label,q=F.alternateAction.funct);this.showError(e,A,E,k,U,null,null,c,q,null,null,null,n?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,e,k){c=new ErrorDialog(this,null,c,mxResources.get("ok"),e);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,e,k,n,q,u){c=null!=c?c:"";var A=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},D=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){A();null!=e&&e()},function(){A();null!=k&&k()},n,q,null,null,null,null,D);this.showDialog(c.container,340,46+D,!0,u);c.init()};EditorUi.prototype.showBanner=-function(c,e,k,n,q,u,A,D,G){var E=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){u=null!=u?u:"bottom:10px;left:50%;";A=null!=A?A:"translate(-50%,120%)";D=null!=D?D:"translate(-50%,0%)";var U=q?500:1E3;E=q?"padding:4px;border-radius:6px;font-size:11px;height:12px;font-weight:normal;":"font-size:16px;padding:18px 34px 12px 20px;font-weight:bold;";var P=document.createElement("div");P.style.cssText="position:absolute;"+-u+";max-width:90%;white-space:nowrap;cursor:pointer;z-index:"+mxPopupMenu.prototype.zIndex+";"+E;mxUtils.setPrefixedStyle(P.style,"transform",A);mxUtils.setPrefixedStyle(P.style,"transition","all "+U+"ms ease");P.className="geBtn gePrimaryBtn"+(q?" geSmallBanner":"");Editor.isDarkMode()||mxUtils.setPrefixedStyle(P.style,"box-shadow","1px 1px 2px 0px #ddd");null!=G&&mxUtils.setPrefixedStyle(P.style,"transform-origin",G);if(!q){var J=document.createElement("img");J.setAttribute("src",IMAGE_PATH+"/logo.png");-J.setAttribute("border","0");J.setAttribute("align","absmiddle");J.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";P.appendChild(J);J=document.createElement("img");J.setAttribute("src",Dialog.prototype.closeImage);J.setAttribute("title",mxResources.get(n?"doNotShowAgain":"close"));J.setAttribute("border","0");J.style.cssText=(q?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";P.appendChild(J)}mxUtils.write(P,+function(c,e,k,n,q,u,A,D,F){var E=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){u=null!=u?u:"bottom:10px;left:50%;";A=null!=A?A:"translate(-50%,120%)";D=null!=D?D:"translate(-50%,0%)";var U=q?500:1E3;E=q?"padding:4px;border-radius:6px;font-size:11px;height:12px;font-weight:normal;":"font-size:16px;padding:18px 34px 12px 20px;font-weight:bold;";var P=document.createElement("div");P.style.cssText="position:absolute;"++u+";max-width:90%;white-space:nowrap;cursor:pointer;z-index:"+mxPopupMenu.prototype.zIndex+";"+E;mxUtils.setPrefixedStyle(P.style,"transform",A);mxUtils.setPrefixedStyle(P.style,"transition","all "+U+"ms ease");P.className="geBtn gePrimaryBtn"+(q?" geSmallBanner":"");Editor.isDarkMode()||mxUtils.setPrefixedStyle(P.style,"box-shadow","1px 1px 2px 0px #ddd");null!=F&&mxUtils.setPrefixedStyle(P.style,"transform-origin",F);if(!q){var M=document.createElement("img");M.setAttribute("src",IMAGE_PATH+"/logo.png");+M.setAttribute("border","0");M.setAttribute("align","absmiddle");M.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";P.appendChild(M);M=document.createElement("img");M.setAttribute("src",Dialog.prototype.closeImage);M.setAttribute("title",mxResources.get(n?"doNotShowAgain":"close"));M.setAttribute("border","0");M.style.cssText=(q?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";P.appendChild(M)}mxUtils.write(P,e);document.body.appendChild(P);this.bannerShowing=!0;e=document.createElement("div");e.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var m=document.createElement("input");m.setAttribute("type","checkbox");m.setAttribute("id","geDoNotShowAgainCheckbox");m.style.marginRight="6px";if(!n){e.appendChild(m);var v=document.createElement("label");v.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(v,-mxResources.get("doNotShowAgain"));e.appendChild(v);P.style.paddingBottom=q?"16px":"30px";P.appendChild(e)}var z=mxUtils.bind(this,function(){null!=P.parentNode&&(P.parentNode.removeChild(P),this.bannerShowing=!1,m.checked||n)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=J&&mxEvent.addListener(J,"click",mxUtils.bind(this,function(H){mxEvent.consume(H);z()}));var B=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(P.style,+mxResources.get("doNotShowAgain"));e.appendChild(v);P.style.paddingBottom=q?"16px":"30px";P.appendChild(e)}var z=mxUtils.bind(this,function(){null!=P.parentNode&&(P.parentNode.removeChild(P),this.bannerShowing=!1,m.checked||n)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=M&&mxEvent.addListener(M,"click",mxUtils.bind(this,function(H){mxEvent.consume(H);z()}));var B=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(P.style,"transform",A);window.setTimeout(mxUtils.bind(this,function(){z()}),U)});mxEvent.addListener(P,"click",mxUtils.bind(this,function(H){var T=mxEvent.getSource(H);T!=m&&T!=v?(null!=k&&k(),z(),mxEvent.consume(H)):B()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(P.style,"transform",D)}),U/2);window.setTimeout(B,q?4E3:3E4);E=!0}return E};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return this.editor.isExportToCanvas()};EditorUi.prototype.createImageDataUri=function(c,e,k,n){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=e&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(e))),0<n&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,e,k,n,q){var u="jpeg"==k?"jpg":k;n=this.getBaseFilename(n)+(null!=e?".drawio":"")+"."+u;c=this.createImageDataUri(c,e,k,q);this.saveData(n,u,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,e){c=new TextareaDialog(this,c,e,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,e,k,n,q,u){"text/xml"!=k||/(\.drawio)$/i.test(e)||/(\.xml)$/i.test(e)||/(\.svg)$/i.test(e)||/(\.html)$/i.test(e)||(e=e+"."+(null!=u?u:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=n?this.base64ToBlob(c,k):new Blob([c],{type:k}),navigator.msSaveOrOpenBlob(c,e);else if(mxClient.IS_IE)k=window.open("about:blank","_blank"),null==k?mxUtils.popup(c,!0):(k.document.write(c),k.document.close(),k.document.execCommand("SaveAs",!0,e),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(e+":",c):this.openInNewWindow(c,k,n);else{var A=document.createElement("a");u=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof A.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var D=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);-u=65==(D?parseInt(D[2],10):!1)?!1:u}if(u||this.isOffline()){A.href=URL.createObjectURL(n?this.base64ToBlob(c,k):new Blob([c],{type:k}));u?A.download=e:A.setAttribute("target","_blank");document.body.appendChild(A);try{window.setTimeout(function(){URL.revokeObjectURL(A.href)},2E4),A.click(),A.parentNode.removeChild(A)}catch(G){}}else this.createEchoRequest(c,e,k,n,q).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,e,k,n,q,u){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,-c+(null!=k?"&mime="+k:"")+(null!=q?"&format="+q:"")+(null!=u?"&base64="+u:"")+(null!=e?"&filename="+encodeURIComponent(e):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,e,k,n,q,u,A,D){u=null!=u?u:!1;A=null!=A?A:"vsdx"!=q&&(!mxClient.IS_IOS||!navigator.standalone);var G=mxUtils.bind(this,function(U,P,J,m){try{if("_blank"==P)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,n);else if(null!=k&&"text/html"==k.substring(0,9)){var v=new EmbedDialog(this,c);this.showDialog(v.container,+u=65==(D?parseInt(D[2],10):!1)?!1:u}if(u||this.isOffline()){A.href=URL.createObjectURL(n?this.base64ToBlob(c,k):new Blob([c],{type:k}));u?A.download=e:A.setAttribute("target","_blank");document.body.appendChild(A);try{window.setTimeout(function(){URL.revokeObjectURL(A.href)},2E4),A.click(),A.parentNode.removeChild(A)}catch(F){}}else this.createEchoRequest(c,e,k,n,q).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,e,k,n,q,u){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,+c+(null!=k?"&mime="+k:"")+(null!=q?"&format="+q:"")+(null!=u?"&base64="+u:"")+(null!=e?"&filename="+encodeURIComponent(e):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,e,k,n,q,u,A,D){u=null!=u?u:!1;A=null!=A?A:"vsdx"!=q&&(!mxClient.IS_IOS||!navigator.standalone);var F=mxUtils.bind(this,function(U,P,M,m){try{if("_blank"==P)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,n);else if(null!=k&&"text/html"==k.substring(0,9)){var v=new EmbedDialog(this,c);this.showDialog(v.container,450,240,!0,!0);v.init()}else{var z=window.open("about:blank");null==z?mxUtils.popup(c,!0):(z.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),z.document.close())}else if(P==App.MODE_DEVICE||"download"==P)this.doSaveLocalFile(c,U,k,n,null,D);else if(null!=U&&0<U.length){var B=mxUtils.bind(this,function(H){try{this.exportFile(c,U,k,n,P,H)}catch(T){this.handleError(T)}});null!=m?B(m):this.pickFolder(P,B)}}catch(H){this.handleError(H)}});q=[];u||q.push(App.MODE_BROWSER);A||q.push("_blank");-var E=new SaveDialog(this,e,mxUtils.bind(this,function(U,P,J){G(U.value,P,U,J);this.hideDialog(null,null,E.container)}),q,c,k,n);this.showDialog(E.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));E.init()};EditorUi.prototype.openInNewWindow=function(c,e,k){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(c,!0);else{var q="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==e){var u=mxUtils.parseXml(c).documentElement.style.backgroundColor;+var E=new SaveDialog(this,e,mxUtils.bind(this,function(U,P,M){F(U.value,P,U,M);this.hideDialog(null,null,E.container)}),q,c,k,n);this.showDialog(E.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));E.init()};EditorUi.prototype.openInNewWindow=function(c,e,k){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(c,!0);else{var q="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==e){var u=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=u&&(q="background: "+u+";")}q='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+q+'">';"image/svg+xml"!=e||mxClient.IS_SVG?"image/svg+xml"!=e||k?(u=k?c:btoa(unescape(encodeURIComponent(c))),n.document.write(q+'<img style="max-width:100%;" src="data:'+e+";base64,"+u+'"/></body></html>')):n.document.write(q+c+"</body></html>"):n.document.write(q+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");n.document.close()}};var d=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var e=c(mxUtils.bind(this,function(n){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.className="geScrollable",this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=@@ -13113,185 +13113,187 @@ null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function("click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.isExportToCanvas()&&this.isChromelessImageExportEnabled()){this.exportDialog=null;var k=c(mxUtils.bind(this,function(n){var q=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",q);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)q.apply(this);else{this.exportDialog=document.createElement("div");var u=k.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=u.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";u=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=u.zIndex;var A=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});A.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",q);this.editor.exportToCanvas(mxUtils.bind(this,function(D){A.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var G=this.createImageDataUri(D,null,"png");D=document.createElement("img");D.style.maxWidth="140px";D.style.maxHeight="140px";-D.style.cursor="pointer";D.style.backgroundColor="white";D.setAttribute("title",mxResources.get("openInNewWindow"));D.setAttribute("border","0");D.setAttribute("src",G);this.exportDialog.appendChild(D);mxEvent.addListener(D,"click",mxUtils.bind(this,function(){this.openInNewWindow(G.substring(G.indexOf(",")+1),"image/png",!0);q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(D){A.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),+speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});A.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",q);this.editor.exportToCanvas(mxUtils.bind(this,function(D){A.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var F=this.createImageDataUri(D,null,"png");D=document.createElement("img");D.style.maxWidth="140px";D.style.maxHeight="140px";+D.style.cursor="pointer";D.style.backgroundColor="white";D.setAttribute("title",mxResources.get("openInNewWindow"));D.setAttribute("border","0");D.setAttribute("src",F);this.exportDialog.appendChild(D);mxEvent.addListener(D,"click",mxUtils.bind(this,function(){this.openInNewWindow(F.substring(F.indexOf(",")+1),"image/png",!0);q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(D){A.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(D)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,e,k,n,q){this.isLocalFileSave()?this.saveLocalFile(k,c,n,q,e):this.saveRequest(c,e,mxUtils.bind(this,function(u,A){return this.createEchoRequest(k,u,n,q,e,A)}),k,q,n)};EditorUi.prototype.saveRequest=function(c,e,k,n,q,u,A){A=null!=A?A:!mxClient.IS_IOS||!navigator.standalone;var D=mxUtils.bind(this,-function(E,U,P,J){if("_blank"==U||null!=E&&0<E.length){var m=k("_blank"==U?null:E,U==App.MODE_DEVICE||"download"==U||null==U||"_blank"==U?"0":"1");null!=m&&(U==App.MODE_DEVICE||"download"==U||"_blank"==U?m.simulate(document,"_blank"):(P=mxUtils.bind(this,function(v){u=null!=u?u:"pdf"==e?"application/pdf":"image/"+e;if(null!=n)try{this.exportFile(n,E,u,!0,U,v)}catch(z){this.handleError(z)}else this.spinner.spin(document.body,mxResources.get("saving"))&&m.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=m.getStatus()&&299>=m.getStatus())try{this.exportFile(m.getText(),E,u,!0,U,v)}catch(z){this.handleError(z)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}))}),null!=J?P(J):this.pickFolder(U,P)))}});q=[App.MODE_BROWSER];A||q.push("_blank");var G=new SaveDialog(this,c,mxUtils.bind(this,function(E,U,P){D(E.value,U,E,P);this.hideDialog(null,null,G.container)}),q,null,"application/pdf");this.showDialog(G.container,-420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));G.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,e,k,n,q,u){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,e,k){e(null)};EditorUi.prototype.exportSvg=function(c,e,k,n,q,u,-A,D,G,E,U,P,J,m){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(M){Editor.addRetryToError(M,mxUtils.bind(this,function(){this.exportSvg(c,e,k,n,q,u,A,D,G,E,U,P,J,m)}));this.handleError(M)})))try{var v=this.editor.graph.isSelectionEmpty();k=null!=k?k:v;var z=e?null:this.editor.graph.background;z==mxConstants.NONE&&(z=null);null==z&&0==e&&(z=this.editor.graph.shapeBackgroundColor);var B=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&-(this.editor.graph.addForeignObjectWarning=function(){});var H=this.editor.graph.createSvgImageExport(q),T=this.editor.graph.getSvg(z,c,A,D,null,k,null,H,"blank"==E?"_blank":"self"==E?"_top":null,null,!J,U,P);this.editor.graph.addForeignObjectWarning=B;n&&this.editor.graph.addSvgShadow(T);var g=this.getBaseFilename()+(q?".drawio":"")+".svg";m=null!=m?m:mxUtils.bind(this,function(M){this.isLocalFileSave()||M.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",M,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},-mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(M)}))});var p=mxUtils.bind(this,function(M){this.spinner.stop();q&&M.setAttribute("content",this.getFileData(!0,null,null,null,k,G,null,null,null,null,null,c,A));m(Graph.xmlDeclaration+"\n"+(q?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(M))});this.editor.graph.mathEnabled&&this.editor.addMathCss(T);var F=mxUtils.bind(this,function(M){Editor.replaceSvgDataUris&&u&&EditorUi.embedSvgImages(M);Editor.foreignObjectImages&&-J?this.replaceAlternateContent(M,U,p):p(M)}),K=mxUtils.bind(this,function(M){u&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(M,F,this.thumbImageCache)):F(M)});J?this.embedFonts(T,K):(this.editor.addFontCss(T),K(T))}catch(M){this.handleError(M)}};EditorUi.prototype.replaceAlternateContent=function(c,e,k){function n(P,J,m,v,z){var B=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");B.setAttribute("x",J);B.setAttribute("y",-m+.5);B.setAttribute("width",v.width);B.setAttribute("height",v.height);null==B.setAttributeNS?B.setAttribute("xlink:href",z):B.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",z);P.replaceChild(B,P.lastChild);D()}function q(){if(A<U.length)U[A++](q)}var u="";e=c.getElementsByTagName("style");for(var A=0;A<e.length;A++)u+=e[A].innerHTML;e=c.getElementsByTagName("switch");counter=e.length;var D=mxUtils.bind(this,function(){counter--;0==counter&&k(c)}),G={},E={},U=[];for(A=0;A<e.length;A++)mxUtils.bind(this,-function(P){var J=P.getElementsByTagName("div");if(0<J.length)try{var m=J[0].cloneNode(!0),v=parseInt(m.style.marginLeft),z=parseInt(m.style.paddingTop),B=m.getElementsByTagName("div")[1],H=J=!1,T=m.style.alignItems,g=m.style.justifyContent;if(null!=m.style.writingMode){var p=m.style.writingMode;H="vertical-"==p.substring(0,9);J="-rl"==p.substring(p.length-3)}var F=!H&&"1px"==m.style.width||H&&"1px"==m.style.height;if(!H&&"1px"==m.style.height||H&&"1px"==m.style.width)m.style.alignItems=H&&J?"unsafe flex-end":-"unsafe flex-start";F&&(m.style.justifyContent="unsafe flex-start");m.style.paddingTop="";m.style.marginLeft="";var K=m.outerHTML,M=G[K];null==M&&(m.style.position="absolute",m.style.visibility="hidden",document.body.appendChild(m),p=1,p="1px"==m.style.width?B.offsetWidth:parseInt(m.style.width),F=1,F="1px"==m.style.height?B.offsetHeight:parseInt(m.style.height),document.body.removeChild(m),M=new mxRectangle(v,z,p,F),G[K]=M);"1px"==m.style.height&&("unsafe center"==T?z-=M.height/2:"unsafe flex-end"==-T&&(z-=M.height));if("1px"==m.style.width)if(!H&&"unsafe center"==g||H&&"unsafe center"==T)v-=M.width/2;else if(!H&&"unsafe flex-end"==g||H&&(!J&&"unsafe flex-end"==T||J&&"unsafe flex-start"==T))v-=M.width;M=new mxRectangle(v,z,M.width,M.height+parseInt(B.style.fontSize)/4);U.push(mxUtils.bind(this,function(R){var S=E[K];null==S?Graph.htmlToPng(K,M.width,M.height,mxUtils.bind(this,function(V){n(P,v,z,M,V);E[K]=V;R()}),u):(n(P,v,z,M,S),R())}))}catch(R){D()}else D()})(e[A]);0==counter&&k(c);A=0;q()};-EditorUi.prototype.addRadiobox=function(c,e,k,n,q,u,A){return this.addCheckbox(c,k,n,q,u,A,!0,e)};EditorUi.prototype.addCheckbox=function(c,e,k,n,q,u,A,D){u=null!=u?u:!0;var G=document.createElement("input");G.style.marginRight="8px";G.style.marginTop="16px";G.setAttribute("type",A?"radio":"checkbox");A="geCheckbox-"+Editor.guid();G.id=A;null!=D&&G.setAttribute("name",D);k&&(G.setAttribute("checked","checked"),G.defaultChecked=!0);n&&G.setAttribute("disabled","disabled");u&&(c.appendChild(G),k=document.createElement("label"),-mxUtils.write(k,e),k.setAttribute("for",A),c.appendChild(k),q||mxUtils.br(c));return G};EditorUi.prototype.addEditButton=function(c,e){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var n=this.getCurrentFile(),q="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(q=window.location.href);var u=document.createElement("select");u.style.maxWidth="200px";u.style.width="auto";u.style.marginLeft="8px";u.style.marginRight="10px";u.className=-"geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));u.appendChild(n);var A=document.createElement("option");A.setAttribute("value","custom");mxUtils.write(A,mxResources.get("custom")+"...");u.appendChild(A);c.appendChild(u);mxEvent.addListener(u,"change",mxUtils.bind(this,function(){if("custom"==u.value){var D=new FilenameDialog(this,q,mxResources.get("ok"),function(G){null!=G?(q=G,A.setAttribute("title",G)):(u.value="blank",A.removeAttribute("title"))},+function(E,U,P,M){if("_blank"==U||null!=E&&0<E.length){var m=k("_blank"==U?null:E,U==App.MODE_DEVICE||"download"==U||null==U||"_blank"==U?"0":"1");null!=m&&(U==App.MODE_DEVICE||"download"==U||"_blank"==U?m.simulate(document,"_blank"):(P=mxUtils.bind(this,function(v){u=null!=u?u:"pdf"==e?"application/pdf":"image/"+e;if(null!=n)try{this.exportFile(n,E,u,!0,U,v)}catch(z){this.handleError(z)}else this.spinner.spin(document.body,mxResources.get("saving"))&&m.send(mxUtils.bind(this,function(){this.spinner.stop();+if(200<=m.getStatus()&&299>=m.getStatus())try{this.exportFile(m.getText(),E,u,!0,U,v)}catch(z){this.handleError(z)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}))}),null!=M?P(M):this.pickFolder(U,P)))}});q=[App.MODE_BROWSER];A||q.push("_blank");var F=new SaveDialog(this,c,mxUtils.bind(this,function(E,U,P){D(E.value,U,E,P);this.hideDialog(null,null,F.container)}),q,null,"application/pdf");this.showDialog(F.container,+420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));F.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,e,k,n,q,u){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,e,k){e(null)};EditorUi.prototype.exportSvg=function(c,e,k,n,q,u,+A,D,F,E,U,P,M,m){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(L){Editor.addRetryToError(L,mxUtils.bind(this,function(){this.exportSvg(c,e,k,n,q,u,A,D,F,E,U,P,M,m)}));this.handleError(L)})))try{var v=this.editor.graph.isSelectionEmpty();k=null!=k?k:v;var z=e?null:this.editor.graph.background;z==mxConstants.NONE&&(z=null);null==z&&0==e&&(z=this.editor.graph.shapeBackgroundColor);var B=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+(this.editor.graph.addForeignObjectWarning=function(){});var H=this.editor.graph.createSvgImageExport(q),T=this.editor.graph.getSvg(z,c,A,D,null,k,null,H,"blank"==E?"_blank":"self"==E?"_top":null,null,!M,U,P);this.editor.graph.addForeignObjectWarning=B;n&&this.editor.graph.addSvgShadow(T);var g=this.getBaseFilename()+(q?".drawio":"")+".svg";m=null!=m?m:mxUtils.bind(this,function(L){this.isLocalFileSave()||L.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",L,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},+mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(L)}))});var p=mxUtils.bind(this,function(L){this.spinner.stop();q&&L.setAttribute("content",this.getFileData(!0,null,null,null,k,F,null,null,null,null,null,c,A));m(Graph.xmlDeclaration+"\n"+(q?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(L))});this.editor.graph.mathEnabled&&this.editor.addMathCss(T);var G=mxUtils.bind(this,function(L){Editor.replaceSvgDataUris&&u&&EditorUi.embedSvgImages(L);Editor.foreignObjectImages&&+M?this.replaceAlternateContent(L,U,p):p(L)}),J=mxUtils.bind(this,function(L){u&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(L,G,this.thumbImageCache)):G(L)});M?this.embedFonts(T,J):(this.editor.addFontCss(T),J(T))}catch(L){this.handleError(L)}};EditorUi.prototype.replaceAlternateContent=function(c,e,k){function n(P,M,m,v,z){var B=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");B.setAttribute("x",M);B.setAttribute("y",+m+.5);B.setAttribute("width",v.width);B.setAttribute("height",v.height);null==B.setAttributeNS?B.setAttribute("xlink:href",z):B.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",z);P.replaceChild(B,P.lastChild);D()}function q(){if(A<U.length)U[A++](q)}var u="";e=c.getElementsByTagName("style");for(var A=0;A<e.length;A++)u+=e[A].innerHTML;e=c.getElementsByTagName("switch");counter=e.length;var D=mxUtils.bind(this,function(){counter--;0==counter&&k(c)}),F={},E={},U=[];for(A=0;A<e.length;A++)mxUtils.bind(this,+function(P){var M=P.getElementsByTagName("div");if(0<M.length)try{var m=M[0].cloneNode(!0),v=parseInt(m.style.marginLeft),z=parseInt(m.style.paddingTop),B=m.getElementsByTagName("div")[1],H=M=!1,T=m.style.alignItems,g=m.style.justifyContent;if(null!=m.style.writingMode){var p=m.style.writingMode;H="vertical-"==p.substring(0,9);M="-rl"==p.substring(p.length-3)}var G=!H&&"1px"==m.style.width||H&&"1px"==m.style.height;if(!H&&"1px"==m.style.height||H&&"1px"==m.style.width)m.style.alignItems=H&&M?"unsafe flex-end":+"unsafe flex-start";G&&(m.style.justifyContent="unsafe flex-start");m.style.paddingTop="";m.style.marginLeft="";var J=m.outerHTML,L=F[J];null==L&&(m.style.position="absolute",m.style.visibility="hidden",document.body.appendChild(m),p=1,p="1px"==m.style.width?B.offsetWidth:parseInt(m.style.width),G=1,G="1px"==m.style.height?B.offsetHeight:parseInt(m.style.height),document.body.removeChild(m),L=new mxRectangle(v,z,p,G),F[J]=L);"1px"==m.style.height&&("unsafe center"==T?z-=L.height/2:"unsafe flex-end"==+T&&(z-=L.height));if("1px"==m.style.width)if(!H&&"unsafe center"==g||H&&"unsafe center"==T)v-=L.width/2;else if(!H&&"unsafe flex-end"==g||H&&(!M&&"unsafe flex-end"==T||M&&"unsafe flex-start"==T))v-=L.width;L=new mxRectangle(v,z,L.width,L.height+parseInt(B.style.fontSize)/4);U.push(mxUtils.bind(this,function(R){var S=E[J];null==S?Graph.htmlToPng(J,L.width,L.height,mxUtils.bind(this,function(V){n(P,v,z,L,V);E[J]=V;R()}),u):(n(P,v,z,L,S),R())}))}catch(R){D()}else D()})(e[A]);0==counter&&k(c);A=0;q()};+EditorUi.prototype.addRadiobox=function(c,e,k,n,q,u,A){return this.addCheckbox(c,k,n,q,u,A,!0,e)};EditorUi.prototype.addCheckbox=function(c,e,k,n,q,u,A,D){u=null!=u?u:!0;var F=document.createElement("input");F.style.marginRight="8px";F.style.marginTop="16px";F.setAttribute("type",A?"radio":"checkbox");A="geCheckbox-"+Editor.guid();F.id=A;null!=D&&F.setAttribute("name",D);k&&(F.setAttribute("checked","checked"),F.defaultChecked=!0);n&&F.setAttribute("disabled","disabled");u&&(c.appendChild(F),k=document.createElement("label"),+mxUtils.write(k,e),k.setAttribute("for",A),c.appendChild(k),q||mxUtils.br(c));return F};EditorUi.prototype.addEditButton=function(c,e){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var n=this.getCurrentFile(),q="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(q=window.location.href);var u=document.createElement("select");u.style.maxWidth="200px";u.style.width="auto";u.style.marginLeft="8px";u.style.marginRight="10px";u.className=+"geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));u.appendChild(n);var A=document.createElement("option");A.setAttribute("value","custom");mxUtils.write(A,mxResources.get("custom")+"...");u.appendChild(A);c.appendChild(u);mxEvent.addListener(u,"change",mxUtils.bind(this,function(){if("custom"==u.value){var D=new FilenameDialog(this,q,mxResources.get("ok"),function(F){null!=F?(q=F,A.setAttribute("title",F)):(u.value="blank",A.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){u.value="blank"});this.showDialog(D.container,300,80,!0,!1);D.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==e||e.checked)?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return k.checked?"blank"===u.value?"_blank":q:null},getEditInput:function(){return k},getEditSelect:function(){return u}}};EditorUi.prototype.addLinkSection=function(c,e){function k(){var D=document.createElement("div");D.style.width="100%";D.style.height="100%";D.style.boxSizing="border-box";null!=u&&u!=mxConstants.NONE?(D.style.border="1px solid black",D.style.backgroundColor=u):(D.style.backgroundPosition="center center",D.style.backgroundRepeat="no-repeat",D.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");A.innerText="";A.appendChild(D)}mxUtils.write(c,mxResources.get("links")+":");var n=document.createElement("select");n.style.width="100px";n.style.padding="0px";n.style.marginLeft="8px";n.style.marginRight="10px";n.className="geBtn";var q=document.createElement("option");q.setAttribute("value","auto");mxUtils.write(q,mxResources.get("automatic"));n.appendChild(q);q=document.createElement("option");q.setAttribute("value","blank");mxUtils.write(q,mxResources.get("openInNewWindow"));n.appendChild(q);q=document.createElement("option");q.setAttribute("value","self");mxUtils.write(q,mxResources.get("openInThisWindow"));n.appendChild(q);e&&(e=document.createElement("option"),-e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(e));c.appendChild(n);mxUtils.write(c,mxResources.get("borderColor")+":");var u="#0000ff",A=null;A=mxUtils.button("",mxUtils.bind(this,function(D){this.pickColor(u||"none",function(G){u=G;k()});mxEvent.consume(D)}));k();A.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";A.style.marginLeft="4px";A.style.height="22px";A.style.width="22px";A.style.position="relative";+e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(e));c.appendChild(n);mxUtils.write(c,mxResources.get("borderColor")+":");var u="#0000ff",A=null;A=mxUtils.button("",mxUtils.bind(this,function(D){this.pickColor(u||"none",function(F){u=F;k()});mxEvent.consume(D)}));k();A.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";A.style.marginLeft="4px";A.style.height="22px";A.style.width="22px";A.style.position="relative";A.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";A.className="geColorBtn";c.appendChild(A);mxUtils.br(c);return{getColor:function(){return u},getTarget:function(){return n.value},focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(c,e,k,n,q,u){u=null!=u?u:[];k&&(u.push("lightbox=1"),"auto"!=c&&u.push("target="+c),null!=e&&e!=mxConstants.NONE&&u.push("highlight="+("#"==e.charAt(0)?e.substring(1):e)),null!=n&&0<n.length&&u.push("edit="+encodeURIComponent(n)),-q&&u.push("layers=1"),this.editor.graph.foldingEnabled&&u.push("nav=1"));return u};EditorUi.prototype.createLink=function(c,e,k,n,q,u,A,D,G,E,U){var P=this.getCurrentFile();G=this.createUrlParameters(c,e,n,q,u,G);c=!0;null!=A?k="#U"+encodeURIComponent(A):D||null==P||""==P.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+P.getHash(),c=!1);c&&null!=P&&null!=P.getTitle()&&P.getTitle()!=-this.defaultFilename&&G.push("title="+encodeURIComponent(P.getTitle()));E&&1<k.length&&(G.push("open="+k.substring(1)),k="");U&&null!=this.currentPage&&G.push("page-id="+this.currentPage.getId());return(n&&(null!=A||null!=P&&P.getMode()!=App.MODE_GITHUB&&P.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<G.length?"?"+G.join("&"):"")+k};EditorUi.prototype.createHtml=-function(c,e,k,n,q,u,A,D,G,E,U,P){this.getBasenames();var J={};""!=q&&q!=mxConstants.NONE&&(J.highlight=q);"auto"!==n&&(J.target=n);E||(J.lightbox=!1);J.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(J.zoom=k/100);k=[];A&&(k.push("pages"),J.resize=!0,null!=this.pages&&null!=this.currentPage&&(J.page=mxUtils.indexOf(this.pages,this.currentPage)));e&&(k.push("zoom"),J.resize=!0);D&&k.push("layers");G&&k.push("tags");0<k.length&&(E&&k.push("lightbox"),J.toolbar=k.join(" "));null!=-U&&0<U.length&&(J.edit=U);null!=c?J.url=c:J.xml=this.getFileData(!0,null,null,null,null,!A);e='<div class="mxgraph" style="'+(u?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(J))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";P(e,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":-window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,e,k,n){var q=document.createElement("div");q.style.whiteSpace="nowrap";var u=document.createElement("h3");mxUtils.write(u,mxResources.get("html"));u.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";q.appendChild(u);var A=document.createElement("div");A.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";-var D=document.createElement("input");D.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";D.setAttribute("value","url");D.setAttribute("type","radio");D.setAttribute("name","type-embedhtmldialog");u=D.cloneNode(!0);u.setAttribute("value","copy");A.appendChild(u);var G=document.createElement("span");mxUtils.write(G,mxResources.get("includeCopyOfMyDiagram"));A.appendChild(G);mxUtils.br(A);A.appendChild(D);G=document.createElement("span");mxUtils.write(G,mxResources.get("publicDiagramUrl"));-A.appendChild(G);var E=this.getCurrentFile();null==k&&null!=E&&E.constructor==window.DriveFile&&(G=document.createElement("a"),G.style.paddingLeft="12px",G.style.color="gray",G.style.cursor="pointer",mxUtils.write(G,mxResources.get("share")),A.appendChild(G),mxEvent.addListener(G,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(E.getId(),E)})));u.setAttribute("checked","checked");null==k&&D.setAttribute("disabled","disabled");q.appendChild(A);var U=this.addLinkSection(q),-P=this.addCheckbox(q,mxResources.get("zoom"),!0,null,!0);mxUtils.write(q,":");var J=document.createElement("input");J.setAttribute("type","text");J.style.marginRight="16px";J.style.width="60px";J.style.marginLeft="4px";J.style.marginRight="12px";J.value="100%";q.appendChild(J);var m=this.addCheckbox(q,mxResources.get("fit"),!0);A=null!=this.pages&&1<this.pages.length;var v=v=this.addCheckbox(q,mxResources.get("allPages"),A,!A),z=this.addCheckbox(q,mxResources.get("layers"),!0),B=this.addCheckbox(q,-mxResources.get("tags"),!0),H=this.addCheckbox(q,mxResources.get("lightbox"),!0),T=null;A=380;if(EditorUi.enableHtmlEditOption){T=this.addEditButton(q,H);var g=T.getEditInput();g.style.marginBottom="16px";A+=50;mxEvent.addListener(H,"change",function(){H.checked?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled");g.checked&&H.checked?T.getEditSelect().removeAttribute("disabled"):T.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,q,mxUtils.bind(this,function(){n(D.checked?-k:null,P.checked,J.value,U.getTarget(),U.getColor(),m.checked,v.checked,z.checked,B.checked,H.checked,null!=T?T.getLink():null)}),null,c,e);this.showDialog(c.container,340,A,!0,!0);u.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,e,k,n,q,u,A,D,G){var E=document.createElement("div");E.style.whiteSpace="nowrap";var U=document.createElement("h3");mxUtils.write(U,c||mxResources.get("publish"));U.style.width="100%";U.style.textAlign="center";U.style.marginTop="2px";U.style.marginBottom="20px";-E.appendChild(U);var P=document.createElement("select");c=30;P.className="geBtn";P.style.marginBottom="8px";P.style.marginLeft="0px";P.style.width="100%";P.style.boxSizing="border-box";if(null==D||""==D.getHash())q=null!=q?q:"https://www.drawio.com/doc/faq/publish-diagram-as-link",U=document.createElement("option"),mxUtils.write(U,mxResources.get("makeCopy")),U.setAttribute("value","copy"),P.appendChild(U);U=document.createElement("option");mxUtils.write(U,mxResources.get("authorizationRequired"));-U.setAttribute("value","auth");P.appendChild(U);null!=D&&""!=D.getHash()||U.setAttribute("disabled","disabled");D=document.createElement("option");D.setAttribute("value","public");P.appendChild(D);null!=A?(mxUtils.write(D,mxResources.get("publicDiagramUrl")),D.setAttribute("title",A),P.value="public"):(mxUtils.write(D,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),D.setAttribute("disabled","disabled"));E.appendChild(P);mxUtils.br(E);P.focus();var J=null,m=null;-if(null!=e||null!=k)c+=30,mxUtils.write(E,mxResources.get("width")+":"),J=document.createElement("input"),J.setAttribute("type","text"),J.style.marginRight="16px",J.style.width="50px",J.style.marginLeft="6px",J.style.marginRight="16px",J.style.marginBottom="10px",J.value="100%",E.appendChild(J),mxUtils.write(E,mxResources.get("height")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.width="50px",m.style.marginLeft="6px",m.style.marginBottom="10px",m.value=k+"px",E.appendChild(m),-mxUtils.br(E);var v=this.addLinkSection(E,n),z=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,e=null!=this.currentPage?this.currentPage.getName():"",16<e.length&&(e=e.substring(0,16)+"..."),z=this.addCheckbox(E,mxResources.get("selectedPage")+": "+e));var B=this.addCheckbox(E,mxResources.get("lightbox"),!0,null,null,!n),H=this.addEditButton(E,B),T=H.getEditInput();n&&(T.style.marginLeft=B.style.marginLeft,B.style.display="none",c-=20);var g=this.addCheckbox(E,-mxResources.get("layers"),!0);g.style.marginLeft=T.style.marginLeft;g.style.marginTop="8px";var p=this.addCheckbox(E,mxResources.get("tags"),!0);p.style.marginLeft=T.style.marginLeft;p.style.marginBottom="16px";p.style.marginTop="16px";mxEvent.addListener(B,"change",function(){B.checked?(g.removeAttribute("disabled"),T.removeAttribute("disabled"),p.removeAttribute("disabled")):(g.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"));T.checked&&-B.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});n=new CustomDialog(this,E,mxUtils.bind(this,function(){G(v.getTarget(),v.getColor(),null==z?!1:z.checked,B.checked,H.getLink(),g.checked,null!=J?J.value:null,null!=m?m.value:null,p.checked,P.value)}),null,mxResources.get("create"),q,u);this.showDialog(n.container,340,296+c,!0,!0);null!=J?(J.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?J.select():document.execCommand("selectAll",-!1,null)):null==P.parentNode;v.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,e,k,n,q){var u=document.createElement("div");u.style.whiteSpace="nowrap";var A=document.createElement("h3");mxUtils.write(A,mxResources.get("image"));A.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(q?"10":"4")+"px";u.appendChild(A);if(q){mxUtils.write(u,mxResources.get("zoom")+":");var D=document.createElement("input");D.setAttribute("type","text");D.style.marginRight="16px";-D.style.width="60px";D.style.marginLeft="4px";D.style.marginRight="12px";D.value=this.lastExportZoom||"100%";u.appendChild(D);mxUtils.write(u,mxResources.get("borderWidth")+":");var G=document.createElement("input");G.setAttribute("type","text");G.style.marginRight="16px";G.style.width="60px";G.style.marginLeft="4px";G.value=this.lastExportBorder||"0";u.appendChild(G);mxUtils.br(u)}var E=this.addCheckbox(u,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),U=n?null:this.addCheckbox(u,-mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);A=this.editor.graph;var P=n?null:this.addCheckbox(u,mxResources.get("transparentBackground"),A.background==mxConstants.NONE||null==A.background);null!=P&&(P.style.marginBottom="16px");c=new CustomDialog(this,u,mxUtils.bind(this,function(){var J=parseInt(D.value)/100||1,m=parseInt(G.value)||0;k(!E.checked,null!=U?U.checked:!1,null!=P?P.checked:!1,J,m)}),null,c,e);this.showDialog(c.container,300,(q?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=-function(c,e,k,n,q,u,A,D,G){A=null!=A?A:Editor.defaultIncludeDiagram;var E=document.createElement("div");E.style.whiteSpace="nowrap";var U=this.editor.graph,P="jpeg"==D||"webp"==D?220:320,J=document.createElement("h3");mxUtils.write(J,c);J.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";E.appendChild(J);mxUtils.write(E,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft=-"4px";m.style.marginRight="12px";m.value=this.lastExportZoom||"100%";E.appendChild(m);mxUtils.write(E,mxResources.get("borderWidth")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.value=this.lastExportBorder||"0";E.appendChild(v);mxUtils.br(E);var z=this.addCheckbox(E,mxResources.get("selectionOnly"),!1,U.isSelectionEmpty()),B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight=-"8px";B.style.marginLeft="24px";B.setAttribute("disabled","disabled");B.setAttribute("type","checkbox");var H=document.createElement("select");H.style.marginTop="16px";H.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(J=0;J<c.length;J++)if(!U.isSelectionEmpty()||"selectionOnly"!=c[J]){var T=document.createElement("option");mxUtils.write(T,mxResources.get(c[J]));T.setAttribute("value",c[J]);H.appendChild(T)}G?(mxUtils.write(E,mxResources.get("size")+":"),E.appendChild(H),mxUtils.br(E),-P+=26,mxEvent.addListener(H,"change",function(){"selectionOnly"==H.value&&(z.checked=!0)})):u&&(E.appendChild(B),mxUtils.write(E,mxResources.get("crop")),mxUtils.br(E),P+=30,mxEvent.addListener(z,"change",function(){z.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}));U.isSelectionEmpty()?G&&(z.style.display="none",z.nextSibling.style.display="none",z.nextSibling.nextSibling.style.display="none",P-=30):(H.value="diagram",B.setAttribute("checked","checked"),B.defaultChecked=-!0,mxEvent.addListener(z,"change",function(){H.value=z.checked?"selectionOnly":"diagram"}));var g=this.addCheckbox(E,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=D&&"webp"!=D),p=document.createElement("select");p.style.maxWidth="260px";p.style.marginLeft="8px";p.style.marginTop="16px";u=document.createElement("option");u.setAttribute("value","light");mxUtils.write(u,mxResources.get("light"));p.appendChild(u);G=document.createElement("option");G.setAttribute("value","dark");mxUtils.write(G,-mxResources.get("dark"));p.appendChild(G);"svg"==D?(u=document.createElement("option"),u.setAttribute("value","auto"),mxUtils.write(u,mxResources.get("automatic")),u.setAttribute("selected","selected"),p.appendChild(u)):Editor.isDarkMode()?G.setAttribute("selected","selected"):u.setAttribute("selected","selected");mxUtils.write(E,mxResources.get("appearance")+":");E.appendChild(p);mxUtils.br(E);P+=26;var F=this.addCheckbox(E,mxResources.get("shadow"),U.shadowVisible),K=null;if("png"==D||"jpeg"==D||-"webp"==D)K=this.addCheckbox(E,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),P+=30;var M=this.addCheckbox(E,mxResources.get("includeCopyOfMyDiagram")+":",A,null,null,"jpeg"!=D&&"webp"!=D),R=document.createElement("select");R.style.maxWidth="260px";R.style.marginLeft="28px";"png"==D||"svg"==D?(A=function(){M.checked?R.removeAttribute("disabled"):R.setAttribute("disabled","disabled")},U=document.createElement("option"),U.setAttribute("value","allPages"),mxUtils.write(U,mxResources.get("allPages")),-R.appendChild(U),U=document.createElement("option"),U.setAttribute("value","currentPage"),mxUtils.write(U,mxResources.get("currentPage")),R.appendChild(U),M.style.marginBottom="12px",R.style.marginBottom="16px",E.appendChild(R),mxUtils.br(E),P+=20,null!=this.lastEmbedInclude&&(R.value=this.lastEmbedInclude),mxEvent.addListener(M,"change",A),A()):M.style.marginBottom="16px";var S=document.createElement("input");S.style.marginBottom="16px";S.style.marginRight="8px";S.setAttribute("type","checkbox");-var V=document.createElement("input");V.style.marginBottom="16px";V.style.marginRight="8px";V.setAttribute("type","checkbox");e&&(S.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,E.appendChild(S),mxUtils.write(E,mxResources.get("embedImages")),mxUtils.br(E),V.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,E.appendChild(V),mxUtils.write(E,mxResources.get("embedFonts")),mxUtils.br(E),P+=50);var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";-u=document.createElement("option");u.setAttribute("value","auto");mxUtils.write(u,mxResources.get("automatic"));W.appendChild(u);A=document.createElement("option");A.setAttribute("value","blank");mxUtils.write(A,mxResources.get("openInNewWindow"));W.appendChild(A);A=document.createElement("option");A.setAttribute("value","self");mxUtils.write(A,mxResources.get("openInThisWindow"));W.appendChild(A);A=document.createElement("div");mxUtils.write(A,mxResources.get("LinksLost"));A.style.margin="7px";A.style.display=-"none";"svg"==D&&(mxUtils.write(E,mxResources.get("links")+":"),E.appendChild(W),E.appendChild(A),mxUtils.br(E),mxUtils.br(E),P+=50);k=new CustomDialog(this,E,mxUtils.bind(this,function(){this.lastExportBorder=v.value;this.lastExportZoom=m.value;this.lastEmbedImages=S.checked;this.lastEmbedFonts=V.checked;this.lastEmbedInclude=R.value;q(m.value,g.checked,!z.checked,F.checked,M.checked,S.checked&&e,v.value,B.checked,("png"==D||"svg"==D)&&"currentPage"==R.value,W.value,null!=K?K.checked:null,null!=-p?p.value:null,H.value,V.checked)}),null,k,n);this.showDialog(k.container,340,P,!0,!0,null,null,null,null,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,e,k,n,q){var u=document.createElement("div");u.style.whiteSpace="nowrap";var A=this.editor.graph;if(null!=e){var D=document.createElement("h3");mxUtils.write(D,e);D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";-u.appendChild(D)}var G=this.addCheckbox(u,mxResources.get("fit"),!0),E=this.addCheckbox(u,mxResources.get("shadow"),A.shadowVisible&&n,!n),U=this.addCheckbox(u,k),P=this.addCheckbox(u,mxResources.get("lightbox"),!0),J=this.addEditButton(u,P),m=J.getEditInput(),v=1<A.model.getChildCount(A.model.getRoot()),z=this.addCheckbox(u,mxResources.get("layers"),v,!v);z.style.marginLeft=m.style.marginLeft;z.style.marginBottom="12px";z.style.marginTop="8px";mxEvent.addListener(P,"change",function(){P.checked?-(v&&z.removeAttribute("disabled"),m.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),m.setAttribute("disabled","disabled"));m.checked&&P.checked?J.getEditSelect().removeAttribute("disabled"):J.getEditSelect().setAttribute("disabled","disabled")});e=new CustomDialog(this,u,mxUtils.bind(this,function(){c(G.checked,E.checked,U.checked,P.checked,J.getLink(),z.checked)}),null,mxResources.get("embed"),q);this.showDialog(e.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=-function(c,e,k,n,q,u,A,D){function G(m){var v=" ",z="";n&&(v=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(null!=U?"&page="+U:"")+(q?"&edit=_blank":"")+(u?"&layers=1":"")+"');}})(this);\"",z+=-"cursor:pointer;");c&&(z+="max-width:100%;");var B="";k&&(B=' width="'+Math.round(E.width)+'" height="'+Math.round(E.height)+'"');A('<img src="'+m+'"'+B+(""!=z?' style="'+z+'"':"")+v+"/>")}var E=this.editor.graph.getGraphBounds(),U=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(m){var v=n?this.getFileData(!0):null;m=this.createImageDataUri(m,v,"png");G(m)}),null,null,null,mxUtils.bind(this,function(m){D({message:mxResources.get("unknownError")})}),-null,!0,k?2:1,null,e,null,null,Editor.defaultBorder);else if(e=this.getFileData(!0),E.width*E.height<=MAX_AREA&&e.length<=MAX_REQUEST_SIZE){var P="";k&&(P="&w="+Math.round(2*E.width)+"&h="+Math.round(2*E.height));var J=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+P+"&xml="+encodeURIComponent(e));J.send(mxUtils.bind(this,function(){200<=J.getStatus()&&299>=J.getStatus()?G("data:image/png;base64,"+J.getText()):D({message:mxResources.get("unknownError")})}))}else D({message:mxResources.get("drawingTooLarge")})};-EditorUi.prototype.createEmbedSvg=function(c,e,k,n,q,u,A){var D=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),G=D.getElementsByTagName("a");if(null!=G)for(var E=0;E<G.length;E++){var U=G[E].getAttribute("href");null!=U&&"#"==U.charAt(0)&&"_blank"==G[E].getAttribute("target")&&G[E].removeAttribute("target")}n&&D.setAttribute("content",this.getFileData(!0));e&&this.editor.graph.addSvgShadow(D);if(k){var P=" ",J="";n&&(P="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(q?"&edit=_blank":"")+(u?"&layers=1":"")+"');}})(this);\"",J+="cursor:pointer;");c&&(J+="max-width:100%;");this.editor.convertImages(D,mxUtils.bind(this,function(m){A('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(m))+'"'+(""!=J?' style="'+J+'"':"")+P+"/>")}))}else J="",n&&(e=this.getSelectedPageIndex(),D.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=e?"&page="+e:"")+(q?"&edit=_blank":"")+(u?"&layers=1":"")+"');}}})(this);"),J+="cursor:pointer;"),c&&(c=parseInt(D.getAttribute("width")),q=parseInt(D.getAttribute("height")),D.setAttribute("viewBox","-0.5 -0.5 "+c+" "+q),J+="max-width:100%;max-height:"+q+"px;",D.removeAttribute("height")),""!=J&&D.setAttribute("style",J),this.editor.addFontCss(D),this.editor.graph.mathEnabled&&this.editor.addMathCss(D),A(mxUtils.getXml(D))};EditorUi.prototype.timeSince=function(c){c=+q&&u.push("layers=1"),this.editor.graph.foldingEnabled&&u.push("nav=1"));return u};EditorUi.prototype.createLink=function(c,e,k,n,q,u,A,D,F,E,U){var P=this.getCurrentFile();F=this.createUrlParameters(c,e,n,q,u,F);c=!0;null!=A?k="#U"+encodeURIComponent(A):D||null==P||""==P.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+P.getHash(),c=!1);c&&null!=P&&null!=P.getTitle()&&P.getTitle()!=+this.defaultFilename&&F.push("title="+encodeURIComponent(P.getTitle()));E&&1<k.length&&(F.push("open="+k.substring(1)),k="");U&&null!=this.currentPage&&F.push("page-id="+this.currentPage.getId());return(n&&(null!=A||null!=P&&P.getMode()!=App.MODE_GITHUB&&P.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<F.length?"?"+F.join("&"):"")+k};EditorUi.prototype.createHtml=+function(c,e,k,n,q,u,A,D,F,E,U,P,M){this.getBasenames();var m={};""!=q&&q!=mxConstants.NONE&&(m.highlight=q);"auto"!==n&&(m.target=n);E||(m.lightbox=!1);m.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(m.zoom=k/100);k=[];A&&(k.push("pages"),m.resize=!0,null!=this.pages&&null!=this.currentPage&&(m.page=mxUtils.indexOf(this.pages,this.currentPage)));e&&(k.push("zoom"),m.resize=!0);D&&k.push("layers");F&&k.push("tags");null!=M&&(m["dark-mode"]=M);0<k.length&&(E&&k.push("lightbox"),+m.toolbar=k.join(" "));null!=U&&0<U.length&&(m.edit=U);null!=c?m.url=c:m.xml=this.getFileData(!0,null,null,null,null,!A);e='<div class="mxgraph" style="'+(u?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(m))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";P(e,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?+"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,e,k,n){var q=document.createElement("div");q.style.whiteSpace="nowrap";var u=document.createElement("h3");mxUtils.write(u,mxResources.get("html"));u.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";q.appendChild(u);var A=document.createElement("div");A.style.cssText=+"border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var D=document.createElement("input");D.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";D.setAttribute("value","url");D.setAttribute("type","radio");D.setAttribute("name","type-embedhtmldialog");u=D.cloneNode(!0);u.setAttribute("value","copy");A.appendChild(u);var F=document.createElement("span");mxUtils.write(F,mxResources.get("includeCopyOfMyDiagram"));A.appendChild(F);mxUtils.br(A);A.appendChild(D);F=+document.createElement("span");mxUtils.write(F,mxResources.get("publicDiagramUrl"));A.appendChild(F);var E=this.getCurrentFile();null==k&&null!=E&&E.constructor==window.DriveFile&&(F=document.createElement("a"),F.style.paddingLeft="12px",F.style.color="gray",F.style.cursor="pointer",mxUtils.write(F,mxResources.get("share")),A.appendChild(F),mxEvent.addListener(F,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(E.getId(),E)})));u.setAttribute("checked","checked");null==+k&&D.setAttribute("disabled","disabled");q.appendChild(A);A=380;var U=this.addLinkSection(q),P=document.createElement("select");P.style.maxWidth="260px";P.style.marginLeft="8px";P.style.marginTop="16px";F=document.createElement("option");F.setAttribute("value","light");mxUtils.write(F,mxResources.get("light"));P.appendChild(F);F=document.createElement("option");F.setAttribute("value","dark");mxUtils.write(F,mxResources.get("dark"));P.appendChild(F);F=document.createElement("option");F.setAttribute("value",+"auto");mxUtils.write(F,mxResources.get("automatic"));F.setAttribute("selected","selected");P.appendChild(F);F.setAttribute("selected","selected");mxUtils.write(q,mxResources.get("appearance")+":");q.appendChild(P);mxUtils.br(q);A+=26;var M=this.addCheckbox(q,mxResources.get("zoom"),!0,null,!0);mxUtils.write(q,":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value="100%";q.appendChild(m);+var v=this.addCheckbox(q,mxResources.get("fit"),!0);F=null!=this.pages&&1<this.pages.length;var z=z=this.addCheckbox(q,mxResources.get("allPages"),F,!F),B=this.addCheckbox(q,mxResources.get("layers"),!0),H=this.addCheckbox(q,mxResources.get("tags"),!0),T=this.addCheckbox(q,mxResources.get("lightbox"),!0),g=null;if(EditorUi.enableHtmlEditOption){g=this.addEditButton(q,T);var p=g.getEditInput();p.style.marginBottom="16px";A+=50;mxEvent.addListener(T,"change",function(){T.checked?p.removeAttribute("disabled"):+p.setAttribute("disabled","disabled");p.checked&&T.checked?g.getEditSelect().removeAttribute("disabled"):g.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,q,mxUtils.bind(this,function(){n(D.checked?k:null,M.checked,m.value,U.getTarget(),U.getColor(),v.checked,z.checked,B.checked,H.checked,T.checked,null!=g?g.getLink():null,null!=P?P.value:null)}),null,c,e);this.showDialog(c.container,340,A,!0,!0);u.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,e,k,n,q,+u,A,D,F){var E=document.createElement("div");E.style.whiteSpace="nowrap";var U=document.createElement("h3");mxUtils.write(U,c||mxResources.get("publish"));U.style.width="100%";U.style.textAlign="center";U.style.marginTop="2px";U.style.marginBottom="20px";E.appendChild(U);var P=document.createElement("select");c=30;P.className="geBtn";P.style.marginBottom="8px";P.style.marginLeft="0px";P.style.width="100%";P.style.boxSizing="border-box";if(null==D||""==D.getHash())q=null!=q?q:"https://www.drawio.com/doc/faq/publish-diagram-as-link",+U=document.createElement("option"),mxUtils.write(U,mxResources.get("makeCopy")),U.setAttribute("value","copy"),P.appendChild(U);U=document.createElement("option");mxUtils.write(U,mxResources.get("authorizationRequired"));U.setAttribute("value","auth");P.appendChild(U);null!=D&&""!=D.getHash()||U.setAttribute("disabled","disabled");D=document.createElement("option");D.setAttribute("value","public");P.appendChild(D);null!=A?(mxUtils.write(D,mxResources.get("publicDiagramUrl")),D.setAttribute("title",+A),P.value="public"):(mxUtils.write(D,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),D.setAttribute("disabled","disabled"));E.appendChild(P);mxUtils.br(E);P.focus();var M=null,m=null;if(null!=e||null!=k)c+=30,mxUtils.write(E,mxResources.get("width")+":"),M=document.createElement("input"),M.setAttribute("type","text"),M.style.marginRight="16px",M.style.width="50px",M.style.marginLeft="6px",M.style.marginRight="16px",M.style.marginBottom="10px",M.value="100%",E.appendChild(M),+mxUtils.write(E,mxResources.get("height")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.width="50px",m.style.marginLeft="6px",m.style.marginBottom="10px",m.value=k+"px",E.appendChild(m),mxUtils.br(E);var v=this.addLinkSection(E,n),z=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,e=null!=this.currentPage?this.currentPage.getName():"",16<e.length&&(e=e.substring(0,16)+"..."),z=this.addCheckbox(E,mxResources.get("selectedPage")++": "+e));var B=this.addCheckbox(E,mxResources.get("lightbox"),!0,null,null,!n),H=this.addEditButton(E,B),T=H.getEditInput();n&&(T.style.marginLeft=B.style.marginLeft,B.style.display="none",c-=20);var g=this.addCheckbox(E,mxResources.get("layers"),!0);g.style.marginLeft=T.style.marginLeft;g.style.marginTop="8px";var p=this.addCheckbox(E,mxResources.get("tags"),!0);p.style.marginLeft=T.style.marginLeft;p.style.marginBottom="16px";p.style.marginTop="16px";mxEvent.addListener(B,"change",function(){B.checked?+(g.removeAttribute("disabled"),T.removeAttribute("disabled"),p.removeAttribute("disabled")):(g.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"));T.checked&&B.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});n=new CustomDialog(this,E,mxUtils.bind(this,function(){F(v.getTarget(),v.getColor(),null==z?!1:z.checked,B.checked,H.getLink(),g.checked,null!=M?M.value:null,null!=m?m.value:+null,p.checked,P.value)}),null,mxResources.get("create"),q,u);this.showDialog(n.container,340,296+c,!0,!0);null!=M?(M.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?M.select():document.execCommand("selectAll",!1,null)):null==P.parentNode;v.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,e,k,n,q){var u=document.createElement("div");u.style.whiteSpace="nowrap";var A=document.createElement("h3");mxUtils.write(A,mxResources.get("image"));A.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"++(q?"10":"4")+"px";u.appendChild(A);if(q){mxUtils.write(u,mxResources.get("zoom")+":");var D=document.createElement("input");D.setAttribute("type","text");D.style.marginRight="16px";D.style.width="60px";D.style.marginLeft="4px";D.style.marginRight="12px";D.value=this.lastExportZoom||"100%";u.appendChild(D);mxUtils.write(u,mxResources.get("borderWidth")+":");var F=document.createElement("input");F.setAttribute("type","text");F.style.marginRight="16px";F.style.width="60px";F.style.marginLeft="4px";F.value=+this.lastExportBorder||"0";u.appendChild(F);mxUtils.br(u)}var E=this.addCheckbox(u,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),U=n?null:this.addCheckbox(u,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);A=this.editor.graph;var P=n?null:this.addCheckbox(u,mxResources.get("transparentBackground"),A.background==mxConstants.NONE||null==A.background);null!=P&&(P.style.marginBottom="16px");c=new CustomDialog(this,u,mxUtils.bind(this,function(){var M=+parseInt(D.value)/100||1,m=parseInt(F.value)||0;k(!E.checked,null!=U?U.checked:!1,null!=P?P.checked:!1,M,m)}),null,c,e);this.showDialog(c.container,300,(q?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,e,k,n,q,u,A,D,F){A=null!=A?A:Editor.defaultIncludeDiagram;var E=document.createElement("div");E.style.whiteSpace="nowrap";var U=this.editor.graph,P="jpeg"==D||"webp"==D?220:320,M=document.createElement("h3");mxUtils.write(M,c);M.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";+E.appendChild(M);mxUtils.write(E,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value=this.lastExportZoom||"100%";E.appendChild(m);mxUtils.write(E,mxResources.get("borderWidth")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.value=this.lastExportBorder||+"0";E.appendChild(v);mxUtils.br(E);var z=this.addCheckbox(E,mxResources.get("selectionOnly"),!1,U.isSelectionEmpty()),B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight="8px";B.style.marginLeft="24px";B.setAttribute("disabled","disabled");B.setAttribute("type","checkbox");var H=document.createElement("select");H.style.marginTop="16px";H.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(M=0;M<c.length;M++)if(!U.isSelectionEmpty()||"selectionOnly"!=c[M]){var T=+document.createElement("option");mxUtils.write(T,mxResources.get(c[M]));T.setAttribute("value",c[M]);H.appendChild(T)}F?(mxUtils.write(E,mxResources.get("size")+":"),E.appendChild(H),mxUtils.br(E),P+=26,mxEvent.addListener(H,"change",function(){"selectionOnly"==H.value&&(z.checked=!0)})):u&&(E.appendChild(B),mxUtils.write(E,mxResources.get("crop")),mxUtils.br(E),P+=30,mxEvent.addListener(z,"change",function(){z.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}));U.isSelectionEmpty()?+F&&(z.style.display="none",z.nextSibling.style.display="none",z.nextSibling.nextSibling.style.display="none",P-=30):(H.value="diagram",B.setAttribute("checked","checked"),B.defaultChecked=!0,mxEvent.addListener(z,"change",function(){H.value=z.checked?"selectionOnly":"diagram"}));var g=this.addCheckbox(E,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=D&&"webp"!=D),p=document.createElement("select");p.style.maxWidth="260px";p.style.marginLeft="8px";p.style.marginTop="16px";u=document.createElement("option");+u.setAttribute("value","light");mxUtils.write(u,mxResources.get("light"));p.appendChild(u);F=document.createElement("option");F.setAttribute("value","dark");mxUtils.write(F,mxResources.get("dark"));p.appendChild(F);"svg"==D?(u=document.createElement("option"),u.setAttribute("value","auto"),mxUtils.write(u,mxResources.get("automatic")),u.setAttribute("selected","selected"),p.appendChild(u)):Editor.isDarkMode()?F.setAttribute("selected","selected"):u.setAttribute("selected","selected");mxUtils.write(E,+mxResources.get("appearance")+":");E.appendChild(p);mxUtils.br(E);P+=26;var G=this.addCheckbox(E,mxResources.get("shadow"),U.shadowVisible),J=null;if("png"==D||"jpeg"==D||"webp"==D)J=this.addCheckbox(E,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),P+=30;var L=this.addCheckbox(E,mxResources.get("includeCopyOfMyDiagram")+":",A,null,null,"jpeg"!=D&&"webp"!=D),R=document.createElement("select");R.style.maxWidth="260px";R.style.marginLeft="28px";"png"==D||"svg"==D?(A=function(){L.checked?+R.removeAttribute("disabled"):R.setAttribute("disabled","disabled")},U=document.createElement("option"),U.setAttribute("value","allPages"),mxUtils.write(U,mxResources.get("allPages")),R.appendChild(U),U=document.createElement("option"),U.setAttribute("value","currentPage"),mxUtils.write(U,mxResources.get("currentPage")),R.appendChild(U),L.style.marginBottom="12px",R.style.marginBottom="16px",E.appendChild(R),mxUtils.br(E),P+=20,null!=this.lastEmbedInclude&&(R.value=this.lastEmbedInclude),mxEvent.addListener(L,+"change",A),A()):L.style.marginBottom="16px";var S=document.createElement("input");S.style.marginBottom="16px";S.style.marginRight="8px";S.setAttribute("type","checkbox");var V=document.createElement("input");V.style.marginBottom="16px";V.style.marginRight="8px";V.setAttribute("type","checkbox");e&&(S.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,E.appendChild(S),mxUtils.write(E,mxResources.get("embedImages")),mxUtils.br(E),V.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,+E.appendChild(V),mxUtils.write(E,mxResources.get("embedFonts")),mxUtils.br(E),P+=50);var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";u=document.createElement("option");u.setAttribute("value","auto");mxUtils.write(u,mxResources.get("automatic"));W.appendChild(u);A=document.createElement("option");A.setAttribute("value","blank");mxUtils.write(A,mxResources.get("openInNewWindow"));W.appendChild(A);A=document.createElement("option");A.setAttribute("value","self");+mxUtils.write(A,mxResources.get("openInThisWindow"));W.appendChild(A);A=document.createElement("div");mxUtils.write(A,mxResources.get("LinksLost"));A.style.margin="7px";A.style.display="none";"svg"==D&&(mxUtils.write(E,mxResources.get("links")+":"),E.appendChild(W),E.appendChild(A),mxUtils.br(E),mxUtils.br(E),P+=50);k=new CustomDialog(this,E,mxUtils.bind(this,function(){this.lastExportBorder=v.value;this.lastExportZoom=m.value;this.lastEmbedImages=S.checked;this.lastEmbedFonts=V.checked;this.lastEmbedInclude=+R.value;q(m.value,g.checked,!z.checked,G.checked,L.checked,S.checked&&e,v.value,B.checked,("png"==D||"svg"==D)&&"currentPage"==R.value,W.value,null!=J?J.checked:null,null!=p?p.value:null,H.value,V.checked)}),null,k,n);this.showDialog(k.container,340,P,!0,!0,null,null,null,null,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,e,k,n,q){var u=document.createElement("div");u.style.whiteSpace=+"nowrap";var A=this.editor.graph;if(null!=e){var D=document.createElement("h3");mxUtils.write(D,e);D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";u.appendChild(D)}var F=this.addCheckbox(u,mxResources.get("fit"),!0),E=this.addCheckbox(u,mxResources.get("shadow"),A.shadowVisible&&n,!n),U=this.addCheckbox(u,k),P=this.addCheckbox(u,mxResources.get("lightbox"),!0),M=this.addEditButton(u,P),m=M.getEditInput(),v=1<A.model.getChildCount(A.model.getRoot()),z=this.addCheckbox(u,+mxResources.get("layers"),v,!v);z.style.marginLeft=m.style.marginLeft;z.style.marginBottom="12px";z.style.marginTop="8px";mxEvent.addListener(P,"change",function(){P.checked?(v&&z.removeAttribute("disabled"),m.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),m.setAttribute("disabled","disabled"));m.checked&&P.checked?M.getEditSelect().removeAttribute("disabled"):M.getEditSelect().setAttribute("disabled","disabled")});e=new CustomDialog(this,u,mxUtils.bind(this,function(){c(F.checked,+E.checked,U.checked,P.checked,M.getLink(),z.checked)}),null,mxResources.get("embed"),q);this.showDialog(e.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,e,k,n,q,u,A,D){function F(m){var v=" ",z="";n&&(v=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=U?"&page="+U:"")+(q?"&edit=_blank":"")+(u?"&layers=1":"")+"');}})(this);\"",z+="cursor:pointer;");c&&(z+="max-width:100%;");var B="";k&&(B=' width="'+Math.round(E.width)+'" height="'+Math.round(E.height)+'"');A('<img src="'+m+'"'+B+(""!=z?' style="'+z+'"':"")+v+"/>")}var E=this.editor.graph.getGraphBounds(),U=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(m){var v=n?this.getFileData(!0):null;m=+this.createImageDataUri(m,v,"png");F(m)}),null,null,null,mxUtils.bind(this,function(m){D({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,e,null,null,Editor.defaultBorder);else if(e=this.getFileData(!0),E.width*E.height<=MAX_AREA&&e.length<=MAX_REQUEST_SIZE){var P="";k&&(P="&w="+Math.round(2*E.width)+"&h="+Math.round(2*E.height));var M=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+P+"&xml="+encodeURIComponent(e));M.send(mxUtils.bind(this,function(){200<=M.getStatus()&&+299>=M.getStatus()?F("data:image/png;base64,"+M.getText()):D({message:mxResources.get("unknownError")})}))}else D({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,e,k,n,q,u,A){var D=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),F=D.getElementsByTagName("a");if(null!=F)for(var E=0;E<F.length;E++){var U=F[E].getAttribute("href");null!=U&&"#"==U.charAt(0)&&"_blank"==F[E].getAttribute("target")&&F[E].removeAttribute("target")}n&&+D.setAttribute("content",this.getFileData(!0));e&&this.editor.graph.addSvgShadow(D);if(k){var P=" ",M="";n&&(P="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(q?"&edit=_blank":"")+(u?"&layers=1":+"")+"');}})(this);\"",M+="cursor:pointer;");c&&(M+="max-width:100%;");this.editor.convertImages(D,mxUtils.bind(this,function(m){A('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(m))+'"'+(""!=M?' style="'+M+'"':"")+P+"/>")}))}else M="",n&&(e=this.getSelectedPageIndex(),D.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=e?"&page="+e:"")+(q?"&edit=_blank":"")+(u?"&layers=1":"")+"');}}})(this);"),M+="cursor:pointer;"),c&&(c=parseInt(D.getAttribute("width")),q=parseInt(D.getAttribute("height")),D.setAttribute("viewBox","-0.5 -0.5 "+c+" "+q),M+="max-width:100%;max-height:"+q+"px;",D.removeAttribute("height")),""!=M&&D.setAttribute("style",M),this.editor.addFontCss(D),this.editor.graph.mathEnabled&&this.editor.addMathCss(D),A(mxUtils.getXml(D))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var e=Math.floor(c/31536E3);if(1<e)return e+" "+mxResources.get("years");e=Math.floor(c/2592E3);if(1<e)return e+" "+mxResources.get("months");e=Math.floor(c/86400);if(1<e)return e+" "+mxResources.get("days");e=Math.floor(c/3600);if(1<e)return e+" "+mxResources.get("hours");e=Math.floor(c/60);return 1<e?e+" "+mxResources.get("minutes"):1==e?e+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,e){if(null!=c){var k=null;if("diagram"==c.nodeName)k=c;else if("mxfile"==c.nodeName){var n=c.getElementsByTagName("diagram");if(0<n.length){k=n[0];var q=e.getGlobalVariable;e.getGlobalVariable=function(u){return"page"==u?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==u?1:q.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}n=this.editor.graph;try{this.editor.graph=e,this.editor.setGraphXml(c)}catch(u){}finally{this.editor.graph=n}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};EditorUi.prototype.getPngFileProperties=function(c){var e=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var n=parseFloat(c.getAttribute("scale"));!isNaN(n)&&0<n&&(e=n)}c.hasAttribute("border")&&(n=parseInt(c.getAttribute("border")),!isNaN(n)&&0<n&&(k=n))}return{scale:e,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,e,k,n,q){try{var u=this.editor.graph,A=null;if(null!=k&&0<k.length)u=this.createTemporaryGraph(u.getStylesheet()),document.body.appendChild(u.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,-!0),u),A=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){u=this.createTemporaryGraph(u.getStylesheet());var D=u.getGlobalVariable;u.setBackgroundImage=this.editor.graph.setBackgroundImage;var G=this.pages[0];this.currentPage==G?u.setBackgroundImage(this.editor.graph.backgroundImage):null!=G.viewState&&null!=G.viewState&&u.setBackgroundImage(G.viewState.backgroundImage);u.getGlobalVariable=function(E){return"page"==E?G.getName():"pagenumber"==E?1:D.apply(this,arguments)};document.body.appendChild(u.container);-u.model.setRoot(G.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(E){try{null==A&&(A=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var U=E.toDataURL("image/png");U=Editor.writeGraphModelToPng(U,"tEXt","mxfile",encodeURIComponent(A));c(U.substring(U.lastIndexOf(",")+1));u!=this.editor.graph&&u.container.parentNode.removeChild(u.container)}catch(P){null!=e&&e(P)}}),null,null,null,mxUtils.bind(this,function(E){null!=e&&e(E)}),null,null,n,null,u.shadowVisible,null,u,q,null,-null,null,"diagram",null)}catch(E){null!=e&&e(E)}};EditorUi.prototype.getEmbeddedSvg=function(c,e,k,n,q,u,A,D,G,E,U,P,J){D=null!=D?D:!0;U=null!=U?U:0;A=null!=G?G:e.background;A==mxConstants.NONE&&(A=null);null==A&&"none"==e.getAdaptiveColors()&&(A="#ffffff");G=this.editor.graph.createSvgImageExport(null!=c);u=e.getSvg(A,E,U,null,null,u,null,G,null,e.shadowVisible||P,null,J,"diagram");(e.shadowVisible||P)&&e.addSvgShadow(u,null,null,0==U);null!=c&&u.setAttribute("content",c);null!=k&&u.setAttribute("resource",+!0),u),A=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){u=this.createTemporaryGraph(u.getStylesheet());var D=u.getGlobalVariable;u.setBackgroundImage=this.editor.graph.setBackgroundImage;var F=this.pages[0];this.currentPage==F?u.setBackgroundImage(this.editor.graph.backgroundImage):null!=F.viewState&&null!=F.viewState&&u.setBackgroundImage(F.viewState.backgroundImage);u.getGlobalVariable=function(E){return"page"==E?F.getName():"pagenumber"==E?1:D.apply(this,arguments)};document.body.appendChild(u.container);+u.model.setRoot(F.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(E){try{null==A&&(A=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var U=E.toDataURL("image/png");U=Editor.writeGraphModelToPng(U,"tEXt","mxfile",encodeURIComponent(A));c(U.substring(U.lastIndexOf(",")+1));u!=this.editor.graph&&u.container.parentNode.removeChild(u.container)}catch(P){null!=e&&e(P)}}),null,null,null,mxUtils.bind(this,function(E){null!=e&&e(E)}),null,null,n,null,u.shadowVisible,null,u,q,null,+null,null,"diagram",null)}catch(E){null!=e&&e(E)}};EditorUi.prototype.getEmbeddedSvg=function(c,e,k,n,q,u,A,D,F,E,U,P,M){D=null!=D?D:!0;U=null!=U?U:0;A=null!=F?F:e.background;A==mxConstants.NONE&&(A=null);null==A&&"none"==e.getAdaptiveColors()&&(A="#ffffff");F=this.editor.graph.createSvgImageExport(null!=c);u=e.getSvg(A,E,U,null,null,u,null,F,null,e.shadowVisible||P,null,M,"diagram");(e.shadowVisible||P)&&e.addSvgShadow(u,null,null,0==U);null!=c&&u.setAttribute("content",c);null!=k&&u.setAttribute("resource",k);var m=mxUtils.bind(this,function(v){v=(n?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(v);null!=q&&q(v);return v});e.mathEnabled&&this.editor.addMathCss(u);if(null!=q)this.embedFonts(u,mxUtils.bind(this,function(v){D?this.editor.convertImages(v,mxUtils.bind(this,function(z){m(z)})):m(v)}));else return m(u)};EditorUi.prototype.embedFonts=function(c,e){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,-this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(k){try{null!=k&&this.editor.addFontCss(c,k),e(c)}catch(n){e(c)}}))}catch(k){e(c)}}))};EditorUi.prototype.exportImage=function(c,e,k,n,q,u,A,D,G,E,U,P,J){G=null!=G?G:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(v){Editor.addRetryToError(v,mxUtils.bind(this,function(){this.exportImage(c,e,k,n,q,u,A,D,G,E,U,P,J)}));this.handleError(v)}))){var m=this.editor.graph.isSelectionEmpty();-k=null!=k?k:m;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(v){this.spinner.stop();try{this.saveCanvas(v,q?this.getFileData(!0,null,null,null,k,D,null,null,null,null,null,c,u):null,G,null==this.pages||0==this.pages.length,U)}catch(z){this.handleError(z)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v)}),null,k,c||1,e,n,null,null,u,A,E,P,J)}catch(v){this.spinner.stop(),this.handleError(v)}}};-EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var e=0;e<this.pages.length;e++)c[this.pages[e].getId()]=this.pages[e].getId();return c};EditorUi.prototype.importXml=function(c,e,k,n,q,u,A){e=null!=e?e:0;k=null!=k?k:0;var D=[];try{var G=this.editor.graph;if(null!=c&&0<c.length){G.model.beginUpdate();try{var E=mxUtils.parseXml(c);c={};var U=this.editor.extractGraphModel(E.documentElement,-null!=this.pages);if(null!=U&&"mxfile"==U.nodeName&&null!=this.pages){var P=U.getElementsByTagName("diagram");if(1==P.length&&!u){if(U=Editor.parseDiagramNode(P[0]),null!=this.currentPage&&(c[P[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var J=P[0].getAttribute("name");null!=J&&""!=J&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,J))}}else if(0<P.length){u=[];var m=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[P[0].getAttribute("id")]=-this.pages[0].getId(),J=P[0].getAttribute("name"),null!=J&&""!=J&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],J)),U=Editor.parseDiagramNode(P[0]),n=!1,m=1);for(;m<P.length;m++){var v=P[m].getAttribute("id");P[m].removeAttribute("id");var z=this.updatePageRoot(new DiagramPage(P[m]));c[v]=P[m].getAttribute("id");var B=this.pages.length;null==z.getName()&&z.setName(mxResources.get("pageWithNumber",[B+1]));G.model.execute(new ChangePage(this,z,z,B,!0));u.push(z)}this.updatePageLinks(c,-u)}}if(null!=U&&"mxGraphModel"===U.nodeName){D=G.importGraphModel(U,e,k,n);if(null!=D)for(this.addLocalPagesToMapping(c),m=0;m<D.length;m++)this.updatePageLinksForCell(c,D[m]);var H=G.parseBackgroundImage(U.getAttribute("backgroundImage"));if(null!=H&&null!=H.originalSrc){this.updateBackgroundPageLink(c,H);var T=new ChangePageSetup(this,null,H);T.ignoreColor=!0;G.model.execute(T)}}A&&G.pasteCellStyles(G.includeDescendants(D),G.defaultVertexStyle,G.defaultEdgeStyle)}finally{G.model.endUpdate()}}}catch(g){if(q)throw g;+this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(k){try{null!=k&&this.editor.addFontCss(c,k),e(c)}catch(n){e(c)}}))}catch(k){e(c)}}))};EditorUi.prototype.exportImage=function(c,e,k,n,q,u,A,D,F,E,U,P,M){F=null!=F?F:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(v){Editor.addRetryToError(v,mxUtils.bind(this,function(){this.exportImage(c,e,k,n,q,u,A,D,F,E,U,P,M)}));this.handleError(v)}))){var m=this.editor.graph.isSelectionEmpty();+k=null!=k?k:m;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(v){this.spinner.stop();try{this.saveCanvas(v,q?this.getFileData(!0,null,null,null,k,D,null,null,null,null,null,c,u):null,F,null==this.pages||0==this.pages.length,U)}catch(z){this.handleError(z)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v)}),null,k,c||1,e,n,null,null,u,A,E,P,M)}catch(v){this.spinner.stop(),this.handleError(v)}}};+EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var e=0;e<this.pages.length;e++)c[this.pages[e].getId()]=this.pages[e].getId();return c};EditorUi.prototype.importXml=function(c,e,k,n,q,u,A){e=null!=e?e:0;k=null!=k?k:0;var D=[];try{var F=this.editor.graph;if(null!=c&&0<c.length){F.model.beginUpdate();try{var E=mxUtils.parseXml(c);c={};var U=this.editor.extractGraphModel(E.documentElement,+null!=this.pages);if(null!=U&&"mxfile"==U.nodeName&&null!=this.pages){var P=U.getElementsByTagName("diagram");if(1==P.length&&!u){if(U=Editor.parseDiagramNode(P[0]),null!=this.currentPage&&(c[P[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var M=P[0].getAttribute("name");null!=M&&""!=M&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,M))}}else if(0<P.length){u=[];var m=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[P[0].getAttribute("id")]=+this.pages[0].getId(),M=P[0].getAttribute("name"),null!=M&&""!=M&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],M)),U=Editor.parseDiagramNode(P[0]),n=!1,m=1);for(;m<P.length;m++){var v=P[m].getAttribute("id");P[m].removeAttribute("id");var z=this.updatePageRoot(new DiagramPage(P[m]));c[v]=P[m].getAttribute("id");var B=this.pages.length;null==z.getName()&&z.setName(mxResources.get("pageWithNumber",[B+1]));F.model.execute(new ChangePage(this,z,z,B,!0));u.push(z)}this.updatePageLinks(c,+u)}}if(null!=U&&"mxGraphModel"===U.nodeName){D=F.importGraphModel(U,e,k,n);if(null!=D)for(this.addLocalPagesToMapping(c),m=0;m<D.length;m++)this.updatePageLinksForCell(c,D[m]);var H=F.parseBackgroundImage(U.getAttribute("backgroundImage"));if(null!=H&&null!=H.originalSrc){this.updateBackgroundPageLink(c,H);var T=new ChangePageSetup(this,null,H);T.ignoreColor=!0;F.model.execute(T)}}A&&F.pasteCellStyles(F.includeDescendants(D),F.defaultVertexStyle,F.defaultEdgeStyle)}finally{F.model.endUpdate()}}}catch(g){if(q)throw g;this.handleError(g)}return D};EditorUi.prototype.updatePageLinks=function(c,e){for(var k=0;k<e.length;k++)this.updatePageLinksForCell(c,e[k].root),null!=e[k].viewState&&this.updateBackgroundPageLink(c,e[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,e){try{if(null!=e&&Graph.isPageLink(e.originalSrc)){var k=c[e.originalSrc.substring(e.originalSrc.indexOf(",")+1)];null!=k&&(e.originalSrc="data:page/id,"+k)}}catch(n){}};EditorUi.prototype.updatePageLinksForCell=function(c,e){var k=document.createElement("div"),n=this.editor.graph,q=n.getLinkForCell(e);null!=q&&n.setLinkForCell(e,this.updatePageLink(c,q));if(n.isHtmlLabel(e)){k.innerHTML=Graph.sanitizeHtml(n.getLabel(e));for(var u=k.getElementsByTagName("a"),A=!1,D=0;D<u.length;D++)q=u[D].getAttribute("href"),null!=q&&(u[D].setAttribute("href",this.updatePageLink(c,q)),A=!0);A&&n.labelChanged(e,k.innerHTML)}for(D=0;D<n.model.getChildCount(e);D++)this.updatePageLinksForCell(c,n.model.getChildAt(e,D))};EditorUi.prototype.updatePageLink=function(c,e){if(Graph.isPageLink(e)){var k=c[e.substring(e.indexOf(",")+1)];e=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==e.substring(0,17))try{var n=JSON.parse(e.substring(17));if(null!=n.actions){for(var q=0;q<n.actions.length;q++){var u=n.actions[q];if(null!=u.open&&Graph.isPageLink(u.open)){var A=u.open.substring(u.open.indexOf(",")+1);k=c[A];null!=k?u.open="data:page/id,"+k:null==this.getPageById(A)&&delete u.open}}e="data:action/json,"+JSON.stringify(n)}}catch(D){}return e};-EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,e,k,n,q){var u=mxUtils.bind(this,function(A){this.loadingExtensions=!1;null!=k?k(A):this.handleError(A)});this.createTimeout(null,mxUtils.bind(this,function(A){n=null!=n?n:c.name;var D=mxUtils.bind(this,function(E){A.clear()&&u(E)}),G=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var E=this.isRemoteVisioFormat(n);-try{var U=n.lastIndexOf(".");if(0<=U&&U<n.length)n.substring(U+1).toUpperCase();else{var P=n.lastIndexOf("/");0<=P&&P<n.length&&(n=n.substring(P+1))}}catch(m){}if(E)if(null==VSD_CONVERT_URL||this.isOffline())D({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{E=new FormData;E.append("file1",c,n);var J=new XMLHttpRequest;J.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(n)?"?stencil=1":""));J.responseType="blob";this.addRemoteServiceSecurityCheck(J);-null!=q&&J.setRequestHeader("x-convert-custom",q);J.onreadystatechange=mxUtils.bind(this,function(){if(4==J.readyState&&A.clear())if(200<=J.status&&299>=J.status)try{var m=J.response;if("text/xml"==m.type){var v=new FileReader;v.onload=mxUtils.bind(this,function(z){try{e(z.target.result)}catch(B){D({message:mxResources.get("errorLoadingFile")})}});v.readAsText(m)}else this.doImportVisio(m,e,D,n)}catch(z){D(z)}else try{""==J.responseType||"text"==J.responseType?D({message:J.responseText}):(v=new FileReader,-v.onload=function(){try{D({message:JSON.parse(v.result).Message})}catch(z){D(z)}},v.readAsText(J.response))}catch(z){D({})}});J.send(E)}else if(A.clear())try{this.doImportVisio(c,e,D,n)}catch(m){D(m)}}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?G():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",G,null,null,null,D))}),u)};EditorUi.prototype.importGraphML=function(c,e,k){var n=+EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,e,k,n,q){var u=mxUtils.bind(this,function(A){this.loadingExtensions=!1;null!=k?k(A):this.handleError(A)});this.createTimeout(null,mxUtils.bind(this,function(A){n=null!=n?n:c.name;var D=mxUtils.bind(this,function(E){A.clear()&&u(E)}),F=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var E=this.isRemoteVisioFormat(n);+try{var U=n.lastIndexOf(".");if(0<=U&&U<n.length)n.substring(U+1).toUpperCase();else{var P=n.lastIndexOf("/");0<=P&&P<n.length&&(n=n.substring(P+1))}}catch(m){}if(E)if(null==VSD_CONVERT_URL||this.isOffline())D({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{E=new FormData;E.append("file1",c,n);var M=new XMLHttpRequest;M.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(n)?"?stencil=1":""));M.responseType="blob";this.addRemoteServiceSecurityCheck(M);+null!=q&&M.setRequestHeader("x-convert-custom",q);M.onreadystatechange=mxUtils.bind(this,function(){if(4==M.readyState&&A.clear())if(200<=M.status&&299>=M.status)try{var m=M.response;if("text/xml"==m.type){var v=new FileReader;v.onload=mxUtils.bind(this,function(z){try{e(z.target.result)}catch(B){D({message:mxResources.get("errorLoadingFile")})}});v.readAsText(m)}else this.doImportVisio(m,e,D,n)}catch(z){D(z)}else try{""==M.responseType||"text"==M.responseType?D({message:M.responseText}):(v=new FileReader,+v.onload=function(){try{D({message:JSON.parse(v.result).Message})}catch(z){D(z)}},v.readAsText(M.response))}catch(z){D({})}});M.send(E)}else if(A.clear())try{this.doImportVisio(c,e,D,n)}catch(m){D(m)}}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?F():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",F,null,null,null,D))}),u)};EditorUi.prototype.importGraphML=function(c,e,k){var n=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=k?k(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var u=mxUtils.bind(this,function(D){q.clear()&&n(D)}),A=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,e,n)}catch(D){u(D)}else u({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?A():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",A,null,null,null,u))}),n)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var e=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.createTimeout(null,mxUtils.bind(this,function(k){var n=mxUtils.bind(this,function(u){k.clear()&&e(u)}),q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||n({message:mxResources.get("unknownError")})}catch(u){n(u)}else n({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(q,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,n))}),e)}};EditorUi.prototype.convertLucidChart=function(c,e,k){var n=mxUtils.bind(this,function(q){this.loadingExtensions=!1;-null!=k?k(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var u=mxUtils.bind(this,function(D){q.clear()&&n(D)}),A=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if("undefined"!==typeof window.LucidImporter)try{var D=JSON.parse(c);e(LucidImporter.importState(D));try{if(null!=window.console&&"1"==urlParams.test){var G=[(new Date).toISOString(),"convertLucidChart",D];null!=D.state&&G.push(JSON.parse(D.state));if(null!=D.svgThumbs)for(var E=0;E<D.svgThumbs.length;E++)G.push(Editor.createSvgDataUri(D.svgThumbs[E]));-null!=D.thumb&&G.push(D.thumb);console.log.apply(console,G)}}catch(U){}}catch(U){null!=window.console&&console.error(U),u(U)}else u({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(A,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",+null!=k?k(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var u=mxUtils.bind(this,function(D){q.clear()&&n(D)}),A=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if("undefined"!==typeof window.LucidImporter)try{var D=JSON.parse(c);e(LucidImporter.importState(D));try{if(null!=window.console&&"1"==urlParams.test){var F=[(new Date).toISOString(),"convertLucidChart",D];null!=D.state&&F.push(JSON.parse(D.state));if(null!=D.svgThumbs)for(var E=0;E<D.svgThumbs.length;E++)F.push(Editor.createSvgDataUri(D.svgThumbs[E]));+null!=D.thumb&&F.push(D.thumb);console.log.apply(console,F)}}catch(U){}}catch(U){null!=window.console&&console.error(U),u(U)}else u({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(A,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",A,null,null,null,u)},null,null,null,u)},null,null,null,u)},null,null,null,u)},null,null,null,u):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",A,null,null,null,u))}),n)};EditorUi.prototype.createMermaidXml=function(c,e,k,n,q,u){var A=new Graph(document.createElement("div"));k=A.insertVertex(null,null,null,0,0,n,q,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+k+";");A.setAttributeForCell(k,"mermaidData",JSON.stringify({data:c,-config:e},null,2));null!=u&&A.setAttributeForCell(k,"templatePrompt",u);c=(new mxCodec).encode(A.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,e,k){var n=0,q=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(u){var A=new mxXmlRequest("https://www.draw.io/generate/v2",c,"POST"),D=mxUtils.bind(this,function(G){u.clear()&&k(G)});A.send(mxUtils.bind(this,function(G){if(u.isAlive())if(200<=G.getStatus()&&299>=G.getStatus())this.tryAndHandle(mxUtils.bind(this,-function(){var U=mxUtils.trim(G.getText());this.generateMermaidImage(U,null,mxUtils.bind(this,function(P,J,m){this.tryAndHandle(mxUtils.bind(this,function(){u.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",U),e(U,P,J,m))}),D)}),D,mxUtils.bind(this,function(P){3>n++?u.clear()&&q():D(P)}))}),D);else{var E={message:mxResources.get("error")+" "+G.getStatus()};try{E=JSON.parse(G.getText()),E=E.error}catch(U){}D(E)}}),D)}),k)});q()};EditorUi.prototype.extractMermaidDeclaration=+config:e},null,2));null!=u&&A.setAttributeForCell(k,"templatePrompt",u);c=(new mxCodec).encode(A.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,e,k){var n=0,q=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(u){var A=new mxXmlRequest("https://www.draw.io/generate/v2",c,"POST"),D=mxUtils.bind(this,function(F){u.clear()&&k(F)});A.send(mxUtils.bind(this,function(F){if(u.isAlive())if(200<=F.getStatus()&&299>=F.getStatus())this.tryAndHandle(mxUtils.bind(this,+function(){var U=mxUtils.trim(F.getText());this.generateMermaidImage(U,null,mxUtils.bind(this,function(P,M,m){this.tryAndHandle(mxUtils.bind(this,function(){u.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",U),e(U,P,M,m))}),D)}),D,mxUtils.bind(this,function(P){3>n++?u.clear()&&q():D(P)}))}),D);else{var E={message:mxResources.get("error")+" "+F.getStatus()};try{E=JSON.parse(F.getText()),E=E.error}catch(U){}D(E)}}),D)}),k)});q()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var e=c.split("```");e=1<e.length?e:c.split("<pre>");e=1<e.length?e:c.split("~~~");e=1<e.length?e:c.split("%%");e=1<e.length?e:c.split("(Begins)");c=mxUtils.trim(1>=e.length?c:e[1]);e=c.split("\n");var k=1<e.length?e[1]:null;if(null!=k){var n=k.indexOf("-");0<n&&(k=k.substring(0,n))}if(0<e.length&&"mermaid"==mxUtils.trim(e[0])||null!=k&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k))e.shift(),c=mxUtils.trim(e.join("\n")),e=c.split("\n");k=e[0].split(" ")[0].replace(/:$/,"");n=k.indexOf("-");0<n&&(k=k.substring(0,n));try{"mindmap"==k&&2<e.length&&(c=extractMermaidMindmap(e))}catch(q){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k)&&(c=null);return c};EditorUi.prototype.generateMermaidImage=function(c,e,k,n,q){var u=mxUtils.bind(this,function(D){this.loadingMermaid=!1;null!=n?n(D):this.handleError(D)}),A=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;e=null!=e?e:mxUtils.clone(EditorUi.defaultMermaidConfig);-e.securityLevel="strict";e.startOnLoad=!1;"undefined"!==typeof mxMermaidToDrawio&&e.flowchart&&0<=c.indexOf("$$")&&(e.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(e.theme="dark");var D=mxUtils.bind(this,function(G){try{if(mxClient.IS_IE||mxClient.IS_IE11)G=G.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var E=mxUtils.parseXml(G).getElementsByTagName("svg");if(0<E.length&&"error"!=-E[0].getAttribute("aria-roledescription")){var U=parseFloat(E[0].getAttribute("width")),P=parseFloat(E[0].getAttribute("height"));if(isNaN(U)||isNaN(P))try{var J=E[0].getAttribute("viewBox").split(/\s+/);U=parseFloat(J[2]);P=parseFloat(J[3])}catch(m){U=U||100,P=P||100}k(this.convertDataUri(Editor.createSvgDataUri(G)),U,P)}else null!=q?q():n({message:mxResources.get("invalidInput")})}catch(m){n(m)}});mermaid.mermaidAPI.initialize(e);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),-c).then(function(G){D(G.svg)}).catch(function(G){null!=q?q(G):n(G)})}catch(G){n(G)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(A,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(D){this.importXml(D,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",A,null,null,null,u)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",A,null,null,null,u))};-EditorUi.prototype.generatePlantUmlImage=function(c,e,k,n){function q(D,G,E){c1=D>>2;c2=(D&3)<<4|G>>4;c3=(G&15)<<2|E>>6;c4=E&63;r="";r+=u(c1&63);r+=u(c2&63);r+=u(c3&63);return r+=u(c4&63)}function u(D){if(10>D)return String.fromCharCode(48+D);D-=10;if(26>D)return String.fromCharCode(65+D);D-=26;if(26>D)return String.fromCharCode(97+D);D-=26;return 0==D?"-":1==D?"_":"?"}var A=new XMLHttpRequest;A.open("GET",("txt"==e?PLANT_URL+"/txt/":"png"==e?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(D){r="";-for(i=0;i<D.length;i+=3)r=i+2==D.length?r+q(D.charCodeAt(i),D.charCodeAt(i+1),0):i+1==D.length?r+q(D.charCodeAt(i),0,0):r+q(D.charCodeAt(i),D.charCodeAt(i+1),D.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=e&&(A.responseType="blob");A.onload=function(D){if(200<=this.status&&300>this.status)if("txt"==e)k(this.response);else{var G=new FileReader;G.readAsDataURL(this.response);G.onloadend=function(E){var U=new Image;U.onload=function(){try{var P=U.width,J=U.height;-if(0==P&&0==J){var m=G.result,v=m.indexOf(","),z=decodeURIComponent(escape(atob(m.substring(v+1)))),B=mxUtils.parseXml(z).getElementsByTagName("svg");0<B.length&&(P=parseFloat(B[0].getAttribute("width")),J=parseFloat(B[0].getAttribute("height")))}k(G.result,P,J)}catch(H){n(H)}};U.src=G.result};G.onerror=function(E){n(E)}}else n(D)};A.onerror=function(D){n(D)};A.send()};EditorUi.prototype.insertAsPreText=function(c,e,k){var n=this.editor.graph,q=null;n.getModel().beginUpdate();try{q=n.insertVertex(null,-null,"<pre>"+c+"</pre>",e,k,1,1,"text;html=1;align=left;verticalAlign=top;"),n.updateCellSize(q,!0)}finally{n.getModel().endUpdate()}return q};EditorUi.prototype.insertTextAt=function(c,e,k,n,q,u,A,D){u=null!=u?u:!0;A=null!=A?A:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(J){4==J.readyState&&200<=-J.status&&299>=J.status&&this.editor.graph.setSelectionCells(this.insertTextAt(J.responseText,e,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(q||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var G=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var E=Editor.extractGraphModelFromPdf(c);if(null!=E&&0<E.length)return this.importXml(E,e,k,u,!0,D)}if(Editor.isPngDataUrl(c)&&(E=Editor.extractGraphModelFromPng(c),null!=E&&0<E.length))return this.importXml(E,e,k,u,-!0,D);if("data:image/svg+xml;"==c.substring(0,19))try{E=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(E=c.substring(c.indexOf(",")+1),E=window.atob&&!mxClient.IS_SF?atob(E):Base64.decode(E,!0)):E=decodeURIComponent(c.substring(c.indexOf(",")+1));var U=this.importXml(E,e,k,u,!0,D);if(0<U.length)return U}catch(J){}this.loadImage(c,mxUtils.bind(this,function(J){if("data:"==c.substring(0,5))this.resizeImage(J,c,mxUtils.bind(this,function(z,B,H){G.setSelectionCell(G.insertVertex(null,null,"",G.snap(e),-G.snap(k),B,H,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(z)+";"))}),A,this.maxImageSize);else{var m=Math.min(1,Math.min(this.maxImageSize/J.width,this.maxImageSize/J.height)),v=Math.round(J.width*m);J=Math.round(J.height*m);G.setSelectionCell(G.insertVertex(null,null,"",G.snap(e),G.snap(k),v,J,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+-c+";"))}}),mxUtils.bind(this,function(){var J=null;G.getModel().beginUpdate();try{J=G.insertVertex(G.getDefaultParent(),null,c,G.snap(e),G.snap(k),1,1,"text;"+(n?"html=1;":"")),G.updateCellSize(J),G.fireEvent(new mxEventObject("textInserted","cells",[J]))}finally{G.getModel().endUpdate()}G.setSelectionCell(J)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,e,k,u,null,D);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,-function(J){this.editor.graph.setSelectionCells(this.importXml(J,e,k,u,null,D))}),mxUtils.bind(this,function(J){this.handleError(J)}));else{G=this.editor.graph;q=null;G.getModel().beginUpdate();try{q=G.insertVertex(G.getDefaultParent(),null,"",G.snap(e),G.snap(k),1,1,"text;whiteSpace=wrap;"+(n?"html=1;":""));G.fireEvent(new mxEventObject("textInserted","cells",[q]));n&&(c=G.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");q.value=c;G.updateCellSize(q);if(0<this.maxTextWidth&&-q.geometry.width>this.maxTextWidth){var P=G.getPreferredSizeForCell(q,this.maxTextWidth);q.geometry.width=P.width;q.geometry.height=P.height}Graph.isLink(q.value)&&G.setLinkForCell(q,q.value);q.geometry.width+=G.gridSize;q.geometry.height+=G.gridSize}finally{G.getModel().endUpdate()}return[q]}}return[]};EditorUi.prototype.formatFileSize=function(c){var e=-1;do c/=1024,e++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[e]};EditorUi.prototype.convertDataUri=+e.securityLevel="strict";e.startOnLoad=!1;"undefined"!==typeof mxMermaidToDrawio&&e.flowchart&&0<=c.indexOf("$$")&&(e.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(e.theme="dark");var D=mxUtils.bind(this,function(F){try{if(mxClient.IS_IE||mxClient.IS_IE11)F=F.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var E=mxUtils.parseXml(F).getElementsByTagName("svg");if(0<E.length&&"error"!=+E[0].getAttribute("aria-roledescription")){var U=parseFloat(E[0].getAttribute("width")),P=parseFloat(E[0].getAttribute("height"));if(isNaN(U)||isNaN(P))try{var M=E[0].getAttribute("viewBox").split(/\s+/);U=parseFloat(M[2]);P=parseFloat(M[3])}catch(m){U=U||100,P=P||100}k(this.convertDataUri(Editor.createSvgDataUri(F)),U,P)}else null!=q?q():n({message:mxResources.get("invalidInput")})}catch(m){n(m)}});mermaid.mermaidAPI.initialize(e);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),+c).then(function(F){D(F.svg)}).catch(function(F){null!=q?q(F):n(F)})}catch(F){n(F)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(A,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(D){this.importXml(D,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",A,null,null,null,u)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",A,null,null,null,u))};+EditorUi.prototype.generatePlantUmlImage=function(c,e,k,n){function q(D,F,E){c1=D>>2;c2=(D&3)<<4|F>>4;c3=(F&15)<<2|E>>6;c4=E&63;r="";r+=u(c1&63);r+=u(c2&63);r+=u(c3&63);return r+=u(c4&63)}function u(D){if(10>D)return String.fromCharCode(48+D);D-=10;if(26>D)return String.fromCharCode(65+D);D-=26;if(26>D)return String.fromCharCode(97+D);D-=26;return 0==D?"-":1==D?"_":"?"}var A=new XMLHttpRequest;A.open("GET",("txt"==e?PLANT_URL+"/txt/":"png"==e?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(D){r="";+for(i=0;i<D.length;i+=3)r=i+2==D.length?r+q(D.charCodeAt(i),D.charCodeAt(i+1),0):i+1==D.length?r+q(D.charCodeAt(i),0,0):r+q(D.charCodeAt(i),D.charCodeAt(i+1),D.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=e&&(A.responseType="blob");A.onload=function(D){if(200<=this.status&&300>this.status)if("txt"==e)k(this.response);else{var F=new FileReader;F.readAsDataURL(this.response);F.onloadend=function(E){var U=new Image;U.onload=function(){try{var P=U.width,M=U.height;+if(0==P&&0==M){var m=F.result,v=m.indexOf(","),z=decodeURIComponent(escape(atob(m.substring(v+1)))),B=mxUtils.parseXml(z).getElementsByTagName("svg");0<B.length&&(P=parseFloat(B[0].getAttribute("width")),M=parseFloat(B[0].getAttribute("height")))}k(F.result,P,M)}catch(H){n(H)}};U.src=F.result};F.onerror=function(E){n(E)}}else n(D)};A.onerror=function(D){n(D)};A.send()};EditorUi.prototype.insertAsPreText=function(c,e,k){var n=this.editor.graph,q=null;n.getModel().beginUpdate();try{q=n.insertVertex(null,+null,"<pre>"+c+"</pre>",e,k,1,1,"text;html=1;align=left;verticalAlign=top;"),n.updateCellSize(q,!0)}finally{n.getModel().endUpdate()}return q};EditorUi.prototype.insertTextAt=function(c,e,k,n,q,u,A,D){u=null!=u?u:!0;A=null!=A?A:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(M){4==M.readyState&&200<=+M.status&&299>=M.status&&this.editor.graph.setSelectionCells(this.insertTextAt(M.responseText,e,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(q||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var F=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var E=Editor.extractGraphModelFromPdf(c);if(null!=E&&0<E.length)return this.importXml(E,e,k,u,!0,D)}if(Editor.isPngDataUrl(c)&&(E=Editor.extractGraphModelFromPng(c),null!=E&&0<E.length))return this.importXml(E,e,k,u,+!0,D);if("data:image/svg+xml;"==c.substring(0,19))try{E=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(E=c.substring(c.indexOf(",")+1),E=window.atob&&!mxClient.IS_SF?atob(E):Base64.decode(E,!0)):E=decodeURIComponent(c.substring(c.indexOf(",")+1));var U=this.importXml(E,e,k,u,!0,D);if(0<U.length)return U}catch(M){}this.loadImage(c,mxUtils.bind(this,function(M){if("data:"==c.substring(0,5))this.resizeImage(M,c,mxUtils.bind(this,function(z,B,H){F.setSelectionCell(F.insertVertex(null,null,"",F.snap(e),+F.snap(k),B,H,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(z)+";"))}),A,this.maxImageSize);else{var m=Math.min(1,Math.min(this.maxImageSize/M.width,this.maxImageSize/M.height)),v=Math.round(M.width*m);M=Math.round(M.height*m);F.setSelectionCell(F.insertVertex(null,null,"",F.snap(e),F.snap(k),v,M,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="++c+";"))}}),mxUtils.bind(this,function(){var M=null;F.getModel().beginUpdate();try{M=F.insertVertex(F.getDefaultParent(),null,c,F.snap(e),F.snap(k),1,1,"text;"+(n?"html=1;":"")),F.updateCellSize(M),F.fireEvent(new mxEventObject("textInserted","cells",[M]))}finally{F.getModel().endUpdate()}F.setSelectionCell(M)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,e,k,u,null,D);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,+function(M){this.editor.graph.setSelectionCells(this.importXml(M,e,k,u,null,D))}),mxUtils.bind(this,function(M){this.handleError(M)}));else{F=this.editor.graph;q=null;F.getModel().beginUpdate();try{q=F.insertVertex(F.getDefaultParent(),null,"",F.snap(e),F.snap(k),1,1,"text;whiteSpace=wrap;"+(n?"html=1;":""));F.fireEvent(new mxEventObject("textInserted","cells",[q]));n&&(c=F.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");q.value=c;F.updateCellSize(q);if(0<this.maxTextWidth&&+q.geometry.width>this.maxTextWidth){var P=F.getPreferredSizeForCell(q,this.maxTextWidth);q.geometry.width=P.width;q.geometry.height=P.height}Graph.isLink(q.value)&&F.setLinkForCell(q,q.value);q.geometry.width+=F.gridSize;q.geometry.height+=F.gridSize}finally{F.getModel().endUpdate()}return[q]}}return[]};EditorUi.prototype.formatFileSize=function(c){var e=-1;do c/=1024,e++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[e]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var e=c.indexOf(";");0<e&&(c=c.substring(0,e)+c.substring(c.indexOf(",",e+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,e){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,e){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display="none";document.body.appendChild(k);this.importFileInputElt=k}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(A,D){StorageFile.listFiles(this,"F",A,D)});window.openBrowserFile=-mxUtils.bind(this,function(A,D,G){StorageFile.getFileContent(this,A,D,G)});window.deleteBrowserFile=mxUtils.bind(this,function(A,D,G){StorageFile.deleteFile(this,A,D,G)});if(!e){var n=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(A){this.hideDialog(A)}));window.openFile.setConsumer(mxUtils.bind(this,function(A,D){null!=D&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(D)?(A=new Blob([A],{type:"application/octet-stream"}),this.importVisio(A,-mxUtils.bind(this,function(G){this.importXml(G,0,0,!0)}),null,D)):this.editor.graph.setSelectionCells(this.importXml(A,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!e){var q=this.dialog,u=q.close;this.dialog.close=mxUtils.bind(this,function(A){Editor.useLocalStorage=n;u.apply(q,arguments);A&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=-function(c,e,k){var n=this,q=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(u){if(mxUtils.isEmptyObject(u.files))k();else{var A=0,D,G=!1;u.forEach(function(E,U){E=U.name.toLowerCase();"diagram/diagram.xml"==E?(G=!0,U.async("string").then(function(P){0==P.indexOf("<mxfile ")?e(P):k()})):0==E.indexOf("versions/")&&(E=parseInt(E.substr(9)),E>A&&(A=E,D=U))});0<A?D.async("string").then(function(E){(new XMLHttpRequest).upload&&n.isRemoteFileFormat(E,-c.name)?n.isOffline()?n.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):n.parseFileData(E,mxUtils.bind(this,function(U){4==U.readyState&&(200<=U.status&&299>=U.status?e(U.responseText):k())}),c.name):k()}):G||k()}},function(u){k(u)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,k))};EditorUi.prototype.importFile=function(c,e,k,n,q,u,A,-D,G,E,U,P){E=null!=E?E:!0;var J=!1,m=null,v=mxUtils.bind(this,function(z){var B=null;null!=z&&"<mxlibrary"==z.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,z,A)),this.showSidebar()):B=this.importXml(z,k,n,E,null,null!=P?mxEvent.isControlDown(P):null);null!=D&&D(B)});"image"==e.substring(0,5)?(G=!1,"image/png"==e.substring(0,9)&&(e=U?null:this.extractGraphModelFromPng(c),null!=e&&0<e.length&&(m=this.importXml(e,k,n,E,null,null!=P?mxEvent.isControlDown(P):null),G=!0)),G||(e=this.editor.graph,-G=c.indexOf(";"),0<G&&(c=c.substring(0,G)+c.substring(c.indexOf(",",G+1))),E&&e.isGridEnabled()&&(k=e.snap(k),n=e.snap(n)),m=[e.insertVertex(null,null,"",k,n,q,u,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";")])):/(\.*<graphml )/.test(c)?(J=!0,this.importGraphML(c,v)):null!=G&&null!=A&&EditorUi.isVisioFilename(A)?(J=!0,this.importVisio(G,v)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,A)?this.isOffline()?-this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(J=!0,q=mxUtils.bind(this,function(z){4==z.readyState&&(200<=z.status&&299>=z.status?v(z.responseText):null!=D&&(D(null),this.showError(mxResources.get("error"),413==z.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,q,A):this.parseFile(G,q,A)):0==c.indexOf("PK")&&null!=G?(J=!0,this.importZipFile(G,v,mxUtils.bind(this,function(){m=this.insertTextAt(this.validateFileData(c),-k,n,!0,null,E);D(m)}))):/(\.v(sd|dx))($|\?)/i.test(A)||/(\.vs(s|x))($|\?)/i.test(A)||(m=this.insertTextAt(this.validateFileData(c),k,n,!0,null,E,null,null!=P?mxEvent.isControlDown(P):null));J||null==D||D(m);return m};EditorUi.prototype.importFiles=function(c,e,k,n,q,u,A,D,G,E,U,P,J){n=null!=n?n:this.maxImageSize;E=null!=E?E:this.maxImageBytes;var m=null!=e&&null!=k,v=!0;e=null!=e?e:0;k=null!=k?k:0;var z=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var B=U||this.resampleThreshold,H=0;H<c.length;H++)if("image/svg"!==-c[H].type.substring(0,9)&&"image/"===c[H].type.substring(0,6)&&c[H].size>B){z=!0;break}var T=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;q=null!=q?q:mxUtils.bind(this,function(V,W,X,Y,Z,ba,ha,ca,da){try{if(null!=V&&"<mxlibrary"==V.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,V,ha)),this.showSidebar(),null;this.isCompatibleString(V)&&1==c.length&&null!=J&&"drop"==J.type&&this.isBlankFile()&&!this.canUndo()&&(m=!1,Y=X=0);return this.importFile(V,-W,X,Y,Z,ba,ha,ca,da,m,P,J)}catch(ma){return this.handleError(ma),null}});u=null!=u?u:mxUtils.bind(this,function(V){g.setSelectionCells(V)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var F=c.length,K=F,M=[],R=mxUtils.bind(this,function(V,W){M[V]=W;if(0==--K){this.spinner.stop();if(null!=D)D(M);else{var X=[];g.getModel().beginUpdate();try{for(V=0;V<M.length;V++){var Y=M[V]();null!=Y&&(X=X.concat(Y))}}finally{g.getModel().endUpdate()}}u(X)}}),S=0;S<F;S++)mxUtils.bind(this,function(V){var W=-c[V];if(null!=W){var X=new FileReader;X.onload=mxUtils.bind(this,function(Y){if(null==A||A(W))try{if("image/"==W.type.substring(0,6))if("image/svg"==W.type.substring(0,9)){var Z=Graph.clipSvgDataUri(Y.target.result),ba=Z.indexOf(","),ha=decodeURIComponent(escape(atob(Z.substring(ba+1)))),ca=mxUtils.parseXml(ha),da=ca.getElementsByTagName("svg");if(0<da.length){var ma=da[0],aa=P?null:ma.getAttribute("content");null!=aa&&"<"!=aa.charAt(0)&&"%"!=aa.charAt(0)&&(aa=unescape(window.atob?atob(aa):Base64.decode(aa,+mxUtils.bind(this,function(A,D,F){StorageFile.getFileContent(this,A,D,F)});window.deleteBrowserFile=mxUtils.bind(this,function(A,D,F){StorageFile.deleteFile(this,A,D,F)});if(!e){var n=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(A){this.hideDialog(A)}));window.openFile.setConsumer(mxUtils.bind(this,function(A,D){null!=D&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(D)?(A=new Blob([A],{type:"application/octet-stream"}),this.importVisio(A,+mxUtils.bind(this,function(F){this.importXml(F,0,0,!0)}),null,D)):this.editor.graph.setSelectionCells(this.importXml(A,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!e){var q=this.dialog,u=q.close;this.dialog.close=mxUtils.bind(this,function(A){Editor.useLocalStorage=n;u.apply(q,arguments);A&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=+function(c,e,k){var n=this,q=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(u){if(mxUtils.isEmptyObject(u.files))k();else{var A=0,D,F=!1;u.forEach(function(E,U){E=U.name.toLowerCase();"diagram/diagram.xml"==E?(F=!0,U.async("string").then(function(P){0==P.indexOf("<mxfile ")?e(P):k()})):0==E.indexOf("versions/")&&(E=parseInt(E.substr(9)),E>A&&(A=E,D=U))});0<A?D.async("string").then(function(E){(new XMLHttpRequest).upload&&n.isRemoteFileFormat(E,+c.name)?n.isOffline()?n.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):n.parseFileData(E,mxUtils.bind(this,function(U){4==U.readyState&&(200<=U.status&&299>=U.status?e(U.responseText):k())}),c.name):k()}):F||k()}},function(u){k(u)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,k))};EditorUi.prototype.importFile=function(c,e,k,n,q,u,A,+D,F,E,U,P){E=null!=E?E:!0;var M=!1,m=null,v=mxUtils.bind(this,function(z){var B=null;null!=z&&"<mxlibrary"==z.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,z,A)),this.showSidebar()):B=this.importXml(z,k,n,E,null,null!=P?mxEvent.isControlDown(P):null);null!=D&&D(B)});"image"==e.substring(0,5)?(F=!1,"image/png"==e.substring(0,9)&&(e=U?null:this.extractGraphModelFromPng(c),null!=e&&0<e.length&&(m=this.importXml(e,k,n,E,null,null!=P?mxEvent.isControlDown(P):null),F=!0)),F||(e=this.editor.graph,+F=c.indexOf(";"),0<F&&(c=c.substring(0,F)+c.substring(c.indexOf(",",F+1))),E&&e.isGridEnabled()&&(k=e.snap(k),n=e.snap(n)),m=[e.insertVertex(null,null,"",k,n,q,u,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";")])):/(\.*<graphml )/.test(c)?(M=!0,this.importGraphML(c,v)):null!=F&&null!=A&&EditorUi.isVisioFilename(A)?(M=!0,this.importVisio(F,v)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,A)?this.isOffline()?+this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(M=!0,q=mxUtils.bind(this,function(z){4==z.readyState&&(200<=z.status&&299>=z.status?v(z.responseText):null!=D&&(D(null),this.showError(mxResources.get("error"),413==z.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,q,A):this.parseFile(F,q,A)):0==c.indexOf("PK")&&null!=F?(M=!0,this.importZipFile(F,v,mxUtils.bind(this,function(){m=this.insertTextAt(this.validateFileData(c),+k,n,!0,null,E);D(m)}))):/(\.v(sd|dx))($|\?)/i.test(A)||/(\.vs(s|x))($|\?)/i.test(A)||(m=this.insertTextAt(this.validateFileData(c),k,n,!0,null,E,null,null!=P?mxEvent.isControlDown(P):null));M||null==D||D(m);return m};EditorUi.prototype.importFiles=function(c,e,k,n,q,u,A,D,F,E,U,P,M){n=null!=n?n:this.maxImageSize;E=null!=E?E:this.maxImageBytes;var m=null!=e&&null!=k,v=!0;e=null!=e?e:0;k=null!=k?k:0;var z=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var B=U||this.resampleThreshold,H=0;H<c.length;H++)if("image/svg"!==+c[H].type.substring(0,9)&&"image/"===c[H].type.substring(0,6)&&c[H].size>B){z=!0;break}var T=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;q=null!=q?q:mxUtils.bind(this,function(V,W,X,Y,Z,ba,fa,ca,da){try{if(null!=V&&"<mxlibrary"==V.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,V,fa)),this.showSidebar(),null;this.isCompatibleString(V)&&1==c.length&&null!=M&&"drop"==M.type&&this.isBlankFile()&&!this.canUndo()&&(m=!1,Y=X=0);return this.importFile(V,+W,X,Y,Z,ba,fa,ca,da,m,P,M)}catch(ma){return this.handleError(ma),null}});u=null!=u?u:mxUtils.bind(this,function(V){g.setSelectionCells(V)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var G=c.length,J=G,L=[],R=mxUtils.bind(this,function(V,W){L[V]=W;if(0==--J){this.spinner.stop();if(null!=D)D(L);else{var X=[];g.getModel().beginUpdate();try{for(V=0;V<L.length;V++){var Y=L[V]();null!=Y&&(X=X.concat(Y))}}finally{g.getModel().endUpdate()}}u(X)}}),S=0;S<G;S++)mxUtils.bind(this,function(V){var W=+c[V];if(null!=W){var X=new FileReader;X.onload=mxUtils.bind(this,function(Y){if(null==A||A(W))try{if("image/"==W.type.substring(0,6))if("image/svg"==W.type.substring(0,9)){var Z=Graph.clipSvgDataUri(Y.target.result),ba=Z.indexOf(","),fa=decodeURIComponent(escape(atob(Z.substring(ba+1)))),ca=mxUtils.parseXml(fa),da=ca.getElementsByTagName("svg");if(0<da.length){var ma=da[0],aa=P?null:ma.getAttribute("content");null!=aa&&"<"!=aa.charAt(0)&&"%"!=aa.charAt(0)&&(aa=unescape(window.atob?atob(aa):Base64.decode(aa,!0)));null!=aa&&"%"==aa.charAt(0)&&(aa=decodeURIComponent(aa));null==aa||"<mxfile "!==aa.substring(0,8)&&"<mxGraphModel "!==aa.substring(0,14)?R(V,mxUtils.bind(this,function(){try{if(null!=ca){var ta=ca.getElementsByTagName("svg");if(0<ta.length){var sa=ta[0],ea=sa.getAttribute("width"),ra=sa.getAttribute("height");ea=null!=ea&&"%"!=ea.charAt(ea.length-1)?parseFloat(ea):NaN;ra=null!=ra&&"%"!=ra.charAt(ra.length-1)?parseFloat(ra):NaN;var ua=sa.getAttribute("viewBox");if(null==ua||0==ua.length)sa.setAttribute("viewBox",-"0 0 "+ea+" "+ra);else if(isNaN(ea)||isNaN(ra)){var za=ua.split(" ");3<za.length&&(ea=parseFloat(za[2]),ra=parseFloat(za[3]))}Z=Editor.createSvgDataUri(mxUtils.getXml(sa));var va=Math.min(1,Math.min(n/Math.max(1,ea)),n/Math.max(1,ra)),fa=q(Z,W.type,e+V*p,k+V*p,Math.max(1,Math.round(ea*va)),Math.max(1,Math.round(ra*va)),W.name);if(null!=fa&&(isNaN(ea)||isNaN(ra))){var pa=new Image;pa.onload=mxUtils.bind(this,function(){ea=Math.max(1,pa.width);ra=Math.max(1,pa.height);fa[0].geometry.width=ea;fa[0].geometry.height=-ra;sa.setAttribute("viewBox","0 0 "+ea+" "+ra);Z=Editor.createSvgDataUri(mxUtils.getXml(sa));var Aa=Z.indexOf(";");0<Aa&&(Z=Z.substring(0,Aa)+Z.substring(Z.indexOf(",",Aa+1)));g.setCellStyles("image",Z,[fa[0]])});pa.src=Editor.createSvgDataUri(mxUtils.getXml(sa))}return fa}}}catch(Aa){}return null})):R(V,mxUtils.bind(this,function(){return q(aa,"text/xml",e+V*p,k+V*p,0,0,W.name)}))}else R(V,mxUtils.bind(this,function(){return null}))}else{ba=!1;if("image/png"==W.type){var ia=P?null:this.extractGraphModelFromPng(Y.target.result);+"0 0 "+ea+" "+ra);else if(isNaN(ea)||isNaN(ra)){var za=ua.split(" ");3<za.length&&(ea=parseFloat(za[2]),ra=parseFloat(za[3]))}Z=Editor.createSvgDataUri(mxUtils.getXml(sa));var va=Math.min(1,Math.min(n/Math.max(1,ea)),n/Math.max(1,ra)),ha=q(Z,W.type,e+V*p,k+V*p,Math.max(1,Math.round(ea*va)),Math.max(1,Math.round(ra*va)),W.name);if(null!=ha&&(isNaN(ea)||isNaN(ra))){var pa=new Image;pa.onload=mxUtils.bind(this,function(){ea=Math.max(1,pa.width);ra=Math.max(1,pa.height);ha[0].geometry.width=ea;ha[0].geometry.height=+ra;sa.setAttribute("viewBox","0 0 "+ea+" "+ra);Z=Editor.createSvgDataUri(mxUtils.getXml(sa));var Aa=Z.indexOf(";");0<Aa&&(Z=Z.substring(0,Aa)+Z.substring(Z.indexOf(",",Aa+1)));g.setCellStyles("image",Z,[ha[0]])});pa.src=Editor.createSvgDataUri(mxUtils.getXml(sa))}return ha}}}catch(Aa){}return null})):R(V,mxUtils.bind(this,function(){return q(aa,"text/xml",e+V*p,k+V*p,0,0,W.name)}))}else R(V,mxUtils.bind(this,function(){return null}))}else{ba=!1;if("image/png"==W.type){var ia=P?null:this.extractGraphModelFromPng(Y.target.result);if(null!=ia&&0<ia.length){var ka=new Image;ka.src=Y.target.result;R(V,mxUtils.bind(this,function(){return q(ia,"text/xml",e+V*p,k+V*p,ka.width,ka.height,W.name)}));ba=!0}}ba||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(Y.target.result,mxUtils.bind(this,function(ta){this.resizeImage(ta,Y.target.result,mxUtils.bind(this,function(sa,ea,ra){R(V,mxUtils.bind(this,function(){if(null!=sa&&sa.length<E){var ua=v&&this.isResampleImageSize(W.size,U)?Math.min(1,Math.min(n/ea,n/ra)):1;return q(sa,W.type,e+V*p,k+V*p,Math.round(ea*ua),Math.round(ra*ua),W.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),v,n,U,W.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else Z=Y.target.result,q(Z,W.type,e+V*p,k+V*p,240,160,W.name,function(ta){R(V,function(){return ta})},W)}catch(ta){R(V,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(ta,W)}else R(V,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(W.name)?q(null,W.type,e+V*p,k+V*p,240,160,W.name,function(Y){R(V,function(){return Y})},W):"image"==W.type.substring(0,5)||"application/pdf"==W.type?X.readAsDataURL(W):X.readAsText(W)}})(S)});if(z){z=[];for(H=0;H<c.length;H++)z.push(c[H]);-c=z;this.confirmImageResize(function(g){v=g;T()},G)}else T()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,e){e=null!=e?e:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},n=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,q=function(u,A){if(u||e)mxSettings.setResizeImages(u?+c=z;this.confirmImageResize(function(g){v=g;T()},F)}else T()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,e){e=null!=e?e:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},n=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,q=function(u,A){if(u||e)mxSettings.setResizeImages(u?A:null),mxSettings.save();k();c(A)};null==n||e?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(u){q(u,!0)},function(u){q(u,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):q(!1,n)};EditorUi.prototype.parseFile=function(c,e,k){k=null!=k?k:c.name;var n=new FileReader;n.onload=mxUtils.bind(this,function(){this.parseFileData(n.result,e,k)});n.readAsText(c)};EditorUi.prototype.parseFileData=function(c,e,k){var n=new XMLHttpRequest;n.open("POST",OPEN_URL);n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");n.onreadystatechange=function(){e(n)};n.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(q){}};-EditorUi.prototype.isResampleImageSize=function(c,e){e=null!=e?e:this.resampleThreshold;return c>e};EditorUi.prototype.resizeImage=function(c,e,k,n,q,u,A){q=null!=q?q:this.maxImageSize;var D=Math.max(1,c.width),G=Math.max(1,c.height),E=e;if(n&&this.isResampleImageSize(null!=A?A:e.length,u))try{var U=Math.max(D/q,G/q);if(1<U){var P=Math.round(D/U),J=Math.round(G/U),m=document.createElement("canvas");m.width=P;m.height=J;m.getContext("2d").drawImage(c,0,0,P,J);var v=m.toDataURL();if(v.length<e.length){var z=-document.createElement("canvas");z.width=P;z.height=J;var B=z.toDataURL();v!==B&&(e=v,D=P,G=J)}}}catch(H){}n&&E!=e&&q>this.maxImageSize/2&&e.length>this.maxImageBytes?this.resizeImage(c,e,k,n,q/1.5,u,A):k(e,D,G)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,e,k){try{var n=new Image;n.onload=function(){n.width=0<n.width?n.width:120;n.height=0<n.height?n.height:120;e(n)};null!=k&&(n.onerror=k);n.src=c}catch(q){if(null!=+EditorUi.prototype.isResampleImageSize=function(c,e){e=null!=e?e:this.resampleThreshold;return c>e};EditorUi.prototype.resizeImage=function(c,e,k,n,q,u,A){q=null!=q?q:this.maxImageSize;var D=Math.max(1,c.width),F=Math.max(1,c.height),E=e;if(n&&this.isResampleImageSize(null!=A?A:e.length,u))try{var U=Math.max(D/q,F/q);if(1<U){var P=Math.round(D/U),M=Math.round(F/U),m=document.createElement("canvas");m.width=P;m.height=M;m.getContext("2d").drawImage(c,0,0,P,M);var v=m.toDataURL();if(v.length<e.length){var z=+document.createElement("canvas");z.width=P;z.height=M;var B=z.toDataURL();v!==B&&(e=v,D=P,F=M)}}}catch(H){}n&&E!=e&&q>this.maxImageSize/2&&e.length>this.maxImageBytes?this.resizeImage(c,e,k,n,q/1.5,u,A):k(e,D,F)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,e,k){try{var n=new Image;n.onload=function(){n.width=0<n.width?n.width:120;n.height=0<n.height?n.height:120;e(n)};null!=k&&(n.onerror=k);n.src=c}catch(q){if(null!=k)k(q);else throw q;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var t=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());t.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&-null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var y=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,e=this.editor.graph,k=e.isEnabled;e.isEnabled=function(){return k.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(e.panningHandler.isPanningTrigger=function(p){var F=p.getEvent();return null==p.getState()&&!mxEvent.isMouseEvent(F)&&-!e.freehand.isDrawing()||mxEvent.isPopupTrigger(F)&&(null==p.getState()||mxEvent.isControlDown(F)||mxEvent.isShiftDown(F))});e.cellEditor.editPlantUmlData=function(p,F,K){var M=JSON.parse(K);F=new TextareaDialog(c,mxResources.get("plantUml")+":",M.data,function(R){null!=R&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(R,M.format,function(S,V,W){c.spinner.stop();e.getModel().beginUpdate();try{if("txt"==M.format)e.labelChanged(p,"<pre>"+S+"</pre>"),e.updateCellSize(p,-!0);else{e.setCellStyles("image",c.convertDataUri(S),[p]);var X=e.model.getGeometry(p);null!=X&&(X=X.clone(),X.width=V,X.height=W,e.cellsResized([p],[X],!1))}e.setAttributeForCell(p,"plantUmlData",JSON.stringify({data:R,format:M.format}))}finally{e.getModel().endUpdate()}},function(S){c.handleError(S)})},null,null,400,220);c.showDialog(F.container,420,300,!0,!0);F.init()};e.cellEditor.editMermaidData=function(p,F,K){var M=JSON.parse(K);F=new TextareaDialog(c,mxResources.get("mermaid")+":",M.data,-function(R){null!=R&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(R,M.config,function(S,V,W){c.spinner.stop();e.getModel().beginUpdate();try{e.setCellStyles("image",S,[p]);var X=e.model.getGeometry(p);null!=X&&(X=X.clone(),X.width=Math.max(X.width,V),X.height=Math.max(X.height,W),e.cellsResized([p],[X],!1));e.setAttributeForCell(p,"mermaidData",JSON.stringify({data:R,config:M.config},null,2))}finally{e.getModel().endUpdate()}},function(S){c.handleError(S)})},-null,null,400,220);c.showDialog(F.container,420,300,!0,!0);F.init()};var n=e.cellEditor.startEditing;e.cellEditor.startEditing=function(p,F){try{var K=this.graph.getAttributeForCell(p,"plantUmlData");if(null!=K)this.editPlantUmlData(p,F,K);else if(K=this.graph.getAttributeForCell(p,"mermaidData"),null!=K&&window.isMermaidEnabled)this.editMermaidData(p,F,K);else{var M=e.getCellStyle(p);"1"==mxUtils.getValue(M,"metaEdit","0")?c.showDataDialog(p):n.apply(this,arguments)}}catch(R){c.handleError(R)}};-e.getLinkTitle=function(p){return c.getLinkTitle(p)};e.customLinkClicked=function(p,F){var K=!1;try{var M=this.getGraphBounds();c.handleCustomLink(p,F);K=!0;c.chromelessResize&&!M.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(F))}catch(R){c.handleError(R)}return K};var q=e.parseBackgroundImage;e.parseBackgroundImage=function(p){var F=q.apply(this,arguments);null!=F&&null!=F.src&&Graph.isPageLink(F.src)&&(F={originalSrc:F.src});return F};var u=e.setBackgroundImage;e.setBackgroundImage=-function(p){null!=p&&null!=p.originalSrc&&(p=c.createImageForPageLink(p.originalSrc,c.currentPage,this));u.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){e.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){e.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(p,F){p=null!=e.backgroundImage?e.backgroundImage.originalSrc:null;if(null!=p){var K=p.indexOf(",");if(0<K)for(p=p.substring(K+-1),F=F.getProperty("patches"),K=0;K<F.length;K++)if(null!=F[K][EditorUi.DIFF_UPDATE]&&null!=F[K][EditorUi.DIFF_UPDATE][p]||null!=F[K][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(F[K][EditorUi.DIFF_REMOVE],p)){e.refreshBackgroundImage();break}}}));var A=e.getBackgroundImageObject;e.getBackgroundImageObject=function(p,F){var K=A.apply(this,arguments);null!=K&&null!=K.originalSrc&&(K=F?c.createImageForPageLink(K.originalSrc,null,null,!0):{src:K.originalSrc});return K};this.isOffline()||"undefined"===typeof window.EditDataDialog||-(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var D=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(p){p=null!=p?p:"";"1"==urlParams.dev&&(p+=(0<p.length?"&":"?")+"dev=1");return D.apply(this,arguments)};var G=e.addClickHandler;e.addClickHandler=function(p,F,K){var M=F;F=-function(R,S,V){if(null==S){var W=mxEvent.getSource(R);"a"==W.nodeName.toLowerCase()&&(S=W.getAttribute("href"))}null!=S&&e.isCustomLink(S)&&(mxEvent.isTouchEvent(R)||!mxEvent.isPopupTrigger(R))&&e.customLinkClicked(S,V)&&mxEvent.consume(R);null!=M&&M(R,S,V)};G.call(this,p,F,K)};y.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(e.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var E=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(p,F,K){e.isSelectionEmpty()&&-"simple"==Editor.currentTheme&&this.addMenuItems(p,["zoomIn","zoomOut","-"],null,K);E.apply(this,arguments);e.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(p,["-","addToScratchpad"],null,K);e.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(p,["-","exitGroup","home"],null,K)};var U=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(p,F,K){if(c.editor.graph.isSelectionEmpty())U.apply(this,arguments),c.menus.addMenuItems(p,["copyAsImage"],-null,K);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(p,F,K):this.addPopupMenuArrangeItems(p,F,K),this.addMenuItems(p,"- cut copy copyAsImage duplicate -".split(" "),null,K),this.isShowCellEditItems()||this.addPopupDeleteItem(p,F,K),this.addMenuItems(p,["lockUnlock","-"],null,K),!this.isShowStyleItems()){if(1==e.getSelectionCount()&&!e.isCellLocked(F)&&e.isCellEditable(F)&&(this.addSubmenu("editCell",p,null,mxResources.get("edit")),p.addSeparator(),e.getModel().isEdge(F))){this.addSubmenu("line",-p);var M=e.getModel().getGeometry(F);null!=M&&null!=M.points&&0<M.points.length&&this.addMenuItems(p,["clearWaypoints"],null,K)}1==e.getSelectionCount()&&this.addMenuItems(p,["enterGroup"],null,K);M=c.getSelectionState();null!=M.mergeCell?this.addMenuItem(p,"mergeCells"):(1<M.style.colspan||1<M.style.rowspan)&&this.addMenuItem(p,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=-function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.defaultFilename=mxResources.get("untitledDiagram");var P=e.getExportVariables;e.getExportVariables=function(){var p=P.apply(this,arguments),F=c.getCurrentFile();null!=F&&(p.filename=F.getTitle());p.pagecount=null!=c.pages?c.pages.length:1;p.page=null!=c.currentPage?c.currentPage.getName():"";p.pagenumber=null!=c.pages&&null!=c.currentPage?-mxUtils.indexOf(c.pages,c.currentPage)+1:1;return p};var J=e.getGlobalVariable;e.getGlobalVariable=function(p){var F=c.getCurrentFile();return"filename"==p&&null!=F?F.getTitle():"page"==p&&null!=c.currentPage?c.currentPage.getName():"pagenumber"==p?null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==p?null!=c.pages?c.pages.length:1:J.apply(this,arguments)};var m=null,v=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var p=this.getCurrentFile(),-F=null!=p&&null!=p.getTitle()?p.getTitle():this.defaultFilename;m!=F&&p==v&&(e.invalidateDescendantsWithPlaceholders(e.model.getRoot()),e.view.validate());m=F;v=p}));var z=e.labelLinkClicked;e.labelLinkClicked=function(p,F,K){var M=F.getAttribute("href");if(null==M||!e.isCustomLink(M)||!mxEvent.isTouchEvent(K)&&mxEvent.isPopupTrigger(K))z.apply(this,arguments);else{if(!e.isEnabled()||null!=p&&e.isCellLocked(p.cell))e.customLinkClicked(M),e.getRubberband().reset();mxEvent.consume(K)}};this.editor.getOrCreateFilename=-function(){var p=c.defaultFilename,F=c.getCurrentFile();null!=F&&(p=null!=F.getTitle()?F.getTitle():p);return p};var B=this.actions.get("print");B.setEnabled(!mxClient.IS_IOS||!navigator.standalone);B.visible=B.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),+null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var y=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,e=this.editor.graph,k=e.isEnabled;e.isEnabled=function(){return k.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(e.panningHandler.isPanningTrigger=function(p){var G=p.getEvent();return null==p.getState()&&!mxEvent.isMouseEvent(G)&&+!e.freehand.isDrawing()||mxEvent.isPopupTrigger(G)&&(null==p.getState()||mxEvent.isControlDown(G)||mxEvent.isShiftDown(G))});e.cellEditor.editPlantUmlData=function(p,G,J){var L=JSON.parse(J);G=new TextareaDialog(c,mxResources.get("plantUml")+":",L.data,function(R){null!=R&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(R,L.format,function(S,V,W){c.spinner.stop();e.getModel().beginUpdate();try{if("txt"==L.format)e.labelChanged(p,"<pre>"+S+"</pre>"),e.updateCellSize(p,+!0);else{e.setCellStyles("image",c.convertDataUri(S),[p]);var X=e.model.getGeometry(p);null!=X&&(X=X.clone(),X.width=V,X.height=W,e.cellsResized([p],[X],!1))}e.setAttributeForCell(p,"plantUmlData",JSON.stringify({data:R,format:L.format}))}finally{e.getModel().endUpdate()}},function(S){c.handleError(S)})},null,null,400,220);c.showDialog(G.container,420,300,!0,!0);G.init()};e.cellEditor.editMermaidData=function(p,G,J){var L=JSON.parse(J);G=new TextareaDialog(c,mxResources.get("mermaid")+":",L.data,+function(R){null!=R&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(R,L.config,function(S,V,W){c.spinner.stop();e.getModel().beginUpdate();try{e.setCellStyles("image",S,[p]);var X=e.model.getGeometry(p);null!=X&&(X=X.clone(),X.width=Math.max(X.width,V),X.height=Math.max(X.height,W),e.cellsResized([p],[X],!1));e.setAttributeForCell(p,"mermaidData",JSON.stringify({data:R,config:L.config},null,2))}finally{e.getModel().endUpdate()}},function(S){c.handleError(S)})},+null,null,400,220);c.showDialog(G.container,420,300,!0,!0);G.init()};var n=e.cellEditor.startEditing;e.cellEditor.startEditing=function(p,G){try{var J=this.graph.getAttributeForCell(p,"plantUmlData");if(null!=J)this.editPlantUmlData(p,G,J);else if(J=this.graph.getAttributeForCell(p,"mermaidData"),null!=J&&window.isMermaidEnabled)this.editMermaidData(p,G,J);else{var L=e.getCellStyle(p);"1"==mxUtils.getValue(L,"metaEdit","0")?c.showDataDialog(p):n.apply(this,arguments)}}catch(R){c.handleError(R)}};+e.getLinkTitle=function(p){return c.getLinkTitle(p)};e.customLinkClicked=function(p,G){var J=!1;try{var L=this.getGraphBounds();c.handleCustomLink(p,G);J=!0;c.chromelessResize&&!L.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(G))}catch(R){c.handleError(R)}return J};var q=e.parseBackgroundImage;e.parseBackgroundImage=function(p){var G=q.apply(this,arguments);null!=G&&null!=G.src&&Graph.isPageLink(G.src)&&(G={originalSrc:G.src});return G};var u=e.setBackgroundImage;e.setBackgroundImage=+function(p){null!=p&&null!=p.originalSrc&&(p=c.createImageForPageLink(p.originalSrc,c.currentPage,this));u.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){e.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){e.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(p,G){p=null!=e.backgroundImage?e.backgroundImage.originalSrc:null;if(null!=p){var J=p.indexOf(",");if(0<J)for(p=p.substring(J++1),G=G.getProperty("patches"),J=0;J<G.length;J++)if(null!=G[J][EditorUi.DIFF_UPDATE]&&null!=G[J][EditorUi.DIFF_UPDATE][p]||null!=G[J][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(G[J][EditorUi.DIFF_REMOVE],p)){e.refreshBackgroundImage();break}}}));var A=e.getBackgroundImageObject;e.getBackgroundImageObject=function(p,G){var J=A.apply(this,arguments);null!=J&&null!=J.originalSrc&&(J=G?c.createImageForPageLink(J.originalSrc,null,null,!0):{src:J.originalSrc});return J};this.isOffline()||"undefined"===typeof window.EditDataDialog||+(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var D=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(p){p=null!=p?p:"";"1"==urlParams.dev&&(p+=(0<p.length?"&":"?")+"dev=1");return D.apply(this,arguments)};var F=e.addClickHandler;e.addClickHandler=function(p,G,J){var L=G;G=+function(R,S,V){if(null==S){var W=mxEvent.getSource(R);"a"==W.nodeName.toLowerCase()&&(S=W.getAttribute("href"))}null!=S&&e.isCustomLink(S)&&(mxEvent.isTouchEvent(R)||!mxEvent.isPopupTrigger(R))&&e.customLinkClicked(S,V)&&mxEvent.consume(R);null!=L&&L(R,S,V)};F.call(this,p,G,J)};y.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(e.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var E=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(p,G,J){e.isSelectionEmpty()&&+"simple"==Editor.currentTheme&&this.addMenuItems(p,["zoomIn","zoomOut","-"],null,J);E.apply(this,arguments);e.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(p,["-","addToScratchpad"],null,J);e.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(p,["-","exitGroup","home"],null,J)};var U=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(p,G,J){if(c.editor.graph.isSelectionEmpty())U.apply(this,arguments),c.menus.addMenuItems(p,["copyAsImage"],+null,J);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(p,G,J):this.addPopupMenuArrangeItems(p,G,J),this.addMenuItems(p,"- cut copy copyAsImage duplicate -".split(" "),null,J),this.isShowCellEditItems()||this.addPopupDeleteItem(p,G,J),this.addMenuItems(p,["lockUnlock","-"],null,J),!this.isShowStyleItems()){if(1==e.getSelectionCount()&&!e.isCellLocked(G)&&e.isCellEditable(G)&&(this.addSubmenu("editCell",p,null,mxResources.get("edit")),p.addSeparator(),e.getModel().isEdge(G))){this.addSubmenu("line",+p);var L=e.getModel().getGeometry(G);null!=L&&null!=L.points&&0<L.points.length&&this.addMenuItems(p,["clearWaypoints"],null,J)}1==e.getSelectionCount()&&this.addMenuItems(p,["enterGroup"],null,J);L=c.getSelectionState();null!=L.mergeCell?this.addMenuItem(p,"mergeCells"):(1<L.style.colspan||1<L.style.rowspan)&&this.addMenuItem(p,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=+function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.defaultFilename=mxResources.get("untitledDiagram");var P=e.getExportVariables;e.getExportVariables=function(){var p=P.apply(this,arguments),G=c.getCurrentFile();null!=G&&(p.filename=G.getTitle());p.pagecount=null!=c.pages?c.pages.length:1;p.page=null!=c.currentPage?c.currentPage.getName():"";p.pagenumber=null!=c.pages&&null!=c.currentPage?+mxUtils.indexOf(c.pages,c.currentPage)+1:1;return p};var M=e.getGlobalVariable;e.getGlobalVariable=function(p){var G=c.getCurrentFile();return"filename"==p&&null!=G?G.getTitle():"page"==p&&null!=c.currentPage?c.currentPage.getName():"pagenumber"==p?null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==p?null!=c.pages?c.pages.length:1:M.apply(this,arguments)};var m=null,v=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var p=this.getCurrentFile(),+G=null!=p&&null!=p.getTitle()?p.getTitle():this.defaultFilename;m!=G&&p==v&&(e.invalidateDescendantsWithPlaceholders(e.model.getRoot()),e.view.validate());m=G;v=p}));var z=e.labelLinkClicked;e.labelLinkClicked=function(p,G,J){var L=G.getAttribute("href");if(null==L||!e.isCustomLink(L)||!mxEvent.isTouchEvent(J)&&mxEvent.isPopupTrigger(J))z.apply(this,arguments);else{if(!e.isEnabled()||null!=p&&e.isCellLocked(p.cell))e.customLinkClicked(L),e.getRubberband().reset();mxEvent.consume(J)}};this.editor.getOrCreateFilename=+function(){var p=c.defaultFilename,G=c.getCurrentFile();null!=G&&(p=null!=G.getTitle()?G.getTitle():p);return p};var B=this.actions.get("print");B.setEnabled(!mxClient.IS_IOS||!navigator.standalone);B.visible=B.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]=-"synchronize","1"==urlParams.embedInline&&e.addListener(mxEvent.ESCAPE,function(p,F){null!=F&&e.isEnabled()&&!e.isEditing()&&null!=F.getProperty("event")&&c.actions.get("exit").funct()}),this.installImagePasteHandler(),this.installNativeClipboardHandler();this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateUserElement()}));this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&e.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(p){var F=e.cellEditor.text2,-K=null;null!=F&&(mxEvent.addListener(F,"dragleave",function(M){null!=K&&(K.parentNode.removeChild(K),K=null);M.stopPropagation();M.preventDefault()}),mxEvent.addListener(F,"dragover",mxUtils.bind(this,function(M){null==K&&(!mxClient.IS_IE||10<document.documentMode)&&(K=this.highlightElement(F));M.stopPropagation();M.preventDefault()})),mxEvent.addListener(F,"drop",mxUtils.bind(this,function(M){null!=K&&(K.parentNode.removeChild(K),K=null);if(0<M.dataTransfer.files.length)this.importFiles(M.dataTransfer.files,-0,0,this.maxImageSize,function(S,V,W,X,Y,Z){e.insertImage(S,Y,Z)},function(){},function(S){return"image/"==S.type.substring(0,6)},function(S){for(var V=0;V<S.length;V++)S[V]()},mxEvent.isControlDown(M));else if(0<=mxUtils.indexOf(M.dataTransfer.types,"text/uri-list")){var R=M.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(R)?this.loadImage(decodeURIComponent(R),mxUtils.bind(this,function(S){var V=Math.max(1,S.width);S=Math.max(1,S.height);var W=this.maxImageSize;W=Math.min(1,-Math.min(W/Math.max(1,V)),W/Math.max(1,S));e.insertImage(decodeURIComponent(R),V*W,S*W)})):document.execCommand("insertHTML",!1,M.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(M.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,M.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(M.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,M.dataTransfer.getData("text/plain"));M.stopPropagation();M.preventDefault()})))}));if(Editor.isSettingsEnabled()){B=-this.editor.graph.view;var H=mxSettings.getUnit();B.setUnit(H);Editor.pageSizeUnit=H==mxConstants.METERS?mxConstants.MILLIMETERS:H;B.addListener("unitChanged",function(p,F){p=F.getProperty("unit");mxSettings.setUnit(p);mxSettings.save();Editor.pageSizeUnit=p==mxConstants.METERS?mxConstants.MILLIMETERS:p});this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,B.unit);+"synchronize","1"==urlParams.embedInline&&e.addListener(mxEvent.ESCAPE,function(p,G){null!=G&&e.isEnabled()&&!e.isEditing()&&null!=G.getProperty("event")&&c.actions.get("exit").funct()}),this.installImagePasteHandler(),this.installNativeClipboardHandler();this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateUserElement()}));this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&e.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(p){var G=e.cellEditor.text2,+J=null;null!=G&&(mxEvent.addListener(G,"dragleave",function(L){null!=J&&(J.parentNode.removeChild(J),J=null);L.stopPropagation();L.preventDefault()}),mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(L){null==J&&(!mxClient.IS_IE||10<document.documentMode)&&(J=this.highlightElement(G));L.stopPropagation();L.preventDefault()})),mxEvent.addListener(G,"drop",mxUtils.bind(this,function(L){null!=J&&(J.parentNode.removeChild(J),J=null);if(0<L.dataTransfer.files.length)this.importFiles(L.dataTransfer.files,+0,0,this.maxImageSize,function(S,V,W,X,Y,Z){e.insertImage(S,Y,Z)},function(){},function(S){return"image/"==S.type.substring(0,6)},function(S){for(var V=0;V<S.length;V++)S[V]()},mxEvent.isControlDown(L));else if(0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")){var R=L.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(R)?this.loadImage(decodeURIComponent(R),mxUtils.bind(this,function(S){var V=Math.max(1,S.width);S=Math.max(1,S.height);var W=this.maxImageSize;W=Math.min(1,+Math.min(W/Math.max(1,V)),W/Math.max(1,S));e.insertImage(decodeURIComponent(R),V*W,S*W)})):document.execCommand("insertHTML",!1,L.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(L.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,L.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(L.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,L.dataTransfer.getData("text/plain"));L.stopPropagation();L.preventDefault()})))}));if(Editor.isSettingsEnabled()){B=+this.editor.graph.view;var H=mxSettings.getUnit();B.setUnit(H);Editor.pageSizeUnit=H==mxConstants.METERS?mxConstants.MILLIMETERS:H;B.addListener("unitChanged",function(p,G){p=G.getProperty("unit");mxSettings.setUnit(p);mxSettings.save();Editor.pageSizeUnit=p==mxConstants.METERS?mxConstants.MILLIMETERS:p});this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,B.unit);this.refresh()}if("1"==urlParams.styledev){B=document.getElementById("geFooter");null!=B&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),-this.styleInput.value)})),B.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(p,F){0<this.editor.graph.getSelectionCount()?(p=this.editor.graph.getSelectionCell(),p=this.editor.graph.getModel().getStyle(p),this.styleInput.value=p||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var T=this.isSelectionAllowed;this.isSelectionAllowed=function(p){return mxEvent.getSource(p)==this.styleInput?+this.styleInput.value)})),B.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(p,G){0<this.editor.graph.getSelectionCount()?(p=this.editor.graph.getSelectionCell(),p=this.editor.graph.getModel().getStyle(p),this.styleInput.value=p||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var T=this.isSelectionAllowed;this.isSelectionAllowed=function(p){return mxEvent.getSource(p)==this.styleInput?!0:T.apply(this,arguments)}}B=document.getElementById("geInfo");null!=B&&B.parentNode.removeChild(B);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var g=null;mxEvent.addListener(e.container,"dragleave",function(p){e.isEnabled()&&(null!=g&&(g.parentNode.removeChild(g),g=null),p.stopPropagation(),p.preventDefault())});mxEvent.addListener(e.container,"dragover",mxUtils.bind(this,function(p){null==g&&(!mxClient.IS_IE||10<document.documentMode)&&(g=this.highlightElement(e.container));-null!=this.sidebar&&this.sidebar.hideTooltip();p.stopPropagation();p.preventDefault()}));mxEvent.addListener(e.container,"drop",mxUtils.bind(this,function(p){null!=g&&(g.parentNode.removeChild(g),g=null);if(e.isEnabled()){var F=mxUtils.convertPoint(e.container,mxEvent.getClientX(p),mxEvent.getClientY(p)),K=p.dataTransfer.files,M=e.view.translate,R=e.view.scale,S=F.x/R-M.x,V=F.y/R-M.y;if(0<K.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(p)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&-this.fileLoaded(null),this.openFiles(K,!0)):(mxEvent.isAltDown(p)&&(V=S=null),this.importFiles(K,S,V,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(p),null,null,mxEvent.isShiftDown(p),p));else{mxEvent.isAltDown(p)&&(V=S=0);var W=0<=mxUtils.indexOf(p.dataTransfer.types,"text/uri-list")?p.dataTransfer.getData("text/uri-list"):null;F=this.extractGraphModelFromEvent(p,null!=this.pages);if(null!=F)e.setSelectionCells(this.importXml(F,S,V,!0));else if(0<=mxUtils.indexOf(p.dataTransfer.types,-"text/html")){var X=p.dataTransfer.getData("text/html");F=document.createElement("div");F.innerHTML=Graph.sanitizeHtml(X);var Y=null;K=F.getElementsByTagName("img");null!=K&&1==K.length?(X=K[0].getAttribute("src"),null==X&&(X=K[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(X)||(Y=!0)):(K=F.getElementsByTagName("a"),null!=K&&1==K.length?X=K[0].getAttribute("href"):(F=F.getElementsByTagName("pre"),null!=F&&1==F.length&&(X=mxUtils.getTextContent(F[0]))));var Z=!0,ba=mxUtils.bind(this,-function(){e.setSelectionCells(this.insertTextAt(X,S,V,!0,Y,null,Z,mxEvent.isControlDown(p)))});Y&&null!=X&&X.length>this.resampleThreshold?this.confirmImageResize(function(ha){Z=ha;ba()},mxEvent.isControlDown(p)):ba()}else null!=W&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(W)?this.loadImage(decodeURIComponent(W),mxUtils.bind(this,function(ha){var ca=Math.max(1,ha.width);ha=Math.max(1,ha.height);var da=this.maxImageSize;da=Math.min(1,Math.min(da/Math.max(1,ca)),da/Math.max(1,ha));e.setSelectionCell(e.insertVertex(null,-null,"",S,V,ca*da,ha*da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+W+";"))}),mxUtils.bind(this,function(ha){e.setSelectionCells(this.insertTextAt(W,S,V,!0))})):0<=mxUtils.indexOf(p.dataTransfer.types,"text/plain")&&e.setSelectionCells(this.insertTextAt(p.dataTransfer.getData("text/plain"),S,V,!0))}}p.stopPropagation();p.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",-mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&e.view.validateBackground()});e.addListener("enabledChanged",mxUtils.bind(this,function(){e.isEnabled()||this.hideShapePicker()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var p=parseInt(this.div.offsetLeft),F=-parseInt(this.div.offsetWidth),K=c.embedViewport.x+c.embedViewport.width,M=parseInt(this.div.offsetTop),R=parseInt(this.div.offsetHeight),S=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(p,K-F))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(M,S-R))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};+null!=this.sidebar&&this.sidebar.hideTooltip();p.stopPropagation();p.preventDefault()}));mxEvent.addListener(e.container,"drop",mxUtils.bind(this,function(p){null!=g&&(g.parentNode.removeChild(g),g=null);if(e.isEnabled()){var G=mxUtils.convertPoint(e.container,mxEvent.getClientX(p),mxEvent.getClientY(p)),J=p.dataTransfer.files,L=e.view.translate,R=e.view.scale,S=G.x/R-L.x,V=G.y/R-L.y;if(0<J.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(p)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&+this.fileLoaded(null),this.openFiles(J,!0)):(mxEvent.isAltDown(p)&&(V=S=null),this.importFiles(J,S,V,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(p),null,null,mxEvent.isShiftDown(p),p));else{mxEvent.isAltDown(p)&&(V=S=0);var W=0<=mxUtils.indexOf(p.dataTransfer.types,"text/uri-list")?p.dataTransfer.getData("text/uri-list"):null;G=this.extractGraphModelFromEvent(p,null!=this.pages);if(null!=G)e.setSelectionCells(this.importXml(G,S,V,!0));else if(0<=mxUtils.indexOf(p.dataTransfer.types,+"text/html")){var X=p.dataTransfer.getData("text/html");G=document.createElement("div");G.innerHTML=Graph.sanitizeHtml(X);var Y=null;J=G.getElementsByTagName("img");null!=J&&1==J.length?(X=J[0].getAttribute("src"),null==X&&(X=J[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(X)||(Y=!0)):(J=G.getElementsByTagName("a"),null!=J&&1==J.length?X=J[0].getAttribute("href"):(G=G.getElementsByTagName("pre"),null!=G&&1==G.length&&(X=mxUtils.getTextContent(G[0]))));var Z=!0,ba=mxUtils.bind(this,+function(){e.setSelectionCells(this.insertTextAt(X,S,V,!0,Y,null,Z,mxEvent.isControlDown(p)))});Y&&null!=X&&X.length>this.resampleThreshold?this.confirmImageResize(function(fa){Z=fa;ba()},mxEvent.isControlDown(p)):ba()}else null!=W&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(W)?this.loadImage(decodeURIComponent(W),mxUtils.bind(this,function(fa){var ca=Math.max(1,fa.width);fa=Math.max(1,fa.height);var da=this.maxImageSize;da=Math.min(1,Math.min(da/Math.max(1,ca)),da/Math.max(1,fa));e.setSelectionCell(e.insertVertex(null,+null,"",S,V,ca*da,fa*da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+W+";"))}),mxUtils.bind(this,function(fa){e.setSelectionCells(this.insertTextAt(W,S,V,!0))})):0<=mxUtils.indexOf(p.dataTransfer.types,"text/plain")&&e.setSelectionCells(this.insertTextAt(p.dataTransfer.getData("text/plain"),S,V,!0))}}p.stopPropagation();p.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",+mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&e.view.validateBackground()});e.addListener("enabledChanged",mxUtils.bind(this,function(){e.isEnabled()||this.hideShapePicker()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var p=parseInt(this.div.offsetLeft),G=+parseInt(this.div.offsetWidth),J=c.embedViewport.x+c.embedViewport.width,L=parseInt(this.div.offsetTop),R=parseInt(this.div.offsetHeight),S=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(p,J-G))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(L,S-R))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme)B=Editor.currentTheme,Editor.currentTheme="",this.doSetCurrentTheme(B,mxUtils.bind(this,function(){"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<Editor.smallScreenWidth&&this.toggleFormatPanel(!1);this.fireEvent(new mxEventObject("themeInitialized"))}));if("atlas"!=Editor.currentTheme&&(B=!1,null!=urlParams.dark?B=urlParams.dark:"dark"==Editor.currentTheme?B=!0:Editor.isSettingsEnabled()&&"1"!=urlParams.embed&&(B=mxSettings.settings.darkMode),"auto"==B&&this.isAutoDarkModeSupported()&&(B=window.matchMedia("(prefers-color-scheme: dark)").matches),this.setDarkMode("string"===typeof B?"1"==B:B),this.isAutoDarkModeSupported()))try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(p){this.isAutoDarkMode()&&this.setDarkMode(p.matches)}))}catch(p){this.actions.get("autoMode").setEnabled(!1)}"1"==-urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast&&this.setHighContrast(mxSettings.settings.highContrast);this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(p,F){e.enableFlowAnimation=Editor.enableAnimations;e.refresh()}));e.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&+urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast&&this.setHighContrast(mxSettings.settings.highContrast);this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(p,G){e.enableFlowAnimation=Editor.enableAnimations;e.refresh()}));e.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts()};var x=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,e=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=e&&c<e?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<e&&c>=e&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));this.lastWindowWidth=c}x.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,e=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,n=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(E){mxEvent.getSource(E)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(E),mxEvent.getClientY(E)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var q=-document.createElement("div");q.style.position="absolute";q.style.width="10px";q.style.height="10px";q.style.borderRadius="5px";q.style.border="1px solid gray";q.style.background="#ffffff";q.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(q);this.bottomResizer=q;var u=null,A=null,D=null,G=null;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(E){G=parseInt(this.diagramContainer.style.height);A=mxEvent.getClientY(E);n.popupMenuHandler.hideMenu();mxEvent.consume(E)}));+document.createElement("div");q.style.position="absolute";q.style.width="10px";q.style.height="10px";q.style.borderRadius="5px";q.style.border="1px solid gray";q.style.background="#ffffff";q.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(q);this.bottomResizer=q;var u=null,A=null,D=null,F=null;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(E){F=parseInt(this.diagramContainer.style.height);A=mxEvent.getClientY(E);n.popupMenuHandler.hideMenu();mxEvent.consume(E)}));q=q.cloneNode(!1);q.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(q);this.rightResizer=q;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(E){D=parseInt(this.diagramContainer.style.width);u=mxEvent.getClientX(E);n.popupMenuHandler.hideMenu();mxEvent.consume(E)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(E){var U=!1;null!=u&&(this.diagramContainer.style.width=Math.max(20,D+mxEvent.getClientX(E)-u)+"px",U=!0);null!=A&&(this.diagramContainer.style.height=-Math.max(20,G+mxEvent.getClientY(E)-A)+"px",U=!0);U&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(E){null==u&&null==A||mxEvent.consume(E);A=u=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility=+Math.max(20,F+mxEvent.getClientY(E)-A)+"px",U=!0);U&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(E){null==u&&null==A||mxEvent.consume(E);A=u=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";e.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(E){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(E){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";e.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(e){if(!mxEvent.isConsumed(e))try{for(var k=e.clipboardData||e.originalEvent.clipboardData,n=!1,q=0;q<k.types.length;q++)if("text/"===k.types[q].substring(0,5)){n=!0;break}if(!n){var u=-k.items;for(index in u){var A=u[index];if("file"===A.kind){if(c.isEditing())this.importFiles([A.getAsFile()],0,0,this.maxImageSize,function(G,E,U,P,J,m){c.insertImage(G,J,m)},function(){},function(G){return"image/"==G.type.substring(0,6)},function(G){for(var E=0;E<G.length;E++)G[E]()});else{var D=this.editor.graph.getInsertPoint();this.importFiles([A.getAsFile()],D.x,D.y,this.maxImageSize);mxEvent.consume(e)}break}}}}catch(G){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=+k.items;for(index in u){var A=u[index];if("file"===A.kind){if(c.isEditing())this.importFiles([A.getAsFile()],0,0,this.maxImageSize,function(F,E,U,P,M,m){c.insertImage(F,M,m)},function(){},function(F){return"image/"==F.type.substring(0,6)},function(F){for(var E=0;E<F.length;E++)F[E]()});else{var D=this.editor.graph.getInsertPoint();this.importFiles([A.getAsFile()],D.x,D.y,this.maxImageSize);mxEvent.consume(e)}break}}}}catch(F){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)}var e=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";var n=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(u){var A=mxEvent.getSource(u);null==e.container||!e.isEnabled()||e.isMouseDown||e.isEditing()||null!=this.dialog||"INPUT"==A.nodeName||"TEXTAREA"==A.nodeName||"true"==A.contentEditable||224!=u.keyCode&&(mxClient.IS_MAC||17!=u.keyCode)&&(!mxClient.IS_MAC||91!=u.keyCode&&93!=u.keyCode)||n||(k.style.left=e.container.scrollLeft+10+"px",k.style.top=e.container.scrollTop+10+"px",u=e.container.scrollLeft,A=e.container.scrollTop,e.container.appendChild(k),n=!0,k.focus(),document.execCommand("selectAll",!1,null),e.container.scrollLeft=u,e.container.scrollTop=A)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(u){var A=u.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=A&&17!=A&&91!=A&&93!=A||(n=!1,e.isEditing()||null!=this.dialog||null==e.container||e.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(u){if(e.isEnabled())try{mxClipboard.copy(e),this.copyCells(k),c()}catch(A){this.handleError(A)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(u){if(e.isEnabled())try{mxClipboard.copy(e),this.copyCells(k,!0),c()}catch(A){this.handleError(A)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(u){if(e.isEnabled()&&!e.isCellLocked(e.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=u.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(u,k,!0,!0)),!mxEvent.isConsumed(u)){var A=e.container.scrollLeft,D=e.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{e.container.scrollLeft=A,e.container.scrollTop=D,Graph.removePasteFormatting(k.firstChild),-this.pasteCells(u,k,!1,!0)}catch(G){this.handleError(G)}}),0)}}catch(G){this.handleError(G)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(u){return mxEvent.getSource(u)==k?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,e){mxSettings.setUi(c);(e=this.doSetCurrentTheme(c)||e)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=+this.pasteCells(u,k,!1,!0)}catch(F){this.handleError(F)}}),0)}}catch(F){this.handleError(F)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(u){return mxEvent.getSource(u)==k?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,e){mxSettings.setUi(c);(e=this.doSetCurrentTheme(c)||e)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,e){function k(D){return"simple"==D||"sketch"==D}var n=Editor.currentTheme,q=k(n)&&this.isDefaultTheme(c)||this.isDefaultTheme(n)&&k(c),u=q&&"sketch"!=c&&"sketch"!=n;if(q&&!this.themeSwitching){var A=this.saveScrollState();this.editor.graph.stopEditing(!1);this.container.style.opacity=0;Editor.currentTheme=c;this.themeSwitching=!0;window.setTimeout(mxUtils.bind(this,function(){k(n)&&this.isDefaultTheme(c)?(this.menubarContainer.style.display="",this.toolbarContainer.style.display="block",this.tabContainer.style.display="flex",this.hsplit.style.display="block",this.menubarHeight=App.prototype.menubarHeight):this.isDefaultTheme(n)&&k(c)&&(this.menubarContainer.style.display="none",this.toolbarContainer.style.display="none",this.menubarHeight=0,"simple"!=c?(this.tabContainer.style.display="none",this.hsplit.style.display="none",this.hsplitPosition=0):this.tabContainer.style.display="flex");this.switchTheme(c);this.fireEvent(new mxEventObject("currentThemeChanged"));this.editor.fireEvent(new mxEventObject("statusChanged"));this.editor.graph.refresh();this.restoreScrollState(A);this.container.style.opacity="";delete this.themeSwitching;isLocalStorage&&k(c)&&this.setTabContainerVisible(null!=mxSettings.settings.pages?mxSettings.settings.pages:!0);null!=e&&e()}),0)}return u};EditorUi.prototype.saveScrollState=function(){var c=this.editor.graph.view.translate,e=this.diagramContainer.scrollLeft,k=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(e-=this.embedViewport.x,k-=this.embedViewport.y):@@ -13319,7 +13321,7 @@ this.div.style.left=parseInt(this.div.style.left)+n-140+"px"):(this.div.style.wi(c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,(1200>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)||708>c)&&this.formatWindow.window.toggleMinimized()):this.formatWindow.window.setVisible(!1)}};var C=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var e=this.formatWindow;null!=e?e.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):C.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var e=EditorUi.prototype.hsplitPosition;0==e&&(e=this.defaultSidebarWidth);var k=this.hsplitPosition,n=mxUtils.bind(this,function(){this.hsplitPosition=q;this.refresh();this.diagramContainer.scrollLeft-=k-this.hsplitPosition}),q=c?e:0;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==q?"translateX(0)":"translateX(-100%)");0!=q&&n();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==q?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform 0.3s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==q&&n()}),-300)}),10)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var L=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():L.apply(this,arguments)};var N=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(c){if(null!=this.sketchWrapperElt&&null!=this.sketchWrapperElt.parentNode){c=null!=c?c:!0;if("1"!=urlParams.embedInline){var e=this.container.clientWidth;this.container==+300)}),10)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var K=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():K.apply(this,arguments)};var N=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(c){if(null!=this.sketchWrapperElt&&null!=this.sketchWrapperElt.parentNode){c=null!=c?c:!0;if("1"!=urlParams.embedInline){var e=this.container.clientWidth;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth);var k=this.getDiagramContainerOffset();var n=k.x;var q=k.y;"simple"==Editor.currentTheme&&(q+=this.sketchMainMenuElt.offsetHeight);this.diagramContainer.style.top=q+"px";this.diagramContainer.style.bottom="0";"simple"==Editor.currentTheme?(this.hsplit.style.top=this.sketchMainMenuElt.offsetHeight+"px",this.sidebarContainer.style.top=this.hsplit.style.top,this.formatContainer.style.top=this.hsplit.style.top,e=Math.max(0,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-this.formatWidth,Math.min(this.hsplitPosition,e-this.splitSize-40))),this.sidebarContainer.style.width=e+"px",this.diagramContainer.style.left=e+n+"px",this.tabContainer.style.left=e+"px",this.tabContainer.style.right=this.formatWidth+1+"px",this.sketchMainMenuElt.style.left="0px",this.sketchMainMenuElt.style.right="0px",this.hsplit.style.left=e+"px",this.diagramContainer.style.right=this.formatWidth+"px",this.formatContainer.style.width=this.formatWidth+"px",this.hsplit.style.bottom=this.tabContainer.offsetHeight+"px",this.diagramContainer.style.bottom=this.hsplit.style.bottom,this.checkTabScrollerOverflow()):(this.diagramContainer.style.left=k.x+"px",this.diagramContainer.style.right="0")}c&&this.editor.graph.sizeDidChange()}else N.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var e=mxUtils.bind(this,function(n){n=this.createMenu(n,null,"geTitle");n.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";@@ -13351,25 +13353,25 @@ this.addListener("copyConnectChanged",mxUtils.bind(this,function(e,k){mxSettingsc.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(e,k){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(e,k){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(e,k){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(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.copyImage=function(c,e,k){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,-function(n,q){try{this.spinner.stop();var u=this.createImageDataUri(n,e,"png"),A=parseInt(q.getAttribute("width")),D=parseInt(q.getAttribute("height"));this.writeImageToClipboard(u,A,D,mxUtils.bind(this,function(G){this.handleError(G)}))}catch(G){this.handleError(G)}}),null,null,null,mxUtils.bind(this,function(n){this.spinner.stop();this.handleError(n)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?+function(n,q){try{this.spinner.stop();var u=this.createImageDataUri(n,e,"png"),A=parseInt(q.getAttribute("width")),D=parseInt(q.getAttribute("height"));this.writeImageToClipboard(u,A,D,mxUtils.bind(this,function(F){this.handleError(F)}))}catch(F){this.handleError(F)}}),null,null,null,mxUtils.bind(this,function(n){this.spinner.stop();this.handleError(n)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(n){this.handleError(n)}};EditorUi.prototype.copyCells=function(c,e){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var n=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),q=mxUtils.getXml(k.encodeCells(n));mxUtils.setTextContent(c,encodeURIComponent(q));e?(k.removeCells(n,!1),k.lastPasteXml=null):(k.lastPasteXml=q,k.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeCipboard){var e=this.editor.graph;e.isSelectionEmpty()||(c=mxUtils.sortCells(e.getExportableCells(e.model.getTopmostCells(e.getSelectionCells()))),e=mxUtils.getXml(e.encodeCells(c)),navigator.clipboard.writeText(e))}return c};EditorUi.prototype.pasteXml=function(c,e,k,n,q){q=null!=q?q:!0;var u=this.editor.graph,A=null;u.lastPasteXml==c?u.pasteCounter++:(u.lastPasteXml=c,u.pasteCounter=0);var D=u.pasteCounter*u.gridSize;if(k||this.isCompatibleString(c))A=this.importXml(c,D,D),u.setSelectionCells(A);else if(e&&1==u.getSelectionCount()){q=u.getStartEditingCell(u.getSelectionCell(),n);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==u.getCurrentCellStyle(q)[mxConstants.STYLE_SHAPE])u.setCellStyles(mxConstants.STYLE_IMAGE,c,[q]);else{u.model.beginUpdate();try{u.labelChanged(q,c),Graph.isLink(c)&&u.setLinkForCell(q,c)}finally{u.model.endUpdate()}}u.setSelectionCell(q)}else A=u.getInsertPoint(),u.isMouseInsertPoint()&&(D=0,u.lastPasteXml==c&&0<u.pasteCounter&&u.pasteCounter--),A=this.insertTextAt(c,A.x+D,-A.y+D,q),u.setSelectionCells(A);u.isSelectionEmpty()||(u.scrollCellToVisible(u.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(u.view.getState(u.getSelectionCell())));return A};EditorUi.prototype.pasteCells=function(c,e,k,n){if(!mxEvent.isConsumed(c)){var q=e,u=!1;if(k&&null!=c.clipboardData&&c.clipboardData.getData){var A=c.clipboardData.getData("text/plain"),D=!1;if(null!=A&&0<A.length&&"%3CmxGraphModel%3E"==A.substring(0,18))try{var G=decodeURIComponent(A);this.isCompatibleString(G)&&-(D=!0,A=G)}catch(v){}D=D?null:c.clipboardData.getData("text/html");null!=D&&0<D.length?(q=this.parseHtmlData(D),u="text/plain"!=q.getAttribute("data-type")):null!=A&&0<A.length&&(q=document.createElement("div"),mxUtils.setTextContent(q,D))}A=q.getElementsByTagName("span");if(null!=A&&0<A.length&&"application/vnd.lucid.chart.objects"===A[0].getAttribute("data-lucid-type"))k=A[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(v){var z=this.editor.graph;+A.y+D,q),u.setSelectionCells(A);u.isSelectionEmpty()||(u.scrollCellToVisible(u.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(u.view.getState(u.getSelectionCell())));return A};EditorUi.prototype.pasteCells=function(c,e,k,n){if(!mxEvent.isConsumed(c)){var q=e,u=!1;if(k&&null!=c.clipboardData&&c.clipboardData.getData){var A=c.clipboardData.getData("text/plain"),D=!1;if(null!=A&&0<A.length&&"%3CmxGraphModel%3E"==A.substring(0,18))try{var F=decodeURIComponent(A);this.isCompatibleString(F)&&+(D=!0,A=F)}catch(v){}D=D?null:c.clipboardData.getData("text/html");null!=D&&0<D.length?(q=this.parseHtmlData(D),u="text/plain"!=q.getAttribute("data-type")):null!=A&&0<A.length&&(q=document.createElement("div"),mxUtils.setTextContent(q,D))}A=q.getElementsByTagName("span");if(null!=A&&0<A.length&&"application/vnd.lucid.chart.objects"===A[0].getAttribute("data-lucid-type"))k=A[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(v){var z=this.editor.graph;z.lastPasteXml==v?z.pasteCounter++:(z.lastPasteXml=v,z.pasteCounter=0);var B=z.pasteCounter*z.gridSize;z.setSelectionCells(this.importXml(v,B,B));z.scrollCellToVisible(z.getSelectionCell())}),mxUtils.bind(this,function(v){this.handleError(v)})),mxEvent.consume(c));else{var E=!1,U="";U=u?null!=q.textContent&&"<mxfile"==q.textContent.substring(0,7)&&"</mxfile>"==q.textContent.substring(q.textContent.length-9)||"<mxGraphModel"==q.textContent.substring(0,13)&&"</mxGraphModel>"==q.textContent.substring(q.textContent.length--15)?q.textContent.replace(/\u00a0/g," "):q.innerHTML:mxUtils.trim(null==q.innerText?mxUtils.getTextContent(q):q.innerText);try{var P=U.lastIndexOf("%3E");0<=P&&P<U.length-3&&(U=U.substring(0,P+3))}catch(v){}try{A=q.getElementsByTagName("span"),(G=null!=A&&0<A.length?mxUtils.trim(decodeURIComponent(A[0].textContent)):decodeURIComponent(U))&&(this.isCompatibleString(G)||0==G.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(E=!0,U=G)}catch(v){}try{if(null!=U&&0<U.length){if(0==U.substring(0,-20).replace(/\s/g,"").indexOf('{"isProtected":')){var J=mxUtils.bind(this,function(){try{U=(new MiroImporter).importMiroJson(JSON.parse(U)),this.pasteXml(U,n,E,c)}catch(v){console.log("Miro import error:",v)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",J):J()}else this.pasteXml(U,n,E,c,u);try{mxEvent.consume(c)}catch(v){}}else if(!k){var m=this.editor.graph;m.lastPasteXml=null;m.pasteCounter=0}}catch(v){this.handleError(v)}}}e.innerHTML=" "};EditorUi.prototype.showPrintDialog=-function(c,e){var k=320;this.editor.graph.isEnabled()&&(k+=40);null!=this.pages&&1<this.pages.length&&(k+=40,this.editor.graph.isEnabled()||(k+=10));null==e||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(k+=20);this.showDialog((new PrintDialog(this,c,e)).container,320,k,!0,!0)};EditorUi.prototype.print=function(c,e){var k=this.editor,n=k.graph,q=this.getPageIndex(this.currentPage),u=null!=q?q+1:1,A=mxUtils.bind(this,function(B,H,T,g){var p=B.useCssTransforms,F=B.currentTranslate,K=B.currentScale,-M=B.view.translate,R=B.view.scale;B.useCssTransforms&&(B.useCssTransforms=!1,B.currentTranslate=new mxPoint(0,0),B.currentScale=1,B.view.translate=new mxPoint(0,0),B.view.scale=1);var S=B.getGraphBounds(),V=0,W=0,X=mxRectangle.fromRectangle(B.pageFormat),Y=e.fit||e.crop||!B.pageVisible,Z=e.scale;X.width=Math.ceil(X.width*B.pageScale);X.height=Math.ceil(X.height*B.pageScale);var ba=1;if(e.fit){ba=e.sheetsAcross;var ha=e.sheetsDown;isNaN(Z)||(X.width=Math.ceil(X.width*Z),X.height=Math.ceil(X.height*-Z));ba=Math.min(X.height*ha/(S.height/B.view.scale),X.width*ba/(S.width/B.view.scale))}else ba=isNaN(Z)?1:Z;ba*=1;!Y&&B.pageVisible?(Z=B.getPageLayout(),V-=Z.x*X.width,W-=Z.y*X.height):Y=!0;e.crop&&(e.selection&&(S=n.getBoundingBox(n.getSelectionCells())),X.width=(S.width+1)*ba/B.view.scale,X.height=(S.height+1)*ba/B.view.scale);X.width=Math.ceil(1*X.width);X.height=Math.ceil(1*X.height);g=null!=g?"page/id,"+g:null;if(null==H){H=PrintDialog.createPrintPreview(B,ba,null,0,V,W,Y);H.title=this.getBaseFilename(!0);+15)?q.textContent.replace(/\u00a0/g," "):q.innerHTML:mxUtils.trim(null==q.innerText?mxUtils.getTextContent(q):q.innerText);try{var P=U.lastIndexOf("%3E");0<=P&&P<U.length-3&&(U=U.substring(0,P+3))}catch(v){}try{A=q.getElementsByTagName("span"),(F=null!=A&&0<A.length?mxUtils.trim(decodeURIComponent(A[0].textContent)):decodeURIComponent(U))&&(this.isCompatibleString(F)||0==F.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(E=!0,U=F)}catch(v){}try{if(null!=U&&0<U.length){if(0==U.substring(0,+20).replace(/\s/g,"").indexOf('{"isProtected":')){var M=mxUtils.bind(this,function(){try{U=(new MiroImporter).importMiroJson(JSON.parse(U)),this.pasteXml(U,n,E,c)}catch(v){console.log("Miro import error:",v)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",M):M()}else this.pasteXml(U,n,E,c,u);try{mxEvent.consume(c)}catch(v){}}else if(!k){var m=this.editor.graph;m.lastPasteXml=null;m.pasteCounter=0}}catch(v){this.handleError(v)}}}e.innerHTML=" "};EditorUi.prototype.showPrintDialog=+function(c,e){var k=320;this.editor.graph.isEnabled()&&(k+=40);null!=this.pages&&1<this.pages.length&&(k+=40,this.editor.graph.isEnabled()||(k+=10));null==e||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(k+=20);this.showDialog((new PrintDialog(this,c,e)).container,320,k,!0,!0)};EditorUi.prototype.print=function(c,e){var k=this.editor,n=k.graph,q=this.getPageIndex(this.currentPage),u=null!=q?q+1:1,A=mxUtils.bind(this,function(B,H,T,g){var p=B.useCssTransforms,G=B.currentTranslate,J=B.currentScale,+L=B.view.translate,R=B.view.scale;B.useCssTransforms&&(B.useCssTransforms=!1,B.currentTranslate=new mxPoint(0,0),B.currentScale=1,B.view.translate=new mxPoint(0,0),B.view.scale=1);var S=B.getGraphBounds(),V=0,W=0,X=mxRectangle.fromRectangle(B.pageFormat),Y=e.fit||e.crop||!B.pageVisible,Z=e.scale;X.width=Math.ceil(X.width*B.pageScale);X.height=Math.ceil(X.height*B.pageScale);var ba=1;if(e.fit){ba=e.sheetsAcross;var fa=e.sheetsDown;isNaN(Z)||(X.width=Math.ceil(X.width*Z),X.height=Math.ceil(X.height*+Z));ba=Math.min(X.height*fa/(S.height/B.view.scale),X.width*ba/(S.width/B.view.scale))}else ba=isNaN(Z)?1:Z;ba*=1;!Y&&B.pageVisible?(Z=B.getPageLayout(),V-=Z.x*X.width,W-=Z.y*X.height):Y=!0;e.crop&&(e.selection&&(S=n.getBoundingBox(n.getSelectionCells())),X.width=(S.width+1)*ba/B.view.scale,X.height=(S.height+1)*ba/B.view.scale);X.width=Math.ceil(1*X.width);X.height=Math.ceil(1*X.height);g=null!=g?"page/id,"+g:null;if(null==H){H=PrintDialog.createPrintPreview(B,ba,null,0,V,W,Y);H.title=this.getBaseFilename(!0);H.pageSelector=!1;H.mathEnabled=!1;V=e.border;isNaN(V)||(H.pageMargin=V);e.selection&&(H.isCellVisible=function(aa){return B.isCellSelected(aa)});var ca=H.writeHead;H.writeHead=function(aa){ca.apply(this,arguments);mxClient.IS_GC&&(aa.writeln('<style type="text/css">'),aa.writeln("@media print {"),aa.writeln(".MathJax svg { shape-rendering: crispEdges; }"),aa.writeln("}"),aa.writeln("</style>"));null!=k.fontCss&&(aa.writeln('<style type="text/css">'),aa.writeln(mxUtils.htmlEntities(k.fontCss,!1,!1,!1)),aa.writeln("</style>"));for(var ia=B.getCustomFonts(),ka=0;ka<ia.length;ka++){var ta=ia[ka].name,sa=ia[ka].url;Graph.isCssFontUrl(sa)?aa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(sa))+'" charset="UTF-8" type="text/css">'):(aa.writeln('<style type="text/css">'),aa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ta)+'";\nsrc: url("'+mxUtils.htmlEntities(sa)+'");\n}'),aa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var da=H.drawBackgroundImage;H.drawBackgroundImage=function(aa){da.apply(this,arguments);null!=aa.node&&(EditorUi.embedSvgImages(aa.node),n.disableSvgLinks(aa.node,function(ia){ia.setAttribute("href","javascript:void(0)")}))}}var ma=H.addGraphFragment;H.addGraphFragment=function(aa,ia,ka,ta,sa,ea){ma.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:sa.classList.add("geDisableMathJax")};e.grid&&(H.gridSize=B.gridSize,H.gridSteps=B.view.gridSteps,H.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:B.view.gridColor);H.open(null,null,T,!0,g,X,e.selection?B.getSelectionCells():null)}else{S=B.background;if(null==S||""==S||S==mxConstants.NONE)S="#ffffff";H.backgroundColor=S;H.autoOrigin=Y;e.grid&&(H.gridSize=B.gridSize,H.gridSteps=B.view.gridSteps,H.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:B.view.gridColor);H.appendGraph(B,ba,V,W,T,!0,g,X,e.selection?B.getSelectionCells():null);T=B.getCustomFonts();if(null!=H.wnd)for(X=0;X<T.length;X++)V=T[X].name,W=T[X].url,Graph.isCssFontUrl(W)?-H.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(W)+'" charset="UTF-8" type="text/css">'):(H.wnd.document.writeln('<style type="text/css">'),H.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(V)+'";\nsrc: url("'+mxUtils.htmlEntities(W)+'");\n}'),H.wnd.document.writeln("</style>"))}p&&(B.useCssTransforms=p,B.currentTranslate=F,B.currentScale=K,B.view.translate=M,B.view.scale=R);return H}),D=e.pagesFrom,G=e.pagesTo,E=!e.allPages;q=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,-e);else{E&&(E=e.selection||D==u&&G==u);if(!E&&null!=this.pages&&this.pages.length){E=0;u=this.pages.length-1;e.allPages||(E=parseInt(D)-1,u=parseInt(G)-1);for(var U=E;U<=u;U++){var P=this.pages[U];D=P==this.currentPage?n:null;if(null==D){D=this.createTemporaryGraph(n.stylesheet);D.shapeForegroundColor=n.shapeForegroundColor;D.shapeBackgroundColor=n.shapeBackgroundColor;G=!0;E=!1;var J=null,m=null;null==P.viewState&&null==P.root&&this.updatePageRoot(P);null!=P.viewState&&(G=P.viewState.pageVisible,-E=P.viewState.mathEnabled,J=P.viewState.background,m=P.viewState.backgroundImage,D.pageFormat=P.viewState.pageFormat,D.gridSize=P.viewState.gridSize);null!=m&&null!=m.originalSrc&&(m=this.createImageForPageLink(m.originalSrc,P));D.background=J;D.backgroundImage=null!=m?new mxImage(m.src,m.width,m.height,m.x,m.y):null;D.pageVisible=G;D.mathEnabled=E;var v=D.getGraphBounds;D.getGraphBounds=function(){var B=v.apply(this,arguments),H=this.backgroundImage;if(null!=H&&null!=H.width&&null!=H.height){var T=+H.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(W)+'" charset="UTF-8" type="text/css">'):(H.wnd.document.writeln('<style type="text/css">'),H.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(V)+'";\nsrc: url("'+mxUtils.htmlEntities(W)+'");\n}'),H.wnd.document.writeln("</style>"))}p&&(B.useCssTransforms=p,B.currentTranslate=G,B.currentScale=J,B.view.translate=L,B.view.scale=R);return H}),D=e.pagesFrom,F=e.pagesTo,E=!e.allPages;q=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,+e);else{E&&(E=e.selection||D==u&&F==u);if(!E&&null!=this.pages&&this.pages.length){E=0;u=this.pages.length-1;e.allPages||(E=parseInt(D)-1,u=parseInt(F)-1);for(var U=E;U<=u;U++){var P=this.pages[U];D=P==this.currentPage?n:null;if(null==D){D=this.createTemporaryGraph(n.stylesheet);D.shapeForegroundColor=n.shapeForegroundColor;D.shapeBackgroundColor=n.shapeBackgroundColor;F=!0;E=!1;var M=null,m=null;null==P.viewState&&null==P.root&&this.updatePageRoot(P);null!=P.viewState&&(F=P.viewState.pageVisible,+E=P.viewState.mathEnabled,M=P.viewState.background,m=P.viewState.backgroundImage,D.pageFormat=P.viewState.pageFormat,D.gridSize=P.viewState.gridSize);null!=m&&null!=m.originalSrc&&(m=this.createImageForPageLink(m.originalSrc,P));D.background=M;D.backgroundImage=null!=m?new mxImage(m.src,m.width,m.height,m.x,m.y):null;D.pageVisible=F;D.mathEnabled=E;var v=D.getGraphBounds;D.getGraphBounds=function(){var B=v.apply(this,arguments),H=this.backgroundImage;if(null!=H&&null!=H.width&&null!=H.height){var T=this.view.translate,g=this.view.scale;B=mxRectangle.fromRectangle(B);B.add(new mxRectangle((T.x+H.x)*g,(T.y+H.y)*g,H.width*g,H.height*g))}return B};var z=D.getGlobalVariable;D.getGlobalVariable=function(B){return"page"==B?P.getName():"pagenumber"==B?U+1:"pagecount"==B?null!=this.pages?this.pages.length:1:z.apply(this,arguments)};document.body.appendChild(D.container);this.updatePageRoot(P);D.model.setRoot(P.root)}q=A(D,q,U!=u,P.getId());D!=n&&D.container.parentNode.removeChild(D.container)}}else q=A(n);null==q||null==q.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(q.mathEnabled&&(A=q.wnd.document,c||(q.wnd.IMMEDIATE_PRINT=!0),A.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),q.closeDocument(),Graph.rewritePageLinks(q.wnd.document,!0),q.mathEnabled||c||PrintDialog.printPreview(q));return q}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var e=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(n){null!=e&&(e.parentNode.removeChild(e),e=null);n.stopPropagation();n.preventDefault()}),mxEvent.addListener(c[k],"dragover",mxUtils.bind(this,function(n){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==e&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(e=this.highlightElement());n.stopPropagation();n.preventDefault()})),mxEvent.addListener(c[k],"drop",mxUtils.bind(this,function(n){null!=e&&(e.parentNode.removeChild(e),e=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<@@ -13378,55 +13380,55 @@ n.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFimxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(q))).send(mxUtils.bind(this,function(A){200<=A.getStatus()&&299>=A.getStatus()?this.openLocalFile(A.getText(),null,!0):this.showError(mxResources.get("error"),413==A.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(q)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(q):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(q)))))}else this.openLocalFile(q,null,!0)}n.stopPropagation();n.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var e=0,k=0;if(null==c){var n=document.body;var q=document.documentElement;var u=(n.clientWidth||q.clientWidth)-3;n=Math.max(n.clientHeight||0,q.clientHeight)-3}else e=c.offsetTop,k=c.offsetLeft,u=c.clientWidth,n=c.clientHeight;q=document.createElement("div");q.style.zIndex=mxPopupMenu.prototype.zIndex+2;q.style.border="3px dotted rgb(254, 137, 12)";q.style.pointerEvents="none";q.style.position="absolute";q.style.top=e+"px";q.style.left=k+"px";q.style.width=Math.max(0,u-3)+"px";q.style.height=Math.max(0,n-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(q):document.body.appendChild(q);return q};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var e=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=e){var k=new mxCodec(e.ownerDocument),-n=new mxGraphModel;k.decode(e,n);e=n.getChildAt(n.getRoot(),0);for(k=0;k<n.getChildCount(e);k++)c.push(n.getChildAt(e,k))}return c};EditorUi.prototype.openFileHandle=function(c,e,k,n,q,u){if(null!=e&&0<e.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(e)||/(\.pdf)$/i.test(e))e=e.substring(0,e.length-4),/(\.drawio)$/i.test(e)||(e+=".drawio");var A=mxUtils.bind(this,function(G){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".drawio":e+".drawio";if("<mxlibrary"==G.substring(0,10)){null==-this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,G,e)),this.showSidebar()}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(G,e,n)});if(EditorUi.isVisioFilename(e))this.importVisio(k,mxUtils.bind(this,function(G){this.spinner.stop();A(G)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(G){this.spinner.stop();A(G)}));else if(Graph.fileSupport&&-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,e))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(G){4==G.readyState&&(this.spinner.stop(),200<=G.status&&299>=G.status?A(G.responseText):this.handleError({message:mxResources.get(413==G.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(e)&&(e=e.substring(0,-e.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(G){this.spinner.stop();this.openLocalFile(G,e,n)}),mxUtils.bind(this,function(G){this.spinner.stop();this.handleError(G)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(G){this.handleError(G,mxResources.get("errorLoadingFile"))}}else if(0==-c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(G){this.spinner.stop();A(G)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,e,n)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var D=Editor.extractGraphModelFromPdf(c);null!=D&&(q=null,n=!0,c=D)}this.spinner.stop();this.openLocalFile(c,e,n,q,null!=q?k:null,u)}}};EditorUi.prototype.openFiles=function(c,e){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=+n=new mxGraphModel;k.decode(e,n);e=n.getChildAt(n.getRoot(),0);for(k=0;k<n.getChildCount(e);k++)c.push(n.getChildAt(e,k))}return c};EditorUi.prototype.openFileHandle=function(c,e,k,n,q,u){if(null!=e&&0<e.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(e)||/(\.pdf)$/i.test(e))e=e.substring(0,e.length-4),/(\.drawio)$/i.test(e)||(e+=".drawio");var A=mxUtils.bind(this,function(F){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".drawio":e+".drawio";if("<mxlibrary"==F.substring(0,10)){null==+this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,F,e)),this.showSidebar()}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(F,e,n)});if(EditorUi.isVisioFilename(e))this.importVisio(k,mxUtils.bind(this,function(F){this.spinner.stop();A(F)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(F){this.spinner.stop();A(F)}));else if(Graph.fileSupport&&+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,e))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(F){4==F.readyState&&(this.spinner.stop(),200<=F.status&&299>=F.status?A(F.responseText):this.handleError({message:mxResources.get(413==F.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(e)&&(e=e.substring(0,+e.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(F){this.spinner.stop();this.openLocalFile(F,e,n)}),mxUtils.bind(this,function(F){this.spinner.stop();this.handleError(F)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(F){this.handleError(F,mxResources.get("errorLoadingFile"))}}else if(0==+c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(F){this.spinner.stop();A(F)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,e,n)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var D=Editor.extractGraphModelFromPdf(c);null!=D&&(q=null,n=!0,c=D)}this.spinner.stop();this.openLocalFile(c,e,n,q,null!=q?k:null,u)}}};EditorUi.prototype.openFiles=function(c,e){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=0;k<c.length;k++)mxUtils.bind(this,function(n){var q=new FileReader;q.onload=mxUtils.bind(this,function(u){try{this.openFileHandle(u.target.result,n.name,n,e)}catch(A){this.handleError(A)}});q.onerror=mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u);window.openFile=null});"image"!==n.type.substring(0,5)&&"application/pdf"!==n.type||"image/svg"===n.type.substring(0,9)?q.readAsText(n):q.readAsDataURL(n)})(c[k])};EditorUi.prototype.openLocalFile=function(c,e,k,n,q,u){var A=this.getCurrentFile(),-D=mxUtils.bind(this,function(){window.openFile=null;if(null==e&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var G=mxUtils.parseXml(c);null!=G&&(this.editor.setGraphXml(G.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,e||this.defaultFilename,k,n,q,u))});if(null!=c&&0<c.length)null==A||!A.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n)?D():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n)&&null!=A&&A.isModified()?this.confirm(mxResources.get("allChangesLost"),+D=mxUtils.bind(this,function(){window.openFile=null;if(null==e&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var F=mxUtils.parseXml(c);null!=F&&(this.editor.setGraphXml(F.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,e||this.defaultFilename,k,n,q,u))});if(null!=c&&0<c.length)null==A||!A.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n)?D():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n)&&null!=A&&A.isModified()?this.confirm(mxResources.get("allChangesLost"),null,D,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,e),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=A&&A.isModified()?this.confirm(mxResources.get("allChangesLost"),null,D,mxResources.get("cancel"),mxResources.get("discardChanges")):D()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var e=0;e<this.pages.length;e++)this.updatePageRoot(this.pages[e]),this.addBasenamesForCell(this.pages[e].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);e=[];for(var k in c)e.push(k);return e};EditorUi.prototype.addBasenamesForCell=function(c,e){function k(A){if(null!=A){var D=A.lastIndexOf(".");0<D&&(A=A.substring(D+1,A.length));null==e[A]&&(e[A]=!0)}}var n=this.editor.graph,q=n.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(q[mxConstants.STYLE_SHAPE]));n.model.isEdge(c)&&(k(mxMarker.getPackageForType(q[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(q[mxConstants.STYLE_ENDARROW])));q=n.model.getChildCount(c);for(var u=0;u<q;u++)this.addBasenamesForCell(n.model.getChildAt(c,u),e)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=c?"":"hidden";this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=c&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme?"":"none";this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=c&&0<parseInt(this.tabContainer.style.height)?"":"hidden");null!=this.ruler&&(this.ruler.hRuler.container.style.visibility=c?"":"hidden",this.ruler.vRuler.container.style.visibility=c?"":"hidden");c||this.hideWindows()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=-!1;this.installMessageHandler(mxUtils.bind(this,function(e,k,n,q){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==e||0==e.length)e=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,e,{}));this.mode=App.MODE_EMBED;this.setFileData(e);if(q)try{var u=this.editor.graph;u.setGridEnabled(!1);u.pageVisible=!1;var A=u.model.cells,D;for(D in A){var G=A[D];null!=G&&null!=G.style&&(G.style+=";sketch=1;"+(-1==G.style.indexOf("fontFamily=")||-1<G.style.indexOf("fontFamily=Helvetica;")?+!1;this.installMessageHandler(mxUtils.bind(this,function(e,k,n,q){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==e||0==e.length)e=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,e,{}));this.mode=App.MODE_EMBED;this.setFileData(e);if(q)try{var u=this.editor.graph;u.setGridEnabled(!1);u.pageVisible=!1;var A=u.model.cells,D;for(D in A){var F=A[D];null!=F&&null!=F.style&&(F.style+=";sketch=1;"+(-1==F.style.indexOf("fontFamily=")||-1<F.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(E){console.log(E)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=n?n:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,e){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(k){this.spinner.stop();e(k)})):e(null)};EditorUi.prototype.createLoadMessage=function(c){var e=this.editor.graph;return{event:c,pageVisible:e.pageVisible,translate:e.view.translate,bounds:e.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:e.view.scale,page:e.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var e=this.editor.graph;e.isEditing()&&e.stopEditing(!e.isInvokesStopCellEditing());var k=window.opener||window.parent;if(this.editor.modified){var n=e.background;if(null==n||n==mxConstants.NONE)n=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),e,null,!0,mxUtils.bind(this,function(q){k.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(q)}),"*")}),null,null,!0,n,1,this.embedExportBorder,null,this.embedExportTheme)}else c||k.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,e.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=-!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(q){c||this.handleError(q)}};EditorUi.prototype.installMessageHandler=function(c){var e=null,k=!1,n=!1,q=null,u=mxUtils.bind(this,function(G,E){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,u);mxEvent.addListener(window,"message",mxUtils.bind(this,-function(G){if(G.source==(window.opener||window.parent)){var E=G.data,U=null,P=mxUtils.bind(this,function(aa){if(null!=aa&&"function"===typeof aa.charAt&&"<"!=aa.charAt(0))try{Editor.isPngDataUrl(aa)?aa=Editor.extractGraphModelFromPng(aa):"data:image/svg+xml;base64,"==aa.substring(0,26)?aa=atob(aa.substring(26)):"data:image/svg+xml;utf8,"==aa.substring(0,24)&&(aa=aa.substring(24)),null!=aa&&(""==aa.trim()?aa=null:"%"==aa.charAt(0)?aa=decodeURIComponent(aa):"<"!=aa.charAt(0)&&(aa=Graph.decompress(aa)))}catch(ia){}return aa});-if("json"==urlParams.proto){var J=!1;try{E=JSON.parse(E),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[G],"data",[E])}catch(aa){E=null}try{if(null==E)return;if("dialog"==E.action){this.showError(null!=E.titleKey?mxResources.get(E.titleKey):E.title,null!=E.messageKey?mxResources.get(E.messageKey):mxUtils.htmlEntities(E.message),null!=E.buttonKey?mxResources.get(E.buttonKey):E.button);null!=E.modified&&(this.editor.modified=E.modified);return}if("layout"==E.action){this.executeLayouts(this.editor.graph.createLayouts(E.layouts));+!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(q){c||this.handleError(q)}};EditorUi.prototype.installMessageHandler=function(c){var e=null,k=!1,n=!1,q=null,u=mxUtils.bind(this,function(F,E){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,u);mxEvent.addListener(window,"message",mxUtils.bind(this,+function(F){if(F.source==(window.opener||window.parent)){var E=F.data,U=null,P=mxUtils.bind(this,function(aa){if(null!=aa&&"function"===typeof aa.charAt&&"<"!=aa.charAt(0))try{Editor.isPngDataUrl(aa)?aa=Editor.extractGraphModelFromPng(aa):"data:image/svg+xml;base64,"==aa.substring(0,26)?aa=atob(aa.substring(26)):"data:image/svg+xml;utf8,"==aa.substring(0,24)&&(aa=aa.substring(24)),null!=aa&&(""==aa.trim()?aa=null:"%"==aa.charAt(0)?aa=decodeURIComponent(aa):"<"!=aa.charAt(0)&&(aa=Graph.decompress(aa)))}catch(ia){}return aa});+if("json"==urlParams.proto){var M=!1;try{E=JSON.parse(E),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[F],"data",[E])}catch(aa){E=null}try{if(null==E)return;if("dialog"==E.action){this.showError(null!=E.titleKey?mxResources.get(E.titleKey):E.title,null!=E.messageKey?mxResources.get(E.messageKey):mxUtils.htmlEntities(E.message),null!=E.buttonKey?mxResources.get(E.buttonKey):E.button);null!=E.modified&&(this.editor.modified=E.modified);return}if("layout"==E.action){this.executeLayouts(this.editor.graph.createLayouts(E.layouts));return}if("prompt"==E.action){this.spinner.stop();var m=new FilenameDialog(this,E.defaultValue||"",null!=E.okKey?mxResources.get(E.okKey):E.ok,function(aa){null!=aa?A.postMessage(JSON.stringify({event:"prompt",value:aa,message:E}),"*"):A.postMessage(JSON.stringify({event:"prompt-cancel",message:E}),"*")},null!=E.titleKey?mxResources.get(E.titleKey):E.title,null,null,null,null,function(){A.postMessage(JSON.stringify({event:"prompt-cancel",message:E}),"*")});this.showDialog(m.container,300,80,!0,!1);m.init();return}if("draft"==E.action){var v=P(E.xml);this.spinner.stop();m=new DraftDialog(this,mxResources.get("draftFound",[E.name||this.defaultFilename]),v,mxUtils.bind(this,function(){this.hideDialog();A.postMessage(JSON.stringify({event:"draft",result:"edit",message:E}),"*")}),mxUtils.bind(this,function(){this.hideDialog();A.postMessage(JSON.stringify({event:"draft",result:"discard",message:E}),"*")}),E.editKey?mxResources.get(E.editKey):null,E.discardKey?mxResources.get(E.discardKey):null,E.ignore?mxUtils.bind(this,function(){this.hideDialog();A.postMessage(JSON.stringify({event:"draft",result:"ignore",message:E}),"*")}):null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(aa){aa&&this.actions.get("exit").funct()}));try{m.init()}catch(aa){A.postMessage(JSON.stringify({event:"draft",error:aa.toString(),message:E}),"*")}return}if("template"==E.action){this.spinner.stop();var z=1==E.enableRecent,B=1==E.enableSearch,H=1==E.enableCustomTemp;m=new NewDialog(this,!1,E.templatesOnly?-!1:null!=E.callback,mxUtils.bind(this,function(aa,ia,ka,ta){aa=aa||this.emptyDiagramXml;null!=E.callback?A.postMessage(JSON.stringify({event:"template",xml:aa,blank:aa==this.emptyDiagramXml,name:ia,tempUrl:ka,libs:ta,builtIn:!0,message:E}),"*"):(c(aa,G,aa!=this.emptyDiagramXml,E.toSketch),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,z?mxUtils.bind(this,function(aa){this.remoteInvoke("getRecentDiagrams",[null],null,aa,function(){aa(null,"Network Error!")})}):+!1:null!=E.callback,mxUtils.bind(this,function(aa,ia,ka,ta){aa=aa||this.emptyDiagramXml;null!=E.callback?A.postMessage(JSON.stringify({event:"template",xml:aa,blank:aa==this.emptyDiagramXml,name:ia,tempUrl:ka,libs:ta,builtIn:!0,message:E}),"*"):(c(aa,F,aa!=this.emptyDiagramXml,E.toSketch),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,z?mxUtils.bind(this,function(aa){this.remoteInvoke("getRecentDiagrams",[null],null,aa,function(){aa(null,"Network Error!")})}):null,B?mxUtils.bind(this,function(aa,ia){this.remoteInvoke("searchDiagrams",[aa,null],null,ia,function(){ia(null,"Network Error!")})}):null,mxUtils.bind(this,function(aa,ia,ka){A.postMessage(JSON.stringify({event:"template",docUrl:aa,info:ia,name:ka}),"*")}),null,null,H?mxUtils.bind(this,function(aa){this.remoteInvoke("getCustomTemplates",null,null,aa,function(){aa({},0)})}):null,1==E.withoutType);this.showDialog(m.container,620,460,!0,!1,mxUtils.bind(this,function(aa){null!=this.sidebar&&this.sidebar.hideTooltip();aa&&this.actions.get("exit").funct()}));m.init();return}if("textContent"==E.action){var T=this.getDiagramTextContent();A.postMessage(JSON.stringify({event:"textContent",data:T,message:E}),"*");return}if("status"==E.action){null!=E.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(E.messageKey))):null!=E.message&&this.editor.setStatus(mxUtils.htmlEntities(E.message));null!=E.modified&&(this.editor.modified=E.modified);return}if("spinner"==E.action){var g=null!=E.messageKey?mxResources.get(E.messageKey):E.message;null==E.show||E.show?this.spinner.spin(document.body,g):this.spinner.stop();return}if("exit"==E.action){this.actions.get("exit").funct();return}if("viewport"==E.action){null!=E.viewport&&(this.embedViewport=E.viewport,this.editor.graph.refresh(),this.fireEvent(new mxEventObject("embedViewportChanged")));return}if("fullscreenChanged"==E.action){m=null;try{var p=this.diagramContainer.getAttribute("data-scrollState");null!=p&&(this.diagramContainer.removeAttribute("data-scrollState"),m=JSON.parse(p))}catch(aa){}Editor.inlineFullscreen=-E.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=m&&this.restoreScrollState(m);return}if("snapshot"==E.action){this.sendEmbeddedSvgExport(!0);return}if("export"==E.action){if("png"==E.format||"xmlpng"==E.format){if(null==E.spin&&null==E.spinKey||this.spinner.spin(document.body,null!=E.spinKey?mxResources.get(E.spinKey):E.spin)){var F=null!=E.xml?E.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var K=this.editor.graph,M=mxUtils.bind(this,function(aa,ia){if(E.withSvg)E.withSvg=-!1,this.getEmbeddedSvg(F,this.editor.graph,null,!0,function(ta){M(aa,ta)},null,null,E.embedImages,this.editor.graph.background,E.scale,E.border,E.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ka=this.createLoadMessage("export");ka.format=E.format;ka.message=E;ka.data=aa;ka.svg=ia;ka.xml=F;A.postMessage(JSON.stringify(ka),"*")}}),R=mxUtils.bind(this,function(aa){null==aa&&(aa=Editor.blankImage);"xmlpng"==E.format&&(aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(F)));-K!=this.editor.graph&&K.container.parentNode.removeChild(K.container);M(aa)}),S=E.pageId||(null!=this.pages?E.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var V=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=S){var aa=K.getGlobalVariable;K=this.createTemporaryGraph(K.getStylesheet());for(var ia,ka=0;ka<this.pages.length;ka++)if(this.pages[ka].getId()==S){ia=this.updatePageRoot(this.pages[ka]);break}null==ia&&(ia=this.currentPage);-K.getGlobalVariable=function(ra){return"page"==ra?ia.getName():"pagenumber"==ra?1:aa.apply(this,arguments)};document.body.appendChild(K.container);K.model.setRoot(ia.root)}if(null!=E.layerIds){var ta=K.model,sa=ta.getChildCells(ta.getRoot()),ea={};for(ka=0;ka<E.layerIds.length;ka++)ea[E.layerIds[ka]]=!0;for(ka=0;ka<sa.length;ka++)ta.setVisible(sa[ka],ea[sa[ka].id]||!1)}ka=null;E.keepTheme&&(ka=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(ra){R(ra.toDataURL("image/png"))}),-E.width,null,E.background,mxUtils.bind(this,function(){R(null)}),null,null,E.scale,E.transparent,E.shadow,null,K,E.border,null,E.grid,ka)});null!=E.xml&&0<E.xml.length&&(k=!0,this.setFileData(F),k=!1);V()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==E.format?"1":"0")+(null!=S?"&pageId="+S:"")+(null!=E.layerIds&&0<E.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:E.layerIds})):"")+(null!=E.scale?"&scale="+E.scale:"")+"&base64=1&xml="+encodeURIComponent(F))).send(mxUtils.bind(this,-function(aa){200<=aa.getStatus()&&299>=aa.getStatus()?M("data:image/png;base64,"+aa.getText()):R(null)}),mxUtils.bind(this,function(){R(null)}))}}else if(V=mxUtils.bind(this,function(){var aa=this.createLoadMessage("export");aa.message=E;if("html2"==E.format||"html"==E.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ia=this.getXmlFileData();aa.xml=mxUtils.getXml(ia);aa.data=this.getFileData(null,null,!0,null,null,null,ia);aa.format=E.format}else if("html"==E.format)ia=this.editor.getGraphXml(),+E.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=m&&this.restoreScrollState(m);return}if("snapshot"==E.action){this.sendEmbeddedSvgExport(!0);return}if("export"==E.action){if("png"==E.format||"xmlpng"==E.format){if(null==E.spin&&null==E.spinKey||this.spinner.spin(document.body,null!=E.spinKey?mxResources.get(E.spinKey):E.spin)){var G=null!=E.xml?E.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var J=this.editor.graph,L=mxUtils.bind(this,function(aa,ia){if(E.withSvg)E.withSvg=+!1,this.getEmbeddedSvg(G,this.editor.graph,null,!0,function(ta){L(aa,ta)},null,null,E.embedImages,this.editor.graph.background,E.scale,E.border,E.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ka=this.createLoadMessage("export");ka.format=E.format;ka.message=E;ka.data=aa;ka.svg=ia;ka.xml=G;A.postMessage(JSON.stringify(ka),"*")}}),R=mxUtils.bind(this,function(aa){null==aa&&(aa=Editor.blankImage);"xmlpng"==E.format&&(aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(G)));+J!=this.editor.graph&&J.container.parentNode.removeChild(J.container);L(aa)}),S=E.pageId||(null!=this.pages?E.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var V=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=S){var aa=J.getGlobalVariable;J=this.createTemporaryGraph(J.getStylesheet());for(var ia,ka=0;ka<this.pages.length;ka++)if(this.pages[ka].getId()==S){ia=this.updatePageRoot(this.pages[ka]);break}null==ia&&(ia=this.currentPage);+J.getGlobalVariable=function(ra){return"page"==ra?ia.getName():"pagenumber"==ra?1:aa.apply(this,arguments)};document.body.appendChild(J.container);J.model.setRoot(ia.root)}if(null!=E.layerIds){var ta=J.model,sa=ta.getChildCells(ta.getRoot()),ea={};for(ka=0;ka<E.layerIds.length;ka++)ea[E.layerIds[ka]]=!0;for(ka=0;ka<sa.length;ka++)ta.setVisible(sa[ka],ea[sa[ka].id]||!1)}ka=null;E.keepTheme&&(ka=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(ra){R(ra.toDataURL("image/png"))}),+E.width,null,E.background,mxUtils.bind(this,function(){R(null)}),null,null,E.scale,E.transparent,E.shadow,null,J,E.border,null,E.grid,ka)});null!=E.xml&&0<E.xml.length&&(k=!0,this.setFileData(G),k=!1);V()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==E.format?"1":"0")+(null!=S?"&pageId="+S:"")+(null!=E.layerIds&&0<E.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:E.layerIds})):"")+(null!=E.scale?"&scale="+E.scale:"")+"&base64=1&xml="+encodeURIComponent(G))).send(mxUtils.bind(this,+function(aa){200<=aa.getStatus()&&299>=aa.getStatus()?L("data:image/png;base64,"+aa.getText()):R(null)}),mxUtils.bind(this,function(){R(null)}))}}else if(V=mxUtils.bind(this,function(){var aa=this.createLoadMessage("export");aa.message=E;if("html2"==E.format||"html"==E.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ia=this.getXmlFileData();aa.xml=mxUtils.getXml(ia);aa.data=this.getFileData(null,null,!0,null,null,null,ia);aa.format=E.format}else if("html"==E.format)ia=this.editor.getGraphXml(),aa.data=this.getHtml(ia,this.editor.graph),aa.xml=mxUtils.getXml(ia),aa.format=E.format;else{mxSvgCanvas2D.prototype.foAltText=null;ia=null!=E.background?E.background:this.editor.graph.background;ia==mxConstants.NONE&&(ia=null);aa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);aa.format="svg";var ka=mxUtils.bind(this,function(sa){this.editor.graph.setEnabled(!0);this.spinner.stop();aa.data=Editor.createSvgDataUri(sa);A.postMessage(JSON.stringify(aa),"*")}),ta="auto";E.keepTheme&&(ta=Editor.isDarkMode()?"dark":"light");null!=E.theme&&(ta=E.theme);if("xmlsvg"==E.format){if(null==E.spin&&null==E.spinKey||this.spinner.spin(document.body,null!=E.spinKey?mxResources.get(E.spinKey):E.spin)){ta=null;if(this.isAutoDarkMode()||Editor.isDarkMode())ta="auto";null!=E.theme&&(ta=E.theme);this.getEmbeddedSvg(aa.xml,this.editor.graph,null,!0,ka,null,null,E.embedImages,ia,E.scale,E.border,E.shadow,ta)}}else if(null==E.spin&&null==E.spinKey||this.spinner.spin(document.body,null!=E.spinKey?mxResources.get(E.spinKey):E.spin))this.editor.graph.setEnabled(!1),ia=this.editor.graph.getSvg(ia,E.scale,E.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||E.shadow,null,ta),(this.editor.graph.shadowVisible||E.shadow)&&this.editor.graph.addSvgShadow(ia),this.embedFonts(ia,mxUtils.bind(this,function(sa){E.embedImages||null==E.embedImages?this.editor.convertImages(sa,mxUtils.bind(this,function(ea){ka(mxUtils.getXml(ea))})):ka(mxUtils.getXml(sa))}));return}A.postMessage(JSON.stringify(aa),-"*")}),null!=E.xml&&0<E.xml.length){if(this.editor.graph.mathEnabled){var W=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){W.apply(this,arguments);V()}}k=!0;this.setFileData(E.xml);k=!1;this.editor.graph.mathEnabled||V()}else V();return}if("load"==E.action){J=E.toSketch;n=1==E.autosave;this.hideDialog();null!=E.modified&&null==urlParams.modified&&(urlParams.modified=E.modified);null!=E.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=E.saveAndExit);if("1"==urlParams.saveAndExit||+"*")}),null!=E.xml&&0<E.xml.length){if(this.editor.graph.mathEnabled){var W=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){W.apply(this,arguments);V()}}k=!0;this.setFileData(E.xml);k=!1;this.editor.graph.mathEnabled||V()}else V();return}if("load"==E.action){M=E.toSketch;n=1==E.autosave;this.hideDialog();null!=E.modified&&null==urlParams.modified&&(urlParams.modified=E.modified);null!=E.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=E.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+Shift+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=E.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=E.noSaveBtn);if(null!=E.rough){var X=Editor.sketchMode;this.doSetSketchMode(E.rough);X!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=E.dark&&this.setDarkMode(E.dark);null!=E.border&&(this.embedExportBorder=E.border);null!=E.theme&&(this.embedExportTheme=E.theme);null!=E.background&&(this.embedExportBackground=E.background);null!=E.viewport&&(this.embedViewport=E.viewport);this.embedExitPoint=null;if(null!=E.rect){var Y=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,E.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,E.rect.top)+"px";this.minInlineWidth=E.minWidth;this.minInlineHeight=E.minHeight;-this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Z=E.maxFitScale,ba=E.rect.width+2*Y,ha=E.rect.height+2*Y;U=mxUtils.bind(this,function(){var aa=mxUtils.getDocumentSize();ba=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ba):ba,aa.width-80);aa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ha):ha,aa.height-80);this.diagramContainer.style.width=ba+"px";this.diagramContainer.style.height=-aa+"px";var ia=this.editor.graph;aa=ia.maxFitScale;ia.maxFitScale=Z;ia.fit(2*Y,null,null,null,null,null,ha);this.setPageVisible(!1);if(null!=this.minInlineWidth&&ia.getGraphBounds().width<this.minInlineWidth){var ka=ia.container.scrollTop;this.resetScrollbars();ia.container.scrollTop=ka}ia.maxFitScale=aa;ia.container.scrollTop-=Y;ia.container.scrollLeft-=Y;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[E]));ia.container.focus();null!=this.formatWindow&&+this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Z=E.maxFitScale,ba=E.rect.width+2*Y,fa=E.rect.height+2*Y;U=mxUtils.bind(this,function(){var aa=mxUtils.getDocumentSize();ba=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ba):ba,aa.width-80);aa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,fa):fa,aa.height-80);this.diagramContainer.style.width=ba+"px";this.diagramContainer.style.height=+aa+"px";var ia=this.editor.graph;aa=ia.maxFitScale;ia.maxFitScale=Z;ia.fit(2*Y,null,null,null,null,null,fa);this.setPageVisible(!1);if(null!=this.minInlineWidth&&ia.getGraphBounds().width<this.minInlineWidth){var ka=ia.container.scrollTop;this.resetScrollbars();ia.container.scrollTop=ka}ia.maxFitScale=aa;ia.container.scrollTop-=Y;ia.container.scrollLeft-=Y;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[E]));ia.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=ia.container.style.top);var ta=ia.getGraphBounds();ia.container.clientWidth>ta.width+2*Y&&(ia.container.scrollLeft=ta.x+(ta.width+Y-ia.container.clientWidth)/2)}),10)})}null!=E.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=E.noExitBtn);null!=E.title&&null!=this.buttonContainer&&(v=this.createStatusDiv(""),mxUtils.write(v,E.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(v),this.embedFilenameSpan=v);try{E.libs&&this.sidebar.showEntries(E.libs)}catch(aa){}E=null!=E.xmlpng?this.extractGraphModelFromPng(E.xmlpng):null!=E.descriptor?E.descriptor:E.xml}else{if("merge"==E.action){var ca=this.getCurrentFile();null!=ca&&(v=P(E.xml),null!=v&&""!=v&&ca.mergeFile(new LocalFile(this,v),function(){A.postMessage(JSON.stringify({event:"merge",message:E}),"*")},function(aa){A.postMessage(JSON.stringify({event:"merge",message:E,error:aa}),"*")}))}else"remoteInvokeReady"==-E.action?this.handleRemoteInvokeReady(A):"remoteInvoke"==E.action?this.handleRemoteInvoke(E,G.origin):"remoteInvokeResponse"==E.action?this.handleRemoteInvokeResponse(E):A.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(E)}),"*");return}}catch(aa){this.handleError(aa)}}var da=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ma=mxUtils.bind(this,function(aa,ia){k=!0;-try{c(aa,ia,null,J)}catch(ka){this.handleError(ka)}k=!1;null!=urlParams.modified&&this.editor.setStatus("");q=da();n&&null==e&&(e=mxUtils.bind(this,function(ka,ta){ka=da();ka==q||k||(ta=this.createLoadMessage("autosave"),ta.xml=ka,(window.opener||window.parent).postMessage(JSON.stringify(ta),"*"));q=ka}),this.editor.graph.model.addListener(mxEvent.CHANGE,e),this.editor.graph.addListener("gridSizeChanged",e),this.editor.graph.addListener("shadowVisibleChanged",e),this.addListener("pageFormatChanged",+E.action?this.handleRemoteInvokeReady(A):"remoteInvoke"==E.action?this.handleRemoteInvoke(E,F.origin):"remoteInvokeResponse"==E.action?this.handleRemoteInvokeResponse(E):A.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(E)}),"*");return}}catch(aa){this.handleError(aa)}}var da=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ma=mxUtils.bind(this,function(aa,ia){k=!0;+try{c(aa,ia,null,M)}catch(ka){this.handleError(ka)}k=!1;null!=urlParams.modified&&this.editor.setStatus("");q=da();n&&null==e&&(e=mxUtils.bind(this,function(ka,ta){ka=da();ka==q||k||(ta=this.createLoadMessage("autosave"),ta.xml=ka,(window.opener||window.parent).postMessage(JSON.stringify(ta),"*"));q=ka}),this.editor.graph.model.addListener(mxEvent.CHANGE,e),this.editor.graph.addListener("gridSizeChanged",e),this.editor.graph.addListener("shadowVisibleChanged",e),this.addListener("pageFormatChanged",e),this.addListener("pageScaleChanged",e),this.addListener("backgroundColorChanged",e),this.addListener("backgroundImageChanged",e),this.addListener("foldingEnabledChanged",e),this.addListener("mathEnabledChanged",e),this.addListener("gridEnabledChanged",e),this.addListener("guidesEnabledChanged",e),this.addListener("pageViewChanged",e));if("1"==urlParams.returnbounds||"json"==urlParams.proto)ia=this.createLoadMessage("load"),ia.xml=aa,A.postMessage(JSON.stringify(ia),"*");null!=U&&U()});null!=E&&-"function"===typeof E.substring&&"data:application/vnd.visio;base64,"==E.substring(0,34)?(P="0M8R4KGxGuE"==E.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(E.substring(E.indexOf(",")+1)),function(aa){ma(aa,G)},mxUtils.bind(this,function(aa){this.handleError(aa)}),P)):null!=E&&"function"===typeof E.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(E,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(E,-mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status&&"<mxGraphModel"==aa.responseText.substring(0,13)?ma(aa.responseText,G):this.handleError({message:413==aa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=E&&"function"===typeof E.substring&&this.isLucidChartData(E)?this.convertLucidChart(E,mxUtils.bind(this,function(aa){ma(aa)}),mxUtils.bind(this,function(aa){this.handleError(aa)})):null==E||"object"!==typeof E||null==E.format||-null==E.data&&null==E.url?(E=P(E),ma(E,G)):this.loadDescriptor(E,mxUtils.bind(this,function(aa){ma(da(),G)}),mxUtils.bind(this,function(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}))}}));var A=window.opener||window.parent;u="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";A.postMessage(u,"*");if("json"==urlParams.proto){var D=this.editor.graph.openLink;this.editor.graph.openLink=function(G,E,U){D.apply(this,arguments);A.postMessage(JSON.stringify({event:"openLink",-href:G,target:E,allowOpener:U}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,e,k,n){var q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme,u=document.createElement("button");u.setAttribute("title",c+(null!=k?" ("+k+")":""));u.style.marginLeft="6px";mxUtils.write(u,c);q?(u.className=n?"gePrimaryBtn":"",u.style.marginLeft="8px",u.style.padding="6px"):u.className="geBigButton"+(n?"":" geBigStandardButton");mxEvent.addListener(u,"click",e);return u};+"function"===typeof E.substring&&"data:application/vnd.visio;base64,"==E.substring(0,34)?(P="0M8R4KGxGuE"==E.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(E.substring(E.indexOf(",")+1)),function(aa){ma(aa,F)},mxUtils.bind(this,function(aa){this.handleError(aa)}),P)):null!=E&&"function"===typeof E.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(E,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(E,+mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status&&"<mxGraphModel"==aa.responseText.substring(0,13)?ma(aa.responseText,F):this.handleError({message:413==aa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=E&&"function"===typeof E.substring&&this.isLucidChartData(E)?this.convertLucidChart(E,mxUtils.bind(this,function(aa){ma(aa)}),mxUtils.bind(this,function(aa){this.handleError(aa)})):null==E||"object"!==typeof E||null==E.format||+null==E.data&&null==E.url?(E=P(E),ma(E,F)):this.loadDescriptor(E,mxUtils.bind(this,function(aa){ma(da(),F)}),mxUtils.bind(this,function(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}))}}));var A=window.opener||window.parent;u="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";A.postMessage(u,"*");if("json"==urlParams.proto){var D=this.editor.graph.openLink;this.editor.graph.openLink=function(F,E,U){D.apply(this,arguments);A.postMessage(JSON.stringify({event:"openLink",+href:F,target:E,allowOpener:U}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,e,k,n){var q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme,u=document.createElement("button");u.setAttribute("title",c+(null!=k?" ("+k+")":""));u.style.marginLeft="6px";mxUtils.write(u,c);q?(u.className=n?"gePrimaryBtn":"",u.style.marginLeft="8px",u.style.padding="6px"):u.className="geBigButton"+(n?"":" geBigStandardButton");mxEvent.addListener(u,"click",e);return u};EditorUi.prototype.addEmbedButtons=function(){var c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.marginLeft="auto";"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme&&(c.style.marginRight="66px",c.style["float"]="right","atlas"==Editor.currentTheme&&(c.style.marginTop="2px"));document.createElement("button").className="geBigButton";"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&c.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(c.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&c.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&c.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct));"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||null==this.buttonContainer?null!=this.menubar&&(this.toolbar.container.appendChild(c),this.toolbar.staticElements.push(c)):(this.buttonContainer.appendChild(c),this.editor.fireEvent(new mxEventObject("statusChanged")))};EditorUi.prototype.showImportCsvDialog=@@ -13434,25 +13436,25 @@ function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(function(){var e=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var n=JSON.parse(k);this.executeLayouts(this.editor.graph.createLayouts(n));this.customLayoutConfig=n;this.hideDialog()}catch(q){this.handleError(q)}}),null,null,null,null,mxUtils.bind(this,function(k,n){var q=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var u=n.value;n.value=JSON.stringify(JSON.parse(u));n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));n.value=u}catch(A){this.handleError(A)}}));q.setAttribute("title","copy");q.className="geBtn";k.appendChild(q)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(e.container,620,460,!0,!0);e.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(e){var k=mxUtils.bind(this,function(){this.loadingOrgChart=!1;e.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),n=mxUtils.bind(this,function(q){this.loadingOrgChart=!1;e.clear()&&this.handleError(q)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?k():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",-function(){mxscript("js/orgchart/mxOrgChartLayout.js",k,null,null,null,n)},null,null,null,n)},null,null,null,n)},null,null,null,n):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",k,null,null,null,n))}),onerror)};EditorUi.prototype.importCsv=function(c,e){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,e)}))};EditorUi.prototype.doImportCsv=function(c,e){try{var k=c.split("\n"),n=[],q=[],u=[],A={};if(0<k.length){var D={},G=this.editor.graph,E=null,U=null,P=null,J=null,-m=null,v=null,z=null,B="whiteSpace=wrap;html=1;",H=null,T=null,g="",p="auto",F="auto",K=!1,M=null,R=null,S=40,V=40,W=100,X=0,Y=mxUtils.bind(this,function(){null!=e?e(Ca):(G.setSelectionCells(Ca),G.scrollCellToVisible(G.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Z=G.getFreeInsertPoint(),ba=Z.x,ha=Z.y;Z=ha;var ca=null,da="auto";T=null;for(var ma=[],aa=null,ia=null,ka=0;ka<k.length&&"#"==k[ka].charAt(0);){c=k[ka].replace(/\r$/,+function(){mxscript("js/orgchart/mxOrgChartLayout.js",k,null,null,null,n)},null,null,null,n)},null,null,null,n)},null,null,null,n):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",k,null,null,null,n))}),onerror)};EditorUi.prototype.importCsv=function(c,e){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,e)}))};EditorUi.prototype.doImportCsv=function(c,e){try{var k=c.split("\n"),n=[],q=[],u=[],A={};if(0<k.length){var D={},F=this.editor.graph,E=null,U=null,P=null,M=null,+m=null,v=null,z=null,B="whiteSpace=wrap;html=1;",H=null,T=null,g="",p="auto",G="auto",J=!1,L=null,R=null,S=40,V=40,W=100,X=0,Y=mxUtils.bind(this,function(){null!=e?e(Ca):(F.setSelectionCells(Ca),F.scrollCellToVisible(F.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Z=F.getFreeInsertPoint(),ba=Z.x,fa=Z.y;Z=fa;var ca=null,da="auto";T=null;for(var ma=[],aa=null,ia=null,ka=0;ka<k.length&&"#"==k[ka].charAt(0);){c=k[ka].replace(/\r$/,"");for(ka++;ka<k.length&&"\\"==c.charAt(c.length-1)&&"#"==k[ka].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(k[ka].substring(1)),ka++;if("#"!=c.charAt(1)){var ta=c.indexOf(":");if(0<ta){var sa=mxUtils.trim(c.substring(1,ta)),ea=mxUtils.trim(c.substring(ta+1));"label"==sa?ca=Graph.sanitizeHtml(ea):"labelname"==sa&&0<ea.length&&"-"!=ea?m=ea:"labels"==sa&&0<ea.length&&"-"!=ea?z=JSON.parse(ea):"style"==sa?U=ea:"parentstyle"==sa?B=ea:"unknownStyle"==sa&&"-"!=ea?v=ea:"stylename"==sa&&0<ea.length&&-"-"!=ea?J=ea:"styles"==sa&&0<ea.length&&"-"!=ea?P=JSON.parse(ea):"vars"==sa&&0<ea.length&&"-"!=ea?E=JSON.parse(ea):"identity"==sa&&0<ea.length&&"-"!=ea?H=ea:"parent"==sa&&0<ea.length&&"-"!=ea?T=ea:"namespace"==sa&&0<ea.length&&"-"!=ea?g=ea:"width"==sa?p=ea:"height"==sa?F=ea:"collapsed"==sa&&"-"!=ea?K="true"==ea:"left"==sa&&0<ea.length?M=ea:"top"==sa&&0<ea.length?R=ea:"ignore"==sa?ia=ea.split(","):"connect"==sa?ma.push(JSON.parse(ea)):"link"==sa?aa=ea:"padding"==sa?X=parseFloat(ea):"edgespacing"==+"-"!=ea?M=ea:"styles"==sa&&0<ea.length&&"-"!=ea?P=JSON.parse(ea):"vars"==sa&&0<ea.length&&"-"!=ea?E=JSON.parse(ea):"identity"==sa&&0<ea.length&&"-"!=ea?H=ea:"parent"==sa&&0<ea.length&&"-"!=ea?T=ea:"namespace"==sa&&0<ea.length&&"-"!=ea?g=ea:"width"==sa?p=ea:"height"==sa?G=ea:"collapsed"==sa&&"-"!=ea?J="true"==ea:"left"==sa&&0<ea.length?L=ea:"top"==sa&&0<ea.length?R=ea:"ignore"==sa?ia=ea.split(","):"connect"==sa?ma.push(JSON.parse(ea)):"link"==sa?aa=ea:"padding"==sa?X=parseFloat(ea):"edgespacing"==sa?S=parseFloat(ea):"nodespacing"==sa?V=parseFloat(ea):"levelspacing"==sa?W=parseFloat(ea):"layout"==sa&&(da=ea)}}}if(null==k[ka])throw Error(mxResources.get("invalidOrMissingFile"));var ra=this.editor.csvToArray(k[ka].replace(/\r$/,""));ta=c=null;sa=[];for(ea=0;ea<ra.length;ea++)H==ra[ea]&&(c=ea),T==ra[ea]&&(ta=ea),sa.push(mxUtils.trim(ra[ea]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ca&&(ca="%"+sa[0]+"%");if(null!=ma)for(var ua=0;ua<ma.length;ua++)null==D[ma[ua].to]&&-(D[ma[ua].to]={});H=[];for(ea=ka+1;ea<k.length;ea++){var za=this.editor.csvToArray(k[ea].replace(/\r$/,""));if(null==za){var va=40<k[ea].length?k[ea].substring(0,40)+"...":k[ea];throw Error(va+" ("+ea+"):\n"+mxResources.get("containsValidationErrors"));}0<za.length&&H.push(za)}G.model.beginUpdate();try{for(ea=0;ea<H.length;ea++){za=H[ea];var fa=null,pa=null!=c?g+za[c]:null;k=!1;null!=pa&&(fa=G.model.getCell(pa),k=null==fa||0<=mxUtils.indexOf(n,fa));var Aa=new mxCell(ca,new mxGeometry(ba,Z,0,0),U||-"whiteSpace=wrap;html=1;");Aa.collapsed=K;Aa.vertex=!0;Aa.id=pa;null==fa||k||G.model.setCollapsed(fa,K);for(var na=0;na<za.length;na++)G.setAttributeForCell(Aa,sa[na],za[na]),null==fa||k||G.setAttributeForCell(fa,sa[na],za[na]);if(null!=m&&null!=z){var Ha=z[Aa.getAttribute(m)];null!=Ha&&(G.labelChanged(Aa,Ha),null==fa||k||G.cellLabelChanged(fa,Ha))}if(null!=J&&null!=P){var wa=P[Aa.getAttribute(J)];null!=wa&&(Aa.style=wa)}G.setAttributeForCell(Aa,"placeholders","1");Aa.style=G.replacePlaceholders(Aa,-Aa.style,E);null==fa||k?G.fireEvent(new mxEventObject("cellsInserted","cells",[Aa])):(G.model.setStyle(fa,Aa.style),0>mxUtils.indexOf(u,fa)&&u.push(fa),G.fireEvent(new mxEventObject("cellsInserted","cells",[fa])));k=null!=fa;fa=Aa;if(!k)for(ua=0;ua<ma.length;ua++)D[ma[ua].to][fa.getAttribute(ma[ua].to)]=fa;null!=aa&&"link"!=aa&&(G.setLinkForCell(fa,fa.getAttribute(aa)),G.setAttributeForCell(fa,aa,null));var Da=this.editor.graph.getPreferredSizeForCell(fa);T=null!=ta?G.model.getCell(g+za[ta]):null;-if(fa.vertex){va=null!=T?0:ba;ka=null!=T?0:ha;null!=M&&null!=fa.getAttribute(M)&&(fa.geometry.x=va+parseFloat(fa.getAttribute(M)));null!=R&&null!=fa.getAttribute(R)&&(fa.geometry.y=ka+parseFloat(fa.getAttribute(R)));var Ea="@"==p.charAt(0)?fa.getAttribute(p.substring(1)):null;fa.geometry.width=null!=Ea&&"auto"!=Ea?parseFloat(fa.getAttribute(p.substring(1))):"auto"==p||"auto"==Ea?Da.width+X:parseFloat(p);var Na="@"==F.charAt(0)?fa.getAttribute(F.substring(1)):null;fa.geometry.height=null!=Na&&"auto"!=-Na&&"width"!=F?parseFloat(Na):"auto"==F||"auto"==Na?Da.height+X:"width"==F?fa.geometry.width:parseFloat(F);Z+=fa.geometry.height+V}k?(null==A[pa]&&(A[pa]=[]),A[pa].push(fa)):(n.push(fa),null!=T?(T.style=G.replacePlaceholders(T,B,E),G.addCell(fa,T),q.push(T)):u.push(G.addCell(fa)))}for(ea=0;ea<q.length;ea++)Ea="@"==p.charAt(0)?q[ea].getAttribute(p.substring(1)):null,Na="@"==F.charAt(0)?q[ea].getAttribute(F.substring(1)):null,"auto"!=p&&"auto"!=Ea||"auto"!=F&&"auto"!=Na||G.updateGroupBounds([q[ea]],-X,!0);var Ba=u.slice(),Ca=u.slice();for(ua=0;ua<ma.length;ua++){var Ia=ma[ua];for(ea=0;ea<n.length;ea++){fa=n[ea];var Va=mxUtils.bind(this,function(qa,oa,la){var ya=oa.getAttribute(la.from);if(null!=ya&&""!=ya){ya=ya.split(",");for(var Ja=0;Ja<ya.length;Ja++){var Fa=D[la.to][ya[Ja]];if(null==Fa&&null!=v){Fa=new mxCell(ya[Ja],new mxGeometry(ba,ha,0,0),v);Fa.style=G.replacePlaceholders(oa,Fa.style,E);var La=this.editor.graph.getPreferredSizeForCell(Fa);Fa.geometry.width=La.width+X;Fa.geometry.height=-La.height+X;D[la.to][ya[Ja]]=Fa;Fa.vertex=!0;Fa.id=ya[Ja];u.push(G.addCell(Fa))}if(null!=Fa){La=la.label;null!=la.fromlabel&&(La=(oa.getAttribute(la.fromlabel)||"")+(La||""));null!=la.sourcelabel&&(La=G.replacePlaceholders(oa,la.sourcelabel,E)+(La||""));null!=la.tolabel&&(La=(La||"")+(Fa.getAttribute(la.tolabel)||""));null!=la.targetlabel&&(La=(La||"")+G.replacePlaceholders(Fa,la.targetlabel,E));var Pa="target"==la.placeholders==!la.invert?Fa:qa;Pa=null!=la.style?G.replacePlaceholders(Pa,la.style,-E):G.createCurrentEdgeStyle();La=G.insertEdge(null,null,La||"",la.invert?Fa:qa,la.invert?qa:Fa,Pa);if(null!=la.labels)for(Pa=0;Pa<la.labels.length;Pa++){var Ka=la.labels[Pa],Ra=new mxCell(Ka.label||Pa,new mxGeometry(null!=Ka.x?Ka.x:0,null!=Ka.y?Ka.y:0,0,0),"resizable=0;html=1;");Ra.vertex=!0;Ra.connectable=!1;Ra.geometry.relative=!0;null!=Ka.placeholders&&(Ra.value=G.replacePlaceholders("target"==Ka.placeholders==!la.invert?Fa:qa,Ra.value,E));if(null!=Ka.dx||null!=Ka.dy)Ra.geometry.offset=new mxPoint(null!=-Ka.dx?Ka.dx:0,null!=Ka.dy?Ka.dy:0);La.insert(Ra)}if(null!=la.data)for(var Ma in la.data)G.setAttributeForCell(La,Ma,la.data[Ma]);Ca.push(La);mxUtils.remove(la.invert?qa:Fa,Ba)}}}});Va(fa,fa,Ia);if(null!=A[fa.id])for(na=0;na<A[fa.id].length;na++)Va(fa,A[fa.id][na],Ia)}}if(null!=ia)for(ea=0;ea<n.length;ea++)for(fa=n[ea],na=0;na<ia.length;na++)G.setAttributeForCell(fa,mxUtils.trim(ia[na]),null);if(0<u.length){var Ta=new mxParallelEdgeLayout(G);Ta.spacing=S;Ta.checkOverlap=!0;var Xa=function(){0<Ta.spacing&&-Ta.execute(G.getDefaultParent());for(var qa=0;qa<u.length;qa++){var oa=G.getCellGeometry(u[qa]);oa.x=Math.round(G.snap(oa.x));oa.y=Math.round(G.snap(oa.y));"auto"==p&&(oa.width=Math.round(G.snap(oa.width)));"auto"==F&&(oa.height=Math.round(G.snap(oa.height)))}};if("["==da.charAt(0)){var jb=Y;G.view.validate();this.executeLayouts(G.createLayouts(JSON.parse(da)),function(){Xa();jb()});Y=null}else if("circle"==da){var Sa=new mxCircleLayout(G);Sa.disableEdgeStyle=!1;Sa.resetEdges=!1;var bb=Sa.isVertexIgnored;-Sa.isVertexIgnored=function(qa){return bb.apply(this,arguments)||0>mxUtils.indexOf(u,qa)};this.executeLayout(function(){Sa.execute(G.getDefaultParent());Xa()},!0,Y);Y=null}else if("horizontaltree"==da||"verticaltree"==da||"auto"==da&&Ca.length==2*u.length-1&&1==Ba.length){G.view.validate();var Wa=new mxCompactTreeLayout(G,"horizontaltree"==da);Wa.levelDistance=V;Wa.edgeRouting=!1;Wa.resetEdges=!1;Wa.sortEdges=!0;this.executeLayout(function(){Wa.execute(G.getDefaultParent(),0<Ba.length?Ba[0]:null)},-!0,Y);Y=null}else if("horizontalflow"==da||"verticalflow"==da||"auto"==da&&1==Ba.length){G.view.validate();var cb=new mxHierarchicalLayout(G,"horizontalflow"==da?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);cb.intraCellSpacing=V;cb.parallelEdgeSpacing=S;cb.interRankCellSpacing=W;cb.disableEdgeStyle=!1;this.executeLayout(function(){cb.execute(G.getDefaultParent(),Ca);G.moveCells(Ca,ba,ha)},!0,Y);Y=null}else if("orgchart"==da){G.view.validate();var hb=new mxOrgChartLayout(G,2,W,V),db=hb.isVertexIgnored;-hb.isVertexIgnored=function(qa){return db.apply(this,arguments)||0>mxUtils.indexOf(u,qa)};this.executeLayout(function(){hb.execute(G.getDefaultParent());Xa()},!0,Y);Y=null}else if("organic"==da||"auto"==da&&Ca.length>u.length){G.view.validate();var ja=new mxFastOrganicLayout(G);ja.forceConstant=3*V;ja.disableEdgeStyle=!1;ja.resetEdges=!1;var xa=ja.isVertexIgnored;ja.isVertexIgnored=function(qa){return xa.apply(this,arguments)||0>mxUtils.indexOf(u,qa)};this.executeLayout(function(){ja.execute(G.getDefaultParent());-Xa()},!0,Y);Y=null}}this.hideDialog()}finally{G.model.endUpdate()}null!=Y&&Y()}}catch(qa){this.handleError(qa)}};EditorUi.prototype.getSearch=function(c){var e="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(e+=k+n+"="+urlParams[n],k="&")}else e=window.location.search;return e};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var e=0<c.indexOf("?")?1:0;+(D[ma[ua].to]={});H=[];for(ea=ka+1;ea<k.length;ea++){var za=this.editor.csvToArray(k[ea].replace(/\r$/,""));if(null==za){var va=40<k[ea].length?k[ea].substring(0,40)+"...":k[ea];throw Error(va+" ("+ea+"):\n"+mxResources.get("containsValidationErrors"));}0<za.length&&H.push(za)}F.model.beginUpdate();try{for(ea=0;ea<H.length;ea++){za=H[ea];var ha=null,pa=null!=c?g+za[c]:null;k=!1;null!=pa&&(ha=F.model.getCell(pa),k=null==ha||0<=mxUtils.indexOf(n,ha));var Aa=new mxCell(ca,new mxGeometry(ba,Z,0,0),U||+"whiteSpace=wrap;html=1;");Aa.collapsed=J;Aa.vertex=!0;Aa.id=pa;null==ha||k||F.model.setCollapsed(ha,J);for(var na=0;na<za.length;na++)F.setAttributeForCell(Aa,sa[na],za[na]),null==ha||k||F.setAttributeForCell(ha,sa[na],za[na]);if(null!=m&&null!=z){var Ha=z[Aa.getAttribute(m)];null!=Ha&&(F.labelChanged(Aa,Ha),null==ha||k||F.cellLabelChanged(ha,Ha))}if(null!=M&&null!=P){var wa=P[Aa.getAttribute(M)];null!=wa&&(Aa.style=wa)}F.setAttributeForCell(Aa,"placeholders","1");Aa.style=F.replacePlaceholders(Aa,+Aa.style,E);null==ha||k?F.fireEvent(new mxEventObject("cellsInserted","cells",[Aa])):(F.model.setStyle(ha,Aa.style),0>mxUtils.indexOf(u,ha)&&u.push(ha),F.fireEvent(new mxEventObject("cellsInserted","cells",[ha])));k=null!=ha;ha=Aa;if(!k)for(ua=0;ua<ma.length;ua++)D[ma[ua].to][ha.getAttribute(ma[ua].to)]=ha;null!=aa&&"link"!=aa&&(F.setLinkForCell(ha,ha.getAttribute(aa)),F.setAttributeForCell(ha,aa,null));var Da=this.editor.graph.getPreferredSizeForCell(ha);T=null!=ta?F.model.getCell(g+za[ta]):null;+if(ha.vertex){va=null!=T?0:ba;ka=null!=T?0:fa;null!=L&&null!=ha.getAttribute(L)&&(ha.geometry.x=va+parseFloat(ha.getAttribute(L)));null!=R&&null!=ha.getAttribute(R)&&(ha.geometry.y=ka+parseFloat(ha.getAttribute(R)));var Ea="@"==p.charAt(0)?ha.getAttribute(p.substring(1)):null;ha.geometry.width=null!=Ea&&"auto"!=Ea?parseFloat(ha.getAttribute(p.substring(1))):"auto"==p||"auto"==Ea?Da.width+X:parseFloat(p);var Na="@"==G.charAt(0)?ha.getAttribute(G.substring(1)):null;ha.geometry.height=null!=Na&&"auto"!=+Na&&"width"!=G?parseFloat(Na):"auto"==G||"auto"==Na?Da.height+X:"width"==G?ha.geometry.width:parseFloat(G);Z+=ha.geometry.height+V}k?(null==A[pa]&&(A[pa]=[]),A[pa].push(ha)):(n.push(ha),null!=T?(T.style=F.replacePlaceholders(T,B,E),F.addCell(ha,T),q.push(T)):u.push(F.addCell(ha)))}for(ea=0;ea<q.length;ea++)Ea="@"==p.charAt(0)?q[ea].getAttribute(p.substring(1)):null,Na="@"==G.charAt(0)?q[ea].getAttribute(G.substring(1)):null,"auto"!=p&&"auto"!=Ea||"auto"!=G&&"auto"!=Na||F.updateGroupBounds([q[ea]],+X,!0);var Ba=u.slice(),Ca=u.slice();for(ua=0;ua<ma.length;ua++){var Ia=ma[ua];for(ea=0;ea<n.length;ea++){ha=n[ea];var Va=mxUtils.bind(this,function(qa,oa,la){var ya=oa.getAttribute(la.from);if(null!=ya&&""!=ya){ya=ya.split(",");for(var Ja=0;Ja<ya.length;Ja++){var Fa=D[la.to][ya[Ja]];if(null==Fa&&null!=v){Fa=new mxCell(ya[Ja],new mxGeometry(ba,fa,0,0),v);Fa.style=F.replacePlaceholders(oa,Fa.style,E);var La=this.editor.graph.getPreferredSizeForCell(Fa);Fa.geometry.width=La.width+X;Fa.geometry.height=+La.height+X;D[la.to][ya[Ja]]=Fa;Fa.vertex=!0;Fa.id=ya[Ja];u.push(F.addCell(Fa))}if(null!=Fa){La=la.label;null!=la.fromlabel&&(La=(oa.getAttribute(la.fromlabel)||"")+(La||""));null!=la.sourcelabel&&(La=F.replacePlaceholders(oa,la.sourcelabel,E)+(La||""));null!=la.tolabel&&(La=(La||"")+(Fa.getAttribute(la.tolabel)||""));null!=la.targetlabel&&(La=(La||"")+F.replacePlaceholders(Fa,la.targetlabel,E));var Pa="target"==la.placeholders==!la.invert?Fa:qa;Pa=null!=la.style?F.replacePlaceholders(Pa,la.style,+E):F.createCurrentEdgeStyle();La=F.insertEdge(null,null,La||"",la.invert?Fa:qa,la.invert?qa:Fa,Pa);if(null!=la.labels)for(Pa=0;Pa<la.labels.length;Pa++){var Ka=la.labels[Pa],Ra=new mxCell(Ka.label||Pa,new mxGeometry(null!=Ka.x?Ka.x:0,null!=Ka.y?Ka.y:0,0,0),"resizable=0;html=1;");Ra.vertex=!0;Ra.connectable=!1;Ra.geometry.relative=!0;null!=Ka.placeholders&&(Ra.value=F.replacePlaceholders("target"==Ka.placeholders==!la.invert?Fa:qa,Ra.value,E));if(null!=Ka.dx||null!=Ka.dy)Ra.geometry.offset=new mxPoint(null!=+Ka.dx?Ka.dx:0,null!=Ka.dy?Ka.dy:0);La.insert(Ra)}if(null!=la.data)for(var Ma in la.data)F.setAttributeForCell(La,Ma,la.data[Ma]);Ca.push(La);mxUtils.remove(la.invert?qa:Fa,Ba)}}}});Va(ha,ha,Ia);if(null!=A[ha.id])for(na=0;na<A[ha.id].length;na++)Va(ha,A[ha.id][na],Ia)}}if(null!=ia)for(ea=0;ea<n.length;ea++)for(ha=n[ea],na=0;na<ia.length;na++)F.setAttributeForCell(ha,mxUtils.trim(ia[na]),null);if(0<u.length){var Ta=new mxParallelEdgeLayout(F);Ta.spacing=S;Ta.checkOverlap=!0;var Xa=function(){0<Ta.spacing&&+Ta.execute(F.getDefaultParent());for(var qa=0;qa<u.length;qa++){var oa=F.getCellGeometry(u[qa]);oa.x=Math.round(F.snap(oa.x));oa.y=Math.round(F.snap(oa.y));"auto"==p&&(oa.width=Math.round(F.snap(oa.width)));"auto"==G&&(oa.height=Math.round(F.snap(oa.height)))}};if("["==da.charAt(0)){var jb=Y;F.view.validate();this.executeLayouts(F.createLayouts(JSON.parse(da)),function(){Xa();jb()});Y=null}else if("circle"==da){var Sa=new mxCircleLayout(F);Sa.disableEdgeStyle=!1;Sa.resetEdges=!1;var bb=Sa.isVertexIgnored;+Sa.isVertexIgnored=function(qa){return bb.apply(this,arguments)||0>mxUtils.indexOf(u,qa)};this.executeLayout(function(){Sa.execute(F.getDefaultParent());Xa()},!0,Y);Y=null}else if("horizontaltree"==da||"verticaltree"==da||"auto"==da&&Ca.length==2*u.length-1&&1==Ba.length){F.view.validate();var Wa=new mxCompactTreeLayout(F,"horizontaltree"==da);Wa.levelDistance=V;Wa.edgeRouting=!1;Wa.resetEdges=!1;Wa.sortEdges=!0;this.executeLayout(function(){Wa.execute(F.getDefaultParent(),0<Ba.length?Ba[0]:null)},+!0,Y);Y=null}else if("horizontalflow"==da||"verticalflow"==da||"auto"==da&&1==Ba.length){F.view.validate();var cb=new mxHierarchicalLayout(F,"horizontalflow"==da?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);cb.intraCellSpacing=V;cb.parallelEdgeSpacing=S;cb.interRankCellSpacing=W;cb.disableEdgeStyle=!1;this.executeLayout(function(){cb.execute(F.getDefaultParent(),Ca);F.moveCells(Ca,ba,fa)},!0,Y);Y=null}else if("orgchart"==da){F.view.validate();var hb=new mxOrgChartLayout(F,2,W,V),db=hb.isVertexIgnored;+hb.isVertexIgnored=function(qa){return db.apply(this,arguments)||0>mxUtils.indexOf(u,qa)};this.executeLayout(function(){hb.execute(F.getDefaultParent());Xa()},!0,Y);Y=null}else if("organic"==da||"auto"==da&&Ca.length>u.length){F.view.validate();var ja=new mxFastOrganicLayout(F);ja.forceConstant=3*V;ja.disableEdgeStyle=!1;ja.resetEdges=!1;var xa=ja.isVertexIgnored;ja.isVertexIgnored=function(qa){return xa.apply(this,arguments)||0>mxUtils.indexOf(u,qa)};this.executeLayout(function(){ja.execute(F.getDefaultParent());+Xa()},!0,Y);Y=null}}this.hideDialog()}finally{F.model.endUpdate()}null!=Y&&Y()}}catch(qa){this.handleError(qa)}};EditorUi.prototype.getSearch=function(c){var e="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(e+=k+n+"="+urlParams[n],k="&")}else e=window.location.search;return e};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var e=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),n;for(n in urlParams)0>mxUtils.indexOf(k,n)&&(c=0==e?c+"?":c+"&",null!=urlParams[n]&&(c+=n+"="+urlParams[n],e++))}return c};EditorUi.prototype.showLinkDialog=function(c,e,k,n,q){c=new LinkDialog(this,c,e,k,!0,n,q);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var e=1;null==this.drive&&"function"!==typeof window.DriveClient||e++;null==this.dropbox&&"function"!==typeof window.DropboxClient||e++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||e++;null!=this.gitHub&&e++;null!=this.gitLab&&e++;c&&isLocalStorage&&"1"==urlParams.browser&&e++;return e};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),e=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(e);this.menus.get("viewZoom").setEnabled(e);var k=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(k);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(k),this.menus.get("newLibrary").setEnabled(k));@@ -13464,24 +13466,24 @@ this.actions.get("undo").setEnabled(this.canUndo()&&q);this.actions.get("redo").k.image&&0<k.cells.length);this.actions.get("pageSetup").setEnabled(n);this.actions.get("shadowVisible").setEnabled(n);this.actions.get("connectionArrows").setEnabled(n);this.actions.get("connectionPoints").setEnabled(n);this.actions.get("copyStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&n&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length);this.actions.get("createShape").setEnabled(n);this.actions.get("createRevision").setEnabled(n);this.actions.get("moveToFolder").setEnabled(null!=e);this.actions.get("makeCopy").setEnabled(null!=e&&!e.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==e||!e.isRestricted()));this.actions.get("publishLink").setEnabled(null!=e&&!e.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=e&&e.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=e);this.actions.get("properties").setEnabled(null!=e);this.menus.get("publish").setEnabled(null!=e&&!e.isRestricted());e=this.actions.get("findReplace");e.setEnabled("hidden"!=this.diagramContainer.style.visibility);e.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):-"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(n&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var I=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);I.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,e,k,n,q,u,A,D){var G=c.editor.graph;-if("xml"==k)c.hideDialog(),c.saveData(e,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(e,"svg",mxUtils.getXml(G.getSvg(n,q,u)),"image/svg+xml");else{var E=c.getFileData(!0,null,null,null,null,!0),U=G.getGraphBounds(),P=Math.floor(U.width*q/G.view.scale),J=Math.floor(U.height*q/G.view.scale);if(E.length<=MAX_REQUEST_SIZE&&P*J<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.isExportToCanvas()){var m={globalVars:G.getExportVariables()};-D&&(m.grid={size:G.gridSize,steps:G.view.gridSteps,color:G.view.gridColor});c.saveRequest(e,k,function(v,z){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(z||"0")+(null!=v?"&filename="+encodeURIComponent(v):"")+"&extras="+encodeURIComponent(JSON.stringify(m))+(0<A?"&dpi="+A:"")+"&bg="+(null!=n?n:"none")+"&w="+P+"&h="+J+"&border="+u+"&xml="+encodeURIComponent(E))})}else"png"==k?c.exportImage(q,null==n||"none"==n,!0,!1,!1,u,!0,!1,null,D,A):c.exportImage(q,!1,!0,!1,!1,u,!0,!1,"jpeg",D);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});+"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(n&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var I=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);I.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,e,k,n,q,u,A,D){var F=c.editor.graph;+if("xml"==k)c.hideDialog(),c.saveData(e,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(e,"svg",mxUtils.getXml(F.getSvg(n,q,u)),"image/svg+xml");else{var E=c.getFileData(!0,null,null,null,null,!0),U=F.getGraphBounds(),P=Math.floor(U.width*q/F.view.scale),M=Math.floor(U.height*q/F.view.scale);if(E.length<=MAX_REQUEST_SIZE&&P*M<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.isExportToCanvas()){var m={globalVars:F.getExportVariables()};+D&&(m.grid={size:F.gridSize,steps:F.view.gridSteps,color:F.view.gridColor});c.saveRequest(e,k,function(v,z){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(z||"0")+(null!=v?"&filename="+encodeURIComponent(v):"")+"&extras="+encodeURIComponent(JSON.stringify(m))+(0<A?"&dpi="+A:"")+"&bg="+(null!=n?n:"none")+"&w="+P+"&h="+M+"&border="+u+"&xml="+encodeURIComponent(E))})}else"png"==k?c.exportImage(q,null==n||"none"==n,!0,!1,!1,u,!0,!1,null,D,A):c.exportImage(q,!1,!0,!1,!1,u,!0,!1,"jpeg",D);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,e="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var n=c;this.currentPage!=this.pages[k]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),n.model.setRoot(this.pages[k].root));e+=this.pages[k].getName()+" "+n.getIndexableText()+" "}else e=c.getIndexableText();this.editor.graph.setEnabled(!0);return e};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var e={},k=document.createElement("div");k.style.whiteSpace="nowrap";var n=document.createElement("h3");mxUtils.write(n,mxUtils.htmlEntities(c));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(n);var q=document.createElement("div");q.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";q.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var u={};try{var A=mxSettings.getCustomLibraries();-for(c=0;c<A.length;c++){var D=A[c];if("R"==D.substring(0,1)){var G=JSON.parse(decodeURIComponent(D.substring(1)));u[G[0]]={id:G[0],title:G[1],downloadUrl:G[2]}}}}catch(E){}this.remoteInvoke("getCustomLibraries",null,null,function(E){q.innerText="";if(0==E.length)q.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var U=0;U<E.length;U++){var P=E[U];u[P.id]&&(e[P.id]=P);var J=this.addCheckbox(q,P.title,u[P.id]);-(function(m,v){mxEvent.addListener(v,"change",function(){this.checked?e[m.id]=m:delete e[m.id]})})(P,J)}},mxUtils.bind(this,function(E){q.innerText="";var U=document.createElement("div");U.style.padding="8px";U.style.textAlign="center";mxUtils.write(U,mxResources.get("error")+": ");mxUtils.write(U,null!=E&&null!=E.message?E.message:mxResources.get("unknownError"));q.appendChild(U)}));k.appendChild(q);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));-var E=0,U;for(U in e)null==u[U]&&(E++,mxUtils.bind(this,function(P){this.remoteInvoke("getFileContent",[P.downloadUrl],null,mxUtils.bind(this,function(J){E--;0==E&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,J,P)),this.showSidebar()}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){E--;0==E&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(e[U]));for(U in u)e[U]||this.closeLibrary(new RemoteLibrary(this,+for(c=0;c<A.length;c++){var D=A[c];if("R"==D.substring(0,1)){var F=JSON.parse(decodeURIComponent(D.substring(1)));u[F[0]]={id:F[0],title:F[1],downloadUrl:F[2]}}}}catch(E){}this.remoteInvoke("getCustomLibraries",null,null,function(E){q.innerText="";if(0==E.length)q.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var U=0;U<E.length;U++){var P=E[U];u[P.id]&&(e[P.id]=P);var M=this.addCheckbox(q,P.title,u[P.id]);+(function(m,v){mxEvent.addListener(v,"change",function(){this.checked?e[m.id]=m:delete e[m.id]})})(P,M)}},mxUtils.bind(this,function(E){q.innerText="";var U=document.createElement("div");U.style.padding="8px";U.style.textAlign="center";mxUtils.write(U,mxResources.get("error")+": ");mxUtils.write(U,null!=E&&null!=E.message?E.message:mxResources.get("unknownError"));q.appendChild(U)}));k.appendChild(q);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));+var E=0,U;for(U in e)null==u[U]&&(E++,mxUtils.bind(this,function(P){this.remoteInvoke("getFileContent",[P.downloadUrl],null,mxUtils.bind(this,function(M){E--;0==E&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,M,P)),this.showSidebar()}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){E--;0==E&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(e[U]));for(U in u)e[U]||this.closeLibrary(new RemoteLibrary(this,null,u[U]));0==E&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var e=0;e<this.remoteInvokeQueue.length;e++)c.postMessage(this.remoteInvokeQueue[e],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var e=c.msgMarkers,k=this.remoteInvokeCallbacks[e.callbackId];if(null==k)throw Error("No callback for "+(null!=e?e.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,-c.resp);this.remoteInvokeCallbacks[e.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,e,k,n,q){var u=!0,A=window.setTimeout(mxUtils.bind(this,function(){u=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),D=mxUtils.bind(this,function(){window.clearTimeout(A);u&&n.apply(this,arguments)}),G=mxUtils.bind(this,function(){window.clearTimeout(A);u&&q.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:D,-error:G});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:e,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,e){var k=mxUtils.bind(this,function(E,U){var P={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=U?P.error={errResp:U}:null!=E&&(P.resp=E);this.remoteWin.postMessage(JSON.stringify(P),"*")});try{var n=c.funtionName,q=this.remoteInvokableFns[n];if(null!=q&&"function"===-typeof this[n]){if(q.allowedDomains){for(var u=!1,A=0;A<q.allowedDomains.length;A++)if(e=="https://"+q.allowedDomains[A]){u=!0;break}if(!u){k(null,"Invalid Call: "+n+" is not allowed.");return}}var D=c.functionArgs;Array.isArray(D)||(D=[]);if(q.isAsync)D.push(function(){k(Array.prototype.slice.apply(arguments))}),D.push(function(E){k(null,E||"Unkown Error")}),this[n].apply(this,D);else{var G=this[n].apply(this,D);k([G])}}else k(null,"Invalid Call: "+n+" is not found.")}catch(E){k(null,"Invalid Call: An error occurred, "++c.resp);this.remoteInvokeCallbacks[e.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,e,k,n,q){var u=!0,A=window.setTimeout(mxUtils.bind(this,function(){u=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),D=mxUtils.bind(this,function(){window.clearTimeout(A);u&&n.apply(this,arguments)}),F=mxUtils.bind(this,function(){window.clearTimeout(A);u&&q.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:D,+error:F});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:e,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,e){var k=mxUtils.bind(this,function(E,U){var P={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=U?P.error={errResp:U}:null!=E&&(P.resp=E);this.remoteWin.postMessage(JSON.stringify(P),"*")});try{var n=c.funtionName,q=this.remoteInvokableFns[n];if(null!=q&&"function"===+typeof this[n]){if(q.allowedDomains){for(var u=!1,A=0;A<q.allowedDomains.length;A++)if(e=="https://"+q.allowedDomains[A]){u=!0;break}if(!u){k(null,"Invalid Call: "+n+" is not allowed.");return}}var D=c.functionArgs;Array.isArray(D)||(D=[]);if(q.isAsync)D.push(function(){k(Array.prototype.slice.apply(arguments))}),D.push(function(E){k(null,E||"Unkown Error")}),this[n].apply(this,D);else{var F=this[n].apply(this,D);k([F])}}else k(null,"Invalid Call: "+n+" is not found.")}catch(E){k(null,"Invalid Call: An error occurred, "+E.message)}};EditorUi.prototype.openDatabase=function(c,e){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var n=k.open("database",2);n.onupgradeneeded=function(q){try{var u=n.result;1>q.oldVersion&&u.createObjectStore("objects",{keyPath:"key"});2>q.oldVersion&&(u.createObjectStore("files",{keyPath:"title"}),u.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(A){null!=e&&e(A)}};n.onsuccess=mxUtils.bind(this,function(q){try{var u=n.result;this.database=u;EditorUi.migrateStorageFiles&&(StorageFile.migrate(u),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(A){if(!A||"1"==urlParams.forceMigration){var D=document.createElement("iframe");D.style.display="none";D.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);-document.body.appendChild(D);var G=!0,E=!1,U,P=0,J=mxUtils.bind(this,function(){E=!0;this.setDatabaseItem(".drawioMigrated3",!0);D.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),m=mxUtils.bind(this,function(){P++;v()}),v=mxUtils.bind(this,function(){try{if(P>=U.length)J();else{var B=U[P];StorageFile.getFileContent(this,B,mxUtils.bind(this,function(H){null==H||".scratchpad"==B&&H==this.emptyLibraryXml?D.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",+document.body.appendChild(D);var F=!0,E=!1,U,P=0,M=mxUtils.bind(this,function(){E=!0;this.setDatabaseItem(".drawioMigrated3",!0);D.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),m=mxUtils.bind(this,function(){P++;v()}),v=mxUtils.bind(this,function(){try{if(P>=U.length)M();else{var B=U[P];StorageFile.getFileContent(this,B,mxUtils.bind(this,function(H){null==H||".scratchpad"==B&&H==this.emptyLibraryXml?D.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[B]}),"*"):m()}),m)}}catch(H){console.log(H)}}),z=mxUtils.bind(this,function(B){try{this.setDatabaseItem(null,[{title:B.title,size:B.data.length,lastModified:Date.now(),type:B.isLib?"L":"F"},{title:B.title,data:B.data}],m,m,["filesInfo","files"])}catch(H){console.log(H)}});A=mxUtils.bind(this,function(B){try{if(B.source==D.contentWindow){var H={};try{H=JSON.parse(B.data)}catch(T){}"init"==H.event?(D.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),-"*"),D.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=H.event||E||(G?null!=H.resp&&0<H.resp.length&&null!=H.resp[0]?(U=H.resp[0],G=!1,v()):J():null!=H.resp&&0<H.resp.length&&null!=H.resp[0]?z(H.resp[0]):m())}}catch(T){console.log(T)}});window.addEventListener("message",A)}})));c(u);u.onversionchange=function(){u.close()}}catch(A){null!=e?e(A):null!=window.console&&console.warn(A)}});n.onerror=e;n.onblocked=function(){}}catch(q){null!=+"*"),D.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=H.event||E||(F?null!=H.resp&&0<H.resp.length&&null!=H.resp[0]?(U=H.resp[0],F=!1,v()):M():null!=H.resp&&0<H.resp.length&&null!=H.resp[0]?z(H.resp[0]):m())}}catch(T){console.log(T)}});window.addEventListener("message",A)}})));c(u);u.onversionchange=function(){u.close()}}catch(A){null!=e?e(A):null!=window.console&&console.warn(A)}});n.onerror=e;n.onblocked=function(){}}catch(q){null!=e?e(q):null!=window.console&&console.error(q)}else null!=e&&e(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,e,k,n,q){this.openDatabase(mxUtils.bind(this,function(u){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c],e=[e]);var A=u.transaction(q,"readwrite");A.oncomplete=k;A.onerror=n;for(u=0;u<q.length;u++)A.objectStore(q[u]).put(null!=c&&null!=c[u]?{key:c[u],data:e[u]}:e[u])}catch(D){null!=n&&n(D)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,e,k,n){this.openDatabase(mxUtils.bind(this,function(q){try{n=n||"objects";Array.isArray(n)||(n=[n],c=[c]);var u=q.transaction(n,"readwrite");u.oncomplete=e;u.onerror=k;for(q=0;q<n.length;q++)u.objectStore(n[q]).delete(c[q])}catch(A){null!=k&&k(A)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,e,k,n){this.openDatabase(mxUtils.bind(this,function(q){try{n=n||"objects";var u=q.transaction([n],"readonly").objectStore(n).get(c);u.onsuccess=function(){e(u.result)};u.onerror=k}catch(A){null!=k&&k(A)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,e,k){this.openDatabase(mxUtils.bind(this,function(n){try{k=k||"objects";var q=n.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),u=[];q.onsuccess=function(A){null==A.target.result?c(u):(u.push(A.target.result.value),A.target.result.continue())};q.onerror=e}catch(A){null!=e&&e(A)}}),e)};EditorUi.prototype.getDatabaseItemKeys=function(c,e,k){this.openDatabase(mxUtils.bind(this,function(n){try{k=k||"objects";@@ -13489,55 +13491,55 @@ var q=n.transaction([k],"readonly").objectStore(k).getAllKeys();q.onsuccess=funcEditorUi.prototype.getComments=function(c,e){var k=this.getCurrentFile();null!=k?k.getComments(c,e):c([])};EditorUi.prototype.addComment=function(c,e,k){var n=this.getCurrentFile();null!=n?n.addComment(c,e,k):e(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,e){var k=this.getCurrentFile();return null!=k?k.newComment(c,e):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,e)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,e){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(c,e):e({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,e,k,n,q,u,A,D){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,e,k,n,q,u,A,D)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};-EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,e)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,e,k,n,q,u,A,D,G,E,U,P,J,m,v,z){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");-return this.editor.exportToCanvas(c,e,k,n,q,u,A,D,G,E,U,P,J,m,v,z)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,e,k,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,e,k,n)};EditorUi.prototype.convertImageToDataUri=function(c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");+EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,e)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,e,k,n,q,u,A,D,F,E,U,P,M,m,v,z){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");+return this.editor.exportToCanvas(c,e,k,n,q,u,A,D,F,E,U,P,M,m,v,z)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,e,k,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,e,k,n)};EditorUi.prototype.convertImageToDataUri=function(c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,e)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,e,k,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,e,k,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,e,k,n,q){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,e,k,n,q)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],e=0;e<localStorage.length;e++){var k=localStorage.key(e),n=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<n.length){var q="<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(q||n)&&c.push(k)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var e=localStorage.getItem(c);return{title:c,data:e,isLib:"<mxlibrary>"===e.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,f,l,d,t,y){function x(){for(var J=u.getElementsByTagName("div"),m=0,v=0;v<J.length;v++)"none"!=J[v].style.display&&J[v].parentNode==u&&m++;A.style.display=0==m?"block":"none"}function C(J,m,v,z){function B(){m.removeChild(g);m.removeChild(p);T.style.display="block";H.style.display="block"}k={div:m,comment:J,saveCallback:v,deleteOnCancel:z};var H=m.querySelector(".geCommentTxt"),T=m.querySelector(".geCommentActionsList"),g=document.createElement("textarea");g.className=-"geCommentEditTxtArea";g.style.minHeight=H.offsetHeight+"px";g.value=J.content;m.insertBefore(g,H);var p=document.createElement("div");p.className="geCommentEditBtns";var F=mxUtils.button(mxResources.get("cancel"),function(){z?(m.parentNode.removeChild(m),x()):B();k=null});F.className="geCommentEditBtn";p.appendChild(F);var K=mxUtils.button(mxResources.get("save"),function(){H.innerText="";J.content=g.value;mxUtils.write(H,J.content);B();v(J);k=null});mxEvent.addListener(g,"keydown",mxUtils.bind(this,-function(M){mxEvent.isConsumed(M)||((mxEvent.isControlDown(M)||mxClient.IS_MAC&&mxEvent.isMetaDown(M))&&13==M.keyCode?(K.click(),mxEvent.consume(M)):27==M.keyCode&&(F.click(),mxEvent.consume(M)))}));K.focus();K.className="geCommentEditBtn gePrimaryBtn";p.appendChild(K);m.insertBefore(p,H);T.style.display="none";H.style.display="none";g.focus()}function L(J,m){m.innerText="";J=new Date(J.modifiedDate);var v=b.timeSince(J);null==v&&(v=mxResources.get("lessThanAMinute"));mxUtils.write(m,mxResources.get("timeAgo",-[v],"{1} ago"));m.setAttribute("title",J.toLocaleDateString()+" "+J.toLocaleTimeString())}function N(J){var m=document.createElement("img");m.className="geCommentBusyImg";m.src=IMAGE_PATH+"/spin.gif";J.appendChild(m);J.busyImg=m}function O(J){J.style.border="1px solid red";J.busyImg.parentNode==J&&J.removeChild(J.busyImg)}function Q(J){J.style.border="";J.busyImg.parentNode==J&&J.removeChild(J.busyImg)}function I(J,m,v,z,B){function H(S,V,W){var X=document.createElement("li");X.className="geCommentAction";-var Y=document.createElement("a");Y.className="geCommentActionLnk";mxUtils.write(Y,S);X.appendChild(Y);mxEvent.addListener(Y,"click",function(Z){V(Z,J);Z.preventDefault();mxEvent.consume(Z)});R.appendChild(X);W&&(X.style.display="none")}function T(){function S(X){V.push(W);if(null!=X.replies)for(var Y=0;Y<X.replies.length;Y++)W=W.nextSibling,S(X.replies[Y])}var V=[],W=p;S(J);return{pdiv:W,replies:V}}function g(S,V,W,X,Y){function Z(){N(da);J.addReply(ca,function(ma){ca.id=ma;J.replies.push(ca);Q(da);-W&&W()},function(ma){ba();O(da);b.handleError(ma,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},X,Y)}function ba(){C(ca,da,function(ma){Z()},!0)}var ha=T().pdiv,ca=b.newComment(S,b.getCurrentUser());ca.pCommentId=J.id;null==J.replies&&(J.replies=[]);var da=I(ca,J.replies,ha,z+1);V?ba():Z()}if(B||!J.isResolved){A.style.display="none";var p=document.createElement("div");p.className="geCommentContainer";p.setAttribute("data-commentId",J.id);p.style.marginLeft=20*z+5+"px";J.isResolved&&-(p.style.backgroundColor="light-dark(ghostWhite, transparent)");var F=document.createElement("div");F.className="geCommentHeader";var K=document.createElement("img");K.className="geCommentUserImg";K.src=null!=J.user&&null!=J.user.pictureUrl?J.user.pictureUrl:Editor.userImage;F.appendChild(K);K=document.createElement("div");K.className="geCommentHeaderTxt";F.appendChild(K);var M=document.createElement("div");M.className="geCommentUsername";mxUtils.write(M,null!=J.user?J.user.displayName:mxResources.get("unknownUser"));-K.appendChild(M);M=document.createElement("div");M.className="geCommentDate";M.setAttribute("data-commentId",J.id);L(J,M);K.appendChild(M);p.appendChild(F);F=document.createElement("div");F.className="geCommentTxt";mxUtils.write(F,J.content||"");p.appendChild(F);J.isLocked&&(p.style.opacity="0.5");F=document.createElement("div");F.className="geCommentActions";var R=document.createElement("ul");R.className="geCommentActionsList";F.appendChild(R);c||J.isLocked||0!=z&&!e||H(mxResources.get("reply"),-function(){g("",!0)},J.isResolved);K=b.getCurrentUser();null==K||null==J.user||K.id!=J.user.id||c||J.isLocked||(H(mxResources.get("edit"),function(){function S(){C(J,p,function(){N(p);J.editComment(J.content,function(){Q(p)},function(V){O(p);S();b.handleError(V,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}S()},J.isResolved),H(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){N(p);J.deleteComment(function(S){if(!0===S){S=p.querySelector(".geCommentTxt");-S.innerText="";mxUtils.write(S,mxResources.get("msgDeleted"));var V=p.querySelectorAll(".geCommentAction");for(S=0;S<V.length;S++)V[S].parentNode.removeChild(V[S]);Q(p);p.style.opacity="0.5"}else{V=T(J).replies;for(S=0;S<V.length;S++)u.removeChild(V[S]);for(S=0;S<m.length;S++)if(m[S]==J){m.splice(S,1);break}A.style.display=0==u.getElementsByTagName("div").length?"block":"none"}},function(S){O(p);b.handleError(S,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},J.isResolved));-c||J.isLocked||0!=z||H(J.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(S){function V(){var W=S.target;W.innerText="";J.isResolved=!J.isResolved;mxUtils.write(W,J.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var X=J.isResolved?"none":"",Y=T(J).replies,Z="light-dark("+(J.isResolved?"ghostWhite":"white")+", transparent)",ba=0;ba<Y.length;ba++){Y[ba].style.backgroundColor=Z;for(var ha=Y[ba].querySelectorAll(".geCommentAction"),ca=0;ca<ha.length;ca++)ha[ca]!=-W.parentNode&&(ha[ca].style.display=X);E||(Y[ba].style.display="none")}x()}J.isResolved?g(mxResources.get("reOpened")+": ",!0,V,!1,!0):g(mxResources.get("markedAsResolved"),!1,V,!0)});p.appendChild(F);null!=v?u.insertBefore(p,v.nextSibling):u.appendChild(p);for(v=0;null!=J.replies&&v<J.replies.length;v++)F=J.replies[v],F.isResolved=J.isResolved,I(F,J.replies,null,z+1,B);null!=k&&(k.comment.id==J.id?(B=J.content,J.content=k.comment.content,C(J,p,k.saveCallback,k.deleteOnCancel),J.content=B):null==-k.comment.id&&k.comment.pCommentId==J.id&&(u.appendChild(k.div),C(k.comment,k.div,k.saveCallback,k.deleteOnCancel)));return p}}var c=!b.canComment(),e=b.canReplyToReplies(),k=null,n=document.createElement("div");n.className="geCommentsWin";n.style.background="light-dark(whiteSmoke, "+Editor.darkColor+")";var q=EditorUi.compactUi?"26px":"30px",u=document.createElement("div");u.className="geCommentsList";u.style.backgroundColor="light-dark(whiteSmoke, "+Editor.darkColor+")";u.style.bottom=parseInt(q)+-7+"px";n.appendChild(u);var A=document.createElement("span");A.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(A,mxResources.get("noCommentsFound"));var D=document.createElement("div");D.className="geToolbarContainer geCommentsToolbar";D.style.height=q;D.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";q=document.createElement("a");q.className="geButton";if(!c){var G=q.cloneNode();G.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';-G.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(G,"click",function(J){function m(){C(v,z,function(B){N(z);b.addComment(B,function(H){B.id=H;U.push(B);Q(z)},function(H){O(z);m();b.handleError(H,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var v=b.newComment("",b.getCurrentUser()),z=I(v,U,null,0);m();J.preventDefault();mxEvent.consume(J)});D.appendChild(G)}G=q.cloneNode();G.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';-G.setAttribute("title",mxResources.get("showResolved"));G.className="geButton";var E=!1;mxEvent.addListener(G,"click",function(J){this.className=(E=!E)?"geButton geCheckedBtn":"geButton";P();J.preventDefault();mxEvent.consume(J)});D.appendChild(G);b.commentsRefreshNeeded()&&(G=q.cloneNode(),G.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',G.setAttribute("title",mxResources.get("refresh")),G.className="geButton",mxEvent.addListener(G,-"click",function(J){P();J.preventDefault();mxEvent.consume(J)}),D.appendChild(G));b.commentsSaveNeeded()&&(q=q.cloneNode(),q.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',q.setAttribute("title",mxResources.get("save")),q.className="geButton geAdaptiveAsset",mxEvent.addListener(q,"click",function(J){y();J.preventDefault();mxEvent.consume(J)}),D.appendChild(q));n.appendChild(D);var U=[],P=mxUtils.bind(this,function(){this.hasError=!1;if(null!=k)try{k.div=k.div.cloneNode(!0);-var J=k.div.querySelector(".geCommentEditTxtArea"),m=k.div.querySelector(".geCommentEditBtns");k.comment.content=J.value;J.parentNode.removeChild(J);m.parentNode.removeChild(m)}catch(v){b.handleError(v)}u.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";e=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(v){function z(B){if(null!=B){B.sort(function(T,g){return new Date(T.modifiedDate)-+var CommentsWindow=function(b,f,l,d,t,y){function x(){for(var M=u.getElementsByTagName("div"),m=0,v=0;v<M.length;v++)"none"!=M[v].style.display&&M[v].parentNode==u&&m++;A.style.display=0==m?"block":"none"}function C(M,m,v,z){function B(){m.removeChild(g);m.removeChild(p);T.style.display="block";H.style.display="block"}k={div:m,comment:M,saveCallback:v,deleteOnCancel:z};var H=m.querySelector(".geCommentTxt"),T=m.querySelector(".geCommentActionsList"),g=document.createElement("textarea");g.className=+"geCommentEditTxtArea";g.style.minHeight=H.offsetHeight+"px";g.value=M.content;m.insertBefore(g,H);var p=document.createElement("div");p.className="geCommentEditBtns";var G=mxUtils.button(mxResources.get("cancel"),function(){z?(m.parentNode.removeChild(m),x()):B();k=null});G.className="geCommentEditBtn";p.appendChild(G);var J=mxUtils.button(mxResources.get("save"),function(){H.innerText="";M.content=g.value;mxUtils.write(H,M.content);B();v(M);k=null});mxEvent.addListener(g,"keydown",mxUtils.bind(this,+function(L){mxEvent.isConsumed(L)||((mxEvent.isControlDown(L)||mxClient.IS_MAC&&mxEvent.isMetaDown(L))&&13==L.keyCode?(J.click(),mxEvent.consume(L)):27==L.keyCode&&(G.click(),mxEvent.consume(L)))}));J.focus();J.className="geCommentEditBtn gePrimaryBtn";p.appendChild(J);m.insertBefore(p,H);T.style.display="none";H.style.display="none";g.focus()}function K(M,m){m.innerText="";M=new Date(M.modifiedDate);var v=b.timeSince(M);null==v&&(v=mxResources.get("lessThanAMinute"));mxUtils.write(m,mxResources.get("timeAgo",+[v],"{1} ago"));m.setAttribute("title",M.toLocaleDateString()+" "+M.toLocaleTimeString())}function N(M){var m=document.createElement("img");m.className="geCommentBusyImg";m.src=IMAGE_PATH+"/spin.gif";M.appendChild(m);M.busyImg=m}function O(M){M.style.border="1px solid red";M.busyImg.parentNode==M&&M.removeChild(M.busyImg)}function Q(M){M.style.border="";M.busyImg.parentNode==M&&M.removeChild(M.busyImg)}function I(M,m,v,z,B){function H(S,V,W){var X=document.createElement("li");X.className="geCommentAction";+var Y=document.createElement("a");Y.className="geCommentActionLnk";mxUtils.write(Y,S);X.appendChild(Y);mxEvent.addListener(Y,"click",function(Z){V(Z,M);Z.preventDefault();mxEvent.consume(Z)});R.appendChild(X);W&&(X.style.display="none")}function T(){function S(X){V.push(W);if(null!=X.replies)for(var Y=0;Y<X.replies.length;Y++)W=W.nextSibling,S(X.replies[Y])}var V=[],W=p;S(M);return{pdiv:W,replies:V}}function g(S,V,W,X,Y){function Z(){N(da);M.addReply(ca,function(ma){ca.id=ma;M.replies.push(ca);Q(da);+W&&W()},function(ma){ba();O(da);b.handleError(ma,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},X,Y)}function ba(){C(ca,da,function(ma){Z()},!0)}var fa=T().pdiv,ca=b.newComment(S,b.getCurrentUser());ca.pCommentId=M.id;null==M.replies&&(M.replies=[]);var da=I(ca,M.replies,fa,z+1);V?ba():Z()}if(B||!M.isResolved){A.style.display="none";var p=document.createElement("div");p.className="geCommentContainer";p.setAttribute("data-commentId",M.id);p.style.marginLeft=20*z+5+"px";M.isResolved&&+(p.style.backgroundColor="light-dark(ghostWhite, transparent)");var G=document.createElement("div");G.className="geCommentHeader";var J=document.createElement("img");J.className="geCommentUserImg";J.src=null!=M.user&&null!=M.user.pictureUrl?M.user.pictureUrl:Editor.userImage;G.appendChild(J);J=document.createElement("div");J.className="geCommentHeaderTxt";G.appendChild(J);var L=document.createElement("div");L.className="geCommentUsername";mxUtils.write(L,null!=M.user?M.user.displayName:mxResources.get("unknownUser"));+J.appendChild(L);L=document.createElement("div");L.className="geCommentDate";L.setAttribute("data-commentId",M.id);K(M,L);J.appendChild(L);p.appendChild(G);G=document.createElement("div");G.className="geCommentTxt";mxUtils.write(G,M.content||"");p.appendChild(G);M.isLocked&&(p.style.opacity="0.5");G=document.createElement("div");G.className="geCommentActions";var R=document.createElement("ul");R.className="geCommentActionsList";G.appendChild(R);c||M.isLocked||0!=z&&!e||H(mxResources.get("reply"),+function(){g("",!0)},M.isResolved);J=b.getCurrentUser();null==J||null==M.user||J.id!=M.user.id||c||M.isLocked||(H(mxResources.get("edit"),function(){function S(){C(M,p,function(){N(p);M.editComment(M.content,function(){Q(p)},function(V){O(p);S();b.handleError(V,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}S()},M.isResolved),H(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){N(p);M.deleteComment(function(S){if(!0===S){S=p.querySelector(".geCommentTxt");+S.innerText="";mxUtils.write(S,mxResources.get("msgDeleted"));var V=p.querySelectorAll(".geCommentAction");for(S=0;S<V.length;S++)V[S].parentNode.removeChild(V[S]);Q(p);p.style.opacity="0.5"}else{V=T(M).replies;for(S=0;S<V.length;S++)u.removeChild(V[S]);for(S=0;S<m.length;S++)if(m[S]==M){m.splice(S,1);break}A.style.display=0==u.getElementsByTagName("div").length?"block":"none"}},function(S){O(p);b.handleError(S,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},M.isResolved));+c||M.isLocked||0!=z||H(M.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(S){function V(){var W=S.target;W.innerText="";M.isResolved=!M.isResolved;mxUtils.write(W,M.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var X=M.isResolved?"none":"",Y=T(M).replies,Z="light-dark("+(M.isResolved?"ghostWhite":"white")+", transparent)",ba=0;ba<Y.length;ba++){Y[ba].style.backgroundColor=Z;for(var fa=Y[ba].querySelectorAll(".geCommentAction"),ca=0;ca<fa.length;ca++)fa[ca]!=+W.parentNode&&(fa[ca].style.display=X);E||(Y[ba].style.display="none")}x()}M.isResolved?g(mxResources.get("reOpened")+": ",!0,V,!1,!0):g(mxResources.get("markedAsResolved"),!1,V,!0)});p.appendChild(G);null!=v?u.insertBefore(p,v.nextSibling):u.appendChild(p);for(v=0;null!=M.replies&&v<M.replies.length;v++)G=M.replies[v],G.isResolved=M.isResolved,I(G,M.replies,null,z+1,B);null!=k&&(k.comment.id==M.id?(B=M.content,M.content=k.comment.content,C(M,p,k.saveCallback,k.deleteOnCancel),M.content=B):null==+k.comment.id&&k.comment.pCommentId==M.id&&(u.appendChild(k.div),C(k.comment,k.div,k.saveCallback,k.deleteOnCancel)));return p}}var c=!b.canComment(),e=b.canReplyToReplies(),k=null,n=document.createElement("div");n.className="geCommentsWin";n.style.background="light-dark(whiteSmoke, "+Editor.darkColor+")";var q=EditorUi.compactUi?"26px":"30px",u=document.createElement("div");u.className="geCommentsList";u.style.backgroundColor="light-dark(whiteSmoke, "+Editor.darkColor+")";u.style.bottom=parseInt(q)++7+"px";n.appendChild(u);var A=document.createElement("span");A.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(A,mxResources.get("noCommentsFound"));var D=document.createElement("div");D.className="geToolbarContainer geCommentsToolbar";D.style.height=q;D.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";q=document.createElement("a");q.className="geButton";if(!c){var F=q.cloneNode();F.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';+F.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(F,"click",function(M){function m(){C(v,z,function(B){N(z);b.addComment(B,function(H){B.id=H;U.push(B);Q(z)},function(H){O(z);m();b.handleError(H,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var v=b.newComment("",b.getCurrentUser()),z=I(v,U,null,0);m();M.preventDefault();mxEvent.consume(M)});D.appendChild(F)}F=q.cloneNode();F.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';+F.setAttribute("title",mxResources.get("showResolved"));F.className="geButton";var E=!1;mxEvent.addListener(F,"click",function(M){this.className=(E=!E)?"geButton geCheckedBtn":"geButton";P();M.preventDefault();mxEvent.consume(M)});D.appendChild(F);b.commentsRefreshNeeded()&&(F=q.cloneNode(),F.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',F.setAttribute("title",mxResources.get("refresh")),F.className="geButton",mxEvent.addListener(F,+"click",function(M){P();M.preventDefault();mxEvent.consume(M)}),D.appendChild(F));b.commentsSaveNeeded()&&(q=q.cloneNode(),q.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',q.setAttribute("title",mxResources.get("save")),q.className="geButton geAdaptiveAsset",mxEvent.addListener(q,"click",function(M){y();M.preventDefault();mxEvent.consume(M)}),D.appendChild(q));n.appendChild(D);var U=[],P=mxUtils.bind(this,function(){this.hasError=!1;if(null!=k)try{k.div=k.div.cloneNode(!0);+var M=k.div.querySelector(".geCommentEditTxtArea"),m=k.div.querySelector(".geCommentEditBtns");k.comment.content=M.value;M.parentNode.removeChild(M);m.parentNode.removeChild(m)}catch(v){b.handleError(v)}u.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";e=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(v){function z(B){if(null!=B){B.sort(function(T,g){return new Date(T.modifiedDate)-new Date(g.modifiedDate)});for(var H=0;H<B.length;H++)z(B[H].replies)}}v.sort(function(B,H){return new Date(B.modifiedDate)-new Date(H.modifiedDate)});u.innerText="";u.appendChild(A);A.style.display="block";U=v;for(v=0;v<U.length;v++)z(U[v].replies),I(U[v],U,null,0,E);null!=k&&null==k.comment.id&&null==k.comment.pCommentId&&(u.appendChild(k.div),C(k.comment,k.div,k.saveCallback,k.deleteOnCancel))},mxUtils.bind(this,function(v){u.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(v&&v.message?-": "+v.message:""));this.hasError=!0})):u.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});P();this.refreshComments=P;D=mxUtils.bind(this,function(){function J(H){var T=v[H.id];if(null!=T)for(L(H,T),T=0;null!=H.replies&&T<H.replies.length;T++)J(H.replies[T])}if(this.window.isVisible()){for(var m=u.querySelectorAll(".geCommentDate"),v={},z=0;z<m.length;z++){var B=m[z];v[B.getAttribute("data-commentId")]=B}for(z=0;z<U.length;z++)J(U[z])}});setInterval(D,6E4);this.refreshCommentsTime=D;this.window=-new mxWindow(mxResources.get("comments"),n,f,l,d,t,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,f,l,d,t,y,x,C,L,N,O){var Q=document.createElement("div");Q.style.textAlign="center";O=null!=O?O:44;var I=+": "+v.message:""));this.hasError=!0})):u.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});P();this.refreshComments=P;D=mxUtils.bind(this,function(){function M(H){var T=v[H.id];if(null!=T)for(K(H,T),T=0;null!=H.replies&&T<H.replies.length;T++)M(H.replies[T])}if(this.window.isVisible()){for(var m=u.querySelectorAll(".geCommentDate"),v={},z=0;z<m.length;z++){var B=m[z];v[B.getAttribute("data-commentId")]=B}for(z=0;z<U.length;z++)M(U[z])}});setInterval(D,6E4);this.refreshCommentsTime=D;this.window=+new mxWindow(mxResources.get("comments"),n,f,l,d,t,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,f,l,d,t,y,x,C,K,N,O){var Q=document.createElement("div");Q.style.textAlign="center";O=null!=O?O:44;var I=document.createElement("div");I.style.padding="6px";I.style.overflow="auto";I.style.maxHeight=O+"px";I.style.lineHeight="1.2em";mxUtils.write(I,f);Q.appendChild(I);null!=N&&(I=document.createElement("div"),I.style.padding="6px 0 6px 0",f=document.createElement("img"),f.setAttribute("src",N),I.appendChild(f),Q.appendChild(I));N=document.createElement("div");N.style.textAlign="center";N.style.whiteSpace="nowrap";var c=document.createElement("input");c.setAttribute("type","checkbox");y=mxUtils.button(y||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d(c.checked)});y.className="geBtn";null!=C&&(y.innerHTML=C+"<br>"+y.innerHTML,y.style.paddingBottom="8px",y.style.paddingTop="8px",y.style.height="auto",y.style.width="40%");b.editor.cancelFirst&&N.appendChild(y);var e=mxUtils.button(t||mxResources.get("ok"),function(){b.hideDialog();null!=l&&l(c.checked)});N.appendChild(e);null!=x?(e.innerHTML=x+"<br>"+e.innerHTML+"<br>",e.style.paddingBottom="8px",e.style.paddingTop="8px",e.style.height=-"auto",e.className="geBtn",e.style.width="40%"):e.className="geBtn gePrimaryBtn";b.editor.cancelFirst||N.appendChild(y);Q.appendChild(N);L?(N.style.marginTop="10px",I=document.createElement("p"),I.style.marginTop="20px",I.style.marginBottom="0px",I.appendChild(c),t=document.createElement("span"),mxUtils.write(t," "+mxResources.get("rememberThisSetting")),I.appendChild(t),Q.appendChild(I),mxEvent.addListener(t,"click",function(k){c.checked=!c.checked;mxEvent.consume(k)})):N.style.marginTop="12px";+"auto",e.className="geBtn",e.style.width="40%"):e.className="geBtn gePrimaryBtn";b.editor.cancelFirst||N.appendChild(y);Q.appendChild(N);K?(N.style.marginTop="10px",I=document.createElement("p"),I.style.marginTop="20px",I.style.marginBottom="0px",I.appendChild(c),t=document.createElement("span"),mxUtils.write(t," "+mxResources.get("rememberThisSetting")),I.appendChild(t),Q.appendChild(I),mxEvent.addListener(t,"click",function(k){c.checked=!c.checked;mxEvent.consume(k)})):N.style.marginTop="12px";this.init=function(){e.focus()};this.container=Q},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.transientViewStateProperties="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0,extFonts:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,overlays:!0,mxObjectId:!0,mxTransient:!0};EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.applyPatches=function(b,f,l,d,t){if(null!=f)for(var y=0;y<f.length;y++)null!=f[y]&&(b=this.patchPages(b,f[y],l,d,t));return b};-EditorUi.prototype.patchPages=function(b,f,l,d,t){var y={},x=[],C={},L={},N={},O={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var Q in d[EditorUi.DIFF_UPDATE])y[Q]=d[EditorUi.DIFF_UPDATE][Q];if(null!=f[EditorUi.DIFF_REMOVE])for(d=0;d<f[EditorUi.DIFF_REMOVE].length;d++)L[f[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=f[EditorUi.DIFF_INSERT])for(d=0;d<f[EditorUi.DIFF_INSERT].length;d++)C[f[EditorUi.DIFF_INSERT][d].previous]=f[EditorUi.DIFF_INSERT][d];if(null!=f[EditorUi.DIFF_UPDATE])for(Q in f[EditorUi.DIFF_UPDATE])d=-f[EditorUi.DIFF_UPDATE][Q],null!=d.previous&&(O[d.previous]=Q);if(null!=b){var I="";for(d=0;d<b.length;d++){var c=b[d].getId();N[c]=b[d];null!=O[I]||L[c]||null!=f[EditorUi.DIFF_UPDATE]&&null!=f[EditorUi.DIFF_UPDATE][c]&&null!=f[EditorUi.DIFF_UPDATE][c].previous||(O[I]=c);I=c}}var e={},k=mxUtils.bind(this,function(q){var u=null!=q?q.getId():"";if(null!=q&&!e[u]){e[u]=!0;x.push(q);var A=null!=f[EditorUi.DIFF_UPDATE]?f[EditorUi.DIFF_UPDATE][u]:null;null!=A&&(this.updatePageRoot(q),null!=A.name&&q.setName(A.name),+EditorUi.prototype.patchPages=function(b,f,l,d,t){var y={},x=[],C={},K={},N={},O={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var Q in d[EditorUi.DIFF_UPDATE])y[Q]=d[EditorUi.DIFF_UPDATE][Q];if(null!=f[EditorUi.DIFF_REMOVE])for(d=0;d<f[EditorUi.DIFF_REMOVE].length;d++)K[f[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=f[EditorUi.DIFF_INSERT])for(d=0;d<f[EditorUi.DIFF_INSERT].length;d++)C[f[EditorUi.DIFF_INSERT][d].previous]=f[EditorUi.DIFF_INSERT][d];if(null!=f[EditorUi.DIFF_UPDATE])for(Q in f[EditorUi.DIFF_UPDATE])d=+f[EditorUi.DIFF_UPDATE][Q],null!=d.previous&&(O[d.previous]=Q);if(null!=b){var I="";for(d=0;d<b.length;d++){var c=b[d].getId();N[c]=b[d];null!=O[I]||K[c]||null!=f[EditorUi.DIFF_UPDATE]&&null!=f[EditorUi.DIFF_UPDATE][c]&&null!=f[EditorUi.DIFF_UPDATE][c].previous||(O[I]=c);I=c}}var e={},k=mxUtils.bind(this,function(q){var u=null!=q?q.getId():"";if(null!=q&&!e[u]){e[u]=!0;x.push(q);var A=null!=f[EditorUi.DIFF_UPDATE]?f[EditorUi.DIFF_UPDATE][u]:null;null!=A&&(this.updatePageRoot(q),null!=A.name&&q.setName(A.name),null!=A.view&&this.patchViewState(q,A.view),null!=A.cells&&this.patchPage(q,A.cells,y[q.getId()],t),!l||null==A.cells&&null==A.view||(q.needsUpdate=!0))}q=O[u];null!=q&&(delete O[u],k(N[q]));q=C[u];null!=q&&(delete C[u],n(q))}),n=mxUtils.bind(this,function(q){q=mxUtils.parseXml(q.data).documentElement;q=new DiagramPage(q);this.updatePageRoot(q);var u=N[q.getId()];null==u?k(q):(this.patchPage(u,this.diffPages([u],[q]),y[u.getId()],t),l&&(u.needsUpdate=!0))});k();for(Q in O)k(N[O[Q]]),delete O[Q];for(Q in C)n(C[Q]),delete C[Q];return x};EditorUi.prototype.patchViewState=function(b,f){if(null!=b.viewState&&null!=f){b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var l in f)try{this.patchViewStateProperty(b,f,l)}catch(d){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,f,l){b.viewState[l]=JSON.parse(f[l])};-EditorUi.prototype.createParentLookup=function(b,f){function l(N){var O=d[N];null==O&&(O={inserted:[],moved:{}},d[N]=O);return O}var d={};if(null!=f[EditorUi.DIFF_INSERT])for(var t=0;t<f[EditorUi.DIFF_INSERT].length;t++){var y=f[EditorUi.DIFF_INSERT][t],x=null!=y.parent?y.parent:"",C=null!=y.previous?y.previous:"";l(x).inserted[C]=y}if(null!=f[EditorUi.DIFF_UPDATE])for(var L in f[EditorUi.DIFF_UPDATE])y=f[EditorUi.DIFF_UPDATE][L],null!=y.previous&&(x=y.parent,null==x&&(t=b.getCell(L),null!=t&&(t=-b.getParent(t),null!=t&&(x=t.getId()))),null!=x&&(l(x).moved[y.previous]=L));return d};-EditorUi.prototype.patchPage=function(b,f,l,d){var t=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),y=this.createParentLookup(t,f);t.beginUpdate();try{var x=t.updateEdgeParent,C=new mxDictionary,L=[];t.updateEdgeParent=function(n,q){!C.get(n)&&d&&(C.put(n,!0),L.push(n))};var N=y[""],O=null!=N&&null!=N.inserted?N.inserted[""]:null,Q=null;null!=O&&(Q=this.getCellForJson(O));if(null==Q){var I=null!=N&&null!=N.moved?N.moved[""]:null;null!=I&&(Q=t.getCell(I))}null!=Q&&(t.setRoot(Q),+EditorUi.prototype.createParentLookup=function(b,f){function l(N){var O=d[N];null==O&&(O={inserted:[],moved:{}},d[N]=O);return O}var d={};if(null!=f[EditorUi.DIFF_INSERT])for(var t=0;t<f[EditorUi.DIFF_INSERT].length;t++){var y=f[EditorUi.DIFF_INSERT][t],x=null!=y.parent?y.parent:"",C=null!=y.previous?y.previous:"";l(x).inserted[C]=y}if(null!=f[EditorUi.DIFF_UPDATE])for(var K in f[EditorUi.DIFF_UPDATE])y=f[EditorUi.DIFF_UPDATE][K],null!=y.previous&&(x=y.parent,null==x&&(t=b.getCell(K),null!=t&&(t=+b.getParent(t),null!=t&&(x=t.getId()))),null!=x&&(l(x).moved[y.previous]=K));return d};+EditorUi.prototype.patchPage=function(b,f,l,d){var t=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),y=this.createParentLookup(t,f);t.beginUpdate();try{var x=t.updateEdgeParent,C=new mxDictionary,K=[];t.updateEdgeParent=function(n,q){!C.get(n)&&d&&(C.put(n,!0),K.push(n))};var N=y[""],O=null!=N&&null!=N.inserted?N.inserted[""]:null,Q=null;null!=O&&(Q=this.getCellForJson(O));if(null==Q){var I=null!=N&&null!=N.moved?N.moved[""]:null;null!=I&&(Q=t.getCell(I))}null!=Q&&(t.setRoot(Q),b.root=Q,EditorUi.debug("EditorUi.patchPage: Root changed",Q.id));this.patchCellRecursive(b,t,t.root,y,f);if(null!=f[EditorUi.DIFF_REMOVE])for(var c=0;c<f[EditorUi.DIFF_REMOVE].length;c++){I=f[EditorUi.DIFF_REMOVE][c];var e=t.getCell(I);null!=e&&t.remove(e)}if(null!=f[EditorUi.DIFF_UPDATE]){var k=null!=l&&null!=l.cells?l.cells[EditorUi.DIFF_UPDATE]:null;for(I in f[EditorUi.DIFF_UPDATE])e=t.getCell(I),null!=e?this.patchCell(t,e,f[EditorUi.DIFF_UPDATE][I],null!=k?k[I]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",-I,"diff",[f[EditorUi.DIFF_UPDATE][I]])}if(null!=f[EditorUi.DIFF_INSERT])for(c=0;c<f[EditorUi.DIFF_INSERT].length;c++)O=f[EditorUi.DIFF_INSERT][c],e=t.getCell(O.id),null!=e&&(t.setTerminal(e,t.getCell(O.source),!0),t.setTerminal(e,t.getCell(O.target),!1));t.updateEdgeParent=x;if(d&&0<L.length)for(c=0;c<L.length;c++)t.contains(L[c])&&t.updateEdgeParent(L[c])}finally{t.endUpdate()}};-EditorUi.prototype.patchCellRecursive=function(b,f,l,d,t){if(null!=l){var y=d[l.getId()],x=null!=y&&null!=y.inserted?y.inserted:{};y=null!=y&&null!=y.moved?y.moved:{};for(var C=0,L=f.getChildCount(l),N="",O=0;O<L;O++){var Q=f.getChildAt(l,O).getId();null==y[N]&&(null==t[EditorUi.DIFF_UPDATE]||null==t[EditorUi.DIFF_UPDATE][Q]||null==t[EditorUi.DIFF_UPDATE][Q].previous&&null==t[EditorUi.DIFF_UPDATE][Q].parent)&&(y[N]=Q);N=Q}L=mxUtils.bind(this,function(I,c){var e=null!=I?I.getId():"";null==e&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",-"cell",I);null!=I&&c&&(c=f.getCell(e),null!=c&&c!=I&&(I=null));null!=I&&(f.getChildAt(l,C)!=I&&f.add(l,I,C),this.patchCellRecursive(b,f,I,d,t),C++);return e});for(N=[null];0<N.length;)if(O=N.shift(),O=L(null!=O?O.child:null,null!=O?O.insert:!1),Q=y[O],null!=Q&&(delete y[O],N.push({child:f.getCell(Q)})),Q=x[O],null!=Q&&(delete x[O],N.push({child:this.getCellForJson(Q),insert:!0})),0==N.length){for(O in y)N.push({child:f.getCell(y[O])}),delete y[O];for(O in x)N.push({child:this.getCellForJson(x[O]),+I,"diff",[f[EditorUi.DIFF_UPDATE][I]])}if(null!=f[EditorUi.DIFF_INSERT])for(c=0;c<f[EditorUi.DIFF_INSERT].length;c++)O=f[EditorUi.DIFF_INSERT][c],e=t.getCell(O.id),null!=e&&(t.setTerminal(e,t.getCell(O.source),!0),t.setTerminal(e,t.getCell(O.target),!1));t.updateEdgeParent=x;if(d&&0<K.length)for(c=0;c<K.length;c++)t.contains(K[c])&&t.updateEdgeParent(K[c])}finally{t.endUpdate()}};+EditorUi.prototype.patchCellRecursive=function(b,f,l,d,t){if(null!=l){var y=d[l.getId()],x=null!=y&&null!=y.inserted?y.inserted:{};y=null!=y&&null!=y.moved?y.moved:{};for(var C=0,K=f.getChildCount(l),N="",O=0;O<K;O++){var Q=f.getChildAt(l,O).getId();null==y[N]&&(null==t[EditorUi.DIFF_UPDATE]||null==t[EditorUi.DIFF_UPDATE][Q]||null==t[EditorUi.DIFF_UPDATE][Q].previous&&null==t[EditorUi.DIFF_UPDATE][Q].parent)&&(y[N]=Q);N=Q}K=mxUtils.bind(this,function(I,c){var e=null!=I?I.getId():"";null==e&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",+"cell",I);null!=I&&c&&(c=f.getCell(e),null!=c&&c!=I&&(I=null));null!=I&&(f.getChildAt(l,C)!=I&&f.add(l,I,C),this.patchCellRecursive(b,f,I,d,t),C++);return e});for(N=[null];0<N.length;)if(O=N.shift(),O=K(null!=O?O.child:null,null!=O?O.insert:!1),Q=y[O],null!=Q&&(delete y[O],N.push({child:f.getCell(Q)})),Q=x[O],null!=Q&&(delete x[O],N.push({child:this.getCellForJson(Q),insert:!0})),0==N.length){for(O in y)N.push({child:f.getCell(y[O])}),delete y[O];for(O in x)N.push({child:this.getCellForJson(x[O]),insert:!0}),delete x[O]}}};EditorUi.prototype.patchCell=function(b,f,l,d){if(null!=f&&null!=l){if(null==d||null==d.xmlValue&&(null==d.value||""==d.value))"value"in l?b.setValue(f,l.value):null!=l.xmlValue&&b.setValue(f,mxUtils.parseXml(l.xmlValue).documentElement);null!=d&&null!=d.style||null==l.style||b.setStyle(f,l.style);null!=l.visible&&b.setVisible(f,1==l.visible);null!=l.collapsed&&b.setCollapsed(f,1==l.collapsed);null!=l.vertex&&(f.vertex=1==l.vertex);null!=l.edge&&(f.edge=1==l.edge);null!=l.connectable&&(f.connectable=1==l.connectable);null!=l.geometry&&b.setGeometry(f,this.codec.decode(mxUtils.parseXml(l.geometry).documentElement));null!=l.source&&b.setTerminal(f,b.getCell(l.source),!0);null!=l.target&&b.setTerminal(f,b.getCell(l.target),!1);for(var t in l)this.cellProperties[t]||(f[t]=l[t])}};EditorUi.prototype.getXmlForPages=function(b){b=this.getNodeForPages(b);var f=null;null!=b&&(f=mxUtils.getXml(b));return f};EditorUi.prototype.getNodeForPages=function(b){var f=null;if(null!=this.fileNode&&null!=b){f=this.fileNode.cloneNode(!1);for(var l=0;l<b.length;l++){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b[l].root));this.editor.graph.saveViewState(b[l].viewState,d);var t=b[l].node.cloneNode(!1);t.appendChild(d);f.appendChild(t)}}return f};EditorUi.prototype.getPagesForXml=function(b){b=mxUtils.parseXml(b);return this.getPagesForNode(b.documentElement)};EditorUi.prototype.getPagesForNode=function(b,f){var l=this.editor.extractGraphModel(b,!0,!0);null!=l&&(b=l);f=b.getElementsByTagName(f||"diagram");l=[];if(0<f.length)for(b=0;b<f.length;b++){var d=new DiagramPage(f[b]);this.updatePageRoot(d,!0);l.push(d)}else"mxGraphModel"==b.nodeName&&(d=new DiagramPage(b.ownerDocument.createElement("diagram")),d.setName(mxResources.get("pageWithNumber",[1])),d.node.appendChild(b.cloneNode(!0)),l.push(d));return l};-EditorUi.prototype.diffPages=function(b,f){var l=[],d=[],t={},y={},x={},C=null;if(null!=b&&null!=f){for(var L=0;L<f.length;L++)y[f[L].getId()]={page:f[L],prev:C},C=f[L];C=null;for(L=0;L<b.length;L++){var N=b[L].getId();f=y[N];if(null==f)d.push(N);else{this.updatePageRoot(b[L]);this.updatePageRoot(f.page);var O=this.diffCells(b[L].root,f.page.root),Q={};mxUtils.isEmptyObject(O)||(Q.cells=O);O=this.diffViewState(b[L],f.page);mxUtils.isEmptyObject(O)||(Q.view=O);if((null!=f.prev?null==C:null!=C)||null!=-C&&null!=f.prev&&C.getId()!=f.prev.getId())Q.previous=null!=f.prev?f.prev.getId():"";null!=f.page.getName()&&b[L].getName()!=f.page.getName()&&(Q.name=f.page.getName());mxUtils.isEmptyObject(Q)||(x[N]=Q)}delete y[b[L].getId()];C=b[L]}for(N in y)f=y[N],l.push({id:f.page.getId(),data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});mxUtils.isEmptyObject(x)||(t[EditorUi.DIFF_UPDATE]=x);0<d.length&&(t[EditorUi.DIFF_REMOVE]=d);0<l.length&&(t[EditorUi.DIFF_INSERT]=l)}return t};+EditorUi.prototype.diffPages=function(b,f){var l=[],d=[],t={},y={},x={},C=null;if(null!=b&&null!=f){for(var K=0;K<f.length;K++)y[f[K].getId()]={page:f[K],prev:C},C=f[K];C=null;for(K=0;K<b.length;K++){var N=b[K].getId();f=y[N];if(null==f)d.push(N);else{this.updatePageRoot(b[K]);this.updatePageRoot(f.page);var O=this.diffCells(b[K].root,f.page.root),Q={};mxUtils.isEmptyObject(O)||(Q.cells=O);O=this.diffViewState(b[K],f.page);mxUtils.isEmptyObject(O)||(Q.view=O);if((null!=f.prev?null==C:null!=C)||null!=+C&&null!=f.prev&&C.getId()!=f.prev.getId())Q.previous=null!=f.prev?f.prev.getId():"";null!=f.page.getName()&&b[K].getName()!=f.page.getName()&&(Q.name=f.page.getName());mxUtils.isEmptyObject(Q)||(x[N]=Q)}delete y[b[K].getId()];C=b[K]}for(N in y)f=y[N],l.push({id:f.page.getId(),data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});mxUtils.isEmptyObject(x)||(t[EditorUi.DIFF_UPDATE]=x);0<d.length&&(t[EditorUi.DIFF_REMOVE]=d);0<l.length&&(t[EditorUi.DIFF_INSERT]=l)}return t};EditorUi.prototype.createCellLookup=function(b,f,l){l=null!=l?l:{};null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):l[b.getId()]={cell:b,prev:f};var d=b.getChildCount();f=null;for(var t=0;t<d;t++){var y=b.getChildAt(t);this.createCellLookup(y,f,l);f=y}return l};EditorUi.prototype.diffCellRecursive=function(b,f,l,d,t){d=null!=d?d:{};var y=l[b.getId()];delete l[b.getId()];if(null==y)null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored removed cell with no id",b):t.push(b.getId());else{var x=this.diffCell(b,y.cell);if(null!=x.parent||(null!=y.prev?null==f:null!=f)||null!=f&&null!=y.prev&&f.getId()!=y.prev.getId())x.previous=null!=y.prev?y.prev.getId():"";mxUtils.isEmptyObject(x)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",b,"diff",x):d[b.getId()]=x)}y=b.getChildCount();f=null;for(x=0;x<y;x++){var C=b.getChildAt(x);this.diffCellRecursive(C,f,l,d,t);f=C}return d};@@ -13621,8 +13623,8 @@ DrawioFileSync.prototype.patchRealtime=function(b,f,l,d){var t=null;if(this.file"all",t,"local",y,"applied",x,"immediate",d)}return t};DrawioFileSync.prototype.isRealtimeActive=function(){return this.ui.editor.autosave};DrawioFileSync.prototype.sendLocalChanges=function(){try{if(this.file.isRealtime()&&this.localFileWasChanged){var b=this.ui.clonePages(this.ui.pages),f=this.ui.diffPages(this.snapshot,b);this.file.ownPages=this.ui.patchPages(this.file.ownPages,f,!0);this.snapshot=b;var l=this.ui.resolveCrossReferences(f,this.ui.diffPages(this.file.ownPages,this.ui.pages));this.file.ownPages=this.ui.patchPages(this.file.ownPages,l,!0);this.isRealtimeActive()&&this.doSendLocalChanges([l,f])}this.localFileWasChanged=!1}catch(d){b=this.file.getCurrentUser(),b=null!=b?b.id:"unknown",EditorUi.logError("Error in sendLocalChanges",null,this.file.getMode()+"."+this.file.getId(),b,d)}};DrawioFileSync.prototype.doReceiveRemoteChanges=function(b){this.file.isRealtime()&&this.isRealtimeActive()&&(this.sendLocalChanges(),this.file.patch(b),this.file.theirPages=this.ui.applyPatches(this.file.theirPages,b),this.scheduleCleanup(),EditorUi.debug("DrawioFileSync.doReceiveRemoteChanges",[this],"changes",b))};-DrawioFileSync.prototype.merge=function(b,f,l,d,t,y,x){try{this.file.stats.merged++;this.lastModified=new Date;var C=this.file.getDescriptorRevisionId(l);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var L=this.ui.clonePages(this.file.getShadowPages()),N=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(L,this.ui.pages):null,O=this.file.isRealtime()?this.ui.diffPages(L,this.file.ownPages):null;L=this.ui.applyPatches(L,b);var Q=null==f?null:this.ui.getHashValueForPages(L);-EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",N,"pending",O,"checksum",f,"current",Q,"valid",f==Q,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",C,"etag",this.file.getDescriptorEtag(l),"immediate",x);if(null!=f&&f!=Q){this.reload(mxUtils.bind(this,function(){null!=d&&d()}),mxUtils.bind(this,function(){null!=t&&t()}),y,null,x);return}this.file.setShadowPages(L);null==this.patchRealtime(b,null,O,x)&&this.file.patch(b,DrawioFile.LAST_WRITE_WINS?+DrawioFileSync.prototype.merge=function(b,f,l,d,t,y,x){try{this.file.stats.merged++;this.lastModified=new Date;var C=this.file.getDescriptorRevisionId(l);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var K=this.ui.clonePages(this.file.getShadowPages()),N=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(K,this.ui.pages):null,O=this.file.isRealtime()?this.ui.diffPages(K,this.file.ownPages):null;K=this.ui.applyPatches(K,b);var Q=null==f?null:this.ui.getHashValueForPages(K);+EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",N,"pending",O,"checksum",f,"current",Q,"valid",f==Q,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",C,"etag",this.file.getDescriptorEtag(l),"immediate",x);if(null!=f&&f!=Q){this.reload(mxUtils.bind(this,function(){null!=d&&d()}),mxUtils.bind(this,function(){null!=t&&t()}),y,null,x);return}this.file.setShadowPages(K);null==this.patchRealtime(b,null,O,x)&&this.file.patch(b,DrawioFile.LAST_WRITE_WINS?N:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),l);null!=d&&d(!0)}catch(e){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=t&&t(e);try{var I=this.file.getCurrentUser(),c=null!=I?I.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),c,e)}catch(k){}}};DrawioFileSync.prototype.fileChanged=function(b,f,l,d,t){var y=window.setTimeout(mxUtils.bind(this,function(){null!=l&&l()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",d,"immediate",t,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(x){null!=l&&l()||(this.isValidState()?this.catchup(x,b,f,l,t):null!=f&&f())}),f)):null!=f&&f())}),d?this.cacheReadyDelay:0);return this.notifyThread=y};@@ -13631,8 +13633,8 @@ this.cleanupThread=null;"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.fastDrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(b){null!=b?(this.file.setDescriptorRevisionId(b,this.file.getCurrentRevisionId()),this.updateDescriptor(b),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(b){this.file.inConflictState=!0;this.file.handleFileError(b)}))};DrawioFileSync.prototype.updateDescriptor=function(b){this.file.setDescriptor(b);this.file.descriptorChanged();this.start()};DrawioFileSync.prototype.catchup=function(b,f,l,d,t){if(null!=b&&(null==d||!d())){var y=this.file.getCurrentRevisionId(),x=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",y,"to",x,"immediate",t,"valid",this.isValidState());if(y==x)this.file.patchDescriptor(this.file.getDescriptor(),b),"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.catchup",[this],"up to date","cleanup",this.cleanupThread,"checksum",this.ui.getHashValueForPages(this.ui.pages)),-document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=f&&f(!0);else if(this.isValidState()){var C=this.file.getDescriptorChecksum(b),L=this.file.getDescriptorSecret(b);if(null!=C&&C==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=f&&f(!0);else if(Editor.enableRealtimeCache&&null!=L&&"1"!=urlParams.lockdown){var N=0,O=!1,Q=mxUtils.bind(this,function(){if(null==d||!d())if(y!=this.file.getCurrentRevisionId())null!=f&&-f(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var I=!0,c=window.setTimeout(mxUtils.bind(this,function(){I=!1;this.reload(f,l,d,null,t)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(y)+"&to="+encodeURIComponent(x)+(null!=L?"&secret="+encodeURIComponent(L):""),mxUtils.bind(this,function(e){this.file.stats.bytesReceived+=e.getText().length;window.clearTimeout(c);if(I&&(null==d||!d()))if(y!=this.file.getCurrentRevisionId())null!=+document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=f&&f(!0);else if(this.isValidState()){var C=this.file.getDescriptorChecksum(b),K=this.file.getDescriptorSecret(b);if(null!=C&&C==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=f&&f(!0);else if(Editor.enableRealtimeCache&&null!=K&&"1"!=urlParams.lockdown){var N=0,O=!1,Q=mxUtils.bind(this,function(){if(null==d||!d())if(y!=this.file.getCurrentRevisionId())null!=f&&+f(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var I=!0,c=window.setTimeout(mxUtils.bind(this,function(){I=!1;this.reload(f,l,d,null,t)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(y)+"&to="+encodeURIComponent(x)+(null!=K?"&secret="+encodeURIComponent(K):""),mxUtils.bind(this,function(e){this.file.stats.bytesReceived+=e.getText().length;window.clearTimeout(c);if(I&&(null==d||!d()))if(y!=this.file.getCurrentRevisionId())null!=f&&f(!0);else if(this.isValidState()){var k=null,n=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[e],"status",e.getStatus(),"cacheReadyRetryCount",N,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=e.getStatus()&&299>=e.getStatus()&&0<e.getText().length)try{var q=JSON.parse(e.getText());if(null!=q&&0<q.length)for(var u=0;u<q.length;u++){var A=this.stringToObject(q[u]);if(A.v>DrawioFileSync.PROTOCOL){O=!0;n=[];break}else if(A.v===DrawioFileSync.PROTOCOL&&null!=A.d)k=A.d.checksum,n.push(A.d.patch);else{O=!0;n=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[q],"status",O?"failed":"ok","temp",n,"checksum",k)}catch(D){n=[],null!=window.console&&"1"==urlParams.test&&console.log(D)}try{0<n.length?(this.file.stats.cacheHits++,this.merge(n,k,b,f,l,d,t)):N<=this.maxCacheReadyRetries-1&&!O&&401!=e.getStatus()&&503!=e.getStatus()&&410!=e.getStatus()?(N++,this.file.stats.cacheMiss++,window.setTimeout(Q,(N+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(f,l,d,null,t))}catch(D){null!=l&&l(D)}}else null!=l&&l()}),l)}else null!=l&&l()});window.setTimeout(Q,this.cacheReadyDelay)}else this.reload(f,l,d,null,t)}else null!=l&&l()}};DrawioFileSync.prototype.reload=function(b,f,l,d,t){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",t);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(y){null!=f&&f(y)}),l,d,t)};@@ -13640,10 +13642,10 @@ DrawioFileSync.prototype.descriptorChanged=function(b){this.lastModified=this.fiEditorUi.debug("DrawioFileSync.descriptorChanged",[this],"from",b,"to",l)}this.updateStatus()};DrawioFileSync.prototype.objectToString=function(b){b=Graph.compress(JSON.stringify(b));null!=this.key&&"undefined"!==typeof CryptoJS&&(b=CryptoJS.AES.encrypt(b,this.key).toString());return b};DrawioFileSync.prototype.stringToObject=function(b){null!=this.key&&"undefined"!==typeof CryptoJS&&(b=CryptoJS.AES.decrypt(b,this.key).toString(CryptoJS.enc.Utf8));return JSON.parse(Graph.decompress(b))};DrawioFileSync.prototype.createToken=function(b,f,l){var d=!0,t=window.setTimeout(mxUtils.bind(this,function(){d=!1;l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&secret="+encodeURIComponent(b),mxUtils.bind(this,function(y){window.clearTimeout(t);d&&(200<=y.getStatus()&&299>=y.getStatus()?f(y.getText()):l({code:y.getStatus(),message:"Token Error "+y.getStatus()}))}),l)};DrawioFileSync.prototype.fileSaving=function(){this.file.isOptimisticSync()&&this.notify(this.createMessage({m:Date.now(),type:"optimistic"}));EditorUi.debug("DrawioFileSync.fileSaving",[this],"optimistic",this.file.isOptimisticSync())};DrawioFileSync.prototype.fileDataUpdated=function(){this.scheduleCleanup(!0);EditorUi.debug("DrawioFileSync.fileDataUpdated",[this])};-DrawioFileSync.prototype.fileSaved=function(b,f,l,d,t,y){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline(!0)&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var x=this.file.getDescriptorSecret(this.file.getDescriptor()),C=this.createMessage({m:this.lastModified.getTime()}),L=this.file.getDescriptorRevisionId(f),N=this.file.getCurrentRevisionId();if(null!=x&&null!=t&&+DrawioFileSync.prototype.fileSaved=function(b,f,l,d,t,y){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline(!0)&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var x=this.file.getDescriptorSecret(this.file.getDescriptor()),C=this.createMessage({m:this.lastModified.getTime()}),K=this.file.getDescriptorRevisionId(f),N=this.file.getCurrentRevisionId();if(null!=x&&null!=t&&"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var O=this.ui.diffPages(this.file.getShadowPages(),b);f=this.file.getDescriptorSecret(f);y=null!=y?y:this.ui.getHashValueForPages(b);var Q=this.objectToString(this.createMessage({patch:O,checksum:y}));this.file.stats.bytesSent+=Q.length;this.file.stats.msgSent++;var I=!0,c=window.setTimeout(mxUtils.bind(this,function(){I=!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+-"&from="+encodeURIComponent(L)+"&to="+encodeURIComponent(N)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(C)))+(null!=x?"&secret="+encodeURIComponent(x):"")+(null!=f?"&last-secret="+encodeURIComponent(f):"")+(Q.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(Q):"")+(null!=t?"&token="+encodeURIComponent(t):""),mxUtils.bind(this,function(e){window.clearTimeout(c);I&&(200<=e.getStatus()&&299>=e.getStatus()?(Editor.p2pSyncNotify&&this.notify(C),null!=l&&l()):d({message:mxResources.get("realtimeCollaboration")+-(0!=e.getStatus()?": "+e.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",L,"to",N,"etag",this.file.getCurrentEtag(),"diff",O,Q.length,"bytes","checksum",y)}else this.notify(C),null!=l&&l(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",L,"to",N,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);this.scheduleCleanup()};+"&from="+encodeURIComponent(K)+"&to="+encodeURIComponent(N)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(C)))+(null!=x?"&secret="+encodeURIComponent(x):"")+(null!=f?"&last-secret="+encodeURIComponent(f):"")+(Q.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(Q):"")+(null!=t?"&token="+encodeURIComponent(t):""),mxUtils.bind(this,function(e){window.clearTimeout(c);I&&(200<=e.getStatus()&&299>=e.getStatus()?(Editor.p2pSyncNotify&&this.notify(C),null!=l&&l()):d({message:mxResources.get("realtimeCollaboration")++(0!=e.getStatus()?": "+e.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",K,"to",N,"etag",this.file.getCurrentEtag(),"diff",O,Q.length,"bytes","checksum",y)}else this.notify(C),null!=l&&l(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",K,"to",N,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);this.scheduleCleanup()};DrawioFileSync.prototype.getIdParameters=function(){var b="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(b+="&sid="+this.pusher.connection.socket_id);return b};DrawioFileSync.prototype.createMessage=function(b){return{v:DrawioFileSync.PROTOCOL,d:b,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(b,f,l){this.catchupRetryCount++;EditorUi.debug("DrawioFileSync.fileConflict",[this],"desc",[b],"catchupRetryCount",this.catchupRetryCount,"maxCatchupRetries",this.maxCatchupRetries);this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=b?this.catchup(b,f,l):this.fileChanged(f,l)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=l&&l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")}))};DrawioFileSync.prototype.stop=function(){null!=this.pusher?(null!=this.pusher.connection&&(this.pusher.connection.unbind("state_change",this.connectionListener),this.pusher.connection.unbind("error",this.pusherErrorListener)),null!=this.channel&&(this.channel.unbind("changed",this.changeListener),this.channel=null),this.pusher.disconnect(),this.pusher=null,null!=this.p2pCollab&&(this.p2pCollab.destroy(),this.p2pCollab=null),EditorUi.debug("DrawioFileSync.stop",[this])):null!=this.polling&&(this.polling.stop(),@@ -13671,20 +13673,20 @@ mxLanguage))}catch(k){document.body.innerHTML="",e=document.createElement("pre")null,"0"!=urlParams.chrome));null!=window.mxscript&&("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)}):"undefined"===typeof window.Dropbox&&(window.DropboxClient=null),"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null),"function"===typeof window.TrelloClient&&!mxClient.IS_IE11&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null));null!=b&&b(D);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,D,(new Date).getTime()-t0.getTime()+"ms"]),null!=-urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(G){EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(G.stack)):(EditorUi.logError(G.message,null,null,null,G),window.setTimeout(function(){alert(G.message)},1))}}mxResources.parse(e[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var n=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=n){EditorUi.debug("Setting configuration",+urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(F){EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(F.stack)):(EditorUi.logError(F.message,null,null,null,F),window.setTimeout(function(){alert(F.message)},1))}}mxResources.parse(e[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var n=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=n){EditorUi.debug("Setting configuration",JSON.stringify(n));if(null!=n.merge){var q=localStorage.getItem(Editor.configurationKey);if(null!=q)try{var u=JSON.parse(q),A;for(A in n.merge)u[A]=n.merge[A];n=u}catch(D){window.location.hash="",alert(D)}else n=n.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(n)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(D){window.location.hash="",alert(D)}1<e.length&&-(Graph.prototype.defaultThemes["default-style2"]=e[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=e[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?k():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],k,function(D){document.body.innerHTML="";var G=document.createElement("pre");mxUtils.write(G,D.stack);document.body.appendChild(G)}))},function(e){e=document.getElementById("geStatus");null!=e&&+(Graph.prototype.defaultThemes["default-style2"]=e[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=e[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?k():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],k,function(D){document.body.innerHTML="";var F=document.createElement("pre");mxUtils.write(F,D.stack);document.body.appendChild(F)}))},function(e){e=document.getElementById("geStatus");null!=e&&(e.innerHTML="Error loading page. <a>Please try refreshing.</a>",e.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";d(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})};if(!App.isMainCalled)if(mxIsElectron&&"undefined"===typeof electron)alert("Runtime Environment not found."),document.body.innerHTML='<div style="margin-top:10%;text-align:center;"><img src="mxgraph/images/warning.png" align="top" style="padding-right:6px;"/>Runtime Environment not found.</div>';else if(App.isMainCalled=!0,window.onerror=function(c,e,k,n,q){EditorUi.logError("Global: "+(null!=c?c:""),e,k,n,q,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",c,"\nURL:",e,"\nLine:",k,"\nColumn:",n,"\nError:",q)):console.error("Message:",c,"\nURL:",e,"\nLine:",k,"\nColumn:",n,"\nError:",q);window.setTimeout(function(){alert("Error: "+(null!=c?c:""))},100)},window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var t=document.getElementById("geInfo");null!=t&&t.parentNode.removeChild(t)}null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){if("1"==urlParams.dev&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&null!=CryptoJS&&App.mode!=App.MODE_DROPBOX&&App.mode!=App.MODE_TRELLO){var y=document.getElementById("geBootstrap");if(null!=y){var x=mxUtils.getTextContent(y);"ff68e9badc5b6bcb8f482e0c64b103a7"!=CryptoJS.MD5(x).toString()&&(console.log("Change bootstrap script MD5 in the previous line:",CryptoJS.MD5(x).toString()),alert("[Dev] Bootstrap script change requires update of CSP"))}var C=document.getElementById("geMain");null!=C&&(x=mxUtils.getTextContent(C),"69c25556b6237c57cdb7d017147af34b"!=CryptoJS.MD5(x).toString()&&(console.log("Change main script MD5 in the previous line:",CryptoJS.MD5(x).toString()),alert("[Dev] Main script change requires update of CSP")))}try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=urlParams.offline&&"1"==urlParams.dev)?App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")}):Editor.enableServiceWorker&&navigator.serviceWorker.register("service-worker.js")}catch(c){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&"1"!=urlParams.embedRT||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||-"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var L=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var N=JSON.parse(localStorage.getItem(mxSettings.key));null!=N&&(L=N.plugins)}catch(c){}N=urlParams.p;App.initPluginCallback();null!=N&&App.loadPlugins(N.split(";"));if(null!=L&&0<-L.length&&"0"!=urlParams.plugins)for(t=0;t<L.length;t++)try{("/"==L[t].charAt(0)&&(L[t]=PLUGINS_BASE_PATH+L[t]),App.isSameDomain(L[t]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(L[t])?null==App.pluginsLoaded[L[t]]&&(App.pluginsLoaded[L[t]]=!0,App.embedModePluginsCount++,mxscript(L[t])):null!=window.console&&console.log("Unknown plugin:",L[t]):null!=window.console&&console.log("Blocked plugin:",L[t])}catch(c){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&+"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var K=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var N=JSON.parse(localStorage.getItem(mxSettings.key));null!=N&&(K=N.plugins)}catch(c){}N=urlParams.p;App.initPluginCallback();null!=N&&App.loadPlugins(N.split(";"));if(null!=K&&0<+K.length&&"0"!=urlParams.plugins)for(t=0;t<K.length;t++)try{("/"==K[t].charAt(0)&&(K[t]=PLUGINS_BASE_PATH+K[t]),App.isSameDomain(K[t]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(K[t])?null==App.pluginsLoaded[K[t]]&&(App.pluginsLoaded[K[t]]=!0,App.embedModePluginsCount++,mxscript(K[t])):null!=window.console&&console.log("Unknown plugin:",K[t]):null!=window.console&&console.log("Blocked plugin:",K[t])}catch(c){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var O=window.opener||window.parent,Q=function(c){if(c.source==O)try{var e=JSON.parse(c.data);null!=e&&"configure"==e.action&&(mxEvent.removeListener(window,"message",Q),Editor.configure(e.config),mxSettings.load(),null!=e.config.darkColor&&document.body.style.setProperty("--dark-color",e.config.darkColor),e.colorSchemeMeta&&mxmeta("color-scheme","dark light"),l())}catch(k){null!=window.console&&console.log("Error in configure message: "+k,c.data)}};mxEvent.addListener(window,"message",Q);O.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):console.error(c)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var I=localStorage.getItem(Editor.configurationKey);if(null!=I)try{I=JSON.parse(I),null!=I&&(EditorUi.debug("Using local configuration",I),Editor.configure(I),mxSettings.load())}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):-console.error(c)}}}l()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}catch(c){document.body.innerHTML="",L=document.createElement("pre"),mxUtils.write(L,c.stack),document.body.appendChild(L)}};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture=IMAGE_PATH+"/default-user.jpg";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg==";+console.error(c)}}}l()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}catch(c){document.body.innerHTML="",K=document.createElement("pre"),mxUtils.write(K,c.stack),document.body.appendChild(K)}};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture=IMAGE_PATH+"/default-user.jpg";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg==";App.prototype.chevronUpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUY1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NjA1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1RDUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1RTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pg+qUokAAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAAL0lEQVR42mJgRgMMRAswMKAKMDDARBjg8lARBoR6KImkH0wTbygT6YaS4DmAAAMAYPkClOEDDD0AAAAASUVORK5CYII=";App.prototype.chevronDownImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUI1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NUM1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1OTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1QTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsCtve8AAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAALUlEQVR42mJgRgMMRAkwQEXBNAOcBSPhclB1cNVwfcxI+vEZykSpoSR6DiDAAF23ApT99bZ+AAAAAElFTkSuQmCC";App.prototype.formatShowImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODdCREY5REY1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODdCREY5RTA1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4N0JERjlERDU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4N0JERjlERTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PlnMQ/8AAAAJUExURQAAAP///3FxcTfTiAsAAAACdFJOU/8A5bcwSgAAACFJREFUeNpiYEQDDEQJMMABTAAixcQ00ALoDiPRcwABBgB6DADly9Yx8wAAAABJRU5ErkJggg==";@@ -13728,11 +13730,11 @@ App.prototype.addRecent=function(b,f,l){if(isLocalStorage&&null!=localStorage){fApp.prototype.resetRecent=function(b){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent"+(null!=b?b:""))}catch(f){}};App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");var b=this.getCurrentFile();if(null!=b)if(b.constructor!=LocalFile||""!=b.getHash()||b.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()||null!=b.fileHandle){if(b.isModified())return this.logIfModified(b),mxResources.get("allChangesLost");b.close(!0)}else return mxResources.get("ensureDataSaved")};App.prototype.updateDocumentTitle=function(){var b=this.editor.appName,f=this.getCurrentFile();null==f||!this.editor.graph.isLightboxView()&&"simple"!=Editor.currentTheme||null==this.pages||null==this.currentPage?this.isOfflineApp()&&(b+=" app"):b=this.getShortPageName(this.currentPage);null!=f&&(b=(null!=f.getTitle()?f.getTitle():this.defaultFilename)+" - "+b);document.title!=b&&(document.title=b)};-App.prototype.getThumbnail=function(b,f,l){l=null!=l?l:0;var d=!1;try{var t=!0,y=window.setTimeout(mxUtils.bind(this,function(){t=!1;f(null)}),this.timeout),x=mxUtils.bind(this,function(P){window.clearTimeout(y);t&&f(P)});null==this.thumbImageCache&&(this.thumbImageCache={});var C=this.editor.graph,L=C.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var N=C.getGlobalVariable;C=this.createTemporaryGraph(C.getStylesheet());C.setBackgroundImage=this.editor.graph.setBackgroundImage;-var O=this.pages[0];this.currentPage==O?C.setBackgroundImage(L):null!=O.viewState&&null!=O.viewState&&(L=O.viewState.backgroundImage,C.setBackgroundImage(L));C.getGlobalVariable=function(P){return"page"==P?O.getName():"pagenumber"==P?1:N.apply(this,arguments)};C.getGlobalVariable=N;document.body.appendChild(C.container);C.model.setRoot(O.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(P){try{C!=this.editor.graph&&null!=C.container.parentNode&&-C.container.parentNode.removeChild(C.container)}catch(J){P=null}x(P)}),b,this.thumbImageCache,"#ffffff",function(){x()},null,null,null,null,null,null,C,l,null,null,null,"diagram",null),d=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var Q=document.createElement("canvas"),I=C.getGraphBounds(),c=C.view.translate,e=C.view.scale;null!=L&&(I=mxRectangle.fromRectangle(I),I.add(new mxRectangle((c.x+L.x)*e,(c.y+L.y)*e,L.width*e,L.height*e)));var k=b/I.width;k=Math.min(1,Math.min(3*b/(4*I.height),-k));var n=Math.floor(I.x),q=Math.floor(I.y);Q.setAttribute("width",Math.ceil(k*(I.width+4)));Q.setAttribute("height",Math.ceil(k*(I.height+4)));var u=Q.getContext("2d");u.scale(k,k);u.translate(-n,-q);var A=C.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";u.save();u.fillStyle=A;u.fillRect(n,q,Math.ceil(I.width+4),Math.ceil(I.height+4));u.restore();if(null!=L){var D=new Image;D.src=L.src;u.drawImage(D,L.x*k,L.y*k,L.width*k,L.height*k)}var G=new mxJsCanvas(Q),E=new mxAsyncCanvas(this.thumbImageCache);-G.images=this.thumbImageCache.images;var U=new mxImageExport;U.drawShape=function(P,J){P.shape instanceof mxShape&&P.shape.checkBounds()&&(J.save(),J.translate(.5,.5),P.shape.paint(J),J.translate(-.5,-.5),J.restore())};U.drawText=function(P,J){};U.drawState(C.getView().getState(C.model.root),E);E.finish(mxUtils.bind(this,function(){try{U.drawState(C.getView().getState(C.model.root),G),C!=this.editor.graph&&null!=C.container.parentNode&&C.container.parentNode.removeChild(C.container)}catch(P){Q=null}x(Q)}));+App.prototype.getThumbnail=function(b,f,l){l=null!=l?l:0;var d=!1;try{var t=!0,y=window.setTimeout(mxUtils.bind(this,function(){t=!1;f(null)}),this.timeout),x=mxUtils.bind(this,function(P){window.clearTimeout(y);t&&f(P)});null==this.thumbImageCache&&(this.thumbImageCache={});var C=this.editor.graph,K=C.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var N=C.getGlobalVariable;C=this.createTemporaryGraph(C.getStylesheet());C.setBackgroundImage=this.editor.graph.setBackgroundImage;+var O=this.pages[0];this.currentPage==O?C.setBackgroundImage(K):null!=O.viewState&&null!=O.viewState&&(K=O.viewState.backgroundImage,C.setBackgroundImage(K));C.getGlobalVariable=function(P){return"page"==P?O.getName():"pagenumber"==P?1:N.apply(this,arguments)};C.getGlobalVariable=N;document.body.appendChild(C.container);C.model.setRoot(O.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(P){try{C!=this.editor.graph&&null!=C.container.parentNode&&+C.container.parentNode.removeChild(C.container)}catch(M){P=null}x(P)}),b,this.thumbImageCache,"#ffffff",function(){x()},null,null,null,null,null,null,C,l,null,null,null,"diagram",null),d=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var Q=document.createElement("canvas"),I=C.getGraphBounds(),c=C.view.translate,e=C.view.scale;null!=K&&(I=mxRectangle.fromRectangle(I),I.add(new mxRectangle((c.x+K.x)*e,(c.y+K.y)*e,K.width*e,K.height*e)));var k=b/I.width;k=Math.min(1,Math.min(3*b/(4*I.height),+k));var n=Math.floor(I.x),q=Math.floor(I.y);Q.setAttribute("width",Math.ceil(k*(I.width+4)));Q.setAttribute("height",Math.ceil(k*(I.height+4)));var u=Q.getContext("2d");u.scale(k,k);u.translate(-n,-q);var A=C.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";u.save();u.fillStyle=A;u.fillRect(n,q,Math.ceil(I.width+4),Math.ceil(I.height+4));u.restore();if(null!=K){var D=new Image;D.src=K.src;u.drawImage(D,K.x*k,K.y*k,K.width*k,K.height*k)}var F=new mxJsCanvas(Q),E=new mxAsyncCanvas(this.thumbImageCache);+F.images=this.thumbImageCache.images;var U=new mxImageExport;U.drawShape=function(P,M){P.shape instanceof mxShape&&P.shape.checkBounds()&&(M.save(),M.translate(.5,.5),P.shape.paint(M),M.translate(-.5,-.5),M.restore())};U.drawText=function(P,M){};U.drawState(C.getView().getState(C.model.root),E);E.finish(mxUtils.bind(this,function(){try{U.drawState(C.getView().getState(C.model.root),F),C!=this.editor.graph&&null!=C.container.parentNode&&C.container.parentNode.removeChild(C.container)}catch(P){Q=null}x(Q)}));d=!0}}catch(P){d=!1,null!=C&&C!=this.editor.graph&&null!=C.container.parentNode&&C.container.parentNode.removeChild(C.container)}d||window.clearTimeout(y);return d};(function(){var b=EditorUi.prototype.setMode;App.prototype.setMode=function(f,l){b.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var d=this.getCurrentFile();f=null!=d?d.getMode():f;f==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):f==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):f==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor=f==App.MODE_DEVICE?"pointer":"default")}if(l)try{if(isLocalStorage)localStorage.setItem(".mode",f);else if("undefined"!=typeof Storage){var t=new Date;t.setYear(t.getFullYear()+1);document.cookie="MODE="+f+"; expires="+t.toUTCString()}}catch(y){}}})();@@ -13747,22 +13749,22 @@ App.prototype.showRefreshDialog=function(b,f){this.showingRefreshDialog||(this.sApp.prototype.showAlert=function(b){if(null!=b&&0<b.length){var f=document.createElement("div");f.className="geAlert";f.style.zIndex=2E9;f.style.left="50%";f.style.top="-100%";f.style.maxWidth="80%";f.style.width="max-content";f.style.whiteSpace="pre-wrap";mxUtils.setPrefixedStyle(f.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(f.style,"transition","all 1s ease");f.innerHTML=b;b=document.createElement("a");b.className="geAlertLink";b.style.textAlign="right";b.style.marginTop="20px";b.style.display="block";b.setAttribute("title",mxResources.get("close"));b.innerHTML=mxResources.get("close");f.appendChild(b);mxEvent.addListener(b,"click",function(l){null!=f.parentNode&&(f.parentNode.removeChild(f),mxEvent.consume(l))});document.body.appendChild(f);window.setTimeout(function(){f.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(f.style,"transition","all 2s ease");f.style.opacity="0";window.setTimeout(function(){null!=f.parentNode&&f.parentNode.removeChild(f)},2E3)},15E3)}};-App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(x,C,L,N,O){"ResizeObserver loop limit exceeded"!=x&&(EditorUi.logError("Uncaught: "+(null!=x?x:""),C,L,N,O,null,!0),b.handleError({message:x},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(x){var C=this.getCurrentFile();EditorUi.debug("storage event",[x],-[C]);null!=C&&".draft-alive-check"==x.key&&null!=x.newValue&&null!=C.draftId&&(this.draftAliveCheck=x.newValue,C.saveDraft())}))}catch(x){}var f=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(x){try{var C=this.getDiagramId();if(C!=f){f=C;var L=this.getCurrentFile();null!=L&&L.getHash()==C||this.loadFile(C,!0)}else{var N=this.getHashObject();if(null!=N&&null!=N.pageId&&null!=this.currentPage&&N.pageId!=this.currentPage.getId()){var O=this.getPageById(N.pageId);+App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(x,C,K,N,O){"ResizeObserver loop limit exceeded"!=x&&(EditorUi.logError("Uncaught: "+(null!=x?x:""),C,K,N,O,null,!0),b.handleError({message:x},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(x){var C=this.getCurrentFile();EditorUi.debug("storage event",[x],+[C]);null!=C&&".draft-alive-check"==x.key&&null!=x.newValue&&null!=C.draftId&&(this.draftAliveCheck=x.newValue,C.saveDraft())}))}catch(x){}var f=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(x){try{var C=this.getDiagramId();if(C!=f){f=C;var K=this.getCurrentFile();null!=K&&K.getHash()==C||this.loadFile(C,!0)}else{var N=this.getHashObject();if(null!=N&&null!=N.pageId&&null!=this.currentPage&&N.pageId!=this.currentPage.getId()){var O=this.getPageById(N.pageId);null!=O&&this.selectPage(O)}}}catch(Q){null!=document.body&&this.handleError(Q,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var I=this.getCurrentFile();window.location.hash=null!=I?I.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.desc)try{this.loadDescriptor(JSON.parse(Graph.decompress(urlParams.desc)),null,mxUtils.bind(this,function(x){this.handleError(x,mxResources.get("errorLoadingFile"))}))}catch(x){this.handleError(x,mxResources.get("errorLoadingFile"))}else if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var l=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var x=mxUtils.bind(this,function(N){Editor.isPngDataUrl(N)&&(N=Editor.extractGraphModelFromPng(N));var O=urlParams.title;O=null!=O?decodeURIComponent(O):this.defaultFilename;N=new LocalFile(this,-N,O,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(N.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(N);this.editor.chromeless||(N.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),C=window.opener||window.parent;if(C!=window){var L=urlParams.create;null!=L?x(C[decodeURIComponent(L)]):(L=urlParams.data,null!=L?x(decodeURIComponent(L)):this.installMessageHandler(mxUtils.bind(this,function(N,-O){O.source==C&&x(N)})))}}else if(null==this.dialog)if("1"==urlParams.demo)L=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=L;else if(null!=urlParams["smart-template"])this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),this.actions.get("insertTemplate").funct();else{L=!1;try{L=null!=window.opener&&null!=window.opener.openFile}catch(N){}L?this.spinner.spin(document.body,mxResources.get("loading")):(L=this.getDiagramId(),-!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=L&&0!=L.length||this.editor.isChromelessView()?null!=L&&0<L.length?this.loadFile(L,null,null,mxUtils.bind(this,function(){var N=decodeURIComponent(urlParams.viewbox||"");if(""!=N)try{var O=JSON.parse(N);this.editor.graph.fitWindow(O,O.border)}catch(Q){console.error(Q)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,+N,O,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(N.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(N);this.editor.chromeless||(N.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),C=window.opener||window.parent;if(C!=window){var K=urlParams.create;null!=K?x(C[decodeURIComponent(K)]):(K=urlParams.data,null!=K?x(decodeURIComponent(K)):this.installMessageHandler(mxUtils.bind(this,function(N,+O){O.source==C&&x(N)})))}}else if(null==this.dialog)if("1"==urlParams.demo)K=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=K;else if(null!=urlParams["smart-template"])this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),this.actions.get("insertTemplate").funct();else{K=!1;try{K=null!=window.opener&&null!=window.opener.openFile}catch(N){}K?this.spinner.spin(document.body,mxResources.get("loading")):(K=this.getDiagramId(),+!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=K&&0!=K.length||this.editor.isChromelessView()?null!=K&&0<K.length?this.loadFile(K,null,null,mxUtils.bind(this,function(){var N=decodeURIComponent(urlParams.viewbox||"");if(""!=N)try{var O=JSON.parse(N);this.editor.graph.fitWindow(O,O.border)}catch(Q){console.error(Q)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.checkDrafts())}}),d=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&0<d.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var t=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),y=mxUtils.bind(this,function(x){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,-x,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var C=urlParams.title;C=null!=C?decodeURIComponent(C):this.defaultFilename;x=this.getServiceCount(!0);isLocalStorage&&x++;var L=4>=x?2:6<x?4:3;C=new CreateDialog(this,C,mxUtils.bind(this,function(N,O){if(null==O){this.hideDialog();var Q=Editor.useLocalStorage;this.createFile(0<N.length?N:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=Q}else this.pickFolder(O,mxUtils.bind(this,function(I){this.createFile(N,-this.getFileData(!0),null,O,null,!0,I)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,L,null,null,null,this.editor.fileExtensions);this.showDialog(C.container,420,x>L?390:280,!0,!1,mxUtils.bind(this,function(N){N&&null==this.getCurrentFile()&&this.showSplash()}));C.init()}});if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))if("{"==d.charAt(0))this.spinner.stop(),d=JSON.parse(d),window.isMermaidEnabled&&"mermaid"==d.type?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(x){x!=-this.emptyDiagramXml&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"])),this.createFile(null!=x.filename?x.filename:this.defaultFilename,x,null,null,null,!0,null,!0),this.editor.chromeless&&!this.editor.editable||this.actions.get("fitWindow").funct())})),this.generateMermaidImage(d.data,null,function(){},mxUtils.bind(this,function(x){for(var C=document.querySelectorAll('div[id^="dgeMermaidOutput"]'),L=0;L<C.length;L++)C[L].parentNode.removeChild(C[L]);mxMermaidToDrawio.resetListeners();+x,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var C=urlParams.title;C=null!=C?decodeURIComponent(C):this.defaultFilename;x=this.getServiceCount(!0);isLocalStorage&&x++;var K=4>=x?2:6<x?4:3;C=new CreateDialog(this,C,mxUtils.bind(this,function(N,O){if(null==O){this.hideDialog();var Q=Editor.useLocalStorage;this.createFile(0<N.length?N:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=Q}else this.pickFolder(O,mxUtils.bind(this,function(I){this.createFile(N,+this.getFileData(!0),null,O,null,!0,I)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,K,null,null,null,this.editor.fileExtensions);this.showDialog(C.container,420,x>K?390:280,!0,!1,mxUtils.bind(this,function(N){N&&null==this.getCurrentFile()&&this.showSplash()}));C.init()}});if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))if("{"==d.charAt(0))this.spinner.stop(),d=JSON.parse(d),window.isMermaidEnabled&&"mermaid"==d.type?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(x){x!=+this.emptyDiagramXml&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"])),this.createFile(null!=x.filename?x.filename:this.defaultFilename,x,null,null,null,!0,null,!0),this.editor.chromeless&&!this.editor.editable||this.actions.get("fitWindow").funct())})),this.generateMermaidImage(d.data,null,function(){},mxUtils.bind(this,function(x){for(var C=document.querySelectorAll('div[id^="dgeMermaidOutput"]'),K=0;K<C.length;K++)C[K].parentNode.removeChild(C[K]);mxMermaidToDrawio.resetListeners();this.handleError(x)}))):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));else try{null!=window.opener&&null!=window.opener[d]?y(window.opener[d]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(x){this.handleError(x,mxResources.get("errorLoadingFile"))}else this.loadTemplate(d,function(x){y(x)},mxUtils.bind(this,function(x){this.handleError(x,mxResources.get("errorLoadingFile"),t)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action?null!=this.stateArg.ids&&(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),window.location.hash="G"+this.stateArg.ids[0]):(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),this.setMode(App.MODE_GOOGLE),"0"==urlParams.splash?this.createFile(null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename):this.actions.get("new").funct()):(null!=urlParams.open&&window.history&&window.history.replaceState&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["open","sketch"])),window.location.hash=urlParams.open),l())}}catch(x){this.handleError(x)}};App.prototype.loadDraft=function(b,f){this.createFile(this.defaultFilename,b,null,null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){var l=this.getCurrentFile();null!=l&&(l.fileChanged(),null!=f&&f())}),0)}),null,null,!0)};-App.prototype.filterDrafts=function(b,f,l){function d(){l(t)}var t=[];try{this.getDatabaseItems(mxUtils.bind(this,function(y){EditorUi.debug("App.filterDrafts",[this],"items",y);for(var x=0;x<y.length;x++)try{var C=y[x].key;if(null!=C&&".draft_"==C.substring(0,7)){var L=JSON.parse(y[x].data);null!=L&&"draft"==L.type&&L.aliveCheck!=f&&(null==b&&null==L.fileObject||null!=L.fileObject&&L.fileObject.path==b)&&(L.key=C,t.push(L))}}catch(N){}d()}),d)}catch(y){d()}};+App.prototype.filterDrafts=function(b,f,l){function d(){l(t)}var t=[];try{this.getDatabaseItems(mxUtils.bind(this,function(y){EditorUi.debug("App.filterDrafts",[this],"items",y);for(var x=0;x<y.length;x++)try{var C=y[x].key;if(null!=C&&".draft_"==C.substring(0,7)){var K=JSON.parse(y[x].data);null!=K&&"draft"==K.type&&K.aliveCheck!=f&&(null==b&&null==K.fileObject||null!=K.fileObject&&K.fileObject.path==b)&&(K.key=C,t.push(K))}}catch(N){}d()}),d)}catch(y){d()}};App.prototype.checkDrafts=function(){try{var b=Editor.guid();localStorage.setItem(".draft-alive-check",b);window.setTimeout(mxUtils.bind(this,function(){localStorage.removeItem(".draft-alive-check");this.filterDrafts(null,b,mxUtils.bind(this,function(f){if(1==f.length)this.loadDraft(f[0].data,mxUtils.bind(this,function(){this.removeDatabaseItem(f[0].key)}));else if(1<f.length){var l=new Date(f[0].modified);l=new DraftDialog(this,1<f.length?mxResources.get("selectDraft"):mxResources.get("draftFound",[l.toLocaleDateString()+" "+l.toLocaleTimeString()]),1<f.length?null:f[0].data,mxUtils.bind(this,function(d){this.hideDialog();d=""!=d?d:0;this.loadDraft(f[d].data,mxUtils.bind(this,function(){this.removeDatabaseItem(f[d].key)}))}),mxUtils.bind(this,function(d,t){this.removeDatabaseItem(f[""!=d?d:0].key);null!=t&&t()}),null,null,null,1<f.length?f:null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(d){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}));l.init()}else"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}))}),0)}catch(f){}};@@ -13771,48 +13773,48 @@ mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplashApp.prototype.addLanguageMenu=function(b,f,l){var d=null;null!=this.menus.get("language")&&(d=document.createElement("div"),d.setAttribute("title",mxResources.get("language")),d.className="atlas"!=Editor.currentTheme?"geIcon geAdaptiveAsset":"",d.style.backgroundImage="url("+Editor.globeImage+")",d.style.backgroundPosition="right center",d.style.backgroundRepeat="no-repeat",d.style.backgroundSize="19px 19px",d.style.width="19px",d.style.height="19px",mxUtils.setOpacity(d,40),d.style.position="absolute",d.style.cursor="pointer",d.style.bottom="20px",d.style.right=null!=l?l:"22px",f&&(d.style.direction="rtl",d.style.textAlign="right",d.style.right=null!=l?l:"24px",f=document.createElement("span"),f.style.display="inline-block",f.style.fontSize="12px",f.style.margin="2px 24px 0 0",f.style.userSelect="none",mxUtils.write(f,mxResources.get("language")),d.appendChild(f),f.className="atlas"!=Editor.currentTheme?"geAdaptiveAsset":""),mxEvent.addListener(d,"click",mxUtils.bind(this,function(t){this.editor.graph.popupMenuHandler.hideMenu();var y=new mxPopupMenu(this.menus.get("language").funct);y.div.className+=" geMenubarMenu";y.smartSeparators=!0;y.showDisabled=!0;y.autoExpand=!0;y.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(y,arguments);y.destroy()});var x=mxUtils.getOffset(d);y.popup(x.x,x.y+d.offsetHeight,null,t);this.setCurrentMenu(y)})),b.appendChild(d));return d};-App.prototype.loadFileSystemEntry=function(b,f,l){l=null!=l?l:mxUtils.bind(this,function(d){this.handleError(d)});try{b.getFile().then(mxUtils.bind(this,function(d){var t=new FileReader;t.onload=mxUtils.bind(this,function(y){var x=mxUtils.bind(this,function(C){try{if(null!=f){var L=y.target.result;"image/png"==d.type&&(L=this.extractGraphModelFromPng(L));f(new LocalFile(this,L,d.name,null,b,d,C))}else this.openFileHandle(y.target.result,d.name,d,!1,b,C)}catch(N){l(N)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,+App.prototype.loadFileSystemEntry=function(b,f,l){l=null!=l?l:mxUtils.bind(this,function(d){this.handleError(d)});try{b.getFile().then(mxUtils.bind(this,function(d){var t=new FileReader;t.onload=mxUtils.bind(this,function(y){var x=mxUtils.bind(this,function(C){try{if(null!=f){var K=y.target.result;"image/png"==d.type&&(K=this.extractGraphModelFromPng(K));f(new LocalFile(this,K,d.name,null,b,d,C))}else this.openFileHandle(y.target.result,d.name,d,!1,b,C)}catch(N){l(N)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,function(C){x("denied"!==C)})):b.createWritable().then(mxUtils.bind(this,function(){x(!0)}),mxUtils.bind(this,function(C){x(!1)}))});t.onerror=l;"image"!==d.type.substring(0,5)&&"application/pdf"!==d.type||"image/svg"===d.type.substring(0,9)?t.readAsText(d):t.readAsDataURL(d)}),l)}catch(d){l(d)}};App.prototype.createFileSystemOptions=function(b){var f=[],l=null;if(null!=b){var d=b.lastIndexOf(".");0<d&&(l=b.substring(d+1))}for(d=0;d<this.editor.diagramFileTypes.length;d++){var t={description:mxResources.get(this.editor.diagramFileTypes[d].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[d].extension+")":""),accept:{}};t.accept[this.editor.diagramFileTypes[d].mimeType]=["."+this.editor.diagramFileTypes[d].extension];this.editor.diagramFileTypes[d].extension==l?f.splice(0,0,t):this.editor.diagramFileTypes[d].extension==l?f.splice(0,0,t):f.push(t)}return{types:f,suggestedName:b}};App.prototype.showSaveFilePicker=function(b,f,l){f=null!=f?f:mxUtils.bind(this,function(d){"AbortError"!=d.name&&this.handleError(d)});l=null!=l?l:this.createFileSystemOptions();window.showSaveFilePicker(l).then(mxUtils.bind(this,function(d){null!=d&&d.getFile().then(mxUtils.bind(this,function(t){b(d,t)}),f)}),f)};App.prototype.pickFile=function(b){try{if(b=null!=b?b:this.mode,b==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var f=this.getServiceForName(b);if(null!=f)f.pickFile();else if(b==App.MODE_DEVICE&&EditorUi.nativeFileSupport)window.showOpenFilePicker().then(mxUtils.bind(this,function(x){null!=x&&0<x.length&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(x[0])}),mxUtils.bind(this,function(x){"AbortError"!=x.name&&this.handleError(x)}));else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var l=document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=l.files&&(this.openFiles(l.files),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.openFileInputElt=l}this.openFileInputElt.click()}else{this.hideDialog();window.openNew=-null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(x,C){StorageFile.listFiles(this,"F",x,C)});window.openBrowserFile=mxUtils.bind(this,function(x,C,L){StorageFile.getFileContent(this,x,C,L)});window.deleteBrowserFile=mxUtils.bind(this,function(x,C,L){StorageFile.deleteFile(this,x,C,L)});var d=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,-function(x,C){var L=mxUtils.bind(this,function(){this.useCanvasForExport||".png"!=C.substring(C.length-4)||(C=C.substring(0,C.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,x,C):new LocalFile(this,x,C))}),N=this.getCurrentFile();null!=N&&N.isModified()?this.confirm(mxResources.get("allChangesLost"),null,L,mxResources.get("cancel"),mxResources.get("discardChanges")):L()}));var t=this.dialog,y=t.close;this.dialog.close=mxUtils.bind(this,function(x){Editor.useLocalStorage=+null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(x,C){StorageFile.listFiles(this,"F",x,C)});window.openBrowserFile=mxUtils.bind(this,function(x,C,K){StorageFile.getFileContent(this,x,C,K)});window.deleteBrowserFile=mxUtils.bind(this,function(x,C,K){StorageFile.deleteFile(this,x,C,K)});var d=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,+function(x,C){var K=mxUtils.bind(this,function(){this.useCanvasForExport||".png"!=C.substring(C.length-4)||(C=C.substring(0,C.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,x,C):new LocalFile(this,x,C))}),N=this.getCurrentFile();null!=N&&N.isModified()?this.confirm(mxResources.get("allChangesLost"),null,K,mxResources.get("cancel"),mxResources.get("discardChanges")):K()}));var t=this.dialog,y=t.close;this.dialog.close=mxUtils.bind(this,function(x){Editor.useLocalStorage=d;y.apply(t,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(x){this.handleError(x)}};App.prototype.pickLibrary=function(b){b=null!=b?b:this.mode;var f=mxUtils.bind(this,function(y){try{this.loadLibrary(y);this.showSidebar();try{this.sidebar.palettes[y.getHash()][0].scrollIntoView({behavior:"smooth"})}catch(x){}}catch(x){this.handleError(x,mxResources.get("errorLoadingFile"))}});if(b==App.MODE_GOOGLE||b==App.MODE_DROPBOX||b==App.MODE_ONEDRIVE||b==App.MODE_GITHUB||b==App.MODE_GITLAB||b==App.MODE_TRELLO){var l=b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:this.dropbox;null!=l&&l.pickLibrary(mxUtils.bind(this,function(y,x){null!=x?f(x):this.spinner.spin(document.body,mxResources.get("loading"))&&l.getLibrary(y,mxUtils.bind(this,function(C){this.spinner.stop();f(C)}),mxUtils.bind(this,function(C){this.handleError(C,null!=C?mxResources.get("errorLoadingFile"):null)}))}))}else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var d=document.createElement("input");-d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){if(null!=d.files){for(var y=0;y<d.files.length;y++)mxUtils.bind(this,function(x){var C=new FileReader;C.onload=mxUtils.bind(this,function(L){f(new LocalLibrary(this,L.target.result,x.name))});C.readAsText(x)})(d.files[y]);d.type="";d.type="file";d.value=""}}));d.style.display="none";document.body.appendChild(d);this.libFileInputElt=d}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";window.listBrowserFiles=+d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){if(null!=d.files){for(var y=0;y<d.files.length;y++)mxUtils.bind(this,function(x){var C=new FileReader;C.onload=mxUtils.bind(this,function(K){f(new LocalLibrary(this,K.target.result,x.name))});C.readAsText(x)})(d.files[y]);d.type="";d.type="file";d.value=""}}));d.style.display="none";document.body.appendChild(d);this.libFileInputElt=d}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(y,x){StorageFile.listFiles(this,"L",y,x)});window.openBrowserFile=mxUtils.bind(this,function(y,x,C){StorageFile.getFileContent(this,y,x,C)});window.deleteBrowserFile=mxUtils.bind(this,function(y,x,C){StorageFile.deleteFile(this,y,x,C)});var t=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(y){this.hideDialog(y)}));window.openFile.setConsumer(mxUtils.bind(this,function(y,x){f(b==App.MODE_BROWSER?new StorageLibrary(this,y,x):new LocalLibrary(this,y,x))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=t;window.openFile=null})}};-App.prototype.saveLibrary=function(b,f,l,d,t,y,x){try{d=null!=d?d:this.mode;t=null!=t?t:!1;y=null!=y?y:!1;var C=this.createLibraryDataFromImages(f),L=mxUtils.bind(this,function(Q){this.spinner.stop();null!=x&&x();this.handleError(Q,null!=Q?mxResources.get("errorSavingFile"):null)});null==l&&d==App.MODE_DEVICE&&(l=new LocalLibrary(this,C,b));if(null==l)this.pickFolder(d,mxUtils.bind(this,function(Q){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?-this.drive.insertFile(b,C,Q,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),L,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,C,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),L,Q):d==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,-C,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),L,Q):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,C,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),L,Q):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,C,mxUtils.bind(this,function(I){this.spinner.stop();-this.hideDialog(!0);this.libraryLoaded(I,f)}),L,Q):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,C,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),L,Q):d==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,C,b),mxUtils.bind(this,function(I){this.hideDialog(!0);this.libraryLoaded(I,f)}),L):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));-else if(t||this.spinner.spin(document.body,mxResources.get("saving"))){l.setData(C);var N=mxUtils.bind(this,function(){l.save(!0,mxUtils.bind(this,function(Q){this.spinner.stop();this.hideDialog(!0);y||this.libraryLoaded(l,f);null!=x&&x()}),L)});if(b!=l.getTitle()){var O=l.getHash();l.rename(b,mxUtils.bind(this,function(Q){l.constructor!=LocalLibrary&&O!=l.getHash()&&(mxSettings.removeCustomLibrary(O),mxSettings.addCustomLibrary(l.getHash()));this.removeLibrarySidebar(O);N()}),L)}else N()}}catch(Q){this.handleError(Q)}};+App.prototype.saveLibrary=function(b,f,l,d,t,y,x){try{d=null!=d?d:this.mode;t=null!=t?t:!1;y=null!=y?y:!1;var C=this.createLibraryDataFromImages(f),K=mxUtils.bind(this,function(Q){this.spinner.stop();null!=x&&x();this.handleError(Q,null!=Q?mxResources.get("errorSavingFile"):null)});null==l&&d==App.MODE_DEVICE&&(l=new LocalLibrary(this,C,b));if(null==l)this.pickFolder(d,mxUtils.bind(this,function(Q){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?+this.drive.insertFile(b,C,Q,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),K,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,C,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),K,Q):d==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,+C,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),K,Q):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,C,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),K,Q):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,C,mxUtils.bind(this,function(I){this.spinner.stop();+this.hideDialog(!0);this.libraryLoaded(I,f)}),K,Q):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,C,mxUtils.bind(this,function(I){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(I,f)}),K,Q):d==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,C,b),mxUtils.bind(this,function(I){this.hideDialog(!0);this.libraryLoaded(I,f)}),K):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));+else if(t||this.spinner.spin(document.body,mxResources.get("saving"))){l.setData(C);var N=mxUtils.bind(this,function(){l.save(!0,mxUtils.bind(this,function(Q){this.spinner.stop();this.hideDialog(!0);y||this.libraryLoaded(l,f);null!=x&&x()}),K)});if(b!=l.getTitle()){var O=l.getHash();l.rename(b,mxUtils.bind(this,function(Q){l.constructor!=LocalLibrary&&O!=l.getHash()&&(mxSettings.removeCustomLibrary(O),mxSettings.addCustomLibrary(l.getHash()));this.removeLibrarySidebar(O);N()}),K)}else N()}}catch(Q){this.handleError(Q)}};App.prototype.saveFile=function(b,f){var l=this.getCurrentFile(),d=this.mode;if(null!=l){var t=mxUtils.bind(this,function(){EditorUi.enableDrafts&&l.removeDraft();this.getCurrentFile()==l||l.isModified()||(l.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus(""));null!=f&&f()});if(b||null==l.getTitle()||null!=l.invalidFileHandle||null==this.mode)if(null!=l&&l.constructor==LocalFile&&null!=l.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,-function(C,L){l.invalidFileHandle=null;l.fileHandle=C;l.title=L.name;l.desc=L;l.editable=null;this.save(L.name,t)}),null,this.createFileSystemOptions(l.getTitle()));else{b=null!=l.getTitle()?l.getTitle():this.defaultFilename;var y=mxUtils.bind(this,function(C,L,N,O){if(null!=C&&0<C.length)if(/(\.pdf)$/i.test(C))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),mxUtils.bind(this,function(){N.value=C.split(".").slice(0,--1).join(".");N.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?N.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==d&&L==App.MODE_DEVICE)null!=l&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(I,c){l.fileHandle=I;l.mode=App.MODE_DEVICE;l.title=c.name;l.desc=c;this.setMode(App.MODE_DEVICE);this.save(c.name,t)}),mxUtils.bind(this,function(I){"AbortError"!=I.name&&this.handleError(I)}),-this.createFileSystemOptions(C)):(this.setMode(App.MODE_DEVICE),this.save(C,t));else if("download"==L)(new LocalFile(this,null,C)).save();else if("_blank"==L)window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0);else if(d!=L){var Q=mxUtils.bind(this,function(I){var c=this.editor.graph,e=c.getSelectionCells(),k=c.getViewState(),n=this.currentPage;this.createFile(C,this.getFileData(/(\.xml)$/i.test(C)||-0>C.indexOf(".")||/(\.drawio)$/i.test(C),/(\.svg)$/i.test(C),/(\.html)$/i.test(C)),null,L,t,null==this.mode,I,null,null,mxUtils.bind(this,function(){this.restoreViewState(n,k,e)}))});null!=O?Q(O):this.pickFolder(L,Q)}else null!=L&&this.save(C,t)}),x=!mxClient.IS_IOS||!navigator.standalone;b=new SaveDialog(this,b,mxUtils.bind(this,function(C,L,N){y(C.value,L,C,N);this.hideDialog()}),x?null:["_blank"]);this.showDialog(b.container,420,150,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));b.init()}else this.save(l.getTitle(),+function(C,K){l.invalidFileHandle=null;l.fileHandle=C;l.title=K.name;l.desc=K;l.editable=null;this.save(K.name,t)}),null,this.createFileSystemOptions(l.getTitle()));else{b=null!=l.getTitle()?l.getTitle():this.defaultFilename;var y=mxUtils.bind(this,function(C,K,N,O){if(null!=C&&0<C.length)if(/(\.pdf)$/i.test(C))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),mxUtils.bind(this,function(){N.value=C.split(".").slice(0,+-1).join(".");N.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?N.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==d&&K==App.MODE_DEVICE)null!=l&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(I,c){l.fileHandle=I;l.mode=App.MODE_DEVICE;l.title=c.name;l.desc=c;this.setMode(App.MODE_DEVICE);this.save(c.name,t)}),mxUtils.bind(this,function(I){"AbortError"!=I.name&&this.handleError(I)}),+this.createFileSystemOptions(C)):(this.setMode(App.MODE_DEVICE),this.save(C,t));else if("download"==K)(new LocalFile(this,null,C)).save();else if("_blank"==K)window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0);else if(d!=K){var Q=mxUtils.bind(this,function(I){var c=this.editor.graph,e=c.getSelectionCells(),k=c.getViewState(),n=this.currentPage;this.createFile(C,this.getFileData(/(\.xml)$/i.test(C)||+0>C.indexOf(".")||/(\.drawio)$/i.test(C),/(\.svg)$/i.test(C),/(\.html)$/i.test(C)),null,K,t,null==this.mode,I,null,null,mxUtils.bind(this,function(){this.restoreViewState(n,k,e)}))});null!=O?Q(O):this.pickFolder(K,Q)}else null!=K&&this.save(C,t)}),x=!mxClient.IS_IOS||!navigator.standalone;b=new SaveDialog(this,b,mxUtils.bind(this,function(C,K,N){y(C.value,K,C,N);this.hideDialog()}),x?null:["_blank"]);this.showDialog(b.container,420,150,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));b.init()}else this.save(l.getTitle(),t)}};-App.prototype.loadTemplate=function(b,f,l,d,t){var y=!1,x=b,C=null!=d?d:b;d=/\.png$/i.test(C)||/\.pdf$/i.test(C);var L=EditorUi.isVisioFilename(C);this.editor.isCorsEnabledForUrl(x)||(y=d||L,x="t="+(new Date).getTime(),x=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+x+(y?"&base64=1":""));this.editor.loadUrl(x,mxUtils.bind(this,function(N){try{var O=y?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(N):atob(N):N;if(L||this.isVisioData(O))L||(C=t?this.isRemoteVisioData(O)?"raw.vss":"raw.vssx":this.isRemoteVisioData(O)?+App.prototype.loadTemplate=function(b,f,l,d,t){var y=!1,x=b,C=null!=d?d:b;d=/\.png$/i.test(C)||/\.pdf$/i.test(C);var K=EditorUi.isVisioFilename(C);this.editor.isCorsEnabledForUrl(x)||(y=d||K,x="t="+(new Date).getTime(),x=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+x+(y?"&base64=1":""));this.editor.loadUrl(x,mxUtils.bind(this,function(N){try{var O=y?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(N):atob(N):N;if(K||this.isVisioData(O))K||(C=t?this.isRemoteVisioData(O)?"raw.vss":"raw.vssx":this.isRemoteVisioData(O)?"raw.vsd":"raw.vsdx"),this.importVisio(this.base64ToBlob(N.substring(N.indexOf(",")+1)),function(Q){f(Q)},l,C);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(O,C))this.isExternalDataComms()?this.parseFileData(O,mxUtils.bind(this,function(Q){4==Q.readyState&&200<=Q.status&&299>=Q.status&&"<mxGraphModel"==Q.responseText.substring(0,13)&&f(Q.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,l);else if(this.isLucidChartData(O))this.convertLucidChart(O,-mxUtils.bind(this,function(Q){f(Q)}),mxUtils.bind(this,function(Q){l(Q)}));else{if(/(\.png)($|\?)/i.test(C)||Editor.isPngData(O))O=Editor.extractGraphModelFromPng(N);f(O)}}catch(Q){l(Q)}}),l,/(\.png)($|\?)/i.test(C)||L,null,null,y)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};+mxUtils.bind(this,function(Q){f(Q)}),mxUtils.bind(this,function(Q){l(Q)}));else{if(/(\.png)($|\?)/i.test(C)||Editor.isPngData(O))O=Editor.extractGraphModelFromPng(N);f(O)}}catch(Q){l(Q)}}),l,/(\.png)($|\?)/i.test(C)||K,null,null,y)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};App.prototype.isModeEnabled=function(b){return b==App.MODE_GOOGLE?"function"===typeof window.DriveClient&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode):b==App.MODE_GITHUB?null!=this.gitHub:b==App.MODE_GITLAB?null!=this.gitLab:b==App.MODE_DROPBOX?"function"===typeof window.DropboxClient&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):b==App.MODE_ONEDRIVE?"function"===typeof window.OneDriveClient&&("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"app.diagrams.net"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!mxClient.IS_IOS&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode):b==App.MODE_TRELLO?"function"===typeof window.TrelloClient&&"1"==urlParams.tr&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):!1};App.prototype.isModeReady=function(b){return null!=this.getServiceForName(b)&&(b!=App.MODE_DROPBOX||"undefined"!==typeof Dropbox.choose)};App.prototype.uncompressPages=function(b){if(null!=b)try{var f=mxUtils.parseXml(b);if("mxfile"==f.documentElement.nodeName){for(var l=f.documentElement.getElementsByTagName("diagram"),d=0;d<l.length;d++){var t=Editor.parseDiagramNode(l[d],!0);null!=t&&(mxUtils.setTextContent(l[d],""),l[d].appendChild(t))}b=mxUtils.getPrettyXml(f.documentElement)}}catch(y){}return b};-App.prototype.createFile=function(b,f,l,d,t,y,x,C,L,N){d=C?null:null!=d?d:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){f=null!=f?f:this.emptyDiagramXml;null==f||Editor.defaultCompressed||(f=this.uncompressPages(f));var O=mxUtils.bind(this,function(){this.spinner.stop()}),Q=mxUtils.bind(this,function(c){O();null==c&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=c&&this.handleError(c)});try{var I=mxUtils.bind(this,function(c){O();this.fileCreated(c,-l,y,t,L,N)});d==App.MODE_GOOGLE&&null!=this.drive?(null==x&&null!=this.stateArg&&null!=this.stateArg.folderId&&(x=this.stateArg.folderId),this.drive.insertFile(b,f,x,I,Q)):d==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,f,I,Q,!1,x):d==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,f,I,Q,!1,x):d==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,f,I,Q,!1,x):d==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(b,f,I,Q):d==App.MODE_ONEDRIVE&&null!=this.oneDrive?-this.oneDrive.insertFile(b,f,I,Q,!1,x):d==App.MODE_BROWSER?StorageFile.insertFile(this,b,f,I,Q):!C&&d==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(O(),this.showSaveFilePicker(mxUtils.bind(this,function(c,e){var k=new LocalFile(this,f,e.name,null,c,e);k.saveFile(e.name,!1,mxUtils.bind(this,function(){this.fileCreated(k,l,y,t,L,N)}),Q,!0)}),mxUtils.bind(this,function(c){"AbortError"!=c.name&&Q(c)}),this.createFileSystemOptions(b))):(O(),this.fileCreated(new LocalFile(this,f,b,null==d),l,y,t,L,N))}catch(c){O(),+App.prototype.createFile=function(b,f,l,d,t,y,x,C,K,N){d=C?null:null!=d?d:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){f=null!=f?f:this.emptyDiagramXml;null==f||Editor.defaultCompressed||(f=this.uncompressPages(f));var O=mxUtils.bind(this,function(){this.spinner.stop()}),Q=mxUtils.bind(this,function(c){O();null==c&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=c&&this.handleError(c)});try{var I=mxUtils.bind(this,function(c){O();this.fileCreated(c,+l,y,t,K,N)});d==App.MODE_GOOGLE&&null!=this.drive?(null==x&&null!=this.stateArg&&null!=this.stateArg.folderId&&(x=this.stateArg.folderId),this.drive.insertFile(b,f,x,I,Q)):d==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,f,I,Q,!1,x):d==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,f,I,Q,!1,x):d==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,f,I,Q,!1,x):d==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(b,f,I,Q):d==App.MODE_ONEDRIVE&&null!=this.oneDrive?+this.oneDrive.insertFile(b,f,I,Q,!1,x):d==App.MODE_BROWSER?StorageFile.insertFile(this,b,f,I,Q):!C&&d==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(O(),this.showSaveFilePicker(mxUtils.bind(this,function(c,e){var k=new LocalFile(this,f,e.name,null,c,e);k.saveFile(e.name,!1,mxUtils.bind(this,function(){this.fileCreated(k,l,y,t,K,N)}),Q,!0)}),mxUtils.bind(this,function(c){"AbortError"!=c.name&&Q(c)}),this.createFileSystemOptions(b))):(O(),this.fileCreated(new LocalFile(this,f,b,null==d),l,y,t,K,N))}catch(c){O(),this.handleError(c)}}};-App.prototype.fileCreated=function(b,f,l,d,t,y){var x=window.location.pathname;null!=f&&0<f.length&&(x+="?libs="+f);null!=t&&0<t.length&&(x+="?clibs="+t);x=this.getUrl(x);b.getMode()!=App.MODE_DEVICE&&(x+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var C=b.getData();C=0<C.length?this.editor.extractGraphModel(mxUtils.parseXml(C).documentElement,!0):null;var L=window.location.protocol+"//"+window.location.hostname+x,N=C,O=null;null!=C&&/\.svg$/i.test(b.getTitle())&&(O=-this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(O.container),N=this.decodeNodeIntoGraph(N,O));b.setData(this.createFileData(C,O,b,L));null!=O&&O.container.parentNode.removeChild(O.container);var Q=mxUtils.bind(this,function(){this.spinner.stop()}),I=mxUtils.bind(this,function(){Q();var c=this.getCurrentFile();null==l&&null!=c&&(l=!c.isModified()&&null==c.getMode());var e=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,y);l&&b.addAllSavedStatus();+App.prototype.fileCreated=function(b,f,l,d,t,y){var x=window.location.pathname;null!=f&&0<f.length&&(x+="?libs="+f);null!=t&&0<t.length&&(x+="?clibs="+t);x=this.getUrl(x);b.getMode()!=App.MODE_DEVICE&&(x+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var C=b.getData();C=0<C.length?this.editor.extractGraphModel(mxUtils.parseXml(C).documentElement,!0):null;var K=window.location.protocol+"//"+window.location.hostname+x,N=C,O=null;null!=C&&/\.svg$/i.test(b.getTitle())&&(O=+this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(O.container),N=this.decodeNodeIntoGraph(N,O));b.setData(this.createFileData(C,O,b,K));null!=O&&O.container.parentNode.removeChild(O.container);var Q=mxUtils.bind(this,function(){this.spinner.stop()}),I=mxUtils.bind(this,function(){Q();var c=this.getCurrentFile();null==l&&null!=c&&(l=!c.isModified()&&null==c.getMode());var e=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,y);l&&b.addAllSavedStatus();null!=f&&this.sidebar.showEntries(f);if(null!=t){for(var n=[],q=t.split(";"),u=0;u<q.length;u++)n.push(decodeURIComponent(q[u]));this.loadLibraries(n)}null!=d&&d()}),k=mxUtils.bind(this,function(){l||null==c||!c.isModified()?e():this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==l||l?k():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(x,null,k))});b.constructor==LocalFile?I():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){I()}),mxUtils.bind(this,function(c){Q();null!=c&&"AbortError"==c.name||this.handleError(c)}))}};-App.prototype.loadFile=function(b,f,l,d,t){if("1"==urlParams.openInSameWin||navigator.standalone)f=!0;this.hideDialog();var y=mxUtils.bind(this,function(){if(null==b||0==b.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var L=mxUtils.bind(this,function(c){this.handleError(c,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var e=this.getCurrentFile();-window.location.hash=null!=e?e.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(c){null!=c?(this.fileLoaded(new StorageFile(this,c,b)),null!=d&&d()):L({message:mxResources.get("fileNotFound")})}),L)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.getHash():""}));else if(null!=l)this.spinner.stop(),+App.prototype.loadFile=function(b,f,l,d,t){if("1"==urlParams.openInSameWin||navigator.standalone)f=!0;this.hideDialog();var y=mxUtils.bind(this,function(){if(null==b||0==b.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var K=mxUtils.bind(this,function(c){this.handleError(c,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var e=this.getCurrentFile();+window.location.hash=null!=e?e.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(c){null!=c?(this.fileLoaded(new StorageFile(this,c,b)),null!=d&&d()):K({message:mxResources.get("fileNotFound")})}),K)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.getHash():""}));else if(null!=l)this.spinner.stop(),this.fileLoaded(l),null!=d&&d();else if("S"==b.charAt(0))this.spinner.stop(),this.alert("[Deprecation] #S is no longer supported, go to https://app.diagrams.net/?desc="+b.substring(1).substring(0,10),mxUtils.bind(this,function(){window.location.href="https://app.diagrams.net/?desc="+b.substring(1)}));else if("R"==b.charAt(0)){this.spinner.stop();var N=decodeURIComponent(b.substring(1));"<"!=N.charAt(0)&&(N=Graph.decompress(N));N=new LocalFile(this,N,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);N.getHash=function(){return b};this.fileLoaded(N);null!=d&&d()}else if("E"==b.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(c,e){this.spinner.stop();this.fileLoaded(new EmbedFile(this,c,e));null!=d&&d()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))}));else if("U"==b.charAt(0)){var O=decodeURIComponent(b.substring(1)),Q=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=O.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var c=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var e=O.substring(31,O.lastIndexOf("&ex"));this.loadFile("G"+e,f,null,mxUtils.bind(this,function(){var k=this.getCurrentFile();null!=k&&this.editor.chromeless&&@@ -13824,11 +13826,11 @@ n&&null==k.getMode()&&(q=mxResources.get("copyCreated"),this.editor.setStatus('<n,null,null,"#"+e+b):n()}))}})()}}),x=this.getCurrentFile(),C=mxUtils.bind(this,function(){t||null==x||!x.isModified()?y():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=x&&(window.location.hash=x.getHash())}),y,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length?C():null==x||f?C():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+b,null,C)).container,320,160,!0,!0)};App.prototype.getLibraryStorageHint=function(b){var f=b.getTitle();b.constructor!=LocalLibrary&&(f+="\n"+b.getHash());b.constructor==DriveLibrary?f+=" ("+mxResources.get("googleDrive")+")":b.constructor==GitHubLibrary?f+=" ("+mxResources.get("github")+")":b.constructor==TrelloLibrary?f+=" ("+mxResources.get("trello")+")":b.constructor==DropboxLibrary?f+=" ("+mxResources.get("dropbox")+")":b.constructor==OneDriveLibrary?f+=" ("+mxResources.get("oneDrive")+")":b.constructor==StorageLibrary?f+=" ("+mxResources.get("browser")+")":b.constructor==LocalLibrary&&(f+=" ("+mxResources.get("device")+")");return f};App.prototype.restoreLibraries=function(){function b(l){for(var d=0;d<l.length;d++)""!=l[d]&&0>mxUtils.indexOf(f,l[d])&&f.push(l[d])}var f=[];b(mxSettings.getCustomLibraries());b((urlParams.clibs||"").split(";"));this.loadLibraries(f)};-App.prototype.loadLibraries=function(b,f){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var l=mxUtils.bind(this,function(N,O){O||mxSettings.removeCustomLibrary(N);delete this.loadedLibraries[N]}),d=0,t=[],y=0<b.length&&"L.scratchpad"==b[0]?1:0,x=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var N=b.length-1;0<=N;N--)null!=t[N]&&this.loadLibrary(t[N],N<=y);null!=f&&f()}});if(null!=b)for(var C=0;C<b.length;C++){var L=encodeURIComponent(decodeURIComponent(b[C]));+App.prototype.loadLibraries=function(b,f){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var l=mxUtils.bind(this,function(N,O){O||mxSettings.removeCustomLibrary(N);delete this.loadedLibraries[N]}),d=0,t=[],y=0<b.length&&"L.scratchpad"==b[0]?1:0,x=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var N=b.length-1;0<=N;N--)null!=t[N]&&this.loadLibrary(t[N],N<=y);null!=f&&f()}});if(null!=b)for(var C=0;C<b.length;C++){var K=encodeURIComponent(decodeURIComponent(b[C]));mxUtils.bind(this,function(N,O){if(null!=N&&0<N.length&&null==this.loadedLibraries[N]&&null==this.sidebar.palettes[N]){this.loadedLibraries[N]=!0;d++;var Q=mxUtils.bind(this,function(q){t[O]=q;d--;x()}),I=mxUtils.bind(this,function(q){l(N,q);d--;x()}),c=N.substring(0,1);if("L"==c)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var q=decodeURIComponent(N.substring(1));StorageFile.getFileContent(this,q,mxUtils.bind(this,function(u){".scratchpad"==q&&null==u&&(u=this.emptyLibraryXml);null!=u?Q(new StorageLibrary(this,u,q)):I()}),I)}catch(u){I()}}),0);else if("U"==c){var e=decodeURIComponent(N.substring(1));this.isOffline()?I(!0):this.loadTemplate(e,mxUtils.bind(this,function(q){null!=q&&0<q.length?Q(new UrlLibrary(this,q,e)):I()}),function(){I()},null,!0)}else if("R"==c){c=decodeURIComponent(N.substring(1));try{c=JSON.parse(c);var k={id:c[0],title:c[1],downloadUrl:c[2]};this.remoteInvoke("getFileContent",[k.downloadUrl],null,mxUtils.bind(this,function(q){try{Q(new RemoteLibrary(this,q,k))}catch(u){I()}}),function(){I()})}catch(q){I()}}else if("S"==c&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(N.substring(1)),function(q){Q(q)},I)}catch(q){I()}else{var n=null;"G"==c?null!=this.drive&&null!=this.drive.user&&(n=this.drive):"H"==c?null!=this.gitHub&&null!=this.gitHub.getUser()&&(n=this.gitHub):"T"==c?null!=this.trello&&this.trello.isAuthorized()&&(n=this.trello):"D"==c?null!=this.dropbox&&null!=this.dropbox.getUser()&&(n=this.dropbox):"W"==c&&null!=this.oneDrive&&-null!=this.oneDrive.getUser()&&(n=this.oneDrive);null!=n?n.getLibrary(decodeURIComponent(N.substring(1)),mxUtils.bind(this,function(q){try{Q(q)}catch(u){I()}}),function(q){I()}):I(!0)}}})(L,C)}x()}};+null!=this.oneDrive.getUser()&&(n=this.oneDrive);null!=n?n.getLibrary(decodeURIComponent(N.substring(1)),mxUtils.bind(this,function(q){try{Q(q)}catch(u){I()}}),function(q){I()}):I(!0)}}})(K,C)}x()}};App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer){var b=this.getCurrentFile();"1"==urlParams.embed&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&(this.buttonContainer.style.paddingRight="1"==urlParams.atlas?"32px":"8px");this.commentsSupported()&&"simple"!=Editor.currentTheme&&"atlas"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme?null==this.commentButton&&(this.commentButton=document.createElement("a"),this.commentButton.setAttribute("title",mxResources.get("comments")),this.commentButton.className="geToolbarButton geAdaptiveAsset",this.commentButton.style.cssText="display:inline-block;position:relative;box-sizing:border-box;width:24px;height:24px;background-size:24px 24px;background-position:center center;cursor:pointer;background-repeat:no-repeat;background-image:url("+Editor.commentImage+");",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,function(){this.actions.get("comments").funct()})),null!=this.userElement&&this.userElement.parentNode==this.buttonContainer?this.buttonContainer.insertBefore(this.commentButton,this.userElement):null!=this.shareButton&&this.shareButton.parentNode==this.buttonContainer?this.buttonContainer.insertBefore(this.commentButton,this.shareButton):this.buttonContainer.appendChild(this.commentButton)):null!=this.commentButton&&(this.commentButton.parentNode.removeChild(this.commentButton),this.commentButton=null);if("draw.io"!=this.getServiceName()||"1"==urlParams.embed||this.isStandaloneApp())null!=urlParams.notif&&@@ -13837,20 +13839,20 @@ this.fetchAndShowNotification(urlParams.notif),!this.isStandaloneApp()||"simple"this.shareButton.appendChild(b),"atlas"!=Editor.currentTheme&&(b.style.filter="invert(100%)"),mxUtils.write(this.shareButton,mxResources.get("share")),mxEvent.addListener(this.shareButton,"click",mxUtils.bind(this,function(){this.actions.get("share").funct()})),this.buttonContainer.appendChild(this.shareButton)),null!=this.shareButton&&(this.shareButton.style.display="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme?"none":"inline-block","simple"==Editor.currentTheme||"sketch"==Editor.currentTheme))this.shareButton.parentNode.style.display=0==this.shareButton.parentNode.clientWidth?"none":""}else null!=this.shareButton&&(this.shareButton.parentNode.removeChild(this.shareButton),this.shareButton=null);"1"!=urlParams.extAuth&&"atlas"!=Editor.currentTheme&&this.fetchAndShowNotification("online",this.mode)}null!=this.commentButton&&(this.commentButton.style.marginRight="",this.commentButton.style.top="","simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme&&"1"!=urlParams.embed?this.commentButton.style.top="-6px":"1"==urlParams.embed&&(this.commentButton.style.marginRight="4px"));null!=this.notificationBtn&&("simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"atlas"!=Editor.currentTheme&&"min"!=Editor.currentTheme&&"1"!=urlParams.embed?(this.notificationBtn.style.marginRight="4px",this.notificationBtn.style.marginTop="-12px"):(this.notificationBtn.style.marginRight="",this.notificationBtn.style.marginTop=""))}};-App.prototype.fetchAndShowNotification=function(b,f){if(!this.fetchingNotif){b=b||"online";var l=null,d=mxUtils.bind(this,function(t){t=t.filter(function(L){return!L.targets||-1<L.targets.indexOf(b)||null!=f&&-1<L.targets.indexOf(f)});for(var y=b+"NotifReadTS",x=isLocalStorage?parseInt(localStorage.getItem(y)):!0,C=0;C<t.length;C++)t[C].isNew=!x||t[C].timestamp>x;this.showNotification(t,y)});try{isLocalStorage&&(l=JSON.parse(localStorage.getItem(".notifCache")))}catch(t){}null==l||l.ts+864E5<Date.now()?+App.prototype.fetchAndShowNotification=function(b,f){if(!this.fetchingNotif){b=b||"online";var l=null,d=mxUtils.bind(this,function(t){t=t.filter(function(K){return!K.targets||-1<K.targets.indexOf(b)||null!=f&&-1<K.targets.indexOf(f)});for(var y=b+"NotifReadTS",x=isLocalStorage?parseInt(localStorage.getItem(y)):!0,C=0;C<t.length;C++)t[C].isNew=!x||t[C].timestamp>x;this.showNotification(t,y)});try{isLocalStorage&&(l=JSON.parse(localStorage.getItem(".notifCache")))}catch(t){}null==l||l.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(t){if(200<=t.getStatus()&&299>=t.getStatus())try{var y=JSON.parse(t.getText());y.sort(function(x,C){return C.timestamp-x.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:y}));this.fetchingNotif=!1;d(y)}catch(x){}}))):d(l.notifs)}};App.prototype.showNotification=function(b,f){function l(N){var O=document.querySelector(".geNotification-count");null!=O&&(O.innerHTML=N,O.style.display=0==N?"none":"",O=document.querySelector(".geNotification-bell"),O.style.animation=0==N?"none":"",O.className="geNotification-bell"+(0==N?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==N?"none":"")}var d=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var t=d=0;t<b.length;t++)b[t].isNew&&d++;if(0==d)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var y=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var N=this.notificationWin.querySelectorAll(".circle.active"),O=0;O<N.length;O++)N[O].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(f,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className="geNotification-box";d=document.createElement("span");d.className="geNotification-count";this.notificationBtn.appendChild(d);this.notifCount=d;d=document.createElement("div");d.className="geNotification-bell";t=document.createElement("span");t.className="geBell-top";d.appendChild(t);t=document.createElement("span");t.className="geBell-middle";d.appendChild(t);t=document.createElement("span");t.className="geBell-bottom";d.appendChild(t);t=document.createElement("span");t.className="geBell-rad";d.appendChild(t);this.notificationBtn.appendChild(d);this.buttonContainer.insertBefore(this.notificationBtn,this.buttonContainer.firstChild);this.notificationWin=document.createElement("div");this.notificationWin.className="geNotifPanel";this.notificationWin.style.display="none";document.body.appendChild(this.notificationWin);t=document.createElement("div");t.className="header";d=document.createElement("span");d.className="title";d.textContent=mxResources.get("notifications");t.appendChild(d);d=document.createElement("span");d.className="closeBtn";d.textContent="x";t.appendChild(d);this.notificationWin.appendChild(t);t=document.createElement("div");t.className="notifications clearfix";var x=document.createElement("div");x.setAttribute("id","geNotifList");x.style.position="relative";t.appendChild(x);this.notificationWin.appendChild(t);mxEvent.addListener(this.notificationBtn,"click",mxUtils.bind(this,function(){if("none"==this.notificationWin.style.display){this.notificationWin.style.display="";document.querySelector(".notifications").scrollTop=-0;var N=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=N.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=N.right-this.notificationWin.clientWidth+"px";l(0)}else y()}));mxEvent.addListener(d,"click",y)}else this.notificationBtn.style.display="";var C=0,L=document.getElementById("geNotifList");if(null!=L){L.innerHTML='<div class="line"></div>';for(t=0;t<b.length;t++)(function(N,O){O.isNew&&C++;var Q=document.createElement("div");Q.className="notification";-N=N.timeSince(new Date(O.timestamp));null==N&&(N=mxResources.get("lessThanAMinute"));Q.innerHTML='<div class="circle'+(O.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[N],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(O.content)+"</p>";O.link&&mxEvent.addListener(Q,"click",function(){window.open(O.link,"notifWin")});L.appendChild(Q)})(this,b[t]);l(C)}}};-App.prototype.save=function(b,f){var l=this.getCurrentFile(),d=!0,t=mxUtils.bind(this,function(){d&&(d=!1,l.handleFileSuccess(!0),null!=f&&f())}),y=mxUtils.bind(this,function(x){if(d){d=!1;Editor.addRetryToError(x,mxUtils.bind(this,function(){this.save(b,f)}));if(null!=x&&null!=x.retry){var C=x.retry;x.retry=function(){d=!0;try{l.isModified()?C():t()}catch(L){y(L)}}}l.handleFileError(x,null==x||"AbortError"!=x.name)}});if(null!=l&&this.spinner.spin(document.body,mxResources.get("saving"),y,3*this.timeout))try{this.editor.setStatus(""),+0;var N=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=N.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=N.right-this.notificationWin.clientWidth+"px";l(0)}else y()}));mxEvent.addListener(d,"click",y)}else this.notificationBtn.style.display="";var C=0,K=document.getElementById("geNotifList");if(null!=K){K.innerHTML='<div class="line"></div>';for(t=0;t<b.length;t++)(function(N,O){O.isNew&&C++;var Q=document.createElement("div");Q.className="notification";+N=N.timeSince(new Date(O.timestamp));null==N&&(N=mxResources.get("lessThanAMinute"));Q.innerHTML='<div class="circle'+(O.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[N],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(O.content)+"</p>";O.link&&mxEvent.addListener(Q,"click",function(){window.open(O.link,"notifWin")});K.appendChild(Q)})(this,b[t]);l(C)}}};+App.prototype.save=function(b,f){var l=this.getCurrentFile(),d=!0,t=mxUtils.bind(this,function(){d&&(d=!1,l.handleFileSuccess(!0),null!=f&&f())}),y=mxUtils.bind(this,function(x){if(d){d=!1;Editor.addRetryToError(x,mxUtils.bind(this,function(){this.save(b,f)}));if(null!=x&&null!=x.retry){var C=x.retry;x.retry=function(){d=!0;try{l.isModified()?C():t()}catch(K){y(K)}}}l.handleFileError(x,null==x||"AbortError"!=x.name)}});if(null!=l&&this.spinner.spin(document.body,mxResources.get("saving"),y,3*this.timeout))try{this.editor.setStatus(""),this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==l.getTitle()?l.save(!0,t,y):l.saveAs(b,t,y)}catch(x){y(x)}};App.prototype.getExtensionForService=function(b){b=this.getServiceForName(b);return null!=b?b.extension:".drawio"};App.prototype.getServiceForName=function(b){return b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_DROPBOX?this.dropbox:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:null};App.prototype.getTitleForService=function(b){return b==App.MODE_GOOGLE?mxResources.get("googleDrive"):b==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):EditorUi.prototype.getTitleForService.apply(this,arguments)};-App.prototype.pickFolder=function(b,f,l,d,t,y){l=null!=l?l:!0;var x=this.spinner.pause();l&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(C){x();if(C.action==google.picker.Action.PICKED){var L=null;null!=C.docs&&0<C.docs.length&&"folder"==C.docs[0].type&&(L=C.docs[0].id);f(y?C:L)}}),t):l&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(C){x();if(null!=C&&null!=C.value&&0<C.value.length){var L=OneDriveFile.prototype.getIdOf(C.value[0]);-f(y?C:L)}}),d):l&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(C){x();f(C)})):l&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(C){x();f(C)})):l&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(C){x();f(C)})):EditorUi.prototype.pickFolder.apply(this,arguments)};+App.prototype.pickFolder=function(b,f,l,d,t,y){l=null!=l?l:!0;var x=this.spinner.pause();l&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(C){x();if(C.action==google.picker.Action.PICKED){var K=null;null!=C.docs&&0<C.docs.length&&"folder"==C.docs[0].type&&(K=C.docs[0].id);f(y?C:K)}}),t):l&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(C){x();if(null!=C&&null!=C.value&&0<C.value.length){var K=OneDriveFile.prototype.getIdOf(C.value[0]);+f(y?C:K)}}),d):l&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(C){x();f(C)})):l&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(C){x();f(C)})):l&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(C){x();f(C)})):EditorUi.prototype.pickFolder.apply(this,arguments)};App.prototype.exportFile=function(b,f,l,d,t,y){t==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(f,d?this.base64ToBlob(b,l):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x)})):t==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(f,b,y,mxUtils.bind(this,function(x){this.spinner.stop()}),mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x)}),l,d):t==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(f,d?this.base64ToBlob(b,l):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x)}),!1,y):t==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(f,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x)}),!0,y,d):t==App.MODE_GITLAB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitLab.insertFile(f,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x)}),!0,y,d):t==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(f,d?this.base64ToBlob(b,@@ -13859,9 +13861,9 @@ function(){localStorage.setItem(f,b)}),null==localStorage.getItem(f)?l():this.coApp.prototype.descriptorChanged=function(){var b=this.getCurrentFile();if(null!=b){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerText="";var f=null!=b.getTitle()?b.getTitle():this.defaultFilename;mxUtils.write(this.fname,f);this.fname.setAttribute("title",f+" - "+mxResources.get("rename"))}f=this.editor.graph;var l=b.isEditable();f.isEnabled()&&!l&&f.reset();f.setEnabled(l);null==urlParams.rev&&(this.updateDocumentTitle(),f=b.getHash(),0<f.length?(f!=this.getDiagramId()&&(window.location.hash=f),this.updateHashObject()):0<window.location.hash.length&&(window.location.hash=""))}this.updateUi();null==this.format||null!=b&&this.fileEditable==b.isEditable()||!this.editor.graph.isSelectionEmpty()||(this.format.refresh(),this.fileEditable=null!=b?b.isEditable():null);this.fireEvent(new mxEventObject("fileDescriptorChanged","file",b))};App.prototype.showAuthDialog=function(b,f,l,d){var t=this.spinner.pause();this.showDialog((new AuthDialog(this,b,f,mxUtils.bind(this,function(y){try{null!=l&&l(y,mxUtils.bind(this,function(){this.hideDialog();t()}))}catch(x){this.editor.setStatus(mxUtils.htmlEntities(x.message))}}))).container,300,f?180:140,!0,!0,mxUtils.bind(this,function(y){null!=d&&d(y);y&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};-App.prototype.convertFile=function(b,f,l,d,t,y,x,C){var L=f;/\.svg$/i.test(L)||(L=L.substring(0,f.lastIndexOf("."))+d);var N=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(N=!0);if(/\.v(dx|sdx?)$/i.test(f)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var O=new XMLHttpRequest;O.open("GET",b,!0);N||(O.responseType="blob");if(C)for(var Q in C)O.setRequestHeader(Q,C[Q]);O.onload=mxUtils.bind(this,function(){if(200<=-O.status&&299>=O.status){var c=null;N?(c=JSON.parse(O.responseText),c=this.base64ToBlob(c.content,"application/octet-stream")):c=new Blob([O.response],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(e){t(new LocalFile(this,e,L,!0))}),y,f)}else null!=y&&y({message:mxResources.get("errorLoadingFile")})});O.onerror=y;O.send()}else{var I=mxUtils.bind(this,function(c){try{if(/\.pdf$/i.test(f)){var e=Editor.extractGraphModelFromPdf(c);null!=e&&0<e.length&&t(new LocalFile(this,-e,L,!0))}else/\.png$/i.test(f)?(e=this.extractGraphModelFromPng(c),null!=e?t(new LocalFile(this,e,L,!0)):t(new LocalFile(this,c,f,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,b)?this.parseFileData(c,mxUtils.bind(this,function(k){4==k.readyState&&(200<=k.status&&299>=k.status?t(new LocalFile(this,k.responseText,L,!0)):null!=y&&y({message:mxResources.get("errorLoadingFile")}))}),f):t(new LocalFile(this,c,L,!0))}catch(k){null!=y&&y(k)}});l=/\.png$/i.test(f)||/\.jpe?g$/i.test(f)||+App.prototype.convertFile=function(b,f,l,d,t,y,x,C){var K=f;/\.svg$/i.test(K)||(K=K.substring(0,f.lastIndexOf("."))+d);var N=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(N=!0);if(/\.v(dx|sdx?)$/i.test(f)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var O=new XMLHttpRequest;O.open("GET",b,!0);N||(O.responseType="blob");if(C)for(var Q in C)O.setRequestHeader(Q,C[Q]);O.onload=mxUtils.bind(this,function(){if(200<=+O.status&&299>=O.status){var c=null;N?(c=JSON.parse(O.responseText),c=this.base64ToBlob(c.content,"application/octet-stream")):c=new Blob([O.response],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(e){t(new LocalFile(this,e,K,!0))}),y,f)}else null!=y&&y({message:mxResources.get("errorLoadingFile")})});O.onerror=y;O.send()}else{var I=mxUtils.bind(this,function(c){try{if(/\.pdf$/i.test(f)){var e=Editor.extractGraphModelFromPdf(c);null!=e&&0<e.length&&t(new LocalFile(this,+e,K,!0))}else/\.png$/i.test(f)?(e=this.extractGraphModelFromPng(c),null!=e?t(new LocalFile(this,e,K,!0)):t(new LocalFile(this,c,f,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,b)?this.parseFileData(c,mxUtils.bind(this,function(k){4==k.readyState&&(200<=k.status&&299>=k.status?t(new LocalFile(this,k.responseText,K,!0)):null!=y&&y({message:mxResources.get("errorLoadingFile")}))}),f):t(new LocalFile(this,c,K,!0))}catch(k){null!=y&&y(k)}});l=/\.png$/i.test(f)||/\.jpe?g$/i.test(f)||/\.pdf$/i.test(f)||null!=l&&"image/"==l.substring(0,6);N?mxUtils.get(b,mxUtils.bind(this,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){if(null!=t){c=JSON.parse(c.getText());var e=c.content;"base64"===c.encoding&&(e=/\.png$/i.test(f)?"data:image/png;base64,"+e:/\.pdf$/i.test(f)?"data:application/pdf;base64,"+e:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(e):atob(e));I(e)}}else null!=y&&y({code:App.ERROR_UNKNOWN})}),function(){null!=y&&y({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=y&&y({code:App.ERROR_TIMEOUT,retry:fn})},C):null!=x?x(b,I,y,l):this.editor.loadUrl(b,I,y,l,null,null,null,C)}};App.prototype.updateHeader=function(){if(null!=this.menubar){var b="url("+Editor.logoImage+")";this.appIcon=document.createElement("a");this.appIcon.style.display="block";this.appIcon.style.position="absolute";this.appIcon.style.width="32px";this.appIcon.style.height=this.menubarHeight-28+"px";this.appIcon.style.backgroundColor="light-dark(#f08705, transparent)";this.appIcon.style.margin="8px 0px 8px 16px";this.appIcon.style.opacity="0.85";this.appIcon.style.borderRadius="3px";this.appIcon.style.backgroundPosition=@@ -13890,16 +13892,16 @@ App.prototype.updateUserElementIcon=function(){var b=this.userElement;if(null!=bl.setAttribute("border","0");l.style.position="absolute";l.style.left="16px";l.style.width="12px";l.style.height="12px";l.className="geAdaptiveAsset";var t=f.getRealtimeError();f=f.getRealtimeState();d+=" (";1==f?(l.src=Editor.syncImage,d+=mxResources.get("online")):(l.src=Editor.syncProblemImage,d=null!=t&&null!=t.message?d+t.message:d+mxResources.get("disconnected"));d+=")";"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme?(b.appendChild(l),"min"==Editor.currentTheme&&(b.style.marginRight="4px")):l.style.top="2px"}b.setAttribute("title",d)}}};App.prototype.hideUserPanel=function(){null!=this.userPanel&&null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)};App.prototype.toggleUserPanel=function(){if(null==this.userPanel){var b=document.createElement("div");b.className="geDialog";b.style.position="absolute";b.style.zIndex=5;b.style.padding="0px";b.style.cursor="default";b.style.minWidth="300px";this.userPanel=b;mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(x){mxEvent.isConsumed(x)||this.hideUserPanel()}))}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var f=!1;this.userPanel.innerText=-"";b=document.createElement("img");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("close"));b.className="geDialogClose";b.style.top="8px";b.style.right="8px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var l=this.drive.getUsersList();if(0<l.length){var d=mxUtils.bind(this,function(x,C){var L=this.getCurrentFile();null!=L&&L.constructor==DriveFile?(this.spinner.spin(document.body,-C),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,function(){this.spinner.stop();x()}),2E3)):x()});b=mxUtils.bind(this,function(x){var C=document.createElement("tr"),L=document.createElement("td");L.setAttribute("valig","middle");L.style.height="59px";L.style.width="66px";var N=document.createElement("img");N.setAttribute("width","50");N.setAttribute("height","50");N.setAttribute("border","0");N.setAttribute("src",null!=x.pictureUrl?x.pictureUrl:this.defaultUserPicture);N.style.borderRadius=-"50%";N.style.margin="4px 8px 0 8px";L.appendChild(N);C.appendChild(L);L=document.createElement("td");L.setAttribute("valign","middle");L.style.whiteSpace="nowrap";L.style.paddingTop="4px";L.style.maxWidth="0";L.style.overflow="hidden";L.style.textOverflow="ellipsis";mxUtils.write(L,x.displayName+(x.isCurrent&&1<l.length?" ("+mxResources.get("default")+")":""));null!=x.email&&(mxUtils.br(L),N=document.createElement("small"),N.style.color="gray",mxUtils.write(N,x.email),L.appendChild(N));N=document.createElement("div");-N.style.marginTop="4px";var O=document.createElement("i");mxUtils.write(O,mxResources.get("googleDrive"));N.appendChild(O);L.appendChild(N);C.appendChild(L);x.isCurrent?C.setAttribute("title","User ID: "+x.id):(C.setAttribute("title",mxResources.get("login")+" (User ID: "+x.id+")"),C.style.cursor="pointer",C.style.opacity="0.3",mxEvent.addListener(C,"mouseenter",mxUtils.bind(this,function(){C.style.opacity="1"})),mxEvent.addListener(C,"mouseleave",mxUtils.bind(this,function(){C.style.opacity="0.3"})),+"";b=document.createElement("img");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("close"));b.className="geDialogClose";b.style.top="8px";b.style.right="8px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var l=this.drive.getUsersList();if(0<l.length){var d=mxUtils.bind(this,function(x,C){var K=this.getCurrentFile();null!=K&&K.constructor==DriveFile?(this.spinner.spin(document.body,+C),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,function(){this.spinner.stop();x()}),2E3)):x()});b=mxUtils.bind(this,function(x){var C=document.createElement("tr"),K=document.createElement("td");K.setAttribute("valig","middle");K.style.height="59px";K.style.width="66px";var N=document.createElement("img");N.setAttribute("width","50");N.setAttribute("height","50");N.setAttribute("border","0");N.setAttribute("src",null!=x.pictureUrl?x.pictureUrl:this.defaultUserPicture);N.style.borderRadius=+"50%";N.style.margin="4px 8px 0 8px";K.appendChild(N);C.appendChild(K);K=document.createElement("td");K.setAttribute("valign","middle");K.style.whiteSpace="nowrap";K.style.paddingTop="4px";K.style.maxWidth="0";K.style.overflow="hidden";K.style.textOverflow="ellipsis";mxUtils.write(K,x.displayName+(x.isCurrent&&1<l.length?" ("+mxResources.get("default")+")":""));null!=x.email&&(mxUtils.br(K),N=document.createElement("small"),N.style.color="gray",mxUtils.write(N,x.email),K.appendChild(N));N=document.createElement("div");+N.style.marginTop="4px";var O=document.createElement("i");mxUtils.write(O,mxResources.get("googleDrive"));N.appendChild(O);K.appendChild(N);C.appendChild(K);x.isCurrent?C.setAttribute("title","User ID: "+x.id):(C.setAttribute("title",mxResources.get("login")+" (User ID: "+x.id+")"),C.style.cursor="pointer",C.style.opacity="0.3",mxEvent.addListener(C,"mouseenter",mxUtils.bind(this,function(){C.style.opacity="1"})),mxEvent.addListener(C,"mouseleave",mxUtils.bind(this,function(){C.style.opacity="0.3"})),mxEvent.addListener(C,"click",mxUtils.bind(this,function(Q){this.hideUserPanel();d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(x);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(I){this.handleError(I)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(Q)})));return C});f=!0;var t=document.createElement("table");t.style.borderSpacing="0";t.style.fontSize="10pt";t.style.width="100%";t.style.padding="10px";for(var y=0;y<l.length;y++)t.appendChild(b(l[y]));this.userPanel.appendChild(t);b=document.createElement("div");b.style.textAlign="left";b.style.padding="10px";b.style.whiteSpace="nowrap";b.style.borderTopStyle="solid";b.style.borderTopWidth="1px";t=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxResources.get("signOut"))}))}));t.className="geBtn";t.style.float="right";b.appendChild(t);t=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var x=this.drive.createAuthWin();x.blur();window.focus();d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(C){this.handleError(C)}),!0,x)}),mxResources.get("closingFile")+-"...")}));t.className="geBtn";t.style.margin="0px";b.appendChild(t);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(x,C,L,N){if(null!=x){f&&this.userPanel.appendChild(document.createElement("hr"));f=!0;var O=document.createElement("table");O.style.borderSpacing="0";O.style.fontSize="10pt";O.style.width="100%";O.style.padding="10px";var Q=document.createElement("tbody"),I=document.createElement("tr"),c=document.createElement("td");c.setAttribute("valig","top");c.style.width="40px";if(null!=+"...")}));t.className="geBtn";t.style.margin="0px";b.appendChild(t);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(x,C,K,N){if(null!=x){f&&this.userPanel.appendChild(document.createElement("hr"));f=!0;var O=document.createElement("table");O.style.borderSpacing="0";O.style.fontSize="10pt";O.style.width="100%";O.style.padding="10px";var Q=document.createElement("tbody"),I=document.createElement("tr"),c=document.createElement("td");c.setAttribute("valig","top");c.style.width="40px";if(null!=C){var e=document.createElement("img");e.setAttribute("width","40");e.setAttribute("height","40");e.setAttribute("border","0");e.setAttribute("src",C);e.style.marginRight="6px";c.appendChild(e)}I.appendChild(c);c=document.createElement("td");c.setAttribute("valign","middle");c.style.whiteSpace="nowrap";c.style.maxWidth="0";c.style.overflow="hidden";c.style.textOverflow="ellipsis";mxUtils.write(c,x.displayName);null!=x.email&&(mxUtils.br(c),C=document.createElement("small"),C.style.color="gray",mxUtils.write(C,-x.email),c.appendChild(C));null!=N&&(x=document.createElement("div"),x.style.marginTop="4px",C=document.createElement("i"),mxUtils.write(C,N),x.appendChild(C),c.appendChild(x));I.appendChild(c);Q.appendChild(I);O.appendChild(Q);this.userPanel.appendChild(O);x=document.createElement("div");x.style.textAlign="center";x.style.padding="10px";x.style.whiteSpace="nowrap";null!=L&&(L=mxUtils.button(mxResources.get("signOut"),L),L.className="geBtn",x.appendChild(L));this.userPanel.appendChild(x)}});null!=+x.email),c.appendChild(C));null!=N&&(x=document.createElement("div"),x.style.marginTop="4px",C=document.createElement("i"),mxUtils.write(C,N),x.appendChild(C),c.appendChild(x));I.appendChild(c);Q.appendChild(I);O.appendChild(Q);this.userPanel.appendChild(O);x=document.createElement("div");x.style.textAlign="center";x.style.padding="10px";x.style.whiteSpace="nowrap";null!=K&&(K=mxUtils.button(mxResources.get("signOut"),K),K.className="geBtn",x.appendChild(K));this.userPanel.appendChild(x)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",mxUtils.bind(this,function(){var x=this.getCurrentFile();if(null!=x&&x.constructor==DropboxFile){var C=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});x.isModified()?this.confirm(mxResources.get("allChangesLost"),null,C,mxResources.get("cancel"),mxResources.get("discardChanges")):C()}else this.dropbox.logout()}),mxResources.get("dropbox"));null!=this.oneDrive&&b(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.oneDrive.noLogout?null:mxUtils.bind(this,function(){var x=this.getCurrentFile();if(null!=x&&x.constructor==OneDriveFile){var C=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});x.isModified()?this.confirm(mxResources.get("allChangesLost"),null,C,mxResources.get("cancel"),mxResources.get("discardChanges")):C()}else this.oneDrive.logout()}),mxResources.get("oneDrive"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var x=this.getCurrentFile();if(null!=x&&x.constructor==GitHubFile){var C=mxUtils.bind(this,function(){this.gitHub.logout();window.location.hash=""});x.isModified()?this.confirm(mxResources.get("allChangesLost"),null,C,mxResources.get("cancel"),mxResources.get("discardChanges")):C()}else this.gitHub.logout()}),mxResources.get("github"));null!=this.gitLab&&b(this.gitLab.getUser(),IMAGE_PATH+"/gitlab-logo.svg",mxUtils.bind(this,function(){var x=this.getCurrentFile();if(null!=x&&x.constructor==GitLabFile){var C=@@ -13912,7 +13914,7 @@ Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);nud.style.marginLeft="4px";d.style.cursor="help";d.style.color="blue";var t=document.createElement("img");t.setAttribute("src",Editor.helpImage);t.setAttribute("valign","bottom");t.setAttribute("border","0");t.className="geAdaptiveAsset";mxUtils.setOpacity(t,60);t.style.height="16px";t.style.width="16px";d.appendChild(t);mxEvent.addGestureListeners(d,mxUtils.bind(this,function(y){this.editorUi.hideCurrentMenu();this.editorUi.openLink(l);mxEvent.consume(y)}));return d};Menus.prototype.addLinkToItem=function(l,d){null!=l&&(d=this.createHelpLink(d),d.style.display="inline",d.style.marginLeft="8px",l.firstChild.nextSibling.appendChild(d))};Menus.prototype.removeCustomFont=function(l,d){for(var t=0;t<this.customFonts.length;t++)if(this.customFonts[t].name==l&&this.customFonts[t].url==d){this.customFonts.splice(t,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(l,d){for(var t=0;t<this.customFonts.length;t++)if(this.customFonts[t].name==l&&this.customFonts[t].url==d)return!0;for(t=0;t<this.defaultFonts.length;t++){var y=this.defaultFonts[t];if("string"!==typeof y&&y.fontFamily==l&&y.fontUrl==d||"string"===typeof y&&y==l&&null==d)return!0}return!1};Menus.prototype.addCustomFont=function(l,d){null==l||this.containsFont(l,d)||(this.customFonts.push({name:l,url:d}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var f=Menus.prototype.init;Menus.prototype.init=function(){function l(m,-v,z){d.isExportToCanvas()?d.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(B,H,T,g,p,F,K,M,R,S,V,W,X){var Y=parseInt(B);!isNaN(Y)&&0<Y&&(d.exportImage(Y/100,H&&"png"==m,T,g,p&&"png"==m,K,!M,R,m,V,null,W,X),null!=z&&z(B,H,T,g,p,F,K,M,R,S,V,W,X))}),!0,v,m,!0):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||d.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(B,H,T,g,+v,z){d.isExportToCanvas()?d.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(B,H,T,g,p,G,J,L,R,S,V,W,X){var Y=parseInt(B);!isNaN(Y)&&0<Y&&(d.exportImage(Y/100,H&&"png"==m,T,g,p&&"png"==m,J,!L,R,m,V,null,W,X),null!=z&&z(B,H,T,g,p,G,J,L,R,S,V,W,X))}),!0,v,m,!0):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||d.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(B,H,T,g,p){d.downloadFile(H&&"png"==m?"xmlpng":m,null,null,B,null,null,T,g,p)}),!1,!0)}f.apply(this,arguments);var d=this.editorUi,t=d.editor.graph,y=mxUtils.bind(t,t.isEnabled);mxClient.IS_SVG||d.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(m){return"file"!=m}));d.actions.addAction("new...",function(){var m=d.isOffline(),v=new NewDialog(d,m,!(d.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));d.showDialog(v.container,m?350:620,m?70:460,!0,!0,function(z){d.sidebar.hideTooltip();z&&null==d.getCurrentFile()&&d.showSplash()});v.init()});d.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",function(){if(t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())){var m=new NewDialog(d,null,!1,function(v){d.hideDialog();if(null!=v){var z=d.editor.graph.getFreeInsertPoint();t.setSelectionCells(d.importXml(v,Math.max(z.x,20),Math.max(z.y,20),!0,null,null,!0));t.scrollCellToVisible(t.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));d.showDialog(m.container,620,460,!0,!0,function(){d.sidebar.hideTooltip()});m.init()}})).isEnabled=y;var x=d.actions.addAction("shareCursor",function(){d.setShareCursorPosition(!d.isShareCursorPosition())});x.setToggleAction(!0);x.setSelectedCallback(function(){return d.isShareCursorPosition()});x=d.actions.addAction("showRemoteCursors",function(){d.setShowRemoteCursors(!d.isShowRemoteCursors())});x.setToggleAction(!0);@@ -13925,9 +13927,9 @@ x.setToggleAction(!0);x.setSelectedCallback(function(){return d.isAutoDarkMode(!x=d.actions.put("toggleSketchMode",new Action(mxResources.get("sketch"),function(m){d.setSketchMode(!Editor.sketchMode)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return Editor.sketchMode});d.actions.addAction("properties...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){m=new FilePropertiesDialog(d,m);d.showDialog(m.container,340,200,!0,!0);m.init()})}).isEnabled=y;window.mxFreehand&&(d.actions.put("insertFreehand",new Action(mxResources.get("freehand")+"...",function(){if(t.isEnabled()){if(null==d.freehandWindow){var m=!mxClient.IS_IE&&!mxClient.IS_IE11;d.freehandWindow=new FreehandWindow(d,document.body.offsetWidth-420,102,176,m?126:90,m)}t.freehand.isDrawing()?t.freehand.stopDrawing():t.freehand.startDrawing();d.freehandWindow.window.setVisible(t.freehand.isDrawing())}},null,null,"X")).isEnabled=function(){return y()&&mxClient.IS_SVG});d.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var m=document.createElement("div");m.style.whiteSpace="nowrap";var v=null==d.pages||1>=d.pages.length,z=document.createElement("h3");mxUtils.write(z,mxResources.get("formatXml"));z.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";m.appendChild(z);var B=d.addCheckbox(m,mxResources.get("selectionOnly"),!1,t.isSelectionEmpty()),H=d.addCheckbox(m,mxResources.get("compressed"),Editor.defaultCompressed),T=d.addCheckbox(m,mxResources.get("allPages"),!v,v);T.style.marginBottom="16px";mxEvent.addListener(B,"change",function(){B.checked?T.setAttribute("disabled",-"disabled"):T.removeAttribute("disabled")});m=new CustomDialog(d,m,mxUtils.bind(this,function(){d.downloadFile("xml",!H.checked,null,!B.checked,v||!T.checked)}),null,mxResources.get("export"));d.showDialog(m.container,300,200,!0,!0)}));Editor.enableExportUrl&&d.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){d.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(m,v,z,B,H,T,g,p,F){g=[];B&&F&&g.push("tags=%7B%7D");m=new EmbedDialog(d,d.createLink(m,-v,!0,B,H,T,null,!0,g,null,z));d.showDialog(m.container,450,240,!0,!0);m.init()})}));d.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){d.showHtmlDialog(mxResources.get("export"),null,m,function(v,z,B,H,T,g,p,F,K,M,R){d.createHtml(v,z,B,H,T,g,p,F,K,M,R,mxUtils.bind(this,function(S,V){var W=d.getBaseFilename(p);S='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+-mxUtils.htmlEntities(W)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+S+"\n"+V+"\n</body>\n</html>";d.saveData(W+(".drawio"==W.substring(W.lenth-7)?"":".drawio")+".html","html",S,"text/html")}))})})}));d.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){EditorUi.isElectronApp||!d.isOffline()&&!d.printPdfExport?d.showPrintDialog(mxResources.get("formatPdf"),mxUtils.bind(this,function(m,v){m=null!=d.pages?d.pages.length:1;var z=null==d.pages||1>=d.pages.length,+"disabled"):T.removeAttribute("disabled")});m=new CustomDialog(d,m,mxUtils.bind(this,function(){d.downloadFile("xml",!H.checked,null,!B.checked,v||!T.checked)}),null,mxResources.get("export"));d.showDialog(m.container,300,200,!0,!0)}));Editor.enableExportUrl&&d.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){d.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(m,v,z,B,H,T,g,p,G){g=[];B&&G&&g.push("tags=%7B%7D");m=new EmbedDialog(d,d.createLink(m,+v,!0,B,H,T,null,!0,g,null,z));d.showDialog(m.container,450,240,!0,!0);m.init()})}));d.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){d.showHtmlDialog(mxResources.get("export"),null,m,function(v,z,B,H,T,g,p,G,J,L,R,S){d.createHtml(v,z,B,H,T,g,p,G,J,L,R,mxUtils.bind(this,function(V,W){var X=d.getBaseFilename(p);V='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'++mxUtils.htmlEntities(X)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+V+"\n"+W+"\n</body>\n</html>";d.saveData(X+(".drawio"==X.substring(X.lenth-7)?"":".drawio")+".html","html",V,"text/html")}),S)})})}));d.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){EditorUi.isElectronApp||!d.isOffline()&&!d.printPdfExport?d.showPrintDialog(mxResources.get("formatPdf"),mxUtils.bind(this,function(m,v){m=null!=d.pages?d.pages.length:1;var z=null==d.pages||1>=d.pages.length,B=d.getPageIndex(d.currentPage);B=null!=B?B+1:1;d.downloadFile("pdf",null,null,!v.selection,z||!v.allPages&&v.pagesFrom==B&&v.pagesTo==B,!v.crop,v.transparent,v.scale,null,v.grid,v.includeCopy,v.allPages||v.pagesFrom==B&&v.pagesTo==B?null:{from:Math.max(0,Math.min(m-1,v.pagesFrom-1)),to:Math.max(0,Math.min(m-1,v.pagesTo-1))},v.border,v.fit,v.sheetsAcross,v.sheetsDown)})):d.showDialog((new PrintDialog(d,mxResources.get("formatPdf"))).container,320,null!=d.pages&&1<d.pages.length&&(d.editor.editable||"1"!=urlParams["hide-pages"])?350:280,!0,!0)}));d.actions.addAction("open...",function(){d.pickFile()});d.actions.addAction("close",function(){function m(){null!=v&&v.removeDraft();d.fileLoaded(null)}var v=d.getCurrentFile();null!=v&&v.isModified()?d.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges")):m()});d.actions.addAction("editShape...",mxUtils.bind(this,function(){t.getSelectionCells();if(1==t.getSelectionCount()){var m=t.getSelectionCell(),v=t.view.getState(m);null!=v&&null!=v.shape&&null!=v.shape.stencil&&(m=new EditShapeDialog(d,m,mxResources.get("editShape")+":",630,400),d.showDialog(m.container,640,480,!0,!1),m.init())}}));d.actions.addAction("revisionHistory...",function(){d.isRevisionHistorySupported()?d.spinner.spin(document.body,mxResources.get("loading"))&&d.getRevisions(mxUtils.bind(this,function(m,v){d.spinner.stop();m=new RevisionDialog(d,m,v);d.showDialog(m.container,640,480,!0,!0);m.init()}),mxUtils.bind(this,function(m){d.handleError(null!=@@ -13938,7 +13940,7 @@ x.isEnabled=y);x=d.actions.put("defaultAdaptiveColors",new Action(mxResources.gefunction(){var m=new ChangePageSetup(d);m.ignoreColor=!0;m.ignoreImage=!0;m.adaptiveColors="none";t.model.execute(m)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return"none"==t.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(m,v){this.addMenuItems(m,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],v)})));isLocalStorage&&(x=d.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),x.setToggleAction(!0),x.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var C=d.actions.addAction("autosave",function(){d.editor.setAutosave(!d.editor.autosave)});C.setToggleAction(!0);C.setSelectedCallback(function(){return C.isEnabled()&&d.editor.autosave});d.actions.addAction("editGeometry...",function(){for(var m=t.getSelectionCells(),v=[],z=0;z<m.length;z++)t.getModel().isVertex(m[z])&&v.push(m[z]);0<v.length&&(m=new EditGeometryDialog(d,v),d.showDialog(m.container,200,270,!0,!0),m.init())},null,null,Editor.ctrlKey+"+Shift+M");d.actions.addAction("copyStyle",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var m=t.getSelectionCell(),v=t.getCellStyle(m,!1);d.copiedStyle={};var z=[],B=[],H;for(H in v)z.push(v[H]),B.push(H);t.copyCellStyles([m],B,z,d.copiedStyle,d.copiedStyle,null,null,null,!0)}},null,null,"Alt+C");d.actions.addAction("pasteStyle",function(){t.isEnabled()&&!t.isSelectionEmpty()&&null!=d.copiedStyle&&t.pasteCellStyles(t.includeDescendants(t.getSelectionCells()),-d.copiedStyle,d.copiedStyle,!0)},null,null,"Alt+V");d.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){d.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(m,v,z,B,H,T,g,p,F,K,M,R,S,V){m=parseInt(m);d.lastExportSvgEditable=H;!isNaN(m)&&0<m&&d.exportSvg(m/100,v,z,B,H,T,g,!p,F,K,R,S,V)}),!0,d.lastExportSvgEditable,"svg",!0)}));d.actions.put("exportPng",new Action(mxResources.get("formatPng")++d.copiedStyle,d.copiedStyle,!0)},null,null,"Alt+V");d.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){d.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(m,v,z,B,H,T,g,p,G,J,L,R,S,V){m=parseInt(m);d.lastExportSvgEditable=H;!isNaN(m)&&0<m&&d.exportSvg(m/100,v,z,B,H,T,g,!p,G,J,R,S,V)}),!0,d.lastExportSvgEditable,"svg",!0)}));d.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){l("png",d.lastExportPngEditable,function(m,v,z,B,H){d.lastExportPngEditable=H})}));d.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){l("jpeg")}));d.actions.put("exportWebp",new Action(mxResources.get("formatWebp")+"...",function(){l("webp")}));x=d.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var m=mxUtils.sortCells(t.model.getTopmostCells(t.getSelectionCells())),v=mxUtils.getXml(0==m.length?d.editor.getGraphXml():t.encodeCells(m));d.copyImage(m,v)}),null,null,"Ctrl+Alt+X");x.visible=Editor.enableNativeCipboard&&d.isExportToCanvas()&&!mxClient.IS_SF;x=d.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){t.setShadowVisible(!t.shadowVisible)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return t.shadowVisible});d.actions.put("about",new Action("v"+EditorUi.VERSION,function(m,v){}));d.actions.addAction("support...",function(){EditorUi.isElectronApp?d.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):d.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});d.actions.addAction("exportOptionsDisabled...",function(){d.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});d.actions.addAction("keyboardShortcuts...",function(){!mxClient.IS_SVG||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?d.openLink("https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg"):d.openLink("shortcuts.svg")});d.actions.addAction("feedback...",@@ -13951,18 +13953,18 @@ return null!=this[m]&&this[m].window.isVisible()}));d.actions.put("exportVsdx",n!m,m);B.style.marginBottom="16px";m=new CustomDialog(d,v,mxUtils.bind(this,function(){d.exportVisio(!B.checked)}),null,mxResources.get("export"));d.showDialog(m.container,300,130,!0,!0)}}));isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&d.actions.addAction("configuration...",function(){var m=document.createElement("input");m.setAttribute("type","checkbox");m.style.marginRight="8px";m.checked=mxSettings.getShowStartScreen();m.defaultChecked=m.checked;if(Editor.isSettingsEnabled()&&("sketch"==Editor.currentTheme||"simple"==Editor.currentTheme||"min"==Editor.currentTheme)){var v=document.createElement("span");v.style.display="flex";v.style.alignItems="center";v.style["float"]="right";v.style.cursor="pointer";v.style.userSelect="none";v.style.marginTop="-3px";v.appendChild(m);mxUtils.write(v,mxResources.get("showStartScreen"));mxEvent.addListener(v,"click",function(B){mxEvent.getSource(B)!=m&&(m.checked=!m.checked)});header=v}v=[[mxResources.get("reset"),function(){d.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),d.hideDialog(),d.alert(mxResources.get("restartForChangeRequired"))}catch(B){d.handleError(B)}})}]];if(!d.isOfflineApp()&&isLocalStorage&&d.mode!=App.MODE_ATLAS){var z=d.actions.get("plugins");null==z||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||v.push([mxResources.get("plugins"),z.funct])}EditorUi.isElectronApp||v.push([mxResources.get("link"),function(B,H){if(0<H.value.length)try{var T=-JSON.parse(H.value),g=window.location.protocol+"//"+window.location.host+"/"+d.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(T)),p=new EmbedDialog(d,g);d.showDialog(p.container,450,240,!0);p.init()}catch(F){d.handleError(F)}else d.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=d.getServiceName()&&"1"!=urlParams.embed&&v.push([mxResources.get("preferences"),function(){d.showLocalStorageDialog(mxResources.get("preferences")+":",Editor.settingsKey,[[mxResources.get("reset"),+JSON.parse(H.value),g=window.location.protocol+"//"+window.location.host+"/"+d.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(T)),p=new EmbedDialog(d,g);d.showDialog(p.container,450,240,!0);p.init()}catch(G){d.handleError(G)}else d.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=d.getServiceName()&&"1"!=urlParams.embed&&v.push([mxResources.get("preferences"),function(){d.showLocalStorageDialog(mxResources.get("preferences")+":",Editor.settingsKey,[[mxResources.get("reset"),function(){d.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.settingsKey),localStorage.removeItem(".drawio-config"),d.hideDialog(),d.alert(mxResources.get("restartForChangeRequired"))}catch(B){d.handleError(B)}})}]])}]);d.showLocalStorageDialog(mxResources.get("configuration")+":",Editor.configurationKey,v,m.parentNode,"https://www.drawio.com/doc/faq/configure-diagram-editor",function(){null!=m.parentNode&&(mxSettings.setShowStartScreen(m.checked),mxSettings.save())})});if(mxClient.IS_CHROMEAPP||isLocalStorage){this.put("language",new Menu(mxUtils.bind(this,function(m,v){var z=mxLanguage;null==urlParams.lang&&isLocalStorage&&(z=mxSettings.settings.language);var B=mxUtils.bind(this,function(T){var g=""==T?mxResources.get("automatic"):mxLanguageMap[T],p=null;""!=g&&(p=m.addItem(g,null,mxUtils.bind(this,function(){d.setAndPersistLanguage(T);d.alert(mxResources.get("restartForChangeRequired"))}),v),(T==z||""==T&&null==z)&&m.addCheckmark(p,Editor.checkmarkImage));return p});-B("");m.addSeparator(v);for(var H in mxLanguageMap)B(H)})));var L=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(m){var v=L.apply(this,arguments);if(("1"!=urlParams.embed||"1"==urlParams.atlas)&&null!=v&&Editor.enableSimpleTheme&&"atlassian"!=d.getServiceName()){var z=this.get("dynamicAppearance");if(null!=z){var B=v.addMenu("",z.funct);B.setAttribute("title",mxResources.get("appearance"));B.className="geToolbarButton geAdaptiveAsset";B.style.backgroundPosition="center center";+B("");m.addSeparator(v);for(var H in mxLanguageMap)B(H)})));var K=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(m){var v=K.apply(this,arguments);if(("1"!=urlParams.embed||"1"==urlParams.atlas)&&null!=v&&Editor.enableSimpleTheme&&"atlassian"!=d.getServiceName()){var z=this.get("dynamicAppearance");if(null!=z){var B=v.addMenu("",z.funct);B.setAttribute("title",mxResources.get("appearance"));B.className="geToolbarButton geAdaptiveAsset";B.style.backgroundPosition="center center";B.style.backgroundRepeat="no-repeat";B.style.backgroundSize="100% 100%";B.style.display="inline-block";B.style.cursor="pointer";B.style.zIndex="1";B.style.position="absolute";B.style.height="18px";B.style.width="18px";"atlas"==Editor.currentTheme?(B.style.filter="invert(100%)",B.style.right="11px",B.style.top="10px"):(B.style.right="10px",B.style.top="5px");document.body.appendChild(B);v.langIcon=B;z=mxUtils.bind(this,function(){var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;B.style.display="atlas"==Editor.currentTheme||"min"==Editor.currentTheme||"sketch"==Editor.currentTheme?"none":"";B.style.backgroundImage="simple"==Editor.currentTheme?750>H?"url("+Editor.thinDoubleArrowRightImage+")":"url("+(Editor.isDarkMode()?Editor.thinDarkImage:Editor.thinLightImage)+")":"url("+(Editor.isDarkMode()?Editor.darkModeImage:Editor.lightModeImage)+")"});this.editorUi.addListener("currentThemeChanged",z);this.editorUi.addListener("darkModeChanged",z);mxEvent.addListener(window,"resize",z);z()}}return v}}d.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];d.actions.addAction("runLayout",function(){d.showCustomLayoutDialog(JSON.stringify(d.customLayoutConfig,null,2))});d.actions.put("adaptiveColors",new Action("adaptiveColors",function(m){null==d.adaptiveColorsWindow&&(d.adaptiveColorsWindow=new AdaptiveColorsWindow(d,document.body.offsetWidth-520,80,200,160));d.adaptiveColorsWindow.window.setVisible(!0)}));x=this.get("viewZoom");var N=x.funct;x.funct=mxUtils.bind(this,function(m,v){N.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(m,["-","outline","fullscreen"],v)});x=this.get("layout");var O=x.funct;x.funct=function(m,v){O.apply(this,arguments);m.addItem(mxResources.get("orgChart"),null,function(){var z=null,B=20,H=20,T=function(){"undefined"!==typeof mxOrgChartLayout&&null!=z&&d.tryAndHandle(mxUtils.bind(this,-function(){var V=d.editor.graph,W=new mxOrgChartLayout(V,z,B,H),X=V.getDefaultParent();1<V.model.getChildCount(V.getSelectionCell())&&(X=V.getSelectionCell());W.execute(X)}))},g=document.createElement("div"),p=document.createElement("div");p.style.marginTop="6px";p.style.display="inline-block";p.style.width="180px";mxUtils.write(p,mxResources.get("orgChartType")+": ");g.appendChild(p);var F=document.createElement("select");F.style.width="160px";F.style.boxSizing="border-box";p=[mxResources.get("linear"),-mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")];for(var K=0;K<p.length;K++){var M=document.createElement("option");mxUtils.write(M,p[K]);M.value=K;2==K&&M.setAttribute("selected","selected");F.appendChild(M)}mxEvent.addListener(F,"change",function(){z=F.value});g.appendChild(F);p=document.createElement("div");p.style.marginTop="6px";p.style.display=+function(){var V=d.editor.graph,W=new mxOrgChartLayout(V,z,B,H),X=V.getDefaultParent();1<V.model.getChildCount(V.getSelectionCell())&&(X=V.getSelectionCell());W.execute(X)}))},g=document.createElement("div"),p=document.createElement("div");p.style.marginTop="6px";p.style.display="inline-block";p.style.width="180px";mxUtils.write(p,mxResources.get("orgChartType")+": ");g.appendChild(p);var G=document.createElement("select");G.style.width="160px";G.style.boxSizing="border-box";p=[mxResources.get("linear"),+mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")];for(var J=0;J<p.length;J++){var L=document.createElement("option");mxUtils.write(L,p[J]);L.value=J;2==J&&L.setAttribute("selected","selected");G.appendChild(L)}mxEvent.addListener(G,"change",function(){z=G.value});g.appendChild(G);p=document.createElement("div");p.style.marginTop="6px";p.style.display="inline-block";p.style.width="180px";mxUtils.write(p,mxResources.get("parentChildSpacing")+": ");g.appendChild(p);var R=document.createElement("input");R.type="number";R.value=B;R.style.width="160px";R.style.boxSizing="border-box";g.appendChild(R);mxEvent.addListener(R,"change",function(){B=R.value});p=document.createElement("div");p.style.marginTop="6px";p.style.display="inline-block";p.style.width="180px";mxUtils.write(p,mxResources.get("siblingSpacing")+": ");g.appendChild(p);var S=document.createElement("input");-S.type="number";S.value=H;S.style.width="160px";S.style.boxSizing="border-box";g.appendChild(S);mxEvent.addListener(S,"change",function(){H=S.value});p=mxUtils.button(mxResources.get("custom")+"...",function(){var V=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(F.value),parentChildSpacing:parseInt(R.value),siblingSpacing:parseInt(S.value)}}];d.hideDialog();d.showCustomLayoutDialog(JSON.stringify(V,null,2))});p.className="geBtn";g=new CustomDialog(d,g,function(){null==z&&(z=2);d.loadOrgChartLayouts(T)},+S.type="number";S.value=H;S.style.width="160px";S.style.boxSizing="border-box";g.appendChild(S);mxEvent.addListener(S,"change",function(){H=S.value});p=mxUtils.button(mxResources.get("custom")+"...",function(){var V=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(G.value),parentChildSpacing:parseInt(R.value),siblingSpacing:parseInt(S.value)}}];d.hideDialog();d.showCustomLayoutDialog(JSON.stringify(V,null,2))});p.className="geBtn";g=new CustomDialog(d,g,function(){null==z&&(z=2);d.loadOrgChartLayouts(T)},null,null,null,p);d.showDialog(g.container,355,140,!0,!0)},v,null,y());m.addSeparator(v);m.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){d.tryAndHandle(mxUtils.bind(this,function(){var z=new mxParallelEdgeLayout(t);z.checkOverlap=!0;d.prompt(mxResources.get("spacing"),z.spacing,mxUtils.bind(this,function(B){d.tryAndHandle(mxUtils.bind(this,function(){z.spacing=B;d.executeLayout(function(){z.execute(t.getDefaultParent(),t.isSelectionEmpty()?null:t.getSelectionCells())},!1)}))}))}))}),v);m.addSeparator(v);d.menus.addMenuItem(m,"runLayout",v,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(m,v){if(!mxClient.IS_CHROMEAPP&&d.isOffline())this.addMenuItems(m,["keyboardShortcuts","-","about"],v);else{var z=m.addItem("Search:",null,null,v,null,null,!1);z.style.cursor="default";var B=document.createElement("input");B.setAttribute("type","text");B.setAttribute("size","25");B.style.borderWidth="1px";B.style.marginLeft="8px";mxEvent.addListener(B,"keydown",mxUtils.bind(this,function(H){var T=mxUtils.trim(B.value);13==H.keyCode&&0<T.length?(this.editorUi.openLink("https://www.drawio.com/search?src="+(EditorUi.isElectronApp?"DESKTOP":encodeURIComponent(location.host))+"&search="+encodeURIComponent(T)),B.value="",EditorUi.logEvent({category:"SEARCH-HELP",action:"search",label:T}),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==H.keyCode&&(B.value="")}));z.firstChild.nextSibling.appendChild(B);mxEvent.addGestureListeners(B,@@ -13973,8 +13975,8 @@ v){this.addMenuItems(m,["languageCode","-"],v);v=m.addItem(mxResources.get("disamxResources.parse("testCheckPages=Check Pages");mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");mxResources.parse("testOptimize=Remove Inline Images");mxResources.parse("testPerformance=Performance");d.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!t.isSelectionEmpty()){var m=t.cloneCells(t.getSelectionCells()),v=t.getBoundingBoxFromGeometry(m,!0);m=t.moveCells(m,-v.x,-v.y);d.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+v.width+", "+v.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(t.encodeCells(m)))+"'),")}}));d.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function m(g){return null==g||null==g.boundingBox||!isNaN(g.boundingBox.x)&&!isNaN(g.boundingBox.y)&&!isNaN(g.boundingBox.width)&&!isNaN(g.boundingBox.height)}var v=t.getGraphBounds(),z=t.view.translate,B=t.view.scale;t.insertVertex(t.getDefaultParent(),null,"",v.x/B-z.x,v.y/B-z.y,v.width/B,v.height/B,"fillColor=none;strokeColor=red;");var H=0,T=0;t.view.states.visit(function(g,p){g=!0;m(p.shape)||(console.log("invalid shape",p.cell.id,p.shape),g=!1);m(p.text)||(console.log("invalid text",p.cell.id,p.text),g=!1);g||H++;T++});console.log("states checked",T,"invalid",H)}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var m=null!=d.pages&&null!=d.getCurrentFile()?d.getCurrentFile().getAnonymizedXmlForPages(d.pages):"";m=new TextareaDialog(d,-"Paste Data:",m,function(v){if(0<v.length)try{var z=function(p){function F(ba){if(null==Z[ba]){if(Z[ba]=!0,null!=R[ba]){for(;0<R[ba].length;){var ha=R[ba].pop();F(ha)}delete R[ba]}}else mxLog.debug(K+": Visited: "+ba)}var K=p.parentNode.id,M=p.childNodes;p={};for(var R={},S=null,V={},W=0;W<M.length;W++){var X=M[W];if(null!=X.id&&0<X.id.length)if(null==p[X.id]){p[X.id]=X.id;var Y=X.getAttribute("parent");null==Y?null!=S?mxLog.debug(K+": Multiple roots: "+X.id):S=X.id:(null==R[Y]&&(R[Y]=[]),R[Y].push(X.id))}else V[X.id]=-X.id}M=Object.keys(V);0<M.length?(M=K+": "+M.length+" Duplicates: "+M.join(", "),mxLog.debug(M+" (see console)")):mxLog.debug(K+": Checked");var Z={};null==S?mxLog.debug(K+": No root"):(F(S),Object.keys(Z).length!=Object.keys(p).length&&(mxLog.debug(K+": Invalid tree: (see console)"),console.log(K+": Invalid tree",R)))};"<"!=v.charAt(0)&&(v=Graph.decompress(v),mxLog.debug("See console for uncompressed XML"),console.log("xml",v));var B=mxUtils.parseXml(v),H=d.getPagesForNode(B.documentElement,"mxGraphModel");+"Paste Data:",m,function(v){if(0<v.length)try{var z=function(p){function G(ba){if(null==Z[ba]){if(Z[ba]=!0,null!=R[ba]){for(;0<R[ba].length;){var fa=R[ba].pop();G(fa)}delete R[ba]}}else mxLog.debug(J+": Visited: "+ba)}var J=p.parentNode.id,L=p.childNodes;p={};for(var R={},S=null,V={},W=0;W<L.length;W++){var X=L[W];if(null!=X.id&&0<X.id.length)if(null==p[X.id]){p[X.id]=X.id;var Y=X.getAttribute("parent");null==Y?null!=S?mxLog.debug(J+": Multiple roots: "+X.id):S=X.id:(null==R[Y]&&(R[Y]=[]),R[Y].push(X.id))}else V[X.id]=+X.id}L=Object.keys(V);0<L.length?(L=J+": "+L.length+" Duplicates: "+L.join(", "),mxLog.debug(L+" (see console)")):mxLog.debug(J+": Checked");var Z={};null==S?mxLog.debug(J+": No root"):(G(S),Object.keys(Z).length!=Object.keys(p).length&&(mxLog.debug(J+": Invalid tree: (see console)"),console.log(J+": Invalid tree",R)))};"<"!=v.charAt(0)&&(v=Graph.decompress(v),mxLog.debug("See console for uncompressed XML"),console.log("xml",v));var B=mxUtils.parseXml(v),H=d.getPagesForNode(B.documentElement,"mxGraphModel");if(null!=H&&0<H.length)try{var T=d.getHashValueForPages(H);mxLog.debug("Checksum: ",T)}catch(p){mxLog.debug("Error: ",p.message)}else mxLog.debug("No pages found for checksum");var g=B.getElementsByTagName("root");for(v=0;v<g.length;v++)z(g[v]);mxLog.show()}catch(p){d.handleError(p),null!=window.console&&console.error(p)}});d.showDialog(m.container,620,460,!0,!0);m.init()}));var Q=null;d.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=d.pages){var m=new TextareaDialog(d,"Diff/Sync:","",function(v){var z=d.getCurrentFile();if(0<v.length&&null!=z)try{var B=JSON.parse(v);z.patch([B],null,!0,!0);d.hideDialog()}catch(H){d.handleError(H)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(v,z){Q=d.getPagesForXml(d.getFileData(!0));m.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(Q)}],["Diff",function(v,z){try{m.textarea.value=JSON.stringify(d.diffPages(Q,d.pages),null,2)}catch(B){d.handleError(B)}}]]);null==Q?(Q=d.getPagesForXml(d.getFileData(!0)),m.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(Q)):m.textarea.value=JSON.stringify(d.diffPages(Q,d.pages),null,2);d.showDialog(m.container,620,460,!0,!0);m.init()}else d.alert("No pages")}));d.actions.addAction("testChecksum",mxUtils.bind(this,function(){var m=d.getCurrentFile();null!=d.pages&&null!=m?d.spinner.spin(document.body,mxResources.get("loading"))&&m.getLatestVersion(function(v){d.spinner.stop();@@ -13984,24 +13986,24 @@ d.diffPages(m.ownPages,v)),console.log("diff theirPages/shadowPages",d.diffPagesd.diffPages(m.ownPages,d.pages)),console.log("diff theirPages/actualPages",d.diffPages(m.theirPages,d.pages)))}null!=m&&console.log("Shadow pages",[d.getXmlForPages(m.getShadowPages())]);null!=d.pages&&console.log("Checksum actualPages",d.getHashValueForPages(d.pages))}));d.actions.addAction("testFixPages",mxUtils.bind(this,function(){console.log("editorUi",d);var m=d.getCurrentFile();null!=m&&m.isRealtime()&&null!=m.shadowPages&&(console.log("patching actualPages to shadowPages",m.patch([d.diffPages(m.shadowPages,d.pages)])),m.ownPages=d.clonePages(d.pages),m.theirPages=d.clonePages(d.pages),m.shadowPages=d.clonePages(d.pages),null!=m.sync&&(m.sync.snapshot=d.clonePages(d.pages)))}));d.actions.addAction("testOptimize",mxUtils.bind(this,function(){t.model.beginUpdate();try{var m=t.model.cells,v=0,z=[],B=[],H;for(H in m){var T=m[H],g=t.getCurrentCellStyle(T)[mxConstants.STYLE_IMAGE];null!=g&&"data:"==g.substring(0,5)&&(null==z[g]&&(z[g]=(z[g]||0)+1,v++),B.push(T))}t.setCellStyles(mxConstants.STYLE_IMAGE,null,B);console.log("Removed",v,"image(s) from",B.length,"cell(s): ",[B,z])}finally{t.model.endUpdate()}}));d.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(d,t.getModel())}));d.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var m=new mxImageExport,v=t.getGraphBounds(),z=t.view.scale,B=mxUtils.createXmlDocument(),H=B.createElement("output");B.appendChild(H);B=new mxXmlCanvas2D(H);B.translate(Math.floor((1-v.x)/z),Math.floor((1-v.y)/z));B.scale(1/z);var T=-0,g=B.save;B.save=function(){T++;g.apply(this,arguments)};var p=B.restore;B.restore=function(){T--;p.apply(this,arguments)};var F=m.drawShape;m.drawShape=function(K){mxLog.debug("entering shape",K,T);F.apply(this,arguments);mxLog.debug("leaving shape",K,T)};m.drawState(t.getView().getState(t.model.root),B);mxLog.show();mxLog.debug(mxUtils.getXml(H));mxLog.debug("stateCounter",T)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=+0,g=B.save;B.save=function(){T++;g.apply(this,arguments)};var p=B.restore;B.restore=function(){T--;p.apply(this,arguments)};var G=m.drawShape;m.drawShape=function(J){mxLog.debug("entering shape",J,T);G.apply(this,arguments);mxLog.debug("leaving shape",J,T)};m.drawState(t.getView().getState(t.model.root),B);mxLog.show();mxLog.debug(mxUtils.getXml(H));mxLog.debug("stateCounter",T)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var I=null,c=null,e=null,k=null,n=null,q=null,u=null,A=null;d.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=I?(t.view.revalidate=I,I=null):(I=t.view.revalidate,t.view.revalidate=function(){var m=Date.now(),v=I.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",[this],"time",Date.now()-m+" ms","args",arguments);return v});null!=c?(d.selectPage=c,c=null):(c=d.selectPage,d.selectPage=function(){var m=Date.now(),v=c.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-m+" ms","args",arguments);return v});null!=e?(d.diffPages=e,e=null):(e=d.diffPages,d.diffPages=function(){var m=Date.now(),v=e.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-m+" ms","args",arguments);return v});null!=k?(d.patchPages=k,k=null):(k=d.patchPages,d.patchPages=function(){var m=Date.now(),v=k.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-m+" ms","args",arguments);return v});null!=n?(d.clonePages=n,n=null):(n=d.clonePages,d.clonePages=function(){var m=Date.now(),v=n.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-m+" ms","args",arguments);return v});null!=u?(d.getHashValueForPages=u,u=null):(u=d.getHashValueForPages,d.getHashValueForPages=function(){var m=Date.now(),v=u.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-m+" ms","args",arguments);return v});null!=A?(d.resolveCrossReferences=A,A=null):(A=d.resolveCrossReferences,d.resolveCrossReferences=function(){var m=Date.now(),v=A.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-m+" ms","args",arguments);return v});null!=q?(d.getFileData=q,q=null):(q=d.getFileData,d.getFileData=function(){var m=Date.now(),v=q.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-m+" ms","args",arguments);return v});EditorUi.debug("[Performance]",null!=I?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(m,v){this.addMenuItems(m,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),v);var z=m.addItem(mxResources.get("testPerformance"),null,function(){d.actions.get("testPerformance").funct()},v);null!=I&&m.addCheckmark(z,Editor.checkmarkImage);this.addMenuItems(m,["-","testShowConsole"],v)})))}d.actions.put("shapes",new Action(mxResources.get("moreShapes")+"...",function(m){mxClient.IS_CHROMEAPP||!d.isOffline()?d.showDialog((new MoreShapesDialog(d,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):d.showDialog((new MoreShapesDialog(d,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)}));d.actions.put("createShape",new Action(mxResources.get("shape")+"...",function(m){t.isEnabled()&&-(m=new mxCell("",new mxGeometry(0,0,120,120),d.defaultCustomShapeStyle),m.vertex=!0,m=new EditShapeDialog(d,m,mxResources.get("editShape")+":",630,400),d.showDialog(m.container,640,480,!0,!1),m.init())})).isEnabled=y;d.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){d.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",m,function(v,z,B,H,T,g,p,F,K,M,R){d.createHtml(v,z,B,H,T,g,p,F,K,-M,R,mxUtils.bind(this,function(S,V){var W=new EmbedDialog(d,"\x3c!-- "+d.editor.appName+" diagram --\x3e\n"+S+"\n"+V+"\n",null,null,function(){var X=window.open(),Y=X.document;if(null!=Y){"CSS1Compat"===document.compatMode&&Y.writeln("<!DOCTYPE html>");Y.writeln("<html>");Y.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');Y.writeln("<body>");Y.writeln(S);var Z=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;Z&&Y.writeln(V);-Y.writeln("</body>");Y.writeln("</html>");Y.close();if(!Z){var ba=X.document.createElement("div");ba.marginLeft="26px";ba.marginTop="26px";mxUtils.write(ba,mxResources.get("updatingDocument"));Z=X.document.createElement("img");Z.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");Z.style.marginLeft="6px";ba.appendChild(Z);X.document.body.insertBefore(ba,X.document.body.firstChild);window.setTimeout(function(){var ha=document.createElement("script");-ha.type="text/javascript";ha.src=/<script.*?src="(.*?)"/.exec(V)[1];Y.body.appendChild(ha);ba.parentNode.removeChild(ba)},20)}}else d.handleError({message:mxResources.get("errorUpdatingPreview")})});d.showDialog(W.container,450,240,!0,!0);W.init()}))})})}));d.actions.put("liveImage",new Action("Live image...",function(){var m=d.getCurrentFile();null!=m&&d.getPublicUrl(m,function(v){null!=v?(v=new EmbedDialog(d,'<img src="'+(m.constructor!=DriveFile?v:"https://drive.google.com/uc?id="+m.getId())+'"/>'),-d.showDialog(v.container,450,240,!0,!0),v.init()):d.handleError({message:mxResources.get("invalidPublicUrl")})})}));d.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){d.showEmbedImageDialog(function(m,v,z,B,H,T){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedImage(m,v,z,B,H,T,function(g){d.spinner.stop();g=new EmbedDialog(d,g);d.showDialog(g.container,450,240,!0,!0);g.init()},function(g){d.spinner.stop();d.handleError(g)})},mxResources.get("image"),+(m=new mxCell("",new mxGeometry(0,0,120,120),d.defaultCustomShapeStyle),m.vertex=!0,m=new EditShapeDialog(d,m,mxResources.get("editShape")+":",630,400),d.showDialog(m.container,640,480,!0,!1),m.init())})).isEnabled=y;d.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){d.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",m,function(v,z,B,H,T,g,p,G,J,L,R,S){d.createHtml(v,z,B,H,T,g,p,G,+J,L,R,mxUtils.bind(this,function(V,W){var X=new EmbedDialog(d,"\x3c!-- "+d.editor.appName+" diagram --\x3e\n"+V+"\n"+W+"\n",null,null,function(){var Y=window.open(),Z=Y.document;if(null!=Z){"CSS1Compat"===document.compatMode&&Z.writeln("<!DOCTYPE html>");Z.writeln("<html>");Z.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');Z.writeln("<body>");Z.writeln(V);var ba=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;ba&&Z.writeln(W);+Z.writeln("</body>");Z.writeln("</html>");Z.close();if(!ba){var fa=Y.document.createElement("div");fa.marginLeft="26px";fa.marginTop="26px";mxUtils.write(fa,mxResources.get("updatingDocument"));ba=Y.document.createElement("img");ba.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");ba.style.marginLeft="6px";fa.appendChild(ba);Y.document.body.insertBefore(fa,Y.document.body.firstChild);window.setTimeout(function(){var ca=document.createElement("script");+ca.type="text/javascript";ca.src=/<script.*?src="(.*?)"/.exec(W)[1];Z.body.appendChild(ca);fa.parentNode.removeChild(fa)},20)}}else d.handleError({message:mxResources.get("errorUpdatingPreview")})});d.showDialog(X.container,450,240,!0,!0);X.init()}),S)})})}));d.actions.put("liveImage",new Action("Live image...",function(){var m=d.getCurrentFile();null!=m&&d.getPublicUrl(m,function(v){null!=v?(v=new EmbedDialog(d,'<img src="'+(m.constructor!=DriveFile?v:"https://drive.google.com/uc?id="+m.getId())++'"/>'),d.showDialog(v.container,450,240,!0,!0),v.init()):d.handleError({message:mxResources.get("invalidPublicUrl")})})}));d.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){d.showEmbedImageDialog(function(m,v,z,B,H,T){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedImage(m,v,z,B,H,T,function(g){d.spinner.stop();g=new EmbedDialog(d,g);d.showDialog(g.container,450,240,!0,!0);g.init()},function(g){d.spinner.stop();d.handleError(g)})},mxResources.get("image"),mxResources.get("retina"),d.isExportToCanvas())}));d.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){d.showEmbedImageDialog(function(m,v,z,B,H,T){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedSvg(m,v,z,B,H,T,function(g){d.spinner.stop();g=new EmbedDialog(d,g);d.showDialog(g.container,450,240,!0,!0);g.init()},function(g){d.spinner.stop();d.handleError(g)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")}));-d.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){var v=t.getGraphBounds();d.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,v.height/t.view.scale))+2,null,null,null,m,d.getCurrentFile(),function(z,B,H,T,g,p,F,K,M,R){var S=[];M&&S.push("tags=%7B%7D");z=new EmbedDialog(d,'<iframe frameborder="0" style="width:'+F+";height:"+K+';" src="'+d.createLink(z,B,!0,T,g,p,"public"==R?m:null,null,S,null,+d.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){var v=t.getGraphBounds();d.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,v.height/t.view.scale))+2,null,null,null,m,d.getCurrentFile(),function(z,B,H,T,g,p,G,J,L,R){var S=[];L&&S.push("tags=%7B%7D");z=new EmbedDialog(d,'<iframe frameborder="0" style="width:'+G+";height:"+J+';" src="'+d.createLink(z,B,!0,T,g,p,"public"==R?m:null,null,S,null,H)+'"></iframe>');d.showDialog(z.container,450,240,!0,!0);z.init()},!0)})}));d.actions.put("embedNotion",new Action(mxResources.get("notion")+"...",function(){var m=document.createElement("div");m.style.position="absolute";m.style.bottom="30px";m.style.textAlign="center";m.style.width="100%";m.style.left="0px";var v=document.createElement("a");v.setAttribute("href","javascript:void(0);");v.setAttribute("target","_blank");v.style.cursor="pointer";mxUtils.write(v,mxResources.get("getNotionChromeExtension"));m.appendChild(v);mxUtils.setPrefixedStyle(v.style,"transition","all 1s ease");mxUtils.setOpacity(v,0);window.setTimeout(function(){mxUtils.setOpacity(v,100)},300);mxEvent.addListener(v,"click",function(z){d.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");mxEvent.consume(z)});d.getPublicUrl(d.getCurrentFile(),function(z){d.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",m,z,d.getCurrentFile(),-function(B,H,T,g,p,F,K,M,R,S){K=["border=0"];R&&K.push("tags=%7B%7D");B=new EmbedDialog(d,d.createLink(B,H,!0,g,p,F,"public"==S?z:null,null,K,null,T));d.showDialog(B.container,450,240,!0,!0);B.init()})})}));d.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){d.showPublishLinkDialog(null,null,null,null,null,null,m,d.getCurrentFile(),function(v,z,B,H,T,g,p,F,K,M){p=[];H&&K&&p.push("tags=%7B%7D");v=new EmbedDialog(d,d.createLink(v,-z,!0,H,T,g,"public"==M?m:null,null,p,null,B));d.showDialog(v.container,450,240,!0,!0);v.init()})})}));d.actions.addAction("microsoftOffice...",function(){d.openLink("https://office.draw.io")});d.actions.addAction("googleDocs...",function(){d.openLink("http://docsaddon.draw.io")});d.actions.addAction("googleSlides...",function(){d.openLink("https://slidesaddon.draw.io")});d.actions.addAction("googleSheets...",function(){d.openLink("https://sheetsaddon.draw.io")});d.actions.addAction("googleSites...",+function(B,H,T,g,p,G,J,L,R,S){J=["border=0"];R&&J.push("tags=%7B%7D");B=new EmbedDialog(d,d.createLink(B,H,!0,g,p,G,"public"==S?z:null,null,J,null,T));d.showDialog(B.container,450,240,!0,!0);B.init()})})}));d.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){d.showPublishLinkDialog(null,null,null,null,null,null,m,d.getCurrentFile(),function(v,z,B,H,T,g,p,G,J,L){p=[];H&&J&&p.push("tags=%7B%7D");v=new EmbedDialog(d,d.createLink(v,+z,!0,H,T,g,"public"==L?m:null,null,p,null,B));d.showDialog(v.container,450,240,!0,!0);v.init()})})}));d.actions.addAction("microsoftOffice...",function(){d.openLink("https://office.draw.io")});d.actions.addAction("googleDocs...",function(){d.openLink("http://docsaddon.draw.io")});d.actions.addAction("googleSlides...",function(){d.openLink("https://slidesaddon.draw.io")});d.actions.addAction("googleSheets...",function(){d.openLink("https://sheetsaddon.draw.io")});d.actions.addAction("googleSites...",function(){d.getPublicUrl(d.getCurrentFile(),function(m){m=new GoogleSitesDialog(d,m);d.showDialog(m.container,420,256,!0,!0);m.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)x=d.actions.addAction("scratchpad",function(){d.toggleScratchpad()}),x.setToggleAction(!0),x.setSelectedCallback(function(){return null!=d.scratchpad}),"0"!=urlParams.plugins&&d.actions.addAction("plugins...",function(){d.showDialog((new PluginsDialog(d)).container,380,240,!0,!1)});window.matchMedia&&null!=document.getElementById("high-contrast-stylesheet")&&(x=d.actions.addAction("highContrast",function(){d.setAndPersistHighContrast(!d.isHighContrast())}),x.setToggleAction(!0),x.setSelectedCallback(function(){return d.isHighContrast()}));x=d.actions.addAction("search",function(){if(null!=d.sidebar){var m=d.sidebar.isEntryVisible("search");d.sidebar.showPalette("search",!m);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!m,mxSettings.save())}});x.label=mxResources.get("searchShapes");x.setToggleAction(!0);x.setSelectedCallback(function(){return null!=d.sidebar&&d.sidebar.isEntryVisible("search")});d.actions.get("clearDefaultStyle").funct=function(m){t.isEnabled()&&(d.clearDefaultStyle(),Editor.sketchMode&&d.setSketchMode(!1))};"1"==urlParams.embed&&(d.actions.get("saveAs").setEnabled(!1),d.actions.get("save").funct=function(m){t.isEditing()&&t.stopEditing();var v="0"!=urlParams.pages||null!=d.pages&&1<d.pages.length?d.getFileData(!0):mxUtils.getXml(d.editor.getGraphXml());if("json"==urlParams.proto){var z=d.createLoadMessage("save");z.xml=v;!0!==@@ -14009,14 +14011,14 @@ m||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||(z.exit=!0);v=JSON.s"+S").label="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),d.actions.addAction("exit",function(){if("1"==urlParams.embedInline)d.sendEmbeddedSvgExport();else{var m=function(){d.editor.modified=!1;var v="json"==urlParams.proto?JSON.stringify({event:"exit",modified:d.editor.modified}):"";(window.opener||window.parent).postMessage(v,"*")};d.editor.modified?d.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges")):m()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",new Menu(mxUtils.bind(this,function(m,v){d.isExportToCanvas()?(this.addMenuItems(m,["exportPng"],v),d.jpgSupported&&this.addMenuItems(m,["exportJpg"],v),d.webpSupported&&this.addMenuItems(m,["exportWebp"],v)):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(m,["exportPng","exportJpg"],v);this.addMenuItems(m,["exportSvg","-"],v);d.isOffline()||d.printPdfExport?this.addMenuItems(m,["exportPdf"],v):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(m,["exportPdf"],v);mxClient.IS_IE||"undefined"===typeof VsdxExport&&d.isOffline()||this.addMenuItems(m,["exportVsdx"],v);this.addMenuItems(m,["-","exportHtml","exportXml","exportUrl"],v);d.isOffline()||(m.addSeparator(v),this.addMenuItem(m,"export",v).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"min"!=Editor.currentTheme||this.addMenuItems(m,["publishLink"],-v);d.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||(m.addSeparator(v),d.menus.addSubmenu("embed",m,v))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(m,v){function z(T){T.pickFile(function(g){d.spinner.spin(document.body,mxResources.get("loading"))&&T.getFile(g,function(p){var F="data:image/"==p.getData().substring(0,11)?H(p.getTitle()):"text/xml";/\.svg$/i.test(p.getTitle())&&!d.editor.isDataSvg(p.getData())&&-(p.setData(Editor.createSvgDataUri(p.getData())),F="image/svg+xml");B(p.getData(),F,p.getTitle())},function(p){d.handleError(p,null!=p?mxResources.get("errorLoadingFile"):null)},T==d.drive)},!0)}var B=mxUtils.bind(this,function(T,g,p){var F=t.view,K=t.getGraphBounds(),M=t.snap(Math.ceil(Math.max(0,K.x/F.scale-F.translate.x)+4*t.gridSize)),R=t.snap(Math.ceil(Math.max(0,(K.y+K.height)/F.scale-F.translate.y)+4*t.gridSize));"data:image/"==T.substring(0,11)?d.loadImage(T,mxUtils.bind(this,function(S){var V=-!0,W=mxUtils.bind(this,function(){d.resizeImage(S,T,mxUtils.bind(this,function(X,Y,Z){X=V?Math.min(1,Math.min(d.maxImageSize/Y,d.maxImageSize/Z)):1;d.importFile(T,g,M,R,Math.round(Y*X),Math.round(Z*X),p,function(ba){d.spinner.stop();t.setSelectionCells(ba);t.scrollCellToVisible(t.getSelectionCell())})}),V)});T.length>d.resampleThreshold?d.confirmImageResize(function(X){V=X;W()}):W()}),mxUtils.bind(this,function(){d.handleError({message:mxResources.get("cannotOpenFile")})})):d.importFile(T,g,M,R,0,+v);d.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||(m.addSeparator(v),d.menus.addSubmenu("embed",m,v))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(m,v){function z(T){T.pickFile(function(g){d.spinner.spin(document.body,mxResources.get("loading"))&&T.getFile(g,function(p){var G="data:image/"==p.getData().substring(0,11)?H(p.getTitle()):"text/xml";/\.svg$/i.test(p.getTitle())&&!d.editor.isDataSvg(p.getData())&&+(p.setData(Editor.createSvgDataUri(p.getData())),G="image/svg+xml");B(p.getData(),G,p.getTitle())},function(p){d.handleError(p,null!=p?mxResources.get("errorLoadingFile"):null)},T==d.drive)},!0)}var B=mxUtils.bind(this,function(T,g,p){var G=t.view,J=t.getGraphBounds(),L=t.snap(Math.ceil(Math.max(0,J.x/G.scale-G.translate.x)+4*t.gridSize)),R=t.snap(Math.ceil(Math.max(0,(J.y+J.height)/G.scale-G.translate.y)+4*t.gridSize));"data:image/"==T.substring(0,11)?d.loadImage(T,mxUtils.bind(this,function(S){var V=+!0,W=mxUtils.bind(this,function(){d.resizeImage(S,T,mxUtils.bind(this,function(X,Y,Z){X=V?Math.min(1,Math.min(d.maxImageSize/Y,d.maxImageSize/Z)):1;d.importFile(T,g,L,R,Math.round(Y*X),Math.round(Z*X),p,function(ba){d.spinner.stop();t.setSelectionCells(ba);t.scrollCellToVisible(t.getSelectionCell())})}),V)});T.length>d.resampleThreshold?d.confirmImageResize(function(X){V=X;W()}):W()}),mxUtils.bind(this,function(){d.handleError({message:mxResources.get("cannotOpenFile")})})):d.importFile(T,g,L,R,0,0,p,function(S){d.spinner.stop();t.setSelectionCells(S);t.scrollCellToVisible(t.getSelectionCell())})}),H=mxUtils.bind(this,function(T){var g="text/xml";/\.png$/i.test(T)?g="image/png":/\.jpe?g$/i.test(T)?g="image/jpg":/\.gif$/i.test(T)?g="image/gif":/\.pdf$/i.test(T)&&(g="application/pdf");return g});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=d.drive?m.addItem(mxResources.get("googleDrive")+"...",null,function(){z(d.drive)},v):d.isModeEnabled(App.MODE_GOOGLE)&&m.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1));d.isModeReady(App.MODE_ONEDRIVE)?m.addItem(mxResources.get("oneDrive")+"...",null,function(){z(d.oneDrive)},v):d.isModeEnabled(App.MODE_ONEDRIVE)&&m.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);d.isModeReady(App.MODE_DROPBOX)?m.addItem(mxResources.get("dropbox")+"...",null,function(){z(d.dropbox)},v):d.isModeEnabled(App.MODE_DROPBOX)&&m.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);m.addSeparator(v);d.isModeReady(App.MODE_GITHUB)&&m.addItem(mxResources.get("github")+"...",null,function(){z(d.gitHub)},v);d.isModeReady(App.MODE_GITLAB)&&m.addItem(mxResources.get("gitlab")+"...",null,function(){z(d.gitLab)},v);d.isModeReady(App.MODE_TRELLO)?m.addItem(mxResources.get("trello")+"...",null,function(){z(d.trello)},v):d.isModeEnabled(App.MODE_TRELLO)&&m.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);m.addSeparator(v);isLocalStorage&&"0"!=urlParams.browser&&m.addItem(mxResources.get("browser")+"...",null,function(){d.importLocalFile(!1)},v);"1"!=urlParams.noDevice&&m.addItem(mxResources.get("device")+"...",null,function(){d.importLocalFile(!0)},v);d.isOffline()||(m.addSeparator(v),m.addItem(mxResources.get("url")+"...",null,function(){var T=new FilenameDialog(d,"",mxResources.get("import"),function(g){if(null!=g&&0<g.length&&d.spinner.spin(document.body,mxResources.get("loading"))){var p=-/(\.png)($|\?)/i.test(g)?"image/png":"text/xml";d.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(g),function(F){B(F,p,g)},function(){d.spinner.stop();d.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==p)}},mxResources.get("url"));d.showDialog(T.container,300,80,!0,!0);T.init()},v))}))).isEnabled=y;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(m,v){var z=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&+/(\.png)($|\?)/i.test(g)?"image/png":"text/xml";d.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(g),function(G){B(G,p,g)},function(){d.spinner.stop();d.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==p)}},mxResources.get("url"));d.showDialog(T.container,300,80,!0,!0);T.init()},v))}))).isEnabled=y;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(m,v){var z=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&(750>z&&this.addSubmenu("viewZoom",m,v,mxResources.get("zoom")),460>z&&d.isPageMenuVisible()&&this.addSubmenu("pages",m,v),320>z&&this.addSubmenu("insert",m,v),360>z&&"1"!=urlParams.embed&&"draw.io"==d.getServiceName()&&this.addSubmenu("share",m,v));this.addMenuItems(m,["-","lightMode","darkMode"],v);d.isAutoDarkModeSupported()&&(z=d.menus.addMenuItem(m,"autoMode",v),null!=z&&z.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")+")"));"1"!=urlParams.embed&&this.addMenuItems(m,["-","toggleSimpleMode"],v)})));this.put("appearance",new Menu(mxUtils.bind(this,function(m,v){this.addMenuItems(m,["-","lightMode","darkMode"],v);if(d.isAutoDarkModeSupported()){var z=d.menus.addMenuItem(m,"autoMode",v);null!=z&&z.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")+")")}m.addSeparator(v);z=d.menus.addMenuItem(m,"highContrast",v);(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&d.menus.addLinkToItem(z,"https://github.com/jgraph/drawio/issues/4296")})));d.actions.addAction("addToScratchpad",function(m){t.isSelectionEmpty()||null==d.addSelectionToScratchpad||d.addSelectionToScratchpad(m)});d.actions.addAction("accounts...",function(){d.toggleUserPanel();d.userPanel.style.right="10px";d.userPanel.style.top="10px"});this.put("theme",new Menu(mxUtils.bind(this,function(m,v){var z="1"==urlParams.sketch?"sketch":mxSettings.getUi(),B=m.addItem(mxResources.get("automatic"),null,function(){d.setCurrentTheme("")},@@ -14030,11 +14032,11 @@ mxUtils.bind(this,function(){var m=d.getCurrentFile();if(m.getMode()==App.MODE_Gnew Menu(mxUtils.bind(this,function(m,v){this.addMenuItems(m,["publishLink"],v)})));d.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){d.openLink("https://app.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var m=d.getCurrentFile();null!=m&&m.share()}catch(v){d.handleError(v)}})).isEnabled=y;this.put("embed",new Menu(mxUtils.bind(this,function(m,v){var z=d.getCurrentFile();null==z||z.getMode()!=App.MODE_GOOGLE&&z.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(z.getTitle())||this.addMenuItems(m,["liveImage","-"],v);this.addMenuItems(m,["embedImage","embedSvg","-","embedHtml"],v);navigator.standalone||d.isOffline()||this.addMenuItems(m,["embedIframe"],v);"1"==urlParams.embed||d.isOffline()||this.addMenuItems(m,"- googleDocs googleSlides googleSheets - microsoftOffice - embedNotion".split(" "),v)})));d.addInsertItem=function(m,v,z,B){("plantUml"!=B||EditorUi.enablePlantUml&&!d.isOffline())&&m.addItem(z,null,mxUtils.bind(this,function(){if("fromText"==B||"formatSql"==B||"plantUml"==B||"mermaid"==B){var H=new ParseDialog(d,z,B);d.showDialog(H.container,620,420,!0,!1);d.dialog.container.style.overflow="auto"}else H=new CreateGraphDialog(d,z,B),d.showDialog(H.container,620,420,!0,!1,function(T,g){if(g)return d.confirm(mxResources.get("areYouSure"),function(){d.hideDialog()}),!1;null!=H.graph&&(null!=H.graph.container.parentNode&&H.graph.container.parentNode.removeChild(H.graph.container),H.graph.destroy(),H.graph=null)});-H.init()}),v,null,y())};var D=function(m){t.getModel().beginUpdate();try{m=t.addCell(m),t.fireEvent(new mxEventObject("cellsInserted","cells",[m])),t.model.isVertex(m)&&t.isAutoSizeCell(m)&&t.updateCellSize(m)}finally{t.getModel().endUpdate()}t.scrollCellToVisible(m);t.setSelectionCell(m);t.container.focus();t.editAfterInsert&&t.startEditing(m);window.setTimeout(function(){null!=d.hoverIcons&&d.hoverIcons.update(t.view.getState(m))},0);return m},G=function(m,v,z,B,H){m=new mxCell(m,new mxGeometry(0,-0,v,z),B);m.vertex=!0;null==H&&(H=t.getCenterInsertPoint(t.getBoundingBoxFromGeometry([m],!0)));m.geometry.x=H.x;m.geometry.y=H.y;return D(m)};d.actions.put("insertText",new Action(mxResources.get("text"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&t.startEditingAtCell(G("Text",60,30,t.appendFontSize("text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;",t.vertexFontSize),null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||-!t.isMouseInsertPoint()?null:t.getInsertPoint()))},null,null,"A")).isEnabled=y;d.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&G("",120,60,"whiteSpace=wrap;html=1;",null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||!t.isMouseInsertPoint()?null:t.getInsertPoint())},null,null,"D")).isEnabled=y;d.actions.put("insertNote",new Action(mxResources.get("note"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&-G("",140,160,"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||!t.isMouseInsertPoint()?null:t.getInsertPoint())},null,null,"S")).isEnabled=y;d.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&-G("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||!t.isMouseInsertPoint()?null:t.getInsertPoint())},null,null,"F")).isEnabled=y;d.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&G("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||!t.isMouseInsertPoint()?null:t.getInsertPoint())},null,null,"R")).isEnabled=y;d.actions.put("insertEdge",+H.init()}),v,null,y())};var D=function(m){t.getModel().beginUpdate();try{m=t.addCell(m),t.fireEvent(new mxEventObject("cellsInserted","cells",[m])),t.model.isVertex(m)&&t.isAutoSizeCell(m)&&t.updateCellSize(m)}finally{t.getModel().endUpdate()}t.scrollCellToVisible(m);t.setSelectionCell(m);t.container.focus();t.editAfterInsert&&t.startEditing(m);window.setTimeout(function(){null!=d.hoverIcons&&d.hoverIcons.update(t.view.getState(m))},0);return m},F=function(m,v,z,B,H){m=new mxCell(m,new mxGeometry(0,+0,v,z),B);m.vertex=!0;null==H&&(H=t.getCenterInsertPoint(t.getBoundingBoxFromGeometry([m],!0)));m.geometry.x=H.x;m.geometry.y=H.y;return D(m)};d.actions.put("insertText",new Action(mxResources.get("text"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&t.startEditingAtCell(F("Text",60,30,t.appendFontSize("text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;",t.vertexFontSize),null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||+!t.isMouseInsertPoint()?null:t.getInsertPoint()))},null,null,"A")).isEnabled=y;d.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&F("",120,60,"whiteSpace=wrap;html=1;",null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||!t.isMouseInsertPoint()?null:t.getInsertPoint())},null,null,"D")).isEnabled=y;d.actions.put("insertNote",new Action(mxResources.get("note"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&+F("",140,160,"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||!t.isMouseInsertPoint()?null:t.getInsertPoint())},null,null,"S")).isEnabled=y;d.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&+F("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||!t.isMouseInsertPoint()?null:t.getInsertPoint())},null,null,"F")).isEnabled=y;d.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(m){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&F("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||!t.isMouseInsertPoint()?null:t.getInsertPoint())},null,null,"R")).isEnabled=y;d.actions.put("insertEdge",new Action(mxResources.get("line"),function(m){if(t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())){var v=t.defaultEdgeLength;m=null==m||mxEvent.isControlDown(m)||mxEvent.isMetaDown(m)||!t.isMouseInsertPoint()?null:t.getInsertPoint();null==m&&(m=t.getCenterInsertPoint(t.getBoundingBoxFromGeometry([z],!0)));var z=new mxCell("",new mxGeometry(0,0,v,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");z.geometry.setTerminalPoint(m,!0);z.geometry.setTerminalPoint(new mxPoint(m.x+z.geometry.width,m.y),!1);z.geometry.points=[];z.geometry.relative=!0;z.edge=!0;D(z)}},null,null,"C")).isEnabled=y;x=d.actions.put("toggleShapes",new Action(mxResources.get("shapes"),function(){null!=d.sidebarWindow?d.sidebarWindow.window.setVisible(!d.sidebarWindow.window.isVisible()):d.toggleShapesPanel(!d.isShapesPanelVisible())},null,null,Editor.ctrlKey+"+Shift+K"));x.setToggleAction(!0);x.setSelectedCallback(mxUtils.bind(this,function(){return null!=d.sidebarWindow&&d.sidebarWindow.window.isVisible()||null==d.sidebarWindow&&0<d.hsplitPosition}));d.addInsertMenuItems=mxUtils.bind(this,function(m,v,z){for(var B=0;B<z.length;B++)"-"==z[B]?m.addSeparator(v):d.addInsertItem(m,v,mxResources.get(z[B])+"...",z[B])});this.put("insert",new Menu(mxUtils.bind(this,function(m,v){"sketch"==Editor.currentTheme?(d.menus.addMenuItems(m,["toggleShapes"],v),d.menus.addSubmenu("table",m,v),m.addSeparator(v),d.insertTemplateEnabled&&!d.isOffline()&&d.menus.addMenuItems(m,["insertTemplate"],v),d.menus.addMenuItems(m,["insertImage",@@ -14066,8 +14068,8 @@ v),m.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){d.removfunction(){d.editor.editAsNew(d.getFileData(!0,null,null,null,!0,!0))}),v)))})));this.put("pages",new Menu(mxUtils.bind(this,function(m,v){var z=d.currentPage;d.editor.graph.isLightboxView()||(m.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){try{d.insertPage()}catch(H){d.handleError(H)}}),v,null,d.editor.graph.isEnabled()),m.addSeparator(v));if(null!=d.pages)for(var B=0;B<d.pages.length;B++)mxUtils.bind(this,function(H){var T=null;T=d.pages[H]!=z||d.editor.graph.isLightboxView()?m.addItem(d.getShortPageName(d.pages[H]),null,mxUtils.bind(this,function(){d.selectPage(d.pages[H])}),v):d.menus.addSubmenu("currentPage",m,v,d.getShortPageName(z));var g=d.pages[H].getId();T.setAttribute("title",d.pages[H].getName()+" ("+(H+1)+"/"+d.pages.length+")"+(null!=g?" ["+g+"]":""));d.pages[H]==z&&m.addCheckmark(T,Editor.checkmarkImage)})(B)})));if(EditorUi.isElectronApp){var E="1"==urlParams.enableSpellCheck;x=d.actions.addAction("spellCheck",function(){d.toggleSpellCheck();E=!E;d.alert(mxResources.get("restartForChangeRequired"))});x.setToggleAction(!0);x.setSelectedCallback(function(){return E});var U="1"==urlParams.enableStoreBkp;x=d.actions.addAction("autoBkp",function(){d.toggleStoreBkp();U=!U});x.setToggleAction(!0);x.setSelectedCallback(function(){return U});var P="1"==urlParams.isGoogleFontsEnabled;x=d.actions.addAction("googleFonts",function(){d.toggleGoogleFonts();P=!P;d.alert(mxResources.get("restartForChangeRequired"))});x.setToggleAction(!0);x.setSelectedCallback(function(){return P});d.actions.addAction("openDevTools",-function(){d.openDevTools()});d.actions.addAction("drafts...",function(){var m=new FilenameDialog(d,EditorUi.draftSaveDelay/1E3+"",mxResources.get("apply"),mxUtils.bind(this,function(v){v=parseInt(v);0<=v&&(EditorUi.draftSaveDelay=1E3*v,EditorUi.enableDrafts=0<v,mxSettings.setDraftSaveDelay(v),mxSettings.save())}),mxResources.get("draftSaveInt"));d.showDialog(m.container,320,80,!0,!0);m.init()})}var J=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(m,v){if("simple"==Editor.currentTheme||-"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||d.mode==App.MODE_ATLAS||"1"==urlParams.embedInline||!Editor.isDarkMode()&&(mxClient.IS_IE||mxClient.IS_IE11)||d.menus.addSubmenu("appearance",m,v);"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&d.mode!=App.MODE_ATLAS&&d.menus.addSubmenu("theme",m,v);m.addSeparator(v);null==J||"1"==urlParams.embed&&null!=urlParams.lang||d.menus.addSubmenu("language",m,v);d.menus.addSubmenu("units",+function(){d.openDevTools()});d.actions.addAction("drafts...",function(){var m=new FilenameDialog(d,EditorUi.draftSaveDelay/1E3+"",mxResources.get("apply"),mxUtils.bind(this,function(v){v=parseInt(v);0<=v&&(EditorUi.draftSaveDelay=1E3*v,EditorUi.enableDrafts=0<v,mxSettings.setDraftSaveDelay(v),mxSettings.save())}),mxResources.get("draftSaveInt"));d.showDialog(m.container,320,80,!0,!0);m.init()})}var M=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(m,v){if("simple"==Editor.currentTheme||+"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||d.mode==App.MODE_ATLAS||"1"==urlParams.embedInline||!Editor.isDarkMode()&&(mxClient.IS_IE||mxClient.IS_IE11)||d.menus.addSubmenu("appearance",m,v);"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&d.mode!=App.MODE_ATLAS&&d.menus.addSubmenu("theme",m,v);m.addSeparator(v);null==M||"1"==urlParams.embed&&null!=urlParams.lang||d.menus.addSubmenu("language",m,v);d.menus.addSubmenu("units",m,v);d.menus.addMenuItems(m,"- copyConnect collapseExpand - tooltips animations -".split(" "),v);var z=d.getCurrentFile();"simple"!=Editor.currentTheme&&(null!=z&&z.isRealtimeEnabled()&&z.isRealtimeSupported()&&this.addMenuItems(m,["showRemoteCursors"],v),d.menus.addMenuItems(m,["ruler","-"],v));EditorUi.isElectronApp&&d.menus.addMenuItems(m,"- googleFonts spellCheck autoBkp drafts -".split(" "),v);this.addSubmenu("diagramLanguage",m,v);m.addSeparator(v);d.mode!=App.MODE_ATLAS&&d.menus.addMenuItem(m,"configuration",v);m.addSeparator(v)}else"1"==urlParams.embed&&null!=urlParams.lang||this.addSubmenu("language",m,v),"1"==urlParams.embed&&"1"!=urlParams.atlas||"atlas"==Editor.currentTheme||!Editor.isDarkMode()&&(mxClient.IS_IE||mxClient.IS_IE11)||d.menus.addSubmenu("appearance",m,v),"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&d.mode!=App.MODE_ATLAS&&this.addSubmenu("theme",m,v),m.addSeparator(v),z=this.addSubmenu("adaptiveColors",m,v),(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&d.menus.addLinkToItem(z,"https://github.com/jgraph/drawio/discussions/4713"),"undefined"!==typeof MathJax&&(z=this.addMenuItem(m,"mathematicalTypesetting",v),(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(z,"https://www.drawio.com/doc/faq/math-typesetting")),EditorUi.isElectronApp&&this.addMenuItems(m,["googleFonts","spellCheck","autoBkp","drafts","-"],v),this.addMenuItems(m,["copyConnect","collapseExpand","-"],v),"1"!=urlParams.embed&&(z=d.getCurrentFile(),null!=@@ -14089,14 +14091,14 @@ OneDriveFile||d.menus.addMenuItems(m,["share"],v));m.addSeparator(v);null!=z&&z.v):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==z||z.constructor==LocalFile&&null==z.fileHandle||(m.addSeparator(v),B=this.addMenuItem(m,"synchronize",v),(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(B,"https://www.drawio.com/doc/faq/synchronize")),this.addMenuItems(m,["-","save","saveAs","-"],v),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=d.getServiceName()||d.isOfflineApp()||null==z||this.addMenuItems(m,["share","-"],v),null!=z&&z.isRenamable()&&this.addMenuItems(m,["rename"],v),d.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&this.addMenuItems(m,["upload"],v):(this.addMenuItems(m,["makeCopy"],v),null!=z&&(z.constructor==OneDriveFile&&this.addMenuItems(m,["moveToFolder"],v),null!=z.getFolderUrl()&&d.menus.addMenuItems(m,["openFolder"],v)))),m.addSeparator(v),this.addSubmenu("importFrom",m,v),this.addSubmenu("exportAs",m,v),m.addSeparator(v),this.addSubmenu("embed",m,v),this.addSubmenu("publish",m,v),m.addSeparator(v),this.addSubmenu("newLibrary",m,v),this.addSubmenu("openLibraryFrom",m,v),d.isRevisionHistorySupported()&&this.addMenuItems(m,["-","revisionHistory"],v),null!=z&&null!=d.fileNode&&"1"!=urlParams.embedInline&&(B=null!=z.getTitle()?z.getTitle():d.defaultFilename,(z.constructor==DriveFile&&null!=z.sync&&z.sync.isConnected()||!/(\.html)$/i.test(B))&&this.addMenuItems(m,["-","properties"])),this.addMenuItems(m,["-","pageSetup"],v),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(m,["print"],v),-this.addMenuItems(m,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(m,v){function z(M){var R=encodeURIComponent(M.name)+(null==M.url?"":"@"+encodeURIComponent(M.url));if(!H[R]){for(var S=M.name,V=0;null!=F[S.toLowerCase()];)S=M.name+" ("+ ++V+")";null==p[R]&&(K.push({name:M.name,url:M.url,label:S,title:M.url}),F[S.toLowerCase()]=M,p[R]=M)}}for(var B=mxUtils.bind(this,function(M,R,S,V,W){var X=d.editor.graph,Y=this.styleChange(m,null!=V?V:M,[mxConstants.STYLE_FONTFAMILY,-"fontSource","FType"],[M,null!=R?encodeURIComponent(R):null,null],null,v,function(){X.setFont(M,R);d.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[M,null!=R?encodeURIComponent(R):null,null],"cells",[X.cellEditor.getEditingCell()]))},function(){X.updateLabelElements(X.getSelectionCells(),function(Z){Z.removeAttribute("face");Z.style.fontFamily=null;"PRE"==Z.nodeName&&X.replaceElement(Z,"div")})});S&&(S=document.createElement("img"),-S.className="geAdaptiveAsset",S.setAttribute("src",Editor.crossImage),S.setAttribute("title",mxResources.get("delete")),S.setAttribute("valign","absmiddle"),S.setAttribute("border","0"),S.style.position="relative",S.style.top="2px",S.style.width="14px",S.style.cursor="default",S.style.margin="0 3px",Y.firstChild.nextSibling.nextSibling.appendChild(S),mxEvent.addListener(S,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Z){this.removeCustomFont(M,R);this.editorUi.hideCurrentMenu();-mxEvent.consume(Z)})));Graph.addFont(M,R);Y.firstChild.nextSibling.style.fontFamily=M;W=null!=V?V:M;null!=R&&(W+=" ("+R+")");Y.setAttribute("title",W)}),H={},T=0;T<this.defaultFonts.length;T++){var g=this.defaultFonts[T];"string"===typeof g?B(g):null!=g.fontFamily&&null!=g.fontUrl&&(H[encodeURIComponent(g.fontFamily)+"@"+encodeURIComponent(g.fontUrl)]=!0,B(g.fontFamily,g.fontUrl))}m.addSeparator(v);var p={},F={},K=[];for(T=0;T<this.customFonts.length;T++)z(this.customFonts[T]);K.sort(function(M,R){return M.label<-R.label?-1:M.label>R.label?1:0});if(0<K.length){for(T=0;T<K.length;T++)B(K[T].name,K[T].url,!0,K[T].label);m.addSeparator(v)}m.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[];d.fireEvent(new mxEventObject("customFontsChanged"))}),v);m.addSeparator(v);m.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var M=this.editorUi.editor.graph,R=M.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],S="s",V=null;if(M.isEditing()){var W=-M.getSelectedEditingElement();if(null!=W){var X=mxUtils.getCurrentStyle(W);if(null!=X){R=mxUtils.getCssFontFamily(X.fontFamily);X=M.getView().getState(M.cellEditor.getEditingCell());V=null!=X?X.style.fontSource:null;for(null!=V&&(V=decodeURIComponent(V));null!=W&&W!=M.cellEditor.textarea;){if(W.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=W.getAttribute("data-font-src")){V=W.getAttribute("data-font-src");break}else if(W.getAttribute("face")==R){V=null;break}W=W.parentNode}null!=V&&(Graph.isGoogleFontUrl(V)?-(V=null,S="g"):S="w")}}}else X=M.getView().getState(M.getSelectionCell()),null!=X&&(R=X.style[mxConstants.STYLE_FONTFAMILY]||R,W=X.style.fontSource,null!=W&&(W=decodeURIComponent(W),Graph.isGoogleFontUrl(W)?S="g":(S="w",V=W)));null!=V&&V.substring(0,PROXY_URL.length)==PROXY_URL&&(V=decodeURIComponent(V.substr((PROXY_URL+"?url=").length)));var Y=null;document.activeElement==M.cellEditor.textarea&&(Y=M.cellEditor.saveSelection());R=new FontDialog(this.editorUi,R,V,S,mxUtils.bind(this,function(Z,ba,-ha){null!=Y&&(M.cellEditor.restoreSelection(Y),Y=null);if(null!=Z&&0<Z.length)if(this.addCustomFont(Z,ba),M.isEditing())M.setFont(Z,ba);else{M.getModel().beginUpdate();try{M.stopEditing(!1),M.setCellStyles(mxConstants.STYLE_FONTFAMILY,Z),M.setCellStyles("fontSource",null!=ba?encodeURIComponent(ba):null),M.setCellStyles("FType",null)}finally{M.getModel().endUpdate()}}}));this.editorUi.showDialog(R.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);R.init()}),+this.addMenuItems(m,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(m,v){function z(L){var R=encodeURIComponent(L.name)+(null==L.url?"":"@"+encodeURIComponent(L.url));if(!H[R]){for(var S=L.name,V=0;null!=G[S.toLowerCase()];)S=L.name+" ("+ ++V+")";null==p[R]&&(J.push({name:L.name,url:L.url,label:S,title:L.url}),G[S.toLowerCase()]=L,p[R]=L)}}for(var B=mxUtils.bind(this,function(L,R,S,V,W){var X=d.editor.graph,Y=this.styleChange(m,null!=V?V:L,[mxConstants.STYLE_FONTFAMILY,+"fontSource","FType"],[L,null!=R?encodeURIComponent(R):null,null],null,v,function(){X.setFont(L,R);d.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[L,null!=R?encodeURIComponent(R):null,null],"cells",[X.cellEditor.getEditingCell()]))},function(){X.updateLabelElements(X.getSelectionCells(),function(Z){Z.removeAttribute("face");Z.style.fontFamily=null;"PRE"==Z.nodeName&&X.replaceElement(Z,"div")})});S&&(S=document.createElement("img"),+S.className="geAdaptiveAsset",S.setAttribute("src",Editor.crossImage),S.setAttribute("title",mxResources.get("delete")),S.setAttribute("valign","absmiddle"),S.setAttribute("border","0"),S.style.position="relative",S.style.top="2px",S.style.width="14px",S.style.cursor="default",S.style.margin="0 3px",Y.firstChild.nextSibling.nextSibling.appendChild(S),mxEvent.addListener(S,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Z){this.removeCustomFont(L,R);this.editorUi.hideCurrentMenu();+mxEvent.consume(Z)})));Graph.addFont(L,R);Y.firstChild.nextSibling.style.fontFamily=L;W=null!=V?V:L;null!=R&&(W+=" ("+R+")");Y.setAttribute("title",W)}),H={},T=0;T<this.defaultFonts.length;T++){var g=this.defaultFonts[T];"string"===typeof g?B(g):null!=g.fontFamily&&null!=g.fontUrl&&(H[encodeURIComponent(g.fontFamily)+"@"+encodeURIComponent(g.fontUrl)]=!0,B(g.fontFamily,g.fontUrl))}m.addSeparator(v);var p={},G={},J=[];for(T=0;T<this.customFonts.length;T++)z(this.customFonts[T]);J.sort(function(L,R){return L.label<+R.label?-1:L.label>R.label?1:0});if(0<J.length){for(T=0;T<J.length;T++)B(J[T].name,J[T].url,!0,J[T].label);m.addSeparator(v)}m.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[];d.fireEvent(new mxEventObject("customFontsChanged"))}),v);m.addSeparator(v);m.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var L=this.editorUi.editor.graph,R=L.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],S="s",V=null;if(L.isEditing()){var W=+L.getSelectedEditingElement();if(null!=W){var X=mxUtils.getCurrentStyle(W);if(null!=X){R=mxUtils.getCssFontFamily(X.fontFamily);X=L.getView().getState(L.cellEditor.getEditingCell());V=null!=X?X.style.fontSource:null;for(null!=V&&(V=decodeURIComponent(V));null!=W&&W!=L.cellEditor.textarea;){if(W.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=W.getAttribute("data-font-src")){V=W.getAttribute("data-font-src");break}else if(W.getAttribute("face")==R){V=null;break}W=W.parentNode}null!=V&&(Graph.isGoogleFontUrl(V)?+(V=null,S="g"):S="w")}}}else X=L.getView().getState(L.getSelectionCell()),null!=X&&(R=X.style[mxConstants.STYLE_FONTFAMILY]||R,W=X.style.fontSource,null!=W&&(W=decodeURIComponent(W),Graph.isGoogleFontUrl(W)?S="g":(S="w",V=W)));null!=V&&V.substring(0,PROXY_URL.length)==PROXY_URL&&(V=decodeURIComponent(V.substr((PROXY_URL+"?url=").length)));var Y=null;document.activeElement==L.cellEditor.textarea&&(Y=L.cellEditor.saveSelection());R=new FontDialog(this.editorUi,R,V,S,mxUtils.bind(this,function(Z,ba,+fa){null!=Y&&(L.cellEditor.restoreSelection(Y),Y=null);if(null!=Z&&0<Z.length)if(this.addCustomFont(Z,ba),L.isEditing())L.setFont(Z,ba);else{L.getModel().beginUpdate();try{L.stopEditing(!1),L.setCellStyles(mxConstants.STYLE_FONTFAMILY,Z),L.setCellStyles("fontSource",null!=ba?encodeURIComponent(ba):null),L.setCellStyles("FType",null)}finally{L.getModel().endUpdate()}}}));this.editorUi.showDialog(R.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);R.init()}),v,null,!0)})))}})();function DiagramPage(b,f){this.node=b;null!=f?this.node.setAttribute("id",f):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,f,l){this.ui=b;this.page=f;this.previous=this.name=l}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(b,f,l){this.ui=b;this.oldIndex=f;this.newIndex=l}@@ -14118,7 +14120,7 @@ function(){b.checkDefaultParent()}));var y=mxUtils.bind(this,function(){this.updthis.toolbar&&this.toolbar.updateZoom()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(x,C){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}))}};EditorUi.prototype.scrollToPage=function(b,f){var l=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),d=null!=b?b:this.currentPage;null!=l&&null!=this.tabScroller&&this.tabScroller.children.length>l&&null!=this.tabScroller.children[l]&&(d!=this.lastScrollPage||f)&&(this.tabScroller.children[l].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[l].className="geTab gePageTab geActivePage",this.lastScrollPage=d)};EditorUi.prototype.restoreViewState=function(b,f,l){b=null!=b?this.getPageById(b.getId()):null;var d=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,f):(d.setViewState(f),this.editor.updateGraphComponents(),d.view.revalidate(),d.sizeDidChange()),d.container.scrollLeft=d.view.translate.x*d.view.scale+f.scrollLeft,d.container.scrollTop=d.view.translate.y*d.view.scale+f.scrollTop,d.restoreSelection(l))};-Graph.prototype.createViewState=function(b){var f=b.getAttribute("page"),l=parseFloat(b.getAttribute("pageScale")),d=parseFloat(b.getAttribute("pageWidth")),t=parseFloat(b.getAttribute("pageHeight")),y=b.getAttribute("background"),x=this.parseBackgroundImage(b.getAttribute("backgroundImage")),C=b.getAttribute("extFonts");if(C)try{C=C.split("|").map(function(L){L=L.split("^");return{name:L[0],url:L[1]}})}catch(L){console.log("ExtFonts format error: "+L.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+Graph.prototype.createViewState=function(b){var f=b.getAttribute("page"),l=parseFloat(b.getAttribute("pageScale")),d=parseFloat(b.getAttribute("pageWidth")),t=parseFloat(b.getAttribute("pageHeight")),y=b.getAttribute("background"),x=this.parseBackgroundImage(b.getAttribute("backgroundImage")),C=b.getAttribute("extFonts");if(C)try{C=C.split("|").map(function(K){K=K.split("^");return{name:K[0],url:K[1]}})}catch(K){console.log("ExtFonts format error: "+K.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=f?"0"!=f:this.defaultPageVisible,background:null!=y&&0<y.length?y:null,backgroundImage:x,pageScale:isNaN(l)?mxGraph.prototype.pageScale:l,pageFormat:isNaN(d)||isNaN(t)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,d,t),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:C||[]}};Graph.prototype.saveViewState=function(b,f,l,d){l||(f.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),f.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),f.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),f.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),f.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),f.setAttribute("connect",null==b||b.connect?"1":"0"),f.setAttribute("arrows",null==b||b.arrows?"1":"0"),f.setAttribute("fold",@@ -14142,7 +14144,7 @@ EditorUi.prototype.insertPage=function(b,f,l){this.editor.graph.isEnabled()&&(thEditorUi.prototype.createPage=function(b,f,l){f=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),f);f.setName(null!=b?b:this.createPageName());this.initDiagramNode(f,l);return f};EditorUi.prototype.createPageName=function(){for(var b={},f=0;f<this.pages.length;f++){var l=this.pages[f].getName();null!=l&&0<l.length&&(b[l]=l)}f=this.pages.length;do l=mxResources.get("pageWithNumber",[++f]);while(null!=b[l]);return l};EditorUi.prototype.removePage=function(b){try{var f=this.editor.graph,l=mxUtils.indexOf(this.pages,b);if(f.isEnabled()&&0<=l){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);f.model.beginUpdate();try{var d=this.currentPage;d==b&&1<this.pages.length?(l==this.pages.length-1?l--:l++,d=this.pages[l]):1>=this.pages.length&&(d=this.insertPage(),f.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));f.model.execute(new ChangePage(this,b,d))}finally{f.model.endUpdate()}}}catch(t){this.handleError(t)}return b};EditorUi.prototype.duplicatePage=function(b,f){var l=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var t=b.node.cloneNode(!1);t.removeAttribute("id");var y={},x=d.createCellLookup([d.model.root]);l=new DiagramPage(t);l.root=d.cloneCell(d.model.root,null,y);var C=new mxGraphModel;C.prefix=Editor.guid()+"-";C.setRoot(l.root);d.updateCustomLinks(d.createCellMapping(y,x),[l.root]);l.viewState=b==this.currentPage?d.getViewState():b.viewState;this.initDiagramNode(l);-l.viewState.scale=1;delete l.viewState.scrollLeft;delete l.viewState.scrollTop;delete l.viewState.currentRoot;delete l.viewState.defaultParent;l.setName(f);l=this.insertPage(l,mxUtils.indexOf(this.pages,b)+1)}}catch(L){this.handleError(L)}return l};EditorUi.prototype.initDiagramNode=function(b,f){null==f&&(f=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,f);EditorUi.removeChildNodes(b.node);b.node.appendChild(f)};+l.viewState.scale=1;delete l.viewState.scrollLeft;delete l.viewState.scrollTop;delete l.viewState.currentRoot;delete l.viewState.defaultParent;l.setName(f);l=this.insertPage(l,mxUtils.indexOf(this.pages,b)+1)}}catch(K){this.handleError(K)}return l};EditorUi.prototype.initDiagramNode=function(b,f){null==f&&(f=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,f);EditorUi.removeChildNodes(b.node);b.node.appendChild(f)};EditorUi.prototype.clonePages=function(b){for(var f=[],l=[],d=0;d<b.length;d++)try{l.push(this.clonePage(b[d]))}catch(t){f.push(mxResources.get("pageWithNumber",[d+1])+": "+t.toString())}if(0<f.length){b=Error(f.join("\n"));try{0<l.length&&(b.fallbackFileData=this.getXmlForPages(l))}catch(t){}throw b;}return l};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var f=new DiagramPage(b.node.cloneNode(!0)),l=b==this.currentPage?this.editor.graph.getViewState():b.viewState;f.viewState=mxUtils.clone(l,EditorUi.transientViewStateProperties);f.root=this.editor.graph.model.cloneCell(b.root,null,!0);f.diagramModified=b.diagramModified;return f};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var f=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(l){null!=l&&0<l.length&&this.editor.graph.model.execute(new RenamePage(this,b,l))}),mxResources.get("rename"));this.showDialog(f.container,300,80,!0,!0);f.init()}return b};EditorUi.prototype.movePage=function(b,f){this.editor.graph.model.execute(new MovePage(this,b,f))};@@ -14160,63 +14162,63 @@ EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(nEditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.thinArrowRightImage,mxUtils.bind(this,function(b){var f=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:f,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=f;mxEvent.consume(b)}))};EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.verticalDotsImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var f=new mxPopupMenu(mxUtils.bind(this,function(t,y){this.menus.get("pages").funct(t,y)}));f.div.className+=" geMenubarMenu";f.smartSeparators=!0;f.showDisabled=!0;f.autoExpand=!0;f.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(f,arguments);f.destroy()});var l=mxEvent.getClientX(b),d=mxEvent.getClientY(b);f.popup(l,d,null,b);this.setCurrentMenu(f);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,f){var l=this.createTab(),d=b.getName()||mxResources.get("untitled"),t=b.getId();l.setAttribute("title",d+(null!=t?" ("+t+")":"")+" ["+f+"]");f=document.createElement("span");f.style.maxWidth="160px";f.style.textOverflow="ellipsis";f.style.overflow="hidden";mxUtils.write(f,d);l.appendChild(f);this.addTabListeners(b,l);return l};-EditorUi.prototype.addTabListeners=function(b,f){mxEvent.disableContextMenu(f);var l=this.editor.graph;mxEvent.addListener(f,"dblclick",mxUtils.bind(this,function(L){this.renamePage(b);mxEvent.consume(L)}));var d=document.createElement("div");d.className="geTabMenuButton";d.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";d.style.backgroundSize="10px";f.appendChild(d);var t=!1,y=!1,x=mxUtils.bind(this,-function(L){t=null!=this.currentMenu;y=b==this.currentPage;this.scrollToPage(b);l.isMouseDown||y||this.selectPage(b)}),C=mxUtils.bind(this,function(L){if(l.isEnabled()&&!l.isMouseDown&&(y&&(mxEvent.isTouchEvent(L)||mxEvent.getSource(L)==d)||mxEvent.isPopupTrigger(L))&&(l.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(L)||!t)){var N=new mxPopupMenu(this.createPageMenu(b));N.div.className+=" geMenubarMenu";N.smartSeparators=!0;N.showDisabled=!0;N.autoExpand=!0;N.hideMenu=mxUtils.bind(this,-function(){mxPopupMenu.prototype.hideMenu.apply(N,arguments);this.resetCurrentMenu();N.destroy()});var O=mxEvent.getClientX(L),Q=mxEvent.getClientY(L);N.popup(O,Q,null,L);this.setCurrentMenu(N,f)}mxEvent.consume(L)});mxEvent.addGestureListeners(d,x,null,C);mxEvent.addGestureListeners(f,x,null,C)};+EditorUi.prototype.addTabListeners=function(b,f){mxEvent.disableContextMenu(f);var l=this.editor.graph;mxEvent.addListener(f,"dblclick",mxUtils.bind(this,function(K){this.renamePage(b);mxEvent.consume(K)}));var d=document.createElement("div");d.className="geTabMenuButton";d.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";d.style.backgroundSize="10px";f.appendChild(d);var t=!1,y=!1,x=mxUtils.bind(this,+function(K){t=null!=this.currentMenu;y=b==this.currentPage;this.scrollToPage(b);l.isMouseDown||y||this.selectPage(b)}),C=mxUtils.bind(this,function(K){if(l.isEnabled()&&!l.isMouseDown&&(y&&(mxEvent.isTouchEvent(K)||mxEvent.getSource(K)==d)||mxEvent.isPopupTrigger(K))&&(l.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(K)||!t)){var N=new mxPopupMenu(this.createPageMenu(b));N.div.className+=" geMenubarMenu";N.smartSeparators=!0;N.showDisabled=!0;N.autoExpand=!0;N.hideMenu=mxUtils.bind(this,+function(){mxPopupMenu.prototype.hideMenu.apply(N,arguments);this.resetCurrentMenu();N.destroy()});var O=mxEvent.getClientX(K),Q=mxEvent.getClientY(K);N.popup(O,Q,null,K);this.setCurrentMenu(N,f)}mxEvent.consume(K)});mxEvent.addGestureListeners(d,x,null,C);mxEvent.addGestureListeners(f,x,null,C)};EditorUi.prototype.createPageMenu=function(b,f){return mxUtils.bind(this,function(l,d){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||l.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),d));l.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",[b.getName()]))}),d);l.addSeparator(d);this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",l,d,mxResources.get("move"));l.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),d);l.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,f)}),d)})};(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var b=new mxObjectCodec(new MovePage,["ui"]);b.beforeDecode=function(f,l,d){d.ui=f.ui;return l};b.afterDecode=function(f,l,d){f=d.oldIndex;d.oldIndex=d.newIndex;d.newIndex=f;return d};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new RenamePage,["ui","page"]);b.beforeDecode=function(f,l,d){d.ui=f.ui;return l};b.afterDecode=function(f,l,d){f=d.previous;d.previous=d.name;d.name=f;return d};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","page","previousPage"]);b.afterEncode=function(f,l,d){d.setAttribute("relatedPage",l.relatedPage.getId());null==l.index&&(d.setAttribute("name",l.relatedPage.getName()),null!=l.relatedPage.viewState&&d.setAttribute("viewState",JSON.stringify(l.relatedPage.viewState,function(t,y){return 0>mxUtils.indexOf(EditorUi.transientViewStateProperties,t)?y:void 0})),null!=l.relatedPage.root&&f.encodeCell(l.relatedPage.root,d));return d};b.beforeDecode=function(f,l,d){d.ui=f.ui;d.relatedPage=d.ui.getPageById(l.getAttribute("relatedPage"));if(null==d.relatedPage){var t=l.ownerDocument.createElement("diagram");t.setAttribute("id",l.getAttribute("relatedPage"));t.setAttribute("name",l.getAttribute("name"));d.relatedPage=new DiagramPage(t);t=l.getAttribute("viewState");null!=t&&(d.relatedPage.viewState=JSON.parse(t),l.removeAttribute("viewState"));l=l.cloneNode(!0);t=l.firstChild;if(null!=t)for(d.relatedPage.root=f.decodeCell(t,!1),d=-t.nextSibling,t.parentNode.removeChild(t),t=d;null!=t;){d=t.nextSibling;if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var y=t.getAttribute("id");null==f.lookup(y)&&f.decodeCell(t)}t.parentNode.removeChild(t);t=d}}return l};b.afterDecode=function(f,l,d){d.index=d.previousIndex;return d};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(d,t,y,x,C){t=null!=t?t:!1;null==y&&(y=this.getFoldableCells(this.getSelectionCells(),d));this.stopEditing();this.model.beginUpdate();try{for(var L=y.slice(),N=0;N<y.length;N++)"1"==mxUtils.getValue(this.getCurrentCellStyle(y[N]),"treeFolding","0")&&this.foldTreeCell(d,y[N]);y=L;y=b.apply(this,arguments)}finally{this.model.endUpdate()}return y};Graph.prototype.foldTreeCell=function(d,t){this.model.beginUpdate();try{var y=-[];this.traverse(t,!0,mxUtils.bind(this,function(C,L){var N=null!=L&&this.isTreeEdge(L);N&&y.push(L);C==t||null!=L&&!N||y.push(C);return(null==L||N)&&(C==t||!this.model.isCollapsed(C))}));this.model.setCollapsed(t,d);for(var x=0;x<y.length;x++)this.model.setVisible(y[x],!d)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(d){return!this.isEdgeIgnored(d)};Graph.prototype.getTreeEdges=function(d,t,y,x,C,L){return this.model.filterCells(this.getEdges(d,t,y,x,C,L),mxUtils.bind(this,+t.nextSibling,t.parentNode.removeChild(t),t=d;null!=t;){d=t.nextSibling;if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var y=t.getAttribute("id");null==f.lookup(y)&&f.decodeCell(t)}t.parentNode.removeChild(t);t=d}}return l};b.afterDecode=function(f,l,d){d.index=d.previousIndex;return d};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(d,t,y,x,C){t=null!=t?t:!1;null==y&&(y=this.getFoldableCells(this.getSelectionCells(),d));this.stopEditing();this.model.beginUpdate();try{for(var K=y.slice(),N=0;N<y.length;N++)"1"==mxUtils.getValue(this.getCurrentCellStyle(y[N]),"treeFolding","0")&&this.foldTreeCell(d,y[N]);y=K;y=b.apply(this,arguments)}finally{this.model.endUpdate()}return y};Graph.prototype.foldTreeCell=function(d,t){this.model.beginUpdate();try{var y=+[];this.traverse(t,!0,mxUtils.bind(this,function(C,K){var N=null!=K&&this.isTreeEdge(K);N&&y.push(K);C==t||null!=K&&!N||y.push(C);return(null==K||N)&&(C==t||!this.model.isCollapsed(C))}));this.model.setCollapsed(t,d);for(var x=0;x<y.length;x++)this.model.setVisible(y[x],!d)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(d){return!this.isEdgeIgnored(d)};Graph.prototype.getTreeEdges=function(d,t,y,x,C,K){return this.model.filterCells(this.getEdges(d,t,y,x,C,K),mxUtils.bind(this,function(N){return this.isTreeEdge(N)}))};Graph.prototype.getIncomingTreeEdges=function(d,t){return this.getTreeEdges(d,t,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(d,t){return this.getTreeEdges(d,t,!1,!0,!1)};var f=EditorUi.prototype.init;EditorUi.prototype.init=function(){f.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function d(B){return k.isVertex(B)&&y(B)}function t(B){var H=!1;null!=B&&(H="1"==e.getCurrentCellStyle(B).treeMoving);return H}function y(B){var H=!1;null!=B&&(B=k.getParent(B),H=e.view.getState(B),H="tree"==(null!=H?H.style:e.getCellStyle(B)).containerType);return H}function x(B){var H=!1;null!=B&&(B=k.getParent(B),H=e.view.getState(B),e.view.getState(B),H=null!=(null!=H?H.style:e.getCellStyle(B)).childLayout);return H}function C(B){B=e.view.getState(B);if(null!=B){var H=e.getIncomingTreeEdges(B.cell);if(0<H.length&&(H=e.view.getState(H[0]),null!=H&&(H=H.absolutePoints,null!=-H&&0<H.length&&(H=H[H.length-1],null!=H)))){if(H.y==B.y&&Math.abs(H.x-B.getCenterX())<B.width/2)return mxConstants.DIRECTION_SOUTH;if(H.y==B.y+B.height&&Math.abs(H.x-B.getCenterX())<B.width/2)return mxConstants.DIRECTION_NORTH;if(H.x>B.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function L(B,H){H=null!=H?H:!0;e.model.beginUpdate();try{var T=e.model.getParent(B),g=e.getIncomingTreeEdges(B),p=e.cloneCells([g[0],B]);e.model.setTerminal(p[0],e.model.getTerminal(g[0],-!0),!0);var F=C(B),K=T.geometry;F==mxConstants.DIRECTION_SOUTH||F==mxConstants.DIRECTION_NORTH?p[1].geometry.x+=H?B.geometry.width+10:-p[1].geometry.width-10:p[1].geometry.y+=H?B.geometry.height+10:-p[1].geometry.height-10;e.view.currentRoot!=T&&(p[1].geometry.x-=K.x,p[1].geometry.y-=K.y);var M=e.view.getState(B),R=e.view.scale;if(null!=M){var S=mxRectangle.fromRectangle(M);F==mxConstants.DIRECTION_SOUTH||F==mxConstants.DIRECTION_NORTH?S.x+=(H?B.geometry.width+10:-p[1].geometry.width-10)*R:S.y+=(H?-B.geometry.height+10:-p[1].geometry.height-10)*R;var V=e.getOutgoingTreeEdges(e.model.getTerminal(g[0],!0));if(null!=V){for(var W=F==mxConstants.DIRECTION_SOUTH||F==mxConstants.DIRECTION_NORTH,X=K=g=0;X<V.length;X++){var Y=e.model.getTerminal(V[X],!1);if(F==C(Y)){var Z=e.view.getState(Y);Y!=B&&null!=Z&&(W&&H!=Z.getCenterX()<M.getCenterX()||!W&&H!=Z.getCenterY()<M.getCenterY())&&mxUtils.intersects(S,Z)&&(g=10+Math.max(g,(Math.min(S.x+S.width,Z.x+Z.width)-Math.max(S.x,Z.x))/R),K=10+Math.max(K,(Math.min(S.y+-S.height,Z.y+Z.height)-Math.max(S.y,Z.y))/R))}}W?K=0:g=0;for(X=0;X<V.length;X++)if(Y=e.model.getTerminal(V[X],!1),F==C(Y)&&(Z=e.view.getState(Y),Y!=B&&null!=Z&&(W&&H!=Z.getCenterX()<M.getCenterX()||!W&&H!=Z.getCenterY()<M.getCenterY()))){var ba=[];e.traverse(Z.cell,!0,function(ha,ca){var da=null!=ca&&e.isTreeEdge(ca);da&&ba.push(ca);(null==ca||da)&&ba.push(ha);return null==ca||da});e.moveCells(ba,(H?1:-1)*g,(H?1:-1)*K)}}}return e.addCells(p,T)}finally{e.model.endUpdate()}}function N(B){e.model.beginUpdate();-try{var H=C(B),T=e.getIncomingTreeEdges(B),g=e.cloneCells([T[0],B]);e.model.setTerminal(T[0],g[1],!1);e.model.setTerminal(g[0],g[1],!0);e.model.setTerminal(g[0],B,!1);var p=e.model.getParent(B),F=p.geometry,K=[];e.view.currentRoot!=p&&(g[1].geometry.x-=F.x,g[1].geometry.y-=F.y);e.traverse(B,!0,function(S,V){var W=null!=V&&e.isTreeEdge(V);W&&K.push(V);(null==V||W)&&K.push(S);return null==V||W});var M=B.geometry.width+40,R=B.geometry.height+40;H==mxConstants.DIRECTION_SOUTH?M=0:H==mxConstants.DIRECTION_NORTH?-(M=0,R=-R):H==mxConstants.DIRECTION_WEST?(M=-M,R=0):H==mxConstants.DIRECTION_EAST&&(R=0);e.moveCells(K,M,R);return e.addCells(g,p)}finally{e.model.endUpdate()}}function O(B,H){e.model.beginUpdate();try{var T=e.model.getParent(B),g=e.getIncomingTreeEdges(B),p=C(B);0==g.length&&(g=[e.createEdge(T,null,"",null,null,e.createCurrentEdgeStyle())],p=H);var F=e.cloneCells([g[0],B]);e.model.setTerminal(F[0],B,!0);null==e.model.getTerminal(F[0],!1)&&(e.model.setTerminal(F[0],F[1],!1),e.applyNewEdgeStyle(F[1],-[F[0]],p));g=e.getOutgoingTreeEdges(B);var K=T.geometry;H=[];e.view.currentRoot==T&&(K=new mxRectangle);for(var M=0;M<g.length;M++){var R=e.model.getTerminal(g[M],!1);null!=R&&H.push(R)}var S=e.view.getBounds(H),V=e.view.translate,W=e.view.scale;p==mxConstants.DIRECTION_SOUTH?(F[1].geometry.x=null==S?B.geometry.x+(B.geometry.width-F[1].geometry.width)/2:(S.x+S.width)/W-V.x-K.x+10,F[1].geometry.y+=F[1].geometry.height-K.y+40):p==mxConstants.DIRECTION_NORTH?(F[1].geometry.x=null==S?B.geometry.x+(B.geometry.width--F[1].geometry.width)/2:(S.x+S.width)/W-V.x+-K.x+10,F[1].geometry.y-=F[1].geometry.height+K.y+40):(F[1].geometry.x=p==mxConstants.DIRECTION_WEST?F[1].geometry.x-(F[1].geometry.width+K.x+40):F[1].geometry.x+(F[1].geometry.width-K.x+40),F[1].geometry.y=null==S?B.geometry.y+(B.geometry.height-F[1].geometry.height)/2:(S.y+S.height)/W-V.y+-K.y+10);return e.addCells(F,T)}finally{e.model.endUpdate()}}function Q(B,H,T){B=e.getOutgoingTreeEdges(B);T=e.view.getState(T);var g=[];if(null!=T&&null!=B){for(var p=-0;p<B.length;p++){var F=e.view.getState(e.model.getTerminal(B[p],!1));null!=F&&(!H&&Math.min(F.x+F.width,T.x+T.width)>=Math.max(F.x,T.x)||H&&Math.min(F.y+F.height,T.y+T.height)>=Math.max(F.y,T.y))&&g.push(F)}g.sort(function(K,M){return H?K.x+K.width-M.x-M.width:K.y+K.height-M.y-M.height})}return g}function I(B,H){var T=C(B),g=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;(T==mxConstants.DIRECTION_EAST||T==mxConstants.DIRECTION_WEST)==g&&T!=H?c.actions.get("selectParent").funct():T==+H&&0<H.length&&(H=H[H.length-1],null!=H)))){if(H.y==B.y&&Math.abs(H.x-B.getCenterX())<B.width/2)return mxConstants.DIRECTION_SOUTH;if(H.y==B.y+B.height&&Math.abs(H.x-B.getCenterX())<B.width/2)return mxConstants.DIRECTION_NORTH;if(H.x>B.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function K(B,H){H=null!=H?H:!0;e.model.beginUpdate();try{var T=e.model.getParent(B),g=e.getIncomingTreeEdges(B),p=e.cloneCells([g[0],B]);e.model.setTerminal(p[0],e.model.getTerminal(g[0],+!0),!0);var G=C(B),J=T.geometry;G==mxConstants.DIRECTION_SOUTH||G==mxConstants.DIRECTION_NORTH?p[1].geometry.x+=H?B.geometry.width+10:-p[1].geometry.width-10:p[1].geometry.y+=H?B.geometry.height+10:-p[1].geometry.height-10;e.view.currentRoot!=T&&(p[1].geometry.x-=J.x,p[1].geometry.y-=J.y);var L=e.view.getState(B),R=e.view.scale;if(null!=L){var S=mxRectangle.fromRectangle(L);G==mxConstants.DIRECTION_SOUTH||G==mxConstants.DIRECTION_NORTH?S.x+=(H?B.geometry.width+10:-p[1].geometry.width-10)*R:S.y+=(H?+B.geometry.height+10:-p[1].geometry.height-10)*R;var V=e.getOutgoingTreeEdges(e.model.getTerminal(g[0],!0));if(null!=V){for(var W=G==mxConstants.DIRECTION_SOUTH||G==mxConstants.DIRECTION_NORTH,X=J=g=0;X<V.length;X++){var Y=e.model.getTerminal(V[X],!1);if(G==C(Y)){var Z=e.view.getState(Y);Y!=B&&null!=Z&&(W&&H!=Z.getCenterX()<L.getCenterX()||!W&&H!=Z.getCenterY()<L.getCenterY())&&mxUtils.intersects(S,Z)&&(g=10+Math.max(g,(Math.min(S.x+S.width,Z.x+Z.width)-Math.max(S.x,Z.x))/R),J=10+Math.max(J,(Math.min(S.y++S.height,Z.y+Z.height)-Math.max(S.y,Z.y))/R))}}W?J=0:g=0;for(X=0;X<V.length;X++)if(Y=e.model.getTerminal(V[X],!1),G==C(Y)&&(Z=e.view.getState(Y),Y!=B&&null!=Z&&(W&&H!=Z.getCenterX()<L.getCenterX()||!W&&H!=Z.getCenterY()<L.getCenterY()))){var ba=[];e.traverse(Z.cell,!0,function(fa,ca){var da=null!=ca&&e.isTreeEdge(ca);da&&ba.push(ca);(null==ca||da)&&ba.push(fa);return null==ca||da});e.moveCells(ba,(H?1:-1)*g,(H?1:-1)*J)}}}return e.addCells(p,T)}finally{e.model.endUpdate()}}function N(B){e.model.beginUpdate();+try{var H=C(B),T=e.getIncomingTreeEdges(B),g=e.cloneCells([T[0],B]);e.model.setTerminal(T[0],g[1],!1);e.model.setTerminal(g[0],g[1],!0);e.model.setTerminal(g[0],B,!1);var p=e.model.getParent(B),G=p.geometry,J=[];e.view.currentRoot!=p&&(g[1].geometry.x-=G.x,g[1].geometry.y-=G.y);e.traverse(B,!0,function(S,V){var W=null!=V&&e.isTreeEdge(V);W&&J.push(V);(null==V||W)&&J.push(S);return null==V||W});var L=B.geometry.width+40,R=B.geometry.height+40;H==mxConstants.DIRECTION_SOUTH?L=0:H==mxConstants.DIRECTION_NORTH?+(L=0,R=-R):H==mxConstants.DIRECTION_WEST?(L=-L,R=0):H==mxConstants.DIRECTION_EAST&&(R=0);e.moveCells(J,L,R);return e.addCells(g,p)}finally{e.model.endUpdate()}}function O(B,H){e.model.beginUpdate();try{var T=e.model.getParent(B),g=e.getIncomingTreeEdges(B),p=C(B);0==g.length&&(g=[e.createEdge(T,null,"",null,null,e.createCurrentEdgeStyle())],p=H);var G=e.cloneCells([g[0],B]);e.model.setTerminal(G[0],B,!0);null==e.model.getTerminal(G[0],!1)&&(e.model.setTerminal(G[0],G[1],!1),e.applyNewEdgeStyle(G[1],+[G[0]],p));g=e.getOutgoingTreeEdges(B);var J=T.geometry;H=[];e.view.currentRoot==T&&(J=new mxRectangle);for(var L=0;L<g.length;L++){var R=e.model.getTerminal(g[L],!1);null!=R&&H.push(R)}var S=e.view.getBounds(H),V=e.view.translate,W=e.view.scale;p==mxConstants.DIRECTION_SOUTH?(G[1].geometry.x=null==S?B.geometry.x+(B.geometry.width-G[1].geometry.width)/2:(S.x+S.width)/W-V.x-J.x+10,G[1].geometry.y+=G[1].geometry.height-J.y+40):p==mxConstants.DIRECTION_NORTH?(G[1].geometry.x=null==S?B.geometry.x+(B.geometry.width-+G[1].geometry.width)/2:(S.x+S.width)/W-V.x+-J.x+10,G[1].geometry.y-=G[1].geometry.height+J.y+40):(G[1].geometry.x=p==mxConstants.DIRECTION_WEST?G[1].geometry.x-(G[1].geometry.width+J.x+40):G[1].geometry.x+(G[1].geometry.width-J.x+40),G[1].geometry.y=null==S?B.geometry.y+(B.geometry.height-G[1].geometry.height)/2:(S.y+S.height)/W-V.y+-J.y+10);return e.addCells(G,T)}finally{e.model.endUpdate()}}function Q(B,H,T){B=e.getOutgoingTreeEdges(B);T=e.view.getState(T);var g=[];if(null!=T&&null!=B){for(var p=+0;p<B.length;p++){var G=e.view.getState(e.model.getTerminal(B[p],!1));null!=G&&(!H&&Math.min(G.x+G.width,T.x+T.width)>=Math.max(G.x,T.x)||H&&Math.min(G.y+G.height,T.y+T.height)>=Math.max(G.y,T.y))&&g.push(G)}g.sort(function(J,L){return H?J.x+J.width-L.x-L.width:J.y+J.height-L.y-L.height})}return g}function I(B,H){var T=C(B),g=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;(T==mxConstants.DIRECTION_EAST||T==mxConstants.DIRECTION_WEST)==g&&T!=H?c.actions.get("selectParent").funct():T==H?(H=e.getOutgoingTreeEdges(B),null!=H&&0<H.length&&e.setSelectionCell(e.model.getTerminal(H[0],!1))):(T=e.getIncomingTreeEdges(B),null!=T&&0<T.length&&(g=Q(e.model.getTerminal(T[0],!0),g,B),B=e.view.getState(B),null!=B&&(B=mxUtils.indexOf(g,B),0<=B&&(B+=H==mxConstants.DIRECTION_NORTH||H==mxConstants.DIRECTION_WEST?-1:1,0<=B&&B<=g.length-1&&e.setSelectionCell(g[B].cell)))))}var c=this,e=c.editor.graph,k=e.getModel(),n=c.menus.createPopupMenu;c.menus.createPopupMenu=function(B,H,T){n.apply(this,arguments);if(1==e.getSelectionCount()){H=e.getSelectionCell();var g=e.getOutgoingTreeEdges(H);B.addSeparator();0<g.length&&(d(e.getSelectionCell())&&this.addMenuItems(B,["selectChildren"],null,T),this.addMenuItems(B,["selectDescendants"],null,T));d(e.getSelectionCell())?(B.addSeparator(),0<e.getIncomingTreeEdges(H).length&&this.addMenuItems(B,["selectSiblings","selectParent"],null,T)):0<e.model.getEdgeCount(H)&&this.addMenuItems(B,["selectConnections"],null,T)}};c.actions.addAction("selectChildren",function(B){if(e.isEnabled()&&-1==e.getSelectionCount()){var H=e.getSelectionCell();B=mxEvent.isControlDown(B)?null:e.getOutgoingTreeEdges(H);if(null!=B&&0<B.length){H=[];for(var T=0;T<B.length;T++)H.push(e.model.getTerminal(B[T],!1));e.setSelectionCells(H)}else e.setSelectionCells(e.model.getChildren(H))}},null,null,"Alt+Shift+C");c.actions.addAction("selectDescendants",function(B){var H=e.getSelectionCell();if(e.isEnabled()&&null!=H){var T=[];mxEvent.isControlDown(B)||e.traverse(H,!0,function(g,p){var F=null!=p&&e.isTreeEdge(p);-F&&mxEvent.isControlDown(B)&&T.push(p);(null==p||F)&&T.push(g);return null==p||F});if(0==T.length||1==T.length&&T[0]==H)T=e.model.getDescendants(H);e.setSelectionCells(T)}},null,null,"Alt+Shift+X");c.actions.addAction("selectParent",function(B){var H=e.getSelectionCell();e.isEnabled()&&null!=H&&(B=mxEvent.isControlDown(B)?null:e.getIncomingTreeEdges(H),null!=B&&0<B.length?e.setSelectionCell(e.model.getTerminal(B[0],!0)):e.selectParentCell())},null,null,"Alt+Shift+P");c.actions.addAction("selectSiblings",+1==e.getSelectionCount()){var H=e.getSelectionCell();B=mxEvent.isControlDown(B)?null:e.getOutgoingTreeEdges(H);if(null!=B&&0<B.length){H=[];for(var T=0;T<B.length;T++)H.push(e.model.getTerminal(B[T],!1));e.setSelectionCells(H)}else e.setSelectionCells(e.model.getChildren(H))}},null,null,"Alt+Shift+C");c.actions.addAction("selectDescendants",function(B){var H=e.getSelectionCell();if(e.isEnabled()&&null!=H){var T=[];mxEvent.isControlDown(B)||e.traverse(H,!0,function(g,p){var G=null!=p&&e.isTreeEdge(p);+G&&mxEvent.isControlDown(B)&&T.push(p);(null==p||G)&&T.push(g);return null==p||G});if(0==T.length||1==T.length&&T[0]==H)T=e.model.getDescendants(H);e.setSelectionCells(T)}},null,null,"Alt+Shift+X");c.actions.addAction("selectParent",function(B){var H=e.getSelectionCell();e.isEnabled()&&null!=H&&(B=mxEvent.isControlDown(B)?null:e.getIncomingTreeEdges(H),null!=B&&0<B.length?e.setSelectionCell(e.model.getTerminal(B[0],!0)):e.selectParentCell())},null,null,"Alt+Shift+P");c.actions.addAction("selectSiblings",function(B){if(e.isEnabled()&&1==e.getSelectionCount()){var H=e.getSelectionCell(),T=mxEvent.isControlDown(B)?null:e.getIncomingTreeEdges(H);B=[];if(null!=T&&0<T.length&&(T=e.getOutgoingTreeEdges(e.model.getTerminal(T[0],!0)),null!=T))for(var g=0;g<T.length;g++)B.push(e.model.getTerminal(T[g],!1));0==B.length&&(B=e.model.getChildren(e.model.getParent(H)));e.setSelectionCells(B)}},null,null,"Alt+Shift+S");var q=e.removeCells;e.removeCells=function(B,H){H=null!=H?H:!0;null==B&&(B=this.getDeletableCells(this.getSelectionCells()));-H&&(B=this.getDeletableCells(this.addAllEdges(B)));for(var T=[],g=0;g<B.length;g++){var p=B[g];k.isEdge(p)&&y(p)&&(T.push(p),p=k.getTerminal(p,!1));if(d(p)){var F=[];e.traverse(p,!0,function(K,M){var R=null!=M&&e.isTreeEdge(M);R&&F.push(M);(null==M||R)&&F.push(K);return null==M||R});0<F.length&&(T=T.concat(F),p=e.getIncomingTreeEdges(B[g]),B=B.concat(p))}else null!=p&&T.push(B[g])}B=T;return q.apply(this,arguments)};c.hoverIcons.getStateAt=function(B,H,T){return d(B.cell)?null:this.graph.view.getState(this.graph.getCellAt(H,-T))};var u=e.duplicateCells;e.duplicateCells=function(B,H){B=null!=B?B:this.getSelectionCells();for(var T=B.slice(0),g=0;g<T.length;g++){var p=e.view.getState(T[g]);if(null!=p&&d(p.cell)){var F=e.getIncomingTreeEdges(p.cell);for(p=0;p<F.length;p++)mxUtils.remove(F[p],B)}}this.model.beginUpdate();try{var K=u.call(this,B,H);if(K.length==B.length)for(g=0;g<B.length;g++)if(d(B[g])){var M=e.getIncomingTreeEdges(K[g]);F=e.getIncomingTreeEdges(B[g]);if(0==M.length&&0<F.length){var R=this.cloneCell(F[0]);-this.addEdge(R,e.getDefaultParent(),this.model.getTerminal(F[0],!0),K[g])}}}finally{this.model.endUpdate()}return K};var A=e.moveCells;e.moveCells=function(B,H,T,g,p,F,K){for(var M=null,R=[],S=0;S<B.length;S++)(t(B[S])||d(B[S]))&&!x(B[S])&&this.isCellCollapsed(B[S])?R=R.concat(this.getSubtree(B[S])):R.push(B[S]);B=mxUtils.removeDuplicates(R);this.model.beginUpdate();try{R=p;var V=this.getCurrentCellStyle(p);if(null!=B&&d(p)&&"1"==mxUtils.getValue(V,"treeFolding","0")){for(S=0;S<B.length;S++)if(d(B[S])||-e.model.isEdge(B[S])&&null==e.model.getTerminal(B[S],!0)){p=e.model.getParent(B[S]);break}if(null!=R&&p!=R&&null!=this.view.getState(B[0])){var W=e.getIncomingTreeEdges(B[0]);if(0<W.length){var X=e.view.getState(e.model.getTerminal(W[0],!0));if(null!=X){var Y=e.view.getState(R);null!=Y&&(H=(Y.getCenterX()-X.getCenterX())/e.view.scale,T=(Y.getCenterY()-X.getCenterY())/e.view.scale)}}}}M=A.apply(this,arguments);if(null!=M&&null!=B&&M.length==B.length)for(S=0;S<M.length;S++)if(this.model.isEdge(M[S]))d(R)&&-0>mxUtils.indexOf(M,this.model.getTerminal(M[S],!0))&&this.model.setTerminal(M[S],R,!0);else if(d(B[S])&&(W=e.getIncomingTreeEdges(B[S]),0<W.length))if(!g)d(R)&&0>mxUtils.indexOf(B,this.model.getTerminal(W[0],!0))&&this.model.setTerminal(W[0],R,!0);else if(0==e.getIncomingTreeEdges(M[S]).length){V=R;if(null==V||V==e.model.getParent(B[S]))V=e.model.getTerminal(W[0],!0);g=this.cloneCell(W[0]);this.addEdge(g,e.getDefaultParent(),V,M[S])}}finally{this.model.endUpdate()}return M};if(null!=c.sidebar){var D=-c.sidebar.dropAndConnect;c.sidebar.dropAndConnect=function(B,H,T,g){var p=e.model,F=null;p.beginUpdate();try{if(F=D.apply(this,arguments),d(B))for(var K=0;K<F.length;K++)if(p.isEdge(F[K])&&null==p.getTerminal(F[K],!0)){p.setTerminal(F[K],B,!0);var M=e.getCellGeometry(F[K]);M.points=null;null!=M.getTerminalPoint(!0)&&M.setTerminalPoint(null,!0)}}finally{p.endUpdate()}return F}}var G={67:c.actions.get("selectChildren"),88:c.actions.get("selectDescendants"),80:c.actions.get("selectParent"),83:c.actions.get("selectSiblings")},-E={67:c.actions.get("copyStyle"),86:c.actions.get("pasteStyle")},U=c.onKeyDown;c.onKeyDown=function(B){try{var H=e.getSelectionCell();if(e.isEnabled()&&!e.isEditing()&&null!=H){var T=mxEvent.isAltDown(B)&&mxEvent.isShiftDown(B)?G[B.keyCode]:mxEvent.isAltDown(B)?E[B.keyCode]:null;null!=T?(T.funct(B),mxEvent.consume(B)):d(H)&&(T=null,0<e.getIncomingTreeEdges(H).length&&(9==B.which?T=mxEvent.isShiftDown(B)?N(H):O(H):13==B.which&&(T=L(H,!mxEvent.isShiftDown(B)))),null!=T&&0<T.length?(1==T.length&&e.model.isEdge(T[0])?+H&&(B=this.getDeletableCells(this.addAllEdges(B)));for(var T=[],g=0;g<B.length;g++){var p=B[g];k.isEdge(p)&&y(p)&&(T.push(p),p=k.getTerminal(p,!1));if(d(p)){var G=[];e.traverse(p,!0,function(J,L){var R=null!=L&&e.isTreeEdge(L);R&&G.push(L);(null==L||R)&&G.push(J);return null==L||R});0<G.length&&(T=T.concat(G),p=e.getIncomingTreeEdges(B[g]),B=B.concat(p))}else null!=p&&T.push(B[g])}B=T;return q.apply(this,arguments)};c.hoverIcons.getStateAt=function(B,H,T){return d(B.cell)?null:this.graph.view.getState(this.graph.getCellAt(H,+T))};var u=e.duplicateCells;e.duplicateCells=function(B,H){B=null!=B?B:this.getSelectionCells();for(var T=B.slice(0),g=0;g<T.length;g++){var p=e.view.getState(T[g]);if(null!=p&&d(p.cell)){var G=e.getIncomingTreeEdges(p.cell);for(p=0;p<G.length;p++)mxUtils.remove(G[p],B)}}this.model.beginUpdate();try{var J=u.call(this,B,H);if(J.length==B.length)for(g=0;g<B.length;g++)if(d(B[g])){var L=e.getIncomingTreeEdges(J[g]);G=e.getIncomingTreeEdges(B[g]);if(0==L.length&&0<G.length){var R=this.cloneCell(G[0]);+this.addEdge(R,e.getDefaultParent(),this.model.getTerminal(G[0],!0),J[g])}}}finally{this.model.endUpdate()}return J};var A=e.moveCells;e.moveCells=function(B,H,T,g,p,G,J){for(var L=null,R=[],S=0;S<B.length;S++)(t(B[S])||d(B[S]))&&!x(B[S])&&this.isCellCollapsed(B[S])?R=R.concat(this.getSubtree(B[S])):R.push(B[S]);B=mxUtils.removeDuplicates(R);this.model.beginUpdate();try{R=p;var V=this.getCurrentCellStyle(p);if(null!=B&&d(p)&&"1"==mxUtils.getValue(V,"treeFolding","0")){for(S=0;S<B.length;S++)if(d(B[S])||+e.model.isEdge(B[S])&&null==e.model.getTerminal(B[S],!0)){p=e.model.getParent(B[S]);break}if(null!=R&&p!=R&&null!=this.view.getState(B[0])){var W=e.getIncomingTreeEdges(B[0]);if(0<W.length){var X=e.view.getState(e.model.getTerminal(W[0],!0));if(null!=X){var Y=e.view.getState(R);null!=Y&&(H=(Y.getCenterX()-X.getCenterX())/e.view.scale,T=(Y.getCenterY()-X.getCenterY())/e.view.scale)}}}}L=A.apply(this,arguments);if(null!=L&&null!=B&&L.length==B.length)for(S=0;S<L.length;S++)if(this.model.isEdge(L[S]))d(R)&&+0>mxUtils.indexOf(L,this.model.getTerminal(L[S],!0))&&this.model.setTerminal(L[S],R,!0);else if(d(B[S])&&(W=e.getIncomingTreeEdges(B[S]),0<W.length))if(!g)d(R)&&0>mxUtils.indexOf(B,this.model.getTerminal(W[0],!0))&&this.model.setTerminal(W[0],R,!0);else if(0==e.getIncomingTreeEdges(L[S]).length){V=R;if(null==V||V==e.model.getParent(B[S]))V=e.model.getTerminal(W[0],!0);g=this.cloneCell(W[0]);this.addEdge(g,e.getDefaultParent(),V,L[S])}}finally{this.model.endUpdate()}return L};if(null!=c.sidebar){var D=+c.sidebar.dropAndConnect;c.sidebar.dropAndConnect=function(B,H,T,g){var p=e.model,G=null;p.beginUpdate();try{if(G=D.apply(this,arguments),d(B))for(var J=0;J<G.length;J++)if(p.isEdge(G[J])&&null==p.getTerminal(G[J],!0)){p.setTerminal(G[J],B,!0);var L=e.getCellGeometry(G[J]);L.points=null;null!=L.getTerminalPoint(!0)&&L.setTerminalPoint(null,!0)}}finally{p.endUpdate()}return G}}var F={67:c.actions.get("selectChildren"),88:c.actions.get("selectDescendants"),80:c.actions.get("selectParent"),83:c.actions.get("selectSiblings")},+E={67:c.actions.get("copyStyle"),86:c.actions.get("pasteStyle")},U=c.onKeyDown;c.onKeyDown=function(B){try{var H=e.getSelectionCell();if(e.isEnabled()&&!e.isEditing()&&null!=H){var T=mxEvent.isAltDown(B)&&mxEvent.isShiftDown(B)?F[B.keyCode]:mxEvent.isAltDown(B)?E[B.keyCode]:null;null!=T?(T.funct(B),mxEvent.consume(B)):d(H)&&(T=null,0<e.getIncomingTreeEdges(H).length&&(9==B.which?T=mxEvent.isShiftDown(B)?N(H):O(H):13==B.which&&(T=K(H,!mxEvent.isShiftDown(B)))),null!=T&&0<T.length?(1==T.length&&e.model.isEdge(T[0])?e.setSelectionCell(e.model.getTerminal(T[0],!1)):e.setSelectionCell(T[T.length-1]),null!=c.hoverIcons&&c.hoverIcons.update(e.view.getState(H)),e.startEditingAtCell(H),mxEvent.consume(B)):37==B.keyCode?(I(H,mxConstants.DIRECTION_WEST),mxEvent.consume(B)):38==B.keyCode?(I(H,mxConstants.DIRECTION_NORTH),mxEvent.consume(B)):39==B.keyCode?(I(H,mxConstants.DIRECTION_EAST),mxEvent.consume(B)):40==B.keyCode&&(I(H,mxConstants.DIRECTION_SOUTH),mxEvent.consume(B)))}}catch(g){c.handleError(g)}mxEvent.isConsumed(B)||-U.apply(this,arguments)};var P=e.connectVertex;e.connectVertex=function(B,H,T,g,p,F,K){var M=e.getIncomingTreeEdges(B);if(d(B)){var R=C(B),S=R==mxConstants.DIRECTION_EAST||R==mxConstants.DIRECTION_WEST,V=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;return R==H||0==M.length?O(B,H):S==V?N(B):L(B,H!=mxConstants.DIRECTION_NORTH&&H!=mxConstants.DIRECTION_WEST)}return P.apply(this,arguments)};e.getSubtree=function(B){var H=[B];!t(B)&&!d(B)||x(B)||e.traverse(B,!0,function(T,g){var p=null!=-g&&e.isTreeEdge(g);p&&0>mxUtils.indexOf(H,g)&&H.push(g);(null==g||p)&&0>mxUtils.indexOf(H,T)&&H.push(T);return null==g||p});return H};var J=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){J.apply(this,arguments);(t(this.state.cell)||d(this.state.cell))&&!x(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title",+U.apply(this,arguments)};var P=e.connectVertex;e.connectVertex=function(B,H,T,g,p,G,J){var L=e.getIncomingTreeEdges(B);if(d(B)){var R=C(B),S=R==mxConstants.DIRECTION_EAST||R==mxConstants.DIRECTION_WEST,V=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;return R==H||0==L.length?O(B,H):S==V?N(B):K(B,H!=mxConstants.DIRECTION_NORTH&&H!=mxConstants.DIRECTION_WEST)}return P.apply(this,arguments)};e.getSubtree=function(B){var H=[B];!t(B)&&!d(B)||x(B)||e.traverse(B,!0,function(T,g){var p=null!=+g&&e.isTreeEdge(g);p&&0>mxUtils.indexOf(H,g)&&H.push(g);(null==g||p)&&0>mxUtils.indexOf(H,T)&&H.push(T);return null==g||p});return H};var M=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){M.apply(this,arguments);(t(this.state.cell)||d(this.state.cell))&&!x(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(B){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(B),mxEvent.getClientY(B),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(B);this.graph.isMouseDown=!0;c.hoverIcons.reset();mxEvent.consume(B)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var m=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){m.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var v=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(B){v.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=B?"":"none")};var z=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(B,H){z.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var l=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var d=l.apply(this,arguments),t=this.graph,y=this;return d.concat([this.addEntry("tree container",function(){var x=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");x.vertex=!0;var C=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-C.vertex=!0;var L=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');L.vertex=!0;var N=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");N.geometry.relative=!0;N.edge=!0;C.insertEdge(N,!0);L.insertEdge(N,!1);x.insert(N);x.insert(C);x.insert(L);+C.vertex=!0;var K=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');K.vertex=!0;var N=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");N.geometry.relative=!0;N.edge=!0;C.insertEdge(N,!0);K.insertEdge(N,!1);x.insert(N);x.insert(C);x.insert(K);return y.createVertexTemplateFromCells([x],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var x=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");x.vertex=!0;var C=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-C.vertex=!0;var L=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');L.vertex=!0;var N=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-N.geometry.relative=!0;N.edge=!0;C.insertEdge(N,!0);L.insertEdge(N,!1);var O=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+C.vertex=!0;var K=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');K.vertex=!0;var N=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+N.geometry.relative=!0;N.edge=!0;C.insertEdge(N,!0);K.insertEdge(N,!1);var O=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');O.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),N.style);Q.geometry.relative=!0;Q.edge=!0;C.insertEdge(Q,!0);O.insertEdge(Q,!1);var I=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');I.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),N.style);c.geometry.relative=!0;c.edge=!0;C.insertEdge(c,!0);I.insertEdge(c,!1);var e=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-e.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),N.style);k.geometry.relative=!0;k.edge=!0;C.insertEdge(k,!0);e.insertEdge(k,!1);x.insert(N);x.insert(Q);x.insert(c);x.insert(k);x.insert(C);x.insert(L);x.insert(O);x.insert(I);x.insert(e);return y.createVertexTemplateFromCells([x],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var x=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+e.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),N.style);k.geometry.relative=!0;k.edge=!0;C.insertEdge(k,!0);e.insertEdge(k,!1);x.insert(N);x.insert(Q);x.insert(c);x.insert(k);x.insert(C);x.insert(K);x.insert(O);x.insert(I);x.insert(e);return y.createVertexTemplateFromCells([x],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var x=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');x.vertex=!0;return y.createVertexTemplateFromCells([x],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var x=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');x.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");C.geometry.setTerminalPoint(new mxPoint(-40,40),!0);C.geometry.relative=!0;C.edge=!0;x.insertEdge(C,!1);return y.createVertexTemplateFromCells([x,C],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var x=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');x.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");C.geometry.setTerminalPoint(new mxPoint(-40,40),!0);C.geometry.relative=!0;C.edge=!0;x.insertEdge(C,!1);return y.createVertexTemplateFromCells([x,C],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree orgchart organization division",function(){var x=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');x.vertex=!0;var C=new mxCell("Organization",new mxGeometry(80,-40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');t.setAttributeForCell(C,"treeRoot","1");C.vertex=!0;var L=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');L.vertex=!0;var N=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-N.geometry.relative=!0;N.edge=!0;C.insertEdge(N,!0);L.insertEdge(N,!1);var O=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');O.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");Q.geometry.relative=-!0;Q.edge=!0;C.insertEdge(Q,!0);O.insertEdge(Q,!1);x.insert(N);x.insert(Q);x.insert(C);x.insert(L);x.insert(O);return y.createVertexTemplateFromCells([x],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree root",function(){var x=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');t.setAttributeForCell(x,"treeRoot","1");x.vertex=!0;return y.createVertexTemplateFromCells([x],+40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');t.setAttributeForCell(C,"treeRoot","1");C.vertex=!0;var K=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');K.vertex=!0;var N=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+N.geometry.relative=!0;N.edge=!0;C.insertEdge(N,!0);K.insertEdge(N,!1);var O=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');O.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");Q.geometry.relative=+!0;Q.edge=!0;C.insertEdge(Q,!0);O.insertEdge(Q,!1);x.insert(N);x.insert(Q);x.insert(C);x.insert(K);x.insert(O);return y.createVertexTemplateFromCells([x],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree root",function(){var x=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');t.setAttributeForCell(x,"treeRoot","1");x.vertex=!0;return y.createVertexTemplateFromCells([x],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree division",function(){var x=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');x.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");C.geometry.setTerminalPoint(new mxPoint(0,0),!0);C.geometry.relative=!0;C.edge=!0;x.insertEdge(C,!1);return y.createVertexTemplateFromCells([x,C],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree sub sections",function(){var x=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");x.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");-C.geometry.setTerminalPoint(new mxPoint(110,-40),!0);C.geometry.relative=!0;C.edge=!0;x.insertEdge(C,!1);var L=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");L.vertex=!0;var N=new mxCell("",new mxGeometry(0,0,0,0),C.style);N.geometry.setTerminalPoint(new mxPoint(110,-40),!0);N.geometry.relative=!0;N.edge=!0;L.insertEdge(N,!1);return y.createVertexTemplateFromCells([C,N,x,L],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+C.geometry.setTerminalPoint(new mxPoint(110,-40),!0);C.geometry.relative=!0;C.edge=!0;x.insertEdge(C,!1);var K=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");K.vertex=!0;var N=new mxCell("",new mxGeometry(0,0,0,0),C.style);N.geometry.setTerminalPoint(new mxPoint(110,-40),!0);N.geometry.relative=!0;N.edge=!0;K.insertEdge(N,!1);return y.createVertexTemplateFromCells([C,N,x,K],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;EditorUi.initMinimalTheme=function(){function b(I,c){if(EditorUi.windowed){var e=I.editor.graph;e.popupMenuHandler.hideMenu();null==I.formatWindow?(c=Math.max(10,I.diagramContainer.clientWidth-248),e=Math.min(566,e.container.clientHeight-10),I.formatWindow=new WrapperWindow(I,mxResources.get("format"),c,60,240,e,function(k){I.createFormat(k).init()}),I.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){I.formatWindow.window.fit()})),I.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):I.formatWindow.window.setVisible(null!=c?c:!I.formatWindow.window.isVisible())}else null==I.formatElt&&(I.formatElt=I.createSidebarContainer(),I.createFormat(I.formatElt).init(),I.formatElt.style.border="none",I.formatElt.style.width="240px",I.formatElt.style.borderLeftWidth="1px",I.formatElt.style.borderLeftStyle="solid",I.formatElt.style.right="0px"),e=I.diagramContainer.parentNode,null!=I.formatElt.parentNode?(I.formatElt.parentNode.removeChild(I.formatElt),e.style.right="0px"):(e.parentNode.appendChild(I.formatElt),e.style.right=I.formatElt.style.width)}function f(I,c){function e(q,u){var A=I.menus.get(q);q=k.addMenu(u,mxUtils.bind(this,function(){A.funct.apply(this,arguments)}));q.setAttribute("title",u);q.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";q.className="geTitle";c.appendChild(q);return q}var k=new Menubar(I,c);if(Editor.enableCustomLibraries&&@@ -14229,68 +14231,68 @@ mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var t=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(I){t.apply(this,arguments);null!=this.tabContainer&&(this.tabContainer.style.right="62px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px")};var y=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){y.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var x=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(I,c){null!=c.shortcut&&900>d&&!mxClient.IS_IOS?I.firstChild.nextSibling.setAttribute("title",c.shortcut):x.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(I){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=I?I:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||-null==this.formatWindow&&0<this.formatWidth};var C=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();C.apply(this,arguments)};var L=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(I){L.apply(this,arguments);if(I){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=+null==this.formatWindow&&0<this.formatWidth};var C=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();C.apply(this,arguments)};var K=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(I){K.apply(this,arguments);if(I){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var N=Menus.prototype.init;Menus.prototype.init=function(){N.apply(this,arguments);var I=this.editorUi;EditorUi.enablePlantUml&&!I.isOffline()&&I.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var k=new ParseDialog(I,mxResources.get("plantUml")+"...","plantUml");I.showDialog(k.container,620,420,!0,!1);k.init()}));I.actions.put("mermaid",new Action(mxResources.get("mermaid")+"...",function(){var k=new ParseDialog(I,mxResources.get("mermaid")+"...","mermaid");I.showDialog(k.container,620,420,!0,!1);k.init()}));var c="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),e=function(k,n,q,u){k.addItem(q,null,mxUtils.bind(this,function(){var A=new CreateGraphDialog(I,q,u);I.showDialog(A.container,620,420,!0,!1);A.init()}),n)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(k,n){for(var q=0;q<c.length;q++)"-"==c[q]?k.addSeparator(n):e(k,n,mxResources.get(c[q])+"...",c[q])})))};EditorUi.prototype.installFormatToolbar=function(I){var c=this.editor.graph,e=document.createElement("div");e.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";c.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(k,n){0<c.getSelectionCount()?(I.appendChild(e),e.innerHTML="Selected: "+c.getSelectionCount()):null!=e.parentNode&&e.parentNode.removeChild(e)}))};var O=!1;EditorUi.prototype.initFormatWindow=function(){if(!O&&null!=this.formatWindow){O=!0;var I=this.formatWindow.window.toggleMinimized,c=240;this.formatWindow.window.toggleMinimized=function(){I.apply(this,arguments);this.minimized?(c=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+c-140+"px"):(this.div.style.width=c+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-c+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(e){mxEvent.getSource(e)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var Q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function I(W,X,Y){var Z=u.menus.get(W),ba=-E.addMenu(mxResources.get(W),mxUtils.bind(this,function(){ba.classList.contains("mxDisabled")||Z.funct.apply(this,arguments)}),G);ba.className="geMenuItem";ba.style.display="inline-block";ba.style.boxSizing="border-box";ba.style.top="6px";ba.style.marginRight="6px";ba.style.height="30px";ba.style.paddingTop="6px";ba.style.paddingBottom="6px";ba.style.cursor="pointer";ba.setAttribute("title",mxResources.get(W));u.menus.menuCreated(Z,ba,"geMenuItem");null!=Y?(ba.style.backgroundImage="url("+Y+")",ba.style.backgroundPosition=-"center center",ba.style.backgroundRepeat="no-repeat",ba.style.backgroundSize="24px 24px",ba.style.width="34px",ba.innerText=""):X||(ba.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",ba.style.backgroundPosition="right 6px center",ba.style.backgroundRepeat="no-repeat",ba.style.paddingRight="22px");return ba}function c(W,X,Y,Z,ba,ha){var ca=document.createElement("a");ca.className="geMenuItem";ca.style.display="inline-block";ca.style.boxSizing="border-box";ca.style.height="30px";-ca.style.padding="6px";ca.style.position="relative";ca.style.verticalAlign="top";ca.style.top="0px";null!=u.statusContainer?D.insertBefore(ca,u.statusContainer):D.appendChild(ca);null!=ha?(ca.style.backgroundImage="url("+ha+")",ca.style.backgroundPosition="center center",ca.style.backgroundRepeat="no-repeat",ca.style.backgroundSize="24px 24px",ca.style.width="34px"):mxUtils.write(ca,W);mxEvent.addListener(ca,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(da){da.preventDefault()}));+E.addMenu(mxResources.get(W),mxUtils.bind(this,function(){ba.classList.contains("mxDisabled")||Z.funct.apply(this,arguments)}),F);ba.className="geMenuItem";ba.style.display="inline-block";ba.style.boxSizing="border-box";ba.style.top="6px";ba.style.marginRight="6px";ba.style.height="30px";ba.style.paddingTop="6px";ba.style.paddingBottom="6px";ba.style.cursor="pointer";ba.setAttribute("title",mxResources.get(W));u.menus.menuCreated(Z,ba,"geMenuItem");null!=Y?(ba.style.backgroundImage="url("+Y+")",ba.style.backgroundPosition=+"center center",ba.style.backgroundRepeat="no-repeat",ba.style.backgroundSize="24px 24px",ba.style.width="34px",ba.innerText=""):X||(ba.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",ba.style.backgroundPosition="right 6px center",ba.style.backgroundRepeat="no-repeat",ba.style.paddingRight="22px");return ba}function c(W,X,Y,Z,ba,fa){var ca=document.createElement("a");ca.className="geMenuItem";ca.style.display="inline-block";ca.style.boxSizing="border-box";ca.style.height="30px";+ca.style.padding="6px";ca.style.position="relative";ca.style.verticalAlign="top";ca.style.top="0px";null!=u.statusContainer?D.insertBefore(ca,u.statusContainer):D.appendChild(ca);null!=fa?(ca.style.backgroundImage="url("+fa+")",ca.style.backgroundPosition="center center",ca.style.backgroundRepeat="no-repeat",ca.style.backgroundSize="24px 24px",ca.style.width="34px"):mxUtils.write(ca,W);mxEvent.addListener(ca,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(da){da.preventDefault()}));mxEvent.addListener(ca,"click",function(da){"disabled"!=ca.getAttribute("disabled")&&X(da);mxEvent.consume(da)});null==Y&&(ca.style.marginRight="4px");null!=Z&&ca.setAttribute("title",Z);null!=ba&&(W=function(){ba.isEnabled()?(ca.removeAttribute("disabled"),ca.style.cursor="pointer"):(ca.setAttribute("disabled","disabled"),ca.style.cursor="default")},ba.addListener("stateChanged",W),A.addListener("enabledChanged",W),W());return ca}function e(W,X,Y){Y=document.createElement("div");Y.className="geMenuItem";Y.style.display="inline-block";Y.style.verticalAlign="top";Y.style.marginRight="6px";Y.style.padding="0 4px 0 4px";Y.style.height="30px";Y.style.position="relative";Y.style.top="0px";for(var Z=0;Z<W.length;Z++)null!=W[Z]&&(W[Z].style.margin="0px",W[Z].style.boxShadow="none",Y.appendChild(W[Z]));null!=X&&mxUtils.setOpacity(Y,X);null!=u.statusContainer?D.insertBefore(Y,u.statusContainer):D.appendChild(Y);return Y}function k(){for(var W=D.firstChild;null!=W;){var X=W.nextSibling;"geMenuItem"!=W.className&&-"geItem"!=W.className||W.parentNode.removeChild(W);W=X}G=D.firstChild;d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;W=1E3>d;var Y=null;W||(Y=I("diagram"));X=W?I("diagram",null,Editor.menuImage):null;null!=X&&(Y=X);e([Y,c(mxResources.get("shapes"),u.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),u.actions.get("image"),W?Editor.shapesImage:null),c(mxResources.get("format"),u.actions.get("format").funct,null,mxResources.get("format")+" ("+u.actions.get("format").shortcut+-")",u.actions.get("image"),W?Editor.formatImage:null)],W?60:null);X=I("insert",!0,W?J:null);e([X,c(mxResources.get("delete"),u.actions.get("delete").funct,null,mxResources.get("delete"),u.actions.get("delete"),W?Editor.trashImage:null)],W?60:null);A.isEnabled()||X.classList.add("mxDisabled");411<=d&&(e([K,M],60),520<=d&&e([R,640<=d?c("",H.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",H,Editor.zoomInImage):null,640<=d?c("",T.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",+"geItem"!=W.className||W.parentNode.removeChild(W);W=X}F=D.firstChild;d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;W=1E3>d;var Y=null;W||(Y=I("diagram"));X=W?I("diagram",null,Editor.menuImage):null;null!=X&&(Y=X);e([Y,c(mxResources.get("shapes"),u.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),u.actions.get("image"),W?Editor.shapesImage:null),c(mxResources.get("format"),u.actions.get("format").funct,null,mxResources.get("format")+" ("+u.actions.get("format").shortcut++")",u.actions.get("image"),W?Editor.formatImage:null)],W?60:null);X=I("insert",!0,W?M:null);e([X,c(mxResources.get("delete"),u.actions.get("delete").funct,null,mxResources.get("delete"),u.actions.get("delete"),W?Editor.trashImage:null)],W?60:null);A.isEnabled()||X.classList.add("mxDisabled");411<=d&&(e([J,L],60),520<=d&&e([R,640<=d?c("",H.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",H,Editor.zoomInImage):null,640<=d?c("",T.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",T,Editor.zoomOutImage):null],60))}Q.apply(this,arguments);var n=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=n&&(n.classList.add("geSimple"),n.classList.add("geMinimal"));n=Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries);var q=document.createElement("div");q.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";q.style.bottom=n?"32px":"0px";this.sidebar=this.createSidebar(q);if(1E3<=d||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])l(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=d&&(b(this,!0),this.formatWindow.window.setVisible(!0));var u=this,A=u.editor.graph;u.toolbar=this.createToolbar(u.createDiv("geToolbar"));u.defaultLibraryName=mxResources.get("untitledLibrary");var D=-document.createElement("div");D.className="geMenubarContainer";var G=null,E=new Menubar(u,D);u.statusContainer=u.createStatusContainer();u.statusContainer.style.position="relative";u.statusContainer.style.maxWidth="";u.statusContainer.style.cursor="default";var U=u.hideCurrentMenu;u.hideCurrentMenu=function(){U.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var P=u.descriptorChanged;u.descriptorChanged=function(){P.apply(this,arguments);var W=u.getCurrentFile();if(null!=W&&null!=+document.createElement("div");D.className="geMenubarContainer";var F=null,E=new Menubar(u,D);u.statusContainer=u.createStatusContainer();u.statusContainer.style.position="relative";u.statusContainer.style.maxWidth="";u.statusContainer.style.cursor="default";var U=u.hideCurrentMenu;u.hideCurrentMenu=function(){U.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var P=u.descriptorChanged;u.descriptorChanged=function(){P.apply(this,arguments);var W=u.getCurrentFile();if(null!=W&&null!=W.getTitle()){var X=W.getMode();"google"==X?X="googleDrive":"github"==X?X="gitHub":"gitlab"==X?X="gitLab":"onedrive"==X&&(X="oneDrive");X=mxResources.get(X);D.setAttribute("title",W.getTitle()+(null!=X?" ("+X+")":""))}else D.removeAttribute("title")};u.setStatusText(u.editor.getStatus());D.appendChild(u.statusContainer);u.buttonContainer=document.createElement("div");u.buttonContainer.style.cssText="display:flex;justify-content:flex-end;padding-right:10px;gap:6px;white-space:nowrap;background-color:inherit;align-items:center;min-width:0;margin-left:auto;";-D.appendChild(u.buttonContainer);u.menubarContainer=u.buttonContainer;u.tabContainer=document.createElement("div");u.tabContainer.className="geTabContainer geTabItem";u.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;visibility:hidden;";n=u.diagramContainer.parentNode;q=document.createElement("div");q.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";u.diagramContainer.style.top="47px";var J=Editor.addBoxImage;+D.appendChild(u.buttonContainer);u.menubarContainer=u.buttonContainer;u.tabContainer=document.createElement("div");u.tabContainer.className="geTabContainer geTabItem";u.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;visibility:hidden;";n=u.diagramContainer.parentNode;q=document.createElement("div");q.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";u.diagramContainer.style.top="47px";var M=Editor.addBoxImage;if(null!=u.hoverIcons){var m=u.hoverIcons.update;u.hoverIcons.update=function(){A.freehand.isDrawing()||m.apply(this,arguments)}}if(null!=A.freehand){var v=A.freehand.createStyle;A.freehand.createStyle=function(W){return v.apply(this,arguments)+"sketch=0;"}}u.editor.addListener("statusChanged",mxUtils.bind(this,function(){u.setStatusText(u.editor.getStatus())}));u.setStatusText(u.editor.getStatus());var z=u.menus.get("viewZoom");if(null!=z){var B=function(W){if(mxEvent.isAltDown(W))u.hideCurrentMenu(),-u.actions.get("customZoom").funct(),mxEvent.consume(W);else if("geMenuItem"==mxEvent.getSource(W).className||mxEvent.isShiftDown(W))u.hideCurrentMenu(),u.actions.get("smartFit").funct(),mxEvent.consume(W)},H=u.actions.get("zoomIn"),T=u.actions.get("zoomOut"),g=u.actions.get("resetView"),p=u.actions.get("undo"),F=u.actions.get("redo"),K=c("",p.funct,null,mxResources.get("undo")+" ("+p.shortcut+")",p,Editor.undoImage),M=c("",F.funct,null,mxResources.get("redo")+" ("+F.shortcut+")",F,Editor.redoImage),+u.actions.get("customZoom").funct(),mxEvent.consume(W);else if("geMenuItem"==mxEvent.getSource(W).className||mxEvent.isShiftDown(W))u.hideCurrentMenu(),u.actions.get("smartFit").funct(),mxEvent.consume(W)},H=u.actions.get("zoomIn"),T=u.actions.get("zoomOut"),g=u.actions.get("resetView"),p=u.actions.get("undo"),G=u.actions.get("redo"),J=c("",p.funct,null,mxResources.get("undo")+" ("+p.shortcut+")",p,Editor.undoImage),L=c("",G.funct,null,mxResources.get("redo")+" ("+G.shortcut+")",G,Editor.redoImage),R=c("",B,!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",g,Editor.zoomFitImage);D.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;text-align:left;white-space:nowrap;";this.tabContainer.style.right="70px";var S=E.addMenu("100%",z.funct);S.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");S.className="geTabItem";S.style.height=u.tabContainerHeight+"px";S.style.position="absolute";S.style.display="0"!=urlParams.pages?"flex":"none";S.style.alignItems="center";S.style.justifyContent="center";S.style.paddingRight="11px";S.style.whiteSpace="nowrap";S.style.overflow="hidden";S.style.fontSize="11px";S.style.width="51px";S.style.right="0px";S.style.bottom="0px";S.style.boxSizing="content-box";S.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";S.style.backgroundPosition="right 6px top 15px";S.style.backgroundRepeat="no-repeat";S.style.backgroundSize="10px";S.style.zIndex="1";q.appendChild(S);(function(W){mxEvent.addListener(W,"click",B);var X=mxUtils.bind(this,function(Y,Z,ba){W.innerText="";mxUtils.write(W,Math.round(100*u.editor.graph.view.scale*(null!=ba?ba:1))+"%")});u.editor.graph.view.addListener(mxEvent.EVENT_SCALE,X);u.editor.addListener("resetGraphView",X);u.editor.addListener("pageSelected",X);u.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(Y,Z){X(Y,Z,Z.getProperty("factor"))}))})(S);var V=u.setGraphEnabled;u.setGraphEnabled=function(){V.apply(this,arguments);null!=this.tabContainer&&(S.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="0"!=urlParams.pages&&"hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}q.appendChild(D);q.appendChild(u.diagramContainer);n.appendChild(q);u.updateTabContainer();!EditorUi.windowed&&1E3<=d&&b(this,!0);q.appendChild(u.tabContainer);k();u.addListener("lockedChanged",k);mxEvent.addListener(window,"resize",function(){k();null!=u.sidebarWindow&&u.sidebarWindow.window.fit();null!=u.formatWindow&&u.formatWindow.window.fit();null!=u.actions.outlineWindow&&u.actions.outlineWindow.window.fit();null!=u.actions.layersWindow&&u.actions.layersWindow.window.fit();null!=u.menus.chatWindow&&u.menus.chatWindow.window.fit();null!=u.menus.tagsWindow&&u.menus.tagsWindow.window.fit();null!=u.menus.findWindow&&u.menus.findWindow.window.fit();null!=u.menus.findReplaceWindow&&u.menus.findReplaceWindow.window.fit()})}}};-(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var f=EditorUi.initTheme;EditorUi.initTheme=function(){f.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(d,t,y,x){var C=t.y,L=t.x,N=!1,O=!1;if(null!=this.states&&null!=d&&null!=t){var Q=this,I=new mxCellState,c=this.graph.getView().scale,e=Math.max(2,this.getGuideTolerance()/2);I.x=d.x+L;I.y=d.y+C;I.width=d.width;I.height=d.height;for(var k=[],n=[],q=0;q<this.states.length;q++){var u=this.states[q];u instanceof mxCellState&&(x||!this.graph.isCellSelected(u.cell))&&((I.x>=u.x&&I.x<=u.x+u.width||u.x>=I.x&&u.x<=I.x+I.width)&&(I.y>-u.y+u.height+4||I.y+I.height+4<u.y)?k.push(u):(I.y>=u.y&&I.y<=u.y+u.height||u.y>=I.y&&u.y<=I.y+I.height)&&(I.x>u.x+u.width+4||I.x+I.width+4<u.x)&&n.push(u))}var A=0,D=0,G=u=0,E=0,U=0,P=0,J=0,m=5*c;if(1<k.length){k.push(I);k.sort(function(H,T){return H.y-T.y});var v=!1;q=I==k[0];c=I==k[k.length-1];if(!q&&!c)for(q=1;q<k.length-1;q++)if(I==k[q]){c=k[q-1];q=k[q+1];u=D=G=(q.y-c.y-c.height-I.height)/2;break}for(q=0;q<k.length-1;q++){c=k[q];var z=k[q+1],B=I==c||I==z;z=z.y-c.y-c.height;v|=I==c;if(0==D&&0==-A)D=z,A=1;else if(Math.abs(D-z)<=(B||1==q&&v?e:0))A+=1;else if(1<A&&v){k=k.slice(0,q+1);break}else if(3<=k.length-q&&!v)A=0,u=D=0!=G?G:0,k.splice(0,0==q?1:q),q=-1;else break;0!=u||B||(D=u=z)}3==k.length&&k[1]==I&&(u=0)}if(1<n.length){n.push(I);n.sort(function(H,T){return H.x-T.x});v=!1;q=I==n[0];c=I==n[n.length-1];if(!q&&!c)for(q=1;q<n.length-1;q++)if(I==n[q]){c=n[q-1];q=n[q+1];P=U=J=(q.x-c.x-c.width-I.width)/2;break}for(q=0;q<n.length-1;q++){c=n[q];z=n[q+1];B=I==c||I==z;z=z.x-c.x-c.width;v|=I==c;-if(0==U&&0==E)U=z,E=1;else if(Math.abs(U-z)<=(B||1==q&&v?e:0))E+=1;else if(1<E&&v){n=n.slice(0,q+1);break}else if(3<=n.length-q&&!v)E=0,P=U=0!=J?J:0,n.splice(0,0==q?1:q),q=-1;else break;0!=P||B||(U=P=z)}3==n.length&&n[1]==I&&(P=0)}e=function(H,T,g,p){var F=[];if(p){p=m;var K=0}else p=0,K=m;F.push(new mxPoint(H.x-p,H.y-K));F.push(new mxPoint(H.x+p,H.y+K));F.push(H);F.push(T);F.push(new mxPoint(T.x-p,T.y-K));F.push(new mxPoint(T.x+p,T.y+K));if(null!=g)return g.points=F,g;H=new mxPolyline(F,mxConstants.GUIDE_COLOR,-mxConstants.GUIDE_STROKEWIDTH);H.dialect=mxConstants.DIALECT_SVG;H.pointerEvents=!1;H.init(Q.graph.getView().getOverlayPane());return H};U=function(H,T){if(H&&null!=Q.guidesArrHor)for(H=0;H<Q.guidesArrHor.length;H++)Q.guidesArrHor[H].node.style.visibility="hidden";if(T&&null!=Q.guidesArrVer)for(H=0;H<Q.guidesArrVer.length;H++)Q.guidesArrVer[H].node.style.visibility="hidden"};if(1<E&&E==n.length-1){E=[];J=Q.guidesArrHor;N=[];L=0;q=n[0]==I?1:0;v=n[q].y+n[q].height;if(0<P)for(q=0;q<n.length-1;q++)c=-n[q],z=n[q+1],I==c?(L=z.x-c.width-P,N.push(new mxPoint(L+c.width+m,v)),N.push(new mxPoint(z.x-m,v))):I==z?(N.push(new mxPoint(c.x+c.width+m,v)),L=c.x+c.width+P,N.push(new mxPoint(L-m,v))):(N.push(new mxPoint(c.x+c.width+m,v)),N.push(new mxPoint(z.x-m,v)));else c=n[0],q=n[2],L=c.x+c.width+(q.x-c.x-c.width-I.width)/2,N.push(new mxPoint(c.x+c.width+m,v)),N.push(new mxPoint(L-m,v)),N.push(new mxPoint(L+I.width+m,v)),N.push(new mxPoint(q.x-m,v));for(q=0;q<N.length;q+=2)n=N[q],P=N[q+1],n=e(n,P,null!=J?-J[q/2]:null),n.node.style.visibility="visible",n.redraw(),E.push(n);for(q=N.length/2;null!=J&&q<J.length;q++)J[q].destroy();Q.guidesArrHor=E;L-=d.x;N=!0}else U(!0);if(1<A&&A==k.length-1){E=[];J=Q.guidesArrVer;O=[];C=0;q=k[0]==I?1:0;A=k[q].x+k[q].width;if(0<u)for(q=0;q<k.length-1;q++)c=k[q],z=k[q+1],I==c?(C=z.y-c.height-u,O.push(new mxPoint(A,C+c.height+m)),O.push(new mxPoint(A,z.y-m))):I==z?(O.push(new mxPoint(A,c.y+c.height+m)),C=c.y+c.height+u,O.push(new mxPoint(A,C-m))):(O.push(new mxPoint(A,c.y+-c.height+m)),O.push(new mxPoint(A,z.y-m)));else c=k[0],q=k[2],C=c.y+c.height+(q.y-c.y-c.height-I.height)/2,O.push(new mxPoint(A,c.y+c.height+m)),O.push(new mxPoint(A,C-m)),O.push(new mxPoint(A,C+I.height+m)),O.push(new mxPoint(A,q.y-m));for(q=0;q<O.length;q+=2)n=O[q],P=O[q+1],n=e(n,P,null!=J?J[q/2]:null,!0),n.node.style.visibility="visible",n.redraw(),E.push(n);for(q=O.length/2;null!=J&&q<J.length;q++)J[q].destroy();Q.guidesArrVer=E;C-=d.y;O=!0}else U(!1,!0)}if(N||O)return I=new mxPoint(L,C),k=b.call(this,+(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var f=EditorUi.initTheme;EditorUi.initTheme=function(){f.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(d,t,y,x){var C=t.y,K=t.x,N=!1,O=!1;if(null!=this.states&&null!=d&&null!=t){var Q=this,I=new mxCellState,c=this.graph.getView().scale,e=Math.max(2,this.getGuideTolerance()/2);I.x=d.x+K;I.y=d.y+C;I.width=d.width;I.height=d.height;for(var k=[],n=[],q=0;q<this.states.length;q++){var u=this.states[q];u instanceof mxCellState&&(x||!this.graph.isCellSelected(u.cell))&&((I.x>=u.x&&I.x<=u.x+u.width||u.x>=I.x&&u.x<=I.x+I.width)&&(I.y>+u.y+u.height+4||I.y+I.height+4<u.y)?k.push(u):(I.y>=u.y&&I.y<=u.y+u.height||u.y>=I.y&&u.y<=I.y+I.height)&&(I.x>u.x+u.width+4||I.x+I.width+4<u.x)&&n.push(u))}var A=0,D=0,F=u=0,E=0,U=0,P=0,M=0,m=5*c;if(1<k.length){k.push(I);k.sort(function(H,T){return H.y-T.y});var v=!1;q=I==k[0];c=I==k[k.length-1];if(!q&&!c)for(q=1;q<k.length-1;q++)if(I==k[q]){c=k[q-1];q=k[q+1];u=D=F=(q.y-c.y-c.height-I.height)/2;break}for(q=0;q<k.length-1;q++){c=k[q];var z=k[q+1],B=I==c||I==z;z=z.y-c.y-c.height;v|=I==c;if(0==D&&0==+A)D=z,A=1;else if(Math.abs(D-z)<=(B||1==q&&v?e:0))A+=1;else if(1<A&&v){k=k.slice(0,q+1);break}else if(3<=k.length-q&&!v)A=0,u=D=0!=F?F:0,k.splice(0,0==q?1:q),q=-1;else break;0!=u||B||(D=u=z)}3==k.length&&k[1]==I&&(u=0)}if(1<n.length){n.push(I);n.sort(function(H,T){return H.x-T.x});v=!1;q=I==n[0];c=I==n[n.length-1];if(!q&&!c)for(q=1;q<n.length-1;q++)if(I==n[q]){c=n[q-1];q=n[q+1];P=U=M=(q.x-c.x-c.width-I.width)/2;break}for(q=0;q<n.length-1;q++){c=n[q];z=n[q+1];B=I==c||I==z;z=z.x-c.x-c.width;v|=I==c;+if(0==U&&0==E)U=z,E=1;else if(Math.abs(U-z)<=(B||1==q&&v?e:0))E+=1;else if(1<E&&v){n=n.slice(0,q+1);break}else if(3<=n.length-q&&!v)E=0,P=U=0!=M?M:0,n.splice(0,0==q?1:q),q=-1;else break;0!=P||B||(U=P=z)}3==n.length&&n[1]==I&&(P=0)}e=function(H,T,g,p){var G=[];if(p){p=m;var J=0}else p=0,J=m;G.push(new mxPoint(H.x-p,H.y-J));G.push(new mxPoint(H.x+p,H.y+J));G.push(H);G.push(T);G.push(new mxPoint(T.x-p,T.y-J));G.push(new mxPoint(T.x+p,T.y+J));if(null!=g)return g.points=G,g;H=new mxPolyline(G,mxConstants.GUIDE_COLOR,+mxConstants.GUIDE_STROKEWIDTH);H.dialect=mxConstants.DIALECT_SVG;H.pointerEvents=!1;H.init(Q.graph.getView().getOverlayPane());return H};U=function(H,T){if(H&&null!=Q.guidesArrHor)for(H=0;H<Q.guidesArrHor.length;H++)Q.guidesArrHor[H].node.style.visibility="hidden";if(T&&null!=Q.guidesArrVer)for(H=0;H<Q.guidesArrVer.length;H++)Q.guidesArrVer[H].node.style.visibility="hidden"};if(1<E&&E==n.length-1){E=[];M=Q.guidesArrHor;N=[];K=0;q=n[0]==I?1:0;v=n[q].y+n[q].height;if(0<P)for(q=0;q<n.length-1;q++)c=+n[q],z=n[q+1],I==c?(K=z.x-c.width-P,N.push(new mxPoint(K+c.width+m,v)),N.push(new mxPoint(z.x-m,v))):I==z?(N.push(new mxPoint(c.x+c.width+m,v)),K=c.x+c.width+P,N.push(new mxPoint(K-m,v))):(N.push(new mxPoint(c.x+c.width+m,v)),N.push(new mxPoint(z.x-m,v)));else c=n[0],q=n[2],K=c.x+c.width+(q.x-c.x-c.width-I.width)/2,N.push(new mxPoint(c.x+c.width+m,v)),N.push(new mxPoint(K-m,v)),N.push(new mxPoint(K+I.width+m,v)),N.push(new mxPoint(q.x-m,v));for(q=0;q<N.length;q+=2)n=N[q],P=N[q+1],n=e(n,P,null!=M?+M[q/2]:null),n.node.style.visibility="visible",n.redraw(),E.push(n);for(q=N.length/2;null!=M&&q<M.length;q++)M[q].destroy();Q.guidesArrHor=E;K-=d.x;N=!0}else U(!0);if(1<A&&A==k.length-1){E=[];M=Q.guidesArrVer;O=[];C=0;q=k[0]==I?1:0;A=k[q].x+k[q].width;if(0<u)for(q=0;q<k.length-1;q++)c=k[q],z=k[q+1],I==c?(C=z.y-c.height-u,O.push(new mxPoint(A,C+c.height+m)),O.push(new mxPoint(A,z.y-m))):I==z?(O.push(new mxPoint(A,c.y+c.height+m)),C=c.y+c.height+u,O.push(new mxPoint(A,C-m))):(O.push(new mxPoint(A,c.y++c.height+m)),O.push(new mxPoint(A,z.y-m)));else c=k[0],q=k[2],C=c.y+c.height+(q.y-c.y-c.height-I.height)/2,O.push(new mxPoint(A,c.y+c.height+m)),O.push(new mxPoint(A,C-m)),O.push(new mxPoint(A,C+I.height+m)),O.push(new mxPoint(A,q.y-m));for(q=0;q<O.length;q+=2)n=O[q],P=O[q+1],n=e(n,P,null!=M?M[q/2]:null,!0),n.node.style.visibility="visible",n.redraw(),E.push(n);for(q=O.length/2;null!=M&&q<M.length;q++)M[q].destroy();Q.guidesArrVer=E;C-=d.y;O=!0}else U(!1,!0)}if(N||O)return I=new mxPoint(K,C),k=b.call(this,d,I,y,x),N&&!O?I.y=k.y:O&&!N&&(I.x=k.x),k.y!=I.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),k.x!=I.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),I;U(!0,!0);return b.apply(this,arguments)};var f=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(d){f.call(this,d);var t=this.guidesArrVer,y=this.guidesArrHor;if(null!=t)for(var x=0;x<t.length;x++)t[x].node.style.visibility=d?"visible":"hidden";if(null!=-y)for(x=0;x<y.length;x++)y[x].node.style.visibility=d?"visible":"hidden"};var l=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){l.call(this);var d=this.guidesArrVer,t=this.guidesArrHor;if(null!=d){for(var y=0;y<d.length;y++)d[y].destroy();this.guidesArrVer=null}if(null!=t){for(y=0;y<t.length;y++)t[y].destroy();this.guidesArrHor=null}}})();function mxRuler(b,f,l,d){function t(){var A=b.diagramContainer;Q.style.top=A.offsetTop-L+"px";Q.style.left=A.offsetLeft-L+"px";Q.style.width=(l?0:A.offsetWidth)+L+"px";Q.style.height=(l?A.offsetHeight:0)+L+"px"}function y(A,D,G){if(null!=x)return A;var E;return function(){var U=this,P=arguments,J=G&&!E;clearTimeout(E);E=setTimeout(function(){E=null;G||A.apply(U,P)},D);J&&A.apply(U,P)}}var x=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,-C=window.cancelAnimationFrame||window.mozCancelAnimationFrame,L=this.RULER_THICKNESS,N=this;this.unit=f;var O=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:Editor.darkColor,cornerClr:Editor.darkColor,strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},Q=document.createElement("div");Q.className="geRuler";Q.style.position="fixed";this.updateStyle=mxUtils.bind(this,function(){O=+y)for(x=0;x<y.length;x++)y[x].node.style.visibility=d?"visible":"hidden"};var l=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){l.call(this);var d=this.guidesArrVer,t=this.guidesArrHor;if(null!=d){for(var y=0;y<d.length;y++)d[y].destroy();this.guidesArrVer=null}if(null!=t){for(y=0;y<t.length;y++)t[y].destroy();this.guidesArrHor=null}}})();function mxRuler(b,f,l,d){function t(){var A=b.diagramContainer;Q.style.top=A.offsetTop-K+"px";Q.style.left=A.offsetLeft-K+"px";Q.style.width=(l?0:A.offsetWidth)+K+"px";Q.style.height=(l?A.offsetHeight:0)+K+"px"}function y(A,D,F){if(null!=x)return A;var E;return function(){var U=this,P=arguments,M=F&&!E;clearTimeout(E);E=setTimeout(function(){E=null;F||A.apply(U,P)},D);M&&A.apply(U,P)}}var x=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,+C=window.cancelAnimationFrame||window.mozCancelAnimationFrame,K=this.RULER_THICKNESS,N=this;this.unit=f;var O=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:Editor.darkColor,cornerClr:Editor.darkColor,strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},Q=document.createElement("div");Q.className="geRuler";Q.style.position="fixed";this.updateStyle=mxUtils.bind(this,function(){O=Editor.isDarkMode()?{outBkgClr:Editor.darkColor,cornerClr:Editor.darkColor,strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};Q.style[l?"borderRight":"borderBottom"]="0.5px solid "+O.strokeClr;Q.style.borderLeft="0.5px solid "+O.strokeClr});this.updateStyle();b.diagramContainer.appendChild(Q);mxEvent.disableContextMenu(Q);this.editorUiRefresh=b.refresh;b.refresh=function(A){N.editorUiRefresh.apply(b,-arguments);t()};t();var I=document.createElement("canvas");I.width=Q.offsetWidth;I.height=Q.offsetHeight;Q.style.overflow="hidden";I.style.position="relative";Q.appendChild(I);var c=I.getContext("2d");this.ui=b;var e=b.editor.graph;this.graph=e;this.container=Q;this.canvas=I;var k=function(A,D,G,E,U){A=Math.round(A);D=Math.round(D);G=Math.round(G);E=Math.round(E);c.beginPath();c.moveTo(A+.5,D+.5);c.lineTo(G+.5,E+.5);c.stroke();U&&(l?(c.save(),c.translate(A,D),c.rotate(-Math.PI/2),c.fillText(U,0,0),-c.restore()):c.fillText(U,A,D))},n=function(){c.clearRect(0,0,I.width,I.height);c.beginPath();c.lineWidth=.7;c.strokeStyle=O.strokeClr;c.setLineDash([]);c.font="9px Arial";c.textAlign="center";var A=e.view.scale,D=e.view.getBackgroundPageBounds(),G=e.view.translate,E=e.pageVisible;G=E?L+(l?D.y-e.container.scrollTop:D.x-e.container.scrollLeft):L+(l?G.y*A-e.container.scrollTop:G.x*A-e.container.scrollLeft);var U=0;E&&(U=e.getPageLayout(),U=l?U.y*e.pageFormat.height:U.x*e.pageFormat.width);var P;switch(N.unit){case mxConstants.POINTS:var J=-P=10;var m=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:P=10;J=mxConstants.PIXELS_PER_MM;m=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:P=20;J=mxConstants.PIXELS_PER_MM;m=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:P=.5>=A||4<=A?8:16,J=mxConstants.PIXELS_PER_INCH/P,m=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var v=J;2<=A?v=J/(2*Math.floor(A/2)):.5>=A&&(v=J*Math.floor(1/A/2)*(N.unit==mxConstants.MILLIMETERS?2:1));J=null;D=E?Math.min(G+(l?D.height:D.width),l?-I.height:I.width):l?I.height:I.width;if(E)if(c.fillStyle=O.outBkgClr,l){var z=G-L;0<z&&c.fillRect(0,L,L,z);D<I.height&&c.fillRect(0,D,L,I.height)}else z=G-L,0<z&&c.fillRect(L,0,z,L),D<I.width&&c.fillRect(D,0,I.width,L);c.fillStyle=O.fontClr;for(E=E?G:G%(v*A);E<=D;E+=v*A)if(z=Math.round((E-G)/A/v),!(E<L||z==J)){J=z;var B=null;0==z%P&&(B=N.formatText(U+z*v)+"");l?k(L-m[Math.abs(z)%P],E,L,E,B):k(E,L-m[Math.abs(z)%P],E,L,B)}c.lineWidth=1;k(l?0:L,l?L:0,L,L);c.fillStyle=O.cornerClr;c.fillRect(0,0,L,L)},-q=-1,u=function(){null!=x?(null!=C&&C(q),q=x(n)):n()};this.drawRuler=u;this.sizeListener=f=y(function(){var A=e.container;l?(A=A.offsetHeight+L,I.height!=A&&(I.height=A,Q.style.height=A+"px",u())):(A=A.offsetWidth+L,I.width!=A&&(I.width=A,Q.style.width=A+"px",u()))},10);this.pageListener=function(){u()};this.scrollListener=d=y(function(){var A=l?e.container.scrollTop:e.container.scrollLeft;N.lastScroll!=A&&(N.lastScroll=A,u())},10);this.unitListener=function(A,D){N.setUnit(D.getProperty("unit"))};-e.addListener(mxEvent.SIZE,f);e.container.addEventListener("scroll",d);e.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(A){O=A;Q.style.background=O.bkgClr;n()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(A,D,G,E){if(l&&4<A.height||!l&&4<A.width){if(null!=N.guidePart)try{c.putImageData(N.guidePart.imgData1,-N.guidePart.x1,N.guidePart.y1),c.putImageData(N.guidePart.imgData2,N.guidePart.x2,N.guidePart.y2),c.putImageData(N.guidePart.imgData3,N.guidePart.x3,N.guidePart.y3)}catch(p){}var U=N.origGuideMove.apply(this,arguments);try{c.lineWidth=.5;c.strokeStyle=O.guideClr;c.setLineDash([2]);if(l){var P=A.y+U.y+L-this.graph.container.scrollTop;var J=0;var m=P+A.height/2;var v=L/2;var z=P+A.height;var B=0;var H=c.getImageData(J,P-1,L,3);k(J,P,L,P);P--;var T=c.getImageData(v,m-1,L,3);k(v,m,L,m);m--;var g=c.getImageData(B,-z-1,L,3);k(B,z,L,z);z--}else P=0,J=A.x+U.x+L-this.graph.container.scrollLeft,m=L/2,v=J+A.width/2,z=0,B=J+A.width,H=c.getImageData(J-1,P,3,L),k(J,P,J,L),J--,T=c.getImageData(v-1,m,3,L),k(v,m,v,L),v--,g=c.getImageData(B-1,z,3,L),k(B,z,B,L),B--;if(null==N.guidePart||N.guidePart.x1!=J||N.guidePart.y1!=P)N.guidePart={imgData1:H,x1:J,y1:P,imgData2:T,x2:v,y2:m,imgData3:g,x3:B,y3:z}}catch(p){}}else U=N.origGuideMove.apply(this,arguments);return U};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=+arguments);t()};t();var I=document.createElement("canvas");I.width=Q.offsetWidth;I.height=Q.offsetHeight;Q.style.overflow="hidden";I.style.position="relative";Q.appendChild(I);var c=I.getContext("2d");this.ui=b;var e=b.editor.graph;this.graph=e;this.container=Q;this.canvas=I;var k=function(A,D,F,E,U){A=Math.round(A);D=Math.round(D);F=Math.round(F);E=Math.round(E);c.beginPath();c.moveTo(A+.5,D+.5);c.lineTo(F+.5,E+.5);c.stroke();U&&(l?(c.save(),c.translate(A,D),c.rotate(-Math.PI/2),c.fillText(U,0,0),+c.restore()):c.fillText(U,A,D))},n=function(){c.clearRect(0,0,I.width,I.height);c.beginPath();c.lineWidth=.7;c.strokeStyle=O.strokeClr;c.setLineDash([]);c.font="9px Arial";c.textAlign="center";var A=e.view.scale,D=e.view.getBackgroundPageBounds(),F=e.view.translate,E=e.pageVisible;F=E?K+(l?D.y-e.container.scrollTop:D.x-e.container.scrollLeft):K+(l?F.y*A-e.container.scrollTop:F.x*A-e.container.scrollLeft);var U=0;E&&(U=e.getPageLayout(),U=l?U.y*e.pageFormat.height:U.x*e.pageFormat.width);var P;switch(N.unit){case mxConstants.POINTS:var M=+P=10;var m=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:P=10;M=mxConstants.PIXELS_PER_MM;m=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:P=20;M=mxConstants.PIXELS_PER_MM;m=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:P=.5>=A||4<=A?8:16,M=mxConstants.PIXELS_PER_INCH/P,m=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var v=M;2<=A?v=M/(2*Math.floor(A/2)):.5>=A&&(v=M*Math.floor(1/A/2)*(N.unit==mxConstants.MILLIMETERS?2:1));M=null;D=E?Math.min(F+(l?D.height:D.width),l?+I.height:I.width):l?I.height:I.width;if(E)if(c.fillStyle=O.outBkgClr,l){var z=F-K;0<z&&c.fillRect(0,K,K,z);D<I.height&&c.fillRect(0,D,K,I.height)}else z=F-K,0<z&&c.fillRect(K,0,z,K),D<I.width&&c.fillRect(D,0,I.width,K);c.fillStyle=O.fontClr;for(E=E?F:F%(v*A);E<=D;E+=v*A)if(z=Math.round((E-F)/A/v),!(E<K||z==M)){M=z;var B=null;0==z%P&&(B=N.formatText(U+z*v)+"");l?k(K-m[Math.abs(z)%P],E,K,E,B):k(E,K-m[Math.abs(z)%P],E,K,B)}c.lineWidth=1;k(l?0:K,l?K:0,K,K);c.fillStyle=O.cornerClr;c.fillRect(0,0,K,K)},+q=-1,u=function(){null!=x?(null!=C&&C(q),q=x(n)):n()};this.drawRuler=u;this.sizeListener=f=y(function(){var A=e.container;l?(A=A.offsetHeight+K,I.height!=A&&(I.height=A,Q.style.height=A+"px",u())):(A=A.offsetWidth+K,I.width!=A&&(I.width=A,Q.style.width=A+"px",u()))},10);this.pageListener=function(){u()};this.scrollListener=d=y(function(){var A=l?e.container.scrollTop:e.container.scrollLeft;N.lastScroll!=A&&(N.lastScroll=A,u())},10);this.unitListener=function(A,D){N.setUnit(D.getProperty("unit"))};+e.addListener(mxEvent.SIZE,f);e.container.addEventListener("scroll",d);e.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(A){O=A;Q.style.background=O.bkgClr;n()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(A,D,F,E){if(l&&4<A.height||!l&&4<A.width){if(null!=N.guidePart)try{c.putImageData(N.guidePart.imgData1,+N.guidePart.x1,N.guidePart.y1),c.putImageData(N.guidePart.imgData2,N.guidePart.x2,N.guidePart.y2),c.putImageData(N.guidePart.imgData3,N.guidePart.x3,N.guidePart.y3)}catch(p){}var U=N.origGuideMove.apply(this,arguments);try{c.lineWidth=.5;c.strokeStyle=O.guideClr;c.setLineDash([2]);if(l){var P=A.y+U.y+K-this.graph.container.scrollTop;var M=0;var m=P+A.height/2;var v=K/2;var z=P+A.height;var B=0;var H=c.getImageData(M,P-1,K,3);k(M,P,K,P);P--;var T=c.getImageData(v,m-1,K,3);k(v,m,K,m);m--;var g=c.getImageData(B,+z-1,K,3);k(B,z,K,z);z--}else P=0,M=A.x+U.x+K-this.graph.container.scrollLeft,m=K/2,v=M+A.width/2,z=0,B=M+A.width,H=c.getImageData(M-1,P,3,K),k(M,P,M,K),M--,T=c.getImageData(v-1,m,3,K),k(v,m,v,K),v--,g=c.getImageData(B-1,z,3,K),k(B,z,B,K),B--;if(null==N.guidePart||N.guidePart.x1!=M||N.guidePart.y1!=P)N.guidePart={imgData1:H,x1:M,y1:P,imgData2:T,x2:v,y2:m,imgData3:g,x3:B,y3:z}}catch(p){}}else U=N.origGuideMove.apply(this,arguments);return U};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var A=N.origGuideDestroy.apply(this,arguments);if(null!=N.guidePart)try{c.putImageData(N.guidePart.imgData1,N.guidePart.x1,N.guidePart.y1),c.putImageData(N.guidePart.imgData2,N.guidePart.x2,N.guidePart.y2),c.putImageData(N.guidePart.imgData3,N.guidePart.x3,N.guidePart.y3),N.guidePart=null}catch(D){}return A}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};mxRuler.prototype.formatText=function(b){switch(this.unit){case mxConstants.POINTS:return Math.round(b);case mxConstants.MILLIMETERS:return(b/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(b/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(b/mxConstants.PIXELS_PER_INCH).toFixed(2)}};mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener(this.unitListener);this.ui.removeListener(this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};function mxDualRuler(b,f){var l=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=b.getDiagramContainerOffset;b.getDiagramContainerOffset=function(){return l};this.editorUiRefresh=b.refresh;this.ui=b;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(b,f,!0);this.hRuler=new mxRuler(b,f,!1,!0);f=mxUtils.bind(this,function(d){var t=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,function(y){t=null!=b.currentMenu;mxEvent.consume(y)}),null,mxUtils.bind(this,function(y){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(y)||mxEvent.isPopupTrigger(y))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(y)||!t){var x=new mxPopupMenu(mxUtils.bind(this,function(N,O){b.menus.addMenuItems(N,["points","inches","millimeters","meters"],O)}));x.div.className+=" geMenubarMenu";x.smartSeparators=!0;x.showDisabled=!0;x.autoExpand=-!0;x.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(x,arguments);b.resetCurrentMenu();x.destroy()});var C=mxEvent.getClientX(y),L=mxEvent.getClientY(y);x.popup(C,L,null,y);b.setCurrentMenu(x,d)}mxEvent.consume(y)}}))});f(this.hRuler.container);f(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.updateStyle=function(){this.vRuler.updateStyle();this.hRuler.updateStyle();this.vRuler.drawRuler();this.hRuler.drawRuler()};-mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var f=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=f){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var l=mxFreehand.prototype.MILD_SMOOTHING,d=null,t=[],y,x=[],C,L=!1,N=!0,O=!0,Q=!0,I=!0,c=[],e=!1,k=!1,n=!1,q="default",u={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},A=!0;this.setClosedPath=function(m){L=m};this.setAutoClose=function(m){N=m};this.setAutoInsert=+!0;x.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(x,arguments);b.resetCurrentMenu();x.destroy()});var C=mxEvent.getClientX(y),K=mxEvent.getClientY(y);x.popup(C,K,null,y);b.setCurrentMenu(x,d)}mxEvent.consume(y)}}))});f(this.hRuler.container);f(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.updateStyle=function(){this.vRuler.updateStyle();this.hRuler.updateStyle();this.vRuler.drawRuler();this.hRuler.drawRuler()};+mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var f=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=f){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var l=mxFreehand.prototype.MILD_SMOOTHING,d=null,t=[],y,x=[],C,K=!1,N=!0,O=!0,Q=!0,I=!0,c=[],e=!1,k=!1,n=!1,q="default",u={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},A=!0;this.setClosedPath=function(m){K=m};this.setAutoClose=function(m){N=m};this.setAutoInsert=function(m){O=m};this.setAutoScroll=function(m){Q=m};this.setOpenFill=function(m){I=m};this.setStopClickEnabled=function(m){k=m};this.setSelectInserted=function(m){n=m};this.setSmoothing=function(m){l=m};this.getSmoothing=function(){return l};this.setPerfectFreehandMode=function(m){A=m};this.isPerfectFreehandMode=function(){return A};this.setBrushSize=function(m){u.size=m};this.getBrushSize=function(){return u.size};var D=function(m){e=m;b.getRubberband().setEnabled(!m);b.graphHandler.setSelectEnabled(!m);-b.graphHandler.setMoveEnabled(!m);b.container.style.cursor=m?"crosshair":"";b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){D(!0)};this.isDrawing=function(){return e};var G=mxUtils.bind(this,function(m){if(d){var v=C.length,z=k&&0<x.length&&null!=C&&2>C.length;z||x.push.apply(x,C);C=[];x.push(null);t.push(d);d=null;(z||O)&&this.stopDrawing();O&&(!z||2<=v)&&this.startDrawing();mxEvent.consume(m)}}),E=new mxCell;E.edge=!0;this.getStrokeColor=function(m){var v=null!=+b.graphHandler.setMoveEnabled(!m);b.container.style.cursor=m?"crosshair":"";b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){D(!0)};this.isDrawing=function(){return e};var F=mxUtils.bind(this,function(m){if(d){var v=C.length,z=k&&0<x.length&&null!=C&&2>C.length;z||x.push.apply(x,C);C=[];x.push(null);t.push(d);d=null;(z||O)&&this.stopDrawing();O&&(!z||2<=v)&&this.startDrawing();mxEvent.consume(m)}}),E=new mxCell;E.edge=!0;this.getStrokeColor=function(m){var v=null!=q?q:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(E),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=v||m||(v=b.shapeForegroundColor);return v};this.setStrokeColor=function(m){q=m};this.createStyle=function(m){var v=";fillColor=none;";A&&(v=";lineShape=1;");v+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+"="+m+v};this.stopDrawing=function(){if(0<t.length){if(A){for(var m=[],v=0;v<x.length;v++)null!=x[v]&&m.push([x[v].x,-x[v].y]);m=PerfectFreehand.getStroke(m,u);x=[];for(v=0;v<m.length;v++)x.push({x:m[v][0],y:m[v][1]});x.push(null)}m=x[0].x;var z=x[0].x,B=x[0].y,H=x[0].y;for(v=1;v<x.length;v++)null!=x[v]&&(m=Math.max(m,x[v].x),z=Math.min(z,x[v].x),B=Math.max(B,x[v].y),H=Math.min(H,x[v].y));m-=z;B-=H;if(0<m&&0<B){var T=100/m,g=100/B;x.map(function(R){if(null==R)return R;R.x=(R.x-z)*T;R.y=(R.y-H)*g;return R});var p='<shape strokewidth="inherit"><foreground>',F=0;for(v=0;v<x.length;v++){var K=x[v];if(null==K){K=!1;F=-x[F];var M=x[v-1];!L&&N&&(K=F.x-M.x,M=F.y-M.y,K=Math.sqrt(K*K+M*M)<=b.tolerance);if(L||K)p+='<line x="'+F.x.toFixed(2)+'" y="'+F.y.toFixed(2)+'"/>';p+="</path>"+(I||L||K?"<fillstroke/>":"<stroke/>");F=v+1}else p=v==F?p+('<path><move x="'+K.x.toFixed(2)+'" y="'+K.y.toFixed(2)+'"/>'):p+('<line x="'+K.x.toFixed(2)+'" y="'+K.y.toFixed(2)+'"/>')}p+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){v=this.createStyle("stencil("+Graph.compress(p)+")");p=b.view.scale;F=b.view.translate;-v=new mxCell("",new mxGeometry(z/p-F.x,H/p-F.y,m/p,B/p),v);v.vertex=1;b.model.beginUpdate();try{v=b.addCell(v),b.fireEvent(new mxEventObject("cellsInserted","cells",[v])),b.fireEvent(new mxEventObject("freehandInserted","cell",v))}finally{b.model.endUpdate()}n&&b.setSelectionCells([v])}}for(v=0;v<t.length;v++)t[v].parentNode.removeChild(t[v]);d=null;t=[];x=[]}D(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(m,v){m=v.getProperty("eventName");v=v.getProperty("event");m==mxEvent.MOUSE_MOVE&&+x[v].y]);m=PerfectFreehand.getStroke(m,u);x=[];for(v=0;v<m.length;v++)x.push({x:m[v][0],y:m[v][1]});x.push(null)}m=x[0].x;var z=x[0].x,B=x[0].y,H=x[0].y;for(v=1;v<x.length;v++)null!=x[v]&&(m=Math.max(m,x[v].x),z=Math.min(z,x[v].x),B=Math.max(B,x[v].y),H=Math.min(H,x[v].y));m-=z;B-=H;if(0<m&&0<B){var T=100/m,g=100/B;x.map(function(R){if(null==R)return R;R.x=(R.x-z)*T;R.y=(R.y-H)*g;return R});var p='<shape strokewidth="inherit"><foreground>',G=0;for(v=0;v<x.length;v++){var J=x[v];if(null==J){J=!1;G=+x[G];var L=x[v-1];!K&&N&&(J=G.x-L.x,L=G.y-L.y,J=Math.sqrt(J*J+L*L)<=b.tolerance);if(K||J)p+='<line x="'+G.x.toFixed(2)+'" y="'+G.y.toFixed(2)+'"/>';p+="</path>"+(I||K||J?"<fillstroke/>":"<stroke/>");G=v+1}else p=v==G?p+('<path><move x="'+J.x.toFixed(2)+'" y="'+J.y.toFixed(2)+'"/>'):p+('<line x="'+J.x.toFixed(2)+'" y="'+J.y.toFixed(2)+'"/>')}p+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){v=this.createStyle("stencil("+Graph.compress(p)+")");p=b.view.scale;G=b.view.translate;+v=new mxCell("",new mxGeometry(z/p-G.x,H/p-G.y,m/p,B/p),v);v.vertex=1;b.model.beginUpdate();try{v=b.addCell(v),b.fireEvent(new mxEventObject("cellsInserted","cells",[v])),b.fireEvent(new mxEventObject("freehandInserted","cell",v))}finally{b.model.endUpdate()}n&&b.setSelectionCells([v])}}for(v=0;v<t.length;v++)t[v].parentNode.removeChild(t[v]);d=null;t=[];x=[]}D(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(m,v){m=v.getProperty("eventName");v=v.getProperty("event");m==mxEvent.MOUSE_MOVE&&e&&(null!=v.sourceState&&v.sourceState.setCursor("crosshair"),v.consume())}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(m,v){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(m=v.getEvent(),e&&!mxEvent.isPopupTrigger(m)&&!mxEvent.isMiddleMouseButton(m)&&!mxEvent.isMultiTouchEvent(m))){var z=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);z=Math.max(1,z*b.view.scale);var B=this.getStrokeColor();d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("fill",A?B:"none");d.setAttribute("pointer-events","none");d.setAttribute("stroke",B);d.setAttribute("stroke-width",z);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(B=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",B=B.split(" ").map(function(H){return parseFloat(H)*z}).join(" "),d.setAttribute("stroke-dasharray",B));c=[];m=U(m);P(m);y="M"+m.x+" "+m.y;x.push(m);C=[];d.setAttribute("d",A?PerfectFreehand.getSvgPathFromStroke([[m.x,m.y]],u):y);f.appendChild(d);v.consume()}}),-mouseMove:mxUtils.bind(this,function(m,v){if(null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){m=v.getEvent();m=U(m);P(m);var z=J(0);if(z)if(x.push(z),A){var B=[];for(z=0;z<x.length;z++)B.push([x[z].x,x[z].y]);C=[];for(var H=2;H<c.length;H+=2)z=J(H),B.push([z.x,z.y]),C.push(z);d.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(B,u))}else{y+=" L"+z.x+" "+z.y;B="";C=[];for(H=2;H<c.length;H+=2)z=J(H),B+=" L"+z.x+" "+z.y,C.push(z);d.setAttribute("d",y+B)}Q&&(z=b.view.translate,b.scrollRectToVisible((new mxRectangle(m.x--z.x,m.y-z.y)).grow(20)));v.consume()}}),mouseUp:mxUtils.bind(this,function(m,v){null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(G(v.getEvent()),v.consume())})});var U=function(m){return mxUtils.convertPoint(b.container,mxEvent.getClientX(m),mxEvent.getClientY(m))},P=function(m){for(c.push(m);c.length>l;)c.shift()},J=function(m){var v=c.length;if(1===v%2||v>=l){var z=0,B=0,H,T=0;for(H=m;H<v;H++)T++,m=c[H],z+=m.x,B+=m.y;return{x:z/T,y:B/T}}return null}}}+mouseMove:mxUtils.bind(this,function(m,v){if(null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){m=v.getEvent();m=U(m);P(m);var z=M(0);if(z)if(x.push(z),A){var B=[];for(z=0;z<x.length;z++)B.push([x[z].x,x[z].y]);C=[];for(var H=2;H<c.length;H+=2)z=M(H),B.push([z.x,z.y]),C.push(z);d.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(B,u))}else{y+=" L"+z.x+" "+z.y;B="";C=[];for(H=2;H<c.length;H+=2)z=M(H),B+=" L"+z.x+" "+z.y,C.push(z);d.setAttribute("d",y+B)}Q&&(z=b.view.translate,b.scrollRectToVisible((new mxRectangle(m.x-+z.x,m.y-z.y)).grow(20)));v.consume()}}),mouseUp:mxUtils.bind(this,function(m,v){null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(F(v.getEvent()),v.consume())})});var U=function(m){return mxUtils.convertPoint(b.container,mxEvent.getClientX(m),mxEvent.getClientY(m))},P=function(m){for(c.push(m);c.length>l;)c.shift()},M=function(m){var v=c.length;if(1===v%2||v>=l){var z=0,B=0,H,T=0;for(H=m;H<v;H++)T++,m=c[H],z+=m.x,B+=m.y;return{x:z/T,y:B/T}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;DrawioUser=function(b,f,l,d,t){this.id=b;this.email=f;this.displayName=l;this.pictureUrl=d;this.locale=t};DrawioComment=function(b,f,l,d,t,y,x){this.file=b;this.id=f;this.content=l;this.modifiedDate=d;this.createdDate=t;this.isResolved=y;this.user=x;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,f,l,d,t){f()};DrawioComment.prototype.editComment=function(b,f,l){f()};DrawioComment.prototype.deleteComment=function(b,f){b()};Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];LucidImporter={};diff --git a/src/main/webapp/js/viewer-static.min.js b/src/main/webapp/js/viewer-static.min.jsindex cbf8687fe..575d4a973 100644--- a/src/main/webapp/js/viewer-static.min.js+++ b/src/main/webapp/js/viewer-static.min.js@@ -30,7 +30,7 @@ if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==url"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};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||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.0.3",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.0.4",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&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:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().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:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||@@ -1937,105 +1937,105 @@ Editor.prototype.setModified=function(b){this.modified=b};Editor.prototype.setFiEditor.prototype.createUndoManager=function(){var b=this.graph,e=new mxUndoManager;this.undoListener=function(m,v){e.undoableEditHappened(v.getProperty("edit"))};var g=mxUtils.bind(this,function(m,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,g);b.getView().addListener(mxEvent.UNDO,g);g=function(m,v){m=v.getProperty("edit").changes;m=b.getSelectionCellsForChanges(m);v=!1;if(0<m.length){for(var p=[],A=0;A<m.length;A++)null!=b.view.getState(m[A])&&(p.push(m[A]),v||(b.scrollCellToVisible(m[A]),v=!0));b.setSelectionCells(p)}};e.addListener(mxEvent.UNDO,g);e.addListener(mxEvent.REDO,g);return e};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};OpenFile.prototype.error=function(b){this.cancel(!0);mxUtils.alert(b)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(b){null!=this.done&&this.done(null!=b?b:!0)};-function Dialog(b,e,g,m,v,p,A,G,T,F,P){this.editorUi=b;var Q=T?57:0,U=g,c=m,f=T?0:64,k=Editor.inlineFullscreen||null==b.embedViewport?this.getDocumentSize():mxUtils.clone(b.embedViewport);null==b.embedViewport&&null!=window.innerHeight&&(k.height=window.innerHeight);var B=k.height;k=Math.max(1,Math.round((k.width-g-f)/2));var z=Math.max(1,Math.round((B-m-b.footerHeight)/3));e.style.maxHeight="100%";g=null!=document.body?Math.min(g,document.body.scrollWidth-f):g;m=Math.min(m,B-f);0<b.dialogs.length&&+function Dialog(b,e,g,m,v,p,A,G,S,F,P){this.editorUi=b;var Q=S?57:0,T=g,c=m,f=S?0:64,k=Editor.inlineFullscreen||null==b.embedViewport?this.getDocumentSize():mxUtils.clone(b.embedViewport);null==b.embedViewport&&null!=window.innerHeight&&(k.height=window.innerHeight);var B=k.height;k=Math.max(1,Math.round((k.width-g-f)/2));var z=Math.max(1,Math.round((B-m-b.footerHeight)/3));e.style.maxHeight="100%";g=null!=document.body?Math.min(g,document.body.scrollWidth-f):g;m=Math.min(m,B-f);0<b.dialogs.length&&(this.zIndex+=2*b.dialogs.length);null==this.bg&&(this.bg=b.createDiv("geBackground"),this.bg.style.position="absolute",this.bg.style.height=B+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity));var C=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=C.x+"px";this.bg.style.top=C.y+"px";k+=C.x;z+=C.y;Editor.inlineFullscreen||null==b.embedViewport||(this.bg.style.height=this.getDocumentSize().height+"px",z+=b.embedViewport.y,k+=b.embedViewport.x);-v&&document.body.appendChild(this.bg);var H=b.createDiv(T?"geTransDialog":"geDialog");v=this.getPosition(k,z,g,m);k=v.x;z=v.y;H.style.width=g+"px";H.style.height=m+"px";H.style.left=k+"px";H.style.top=z+"px";H.style.zIndex=this.zIndex;H.appendChild(e);document.body.appendChild(H);!G&&e.clientHeight>H.clientHeight-f&&(e.style.overflowY="auto");e.style.overflowX="hidden";if(p&&(p=document.createElement("img"),p.setAttribute("src",Dialog.prototype.closeImage),p.setAttribute("title",mxResources.get("close")),-p.className="geDialogClose",p.style.top=z+14+"px",p.style.left=k+g+38-Q+"px",p.style.zIndex=this.zIndex,mxEvent.addListener(p,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),document.body.appendChild(p),this.dialogImg=p,!P)){var K=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(M){K=!0}),null,mxUtils.bind(this,function(M){K&&(b.hideDialog(!0),K=!1)}))}this.resizeListener=mxUtils.bind(this,function(){if(null!=F){var M=F();null!=M&&(U=g=M.w,c=m=M.h)}M=Editor.inlineFullscreen||-null==b.embedViewport?this.getDocumentSize():mxUtils.clone(b.embedViewport);B=M.height;this.bg.style.height=B+"px";Editor.inlineFullscreen||null==b.embedViewport||(this.bg.style.height=this.getDocumentSize().height+"px");g=null!=document.body?Math.min(U,document.body.scrollWidth-f):U;m=Math.min(c,B-f);M=Math.max(1,Math.round((M.width-g-f)/2));var O=Math.max(1,Math.round((B-m-b.footerHeight)/3));O=this.getPosition(M,O,g,m);M=O.x;O=O.y;var ea=mxUtils.getDocumentScrollOrigin(document);M+=ea.x;O+=ea.y;-Editor.inlineFullscreen||null==b.embedViewport||(O+=b.embedViewport.y,M+=b.embedViewport.x);H.style.left=M+"px";H.style.top=O+"px";H.style.width=g+"px";H.style.height=m+"px";!G&&e.clientHeight>H.clientHeight-f&&(e.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=O+14+"px",this.dialogImg.style.left=M+g+38-Q+"px")});null!=b.embedViewport?b.addListener("embedViewportChanged",this.resizeListener):mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=A;this.container=-H;b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-2;+v&&document.body.appendChild(this.bg);var I=b.createDiv(S?"geTransDialog":"geDialog");v=this.getPosition(k,z,g,m);k=v.x;z=v.y;I.style.width=g+"px";I.style.height=m+"px";I.style.left=k+"px";I.style.top=z+"px";I.style.zIndex=this.zIndex;I.appendChild(e);document.body.appendChild(I);!G&&e.clientHeight>I.clientHeight-f&&(e.style.overflowY="auto");e.style.overflowX="hidden";if(p&&(p=document.createElement("img"),p.setAttribute("src",Dialog.prototype.closeImage),p.setAttribute("title",mxResources.get("close")),+p.className="geDialogClose",p.style.top=z+14+"px",p.style.left=k+g+38-Q+"px",p.style.zIndex=this.zIndex,mxEvent.addListener(p,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),document.body.appendChild(p),this.dialogImg=p,!P)){var L=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(J){L=!0}),null,mxUtils.bind(this,function(J){L&&(b.hideDialog(!0),L=!1)}))}this.resizeListener=mxUtils.bind(this,function(){if(null!=F){var J=F();null!=J&&(T=g=J.w,c=m=J.h)}J=Editor.inlineFullscreen||+null==b.embedViewport?this.getDocumentSize():mxUtils.clone(b.embedViewport);B=J.height;this.bg.style.height=B+"px";Editor.inlineFullscreen||null==b.embedViewport||(this.bg.style.height=this.getDocumentSize().height+"px");g=null!=document.body?Math.min(T,document.body.scrollWidth-f):T;m=Math.min(c,B-f);J=Math.max(1,Math.round((J.width-g-f)/2));var O=Math.max(1,Math.round((B-m-b.footerHeight)/3));O=this.getPosition(J,O,g,m);J=O.x;O=O.y;var da=mxUtils.getDocumentScrollOrigin(document);J+=da.x;O+=da.y;+Editor.inlineFullscreen||null==b.embedViewport||(O+=b.embedViewport.y,J+=b.embedViewport.x);I.style.left=J+"px";I.style.top=O+"px";I.style.width=g+"px";I.style.height=m+"px";!G&&e.clientHeight>I.clientHeight-f&&(e.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=O+14+"px",this.dialogImg.style.left=J+g+38-Q+"px")});null!=b.embedViewport?b.addListener("embedViewportChanged",this.resizeListener):mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=A;this.container=+I;b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-2;Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":IMAGE_PATH+"/nocolor.png";Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png";Dialog.prototype.clearImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==":IMAGE_PATH+"/clear.gif";Dialog.prototype.bgOpacity=80;Dialog.prototype.getDocumentSize=function(){return mxUtils.getDocumentSize()};Dialog.prototype.getPosition=function(b,e){return new mxPoint(b,e)};Dialog.prototype.close=function(b,e){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,e))return!1;this.onDialogClose=null}null!=this.dialogImg&&null!=this.dialogImg.parentNode&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);null!=this.editorUi.embedViewport?this.editorUi.removeListener(this.resizeListener):mxEvent.removeListener(window,"resize",this.resizeListener);null!=this.container.parentNode&&this.container.parentNode.removeChild(this.container)};-var ErrorDialog=function(b,e,g,m,v,p,A,G,T,F,P){T=null!=T?T:!0;var Q=document.createElement("div");Q.style.textAlign="center";if(null!=e){var U=document.createElement("div");U.style.padding="0px";U.style.margin="0px";U.style.fontSize="18px";U.style.paddingBottom="16px";U.style.marginBottom="10px";U.style.borderBottom="1px solid #c0c0c0";U.style.color="gray";U.style.whiteSpace="nowrap";U.style.textOverflow="ellipsis";U.style.overflow="hidden";mxUtils.write(U,e);U.setAttribute("title",e);Q.appendChild(U)}e=+var ErrorDialog=function(b,e,g,m,v,p,A,G,S,F,P){S=null!=S?S:!0;var Q=document.createElement("div");Q.style.textAlign="center";if(null!=e){var T=document.createElement("div");T.style.padding="0px";T.style.margin="0px";T.style.fontSize="18px";T.style.paddingBottom="16px";T.style.marginBottom="10px";T.style.borderBottom="1px solid #c0c0c0";T.style.color="gray";T.style.whiteSpace="nowrap";T.style.textOverflow="ellipsis";T.style.overflow="hidden";mxUtils.write(T,e);T.setAttribute("title",e);Q.appendChild(T)}e=document.createElement("div");e.style.lineHeight="1.2em";e.style.padding="6px";"string"===typeof g&&(g=g.replace(/\n/g,"<br/>"));e.innerHTML=Graph.sanitizeHtml(g);Q.appendChild(e);g=document.createElement("div");g.style.marginTop="12px";g.style.textAlign="center";null!=p&&(e=mxUtils.button(mxResources.get("tryAgain"),function(){b.hideDialog();p()}),e.className="geBtn",g.appendChild(e),g.style.textAlign="center");null!=F&&(F=mxUtils.button(F,function(){null!=P&&P()}),F.className="geBtn",g.appendChild(F));-var c=mxUtils.button(m,function(){T&&b.hideDialog();null!=v&&v()});c.className="geBtn";g.appendChild(c);null!=A&&(m=mxUtils.button(A,function(){T&&b.hideDialog();null!=G&&G()}),m.className="geBtn gePrimaryBtn",g.appendChild(m));this.init=function(){c.focus()};Q.appendChild(g);this.container=Q},PrintDialog=function(b,e,g){this.create(b,e,g)};-PrintDialog.prototype.create=function(b){function e(c){var f=A.checked||F.checked,k=parseInt(Q.value)/100;isNaN(k)&&(k=1,Q.value="100%");mxClient.IS_SF&&(k*=.75);var B=g.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,z=1/g.pageScale;if(f){var C=A.checked?1:parseInt(P.value);isNaN(C)||(z=mxUtils.getScaleForPageCount(C,g,B))}var H=C=0;B=mxRectangle.fromRectangle(B);B.width=Math.ceil(B.width*k);B.height=Math.ceil(B.height*k);z*=k;!f&&g.pageVisible?(k=g.getPageLayout(),C-=k.x*B.width,H-=k.y*B.height):-f=!0;f=PrintDialog.createPrintPreview(g,z,B,0,C,H,f);f.open();c&&PrintDialog.printPreview(f)}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var A=document.createElement("input");A.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(A);var T=document.createElement("span");mxUtils.write(T," "+mxResources.get("fitPage"));-G.appendChild(T);mxEvent.addListener(T,"click",function(c){A.checked=!A.checked;F.checked=!A.checked;mxEvent.consume(c)});mxEvent.addListener(A,"change",function(){F.checked=!A.checked});p.appendChild(G);v.appendChild(p);p=p.cloneNode(!1);var F=document.createElement("input");F.setAttribute("type","checkbox");G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(F);T=document.createElement("span");mxUtils.write(T," "+mxResources.get("posterPrint")+":");G.appendChild(T);mxEvent.addListener(T,+var c=mxUtils.button(m,function(){S&&b.hideDialog();null!=v&&v()});c.className="geBtn";g.appendChild(c);null!=A&&(m=mxUtils.button(A,function(){S&&b.hideDialog();null!=G&&G()}),m.className="geBtn gePrimaryBtn",g.appendChild(m));this.init=function(){c.focus()};Q.appendChild(g);this.container=Q},PrintDialog=function(b,e,g){this.create(b,e,g)};+PrintDialog.prototype.create=function(b){function e(c){var f=A.checked||F.checked,k=parseInt(Q.value)/100;isNaN(k)&&(k=1,Q.value="100%");mxClient.IS_SF&&(k*=.75);var B=g.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,z=1/g.pageScale;if(f){var C=A.checked?1:parseInt(P.value);isNaN(C)||(z=mxUtils.getScaleForPageCount(C,g,B))}var I=C=0;B=mxRectangle.fromRectangle(B);B.width=Math.ceil(B.width*k);B.height=Math.ceil(B.height*k);z*=k;!f&&g.pageVisible?(k=g.getPageLayout(),C-=k.x*B.width,I-=k.y*B.height):+f=!0;f=PrintDialog.createPrintPreview(g,z,B,0,C,I,f);f.open();c&&PrintDialog.printPreview(f)}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var A=document.createElement("input");A.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(A);var S=document.createElement("span");mxUtils.write(S," "+mxResources.get("fitPage"));+G.appendChild(S);mxEvent.addListener(S,"click",function(c){A.checked=!A.checked;F.checked=!A.checked;mxEvent.consume(c)});mxEvent.addListener(A,"change",function(){F.checked=!A.checked});p.appendChild(G);v.appendChild(p);p=p.cloneNode(!1);var F=document.createElement("input");F.setAttribute("type","checkbox");G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(F);S=document.createElement("span");mxUtils.write(S," "+mxResources.get("posterPrint")+":");G.appendChild(S);mxEvent.addListener(S,"click",function(c){F.checked=!F.checked;A.checked=!F.checked;mxEvent.consume(c)});p.appendChild(G);var P=document.createElement("input");P.setAttribute("value","1");P.setAttribute("type","number");P.setAttribute("min","1");P.setAttribute("size","4");P.setAttribute("disabled","disabled");P.style.width="50px";G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(P);mxUtils.write(G," "+mxResources.get("pages")+" (max)");p.appendChild(G);v.appendChild(p);mxEvent.addListener(F,"change",function(){F.checked?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled");A.checked=!F.checked});p=p.cloneNode(!1);G=document.createElement("td");mxUtils.write(G,mxResources.get("pageScale")+":");p.appendChild(G);G=document.createElement("td");var Q=document.createElement("input");Q.setAttribute("value","100 %");Q.setAttribute("size","5");Q.style.width="50px";G.appendChild(Q);p.appendChild(G);v.appendChild(p);p=document.createElement("tr");G=document.createElement("td");G.colSpan=2;-G.style.paddingTop="20px";G.setAttribute("align","right");T=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});T.className="geBtn";b.editor.cancelFirst&&G.appendChild(T);if(PrintDialog.previewEnabled){var U=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();e(!1)});U.className="geBtn";G.appendChild(U)}U=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();e(!0)});U.className="geBtn gePrimaryBtn";G.appendChild(U);b.editor.cancelFirst||-G.appendChild(T);p.appendChild(G);v.appendChild(p);m.appendChild(v);this.container=m};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(e){}};-PrintDialog.createPrintPreview=function(b,e,g,m,v,p,A){e=new mxPrintPreview(b,e,g,m,v,p);e.title=mxResources.get("preview");e.addPageCss=!mxClient.IS_SF;e.printBackgroundImage=!0;e.autoOrigin=A;A=b.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";e.backgroundColor=A;var G=e.isTextLabel;e.isTextLabel=function(F){return"geHint"==!F.className&&G.apply(this,arguments)};var T=e.getLinkForCellState;e.getLinkForCellState=function(F){return b.getAbsoluteUrl(T.apply(this,arguments))};return e};+G.style.paddingTop="20px";G.setAttribute("align","right");S=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});S.className="geBtn";b.editor.cancelFirst&&G.appendChild(S);if(PrintDialog.previewEnabled){var T=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();e(!1)});T.className="geBtn";G.appendChild(T)}T=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();e(!0)});T.className="geBtn gePrimaryBtn";G.appendChild(T);b.editor.cancelFirst||+G.appendChild(S);p.appendChild(G);v.appendChild(p);m.appendChild(v);this.container=m};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(e){}};+PrintDialog.createPrintPreview=function(b,e,g,m,v,p,A){e=new mxPrintPreview(b,e,g,m,v,p);e.title=mxResources.get("preview");e.addPageCss=!mxClient.IS_SF;e.printBackgroundImage=!0;e.autoOrigin=A;A=b.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";e.backgroundColor=A;var G=e.isTextLabel;e.isTextLabel=function(F){return"geHint"==!F.className&&G.apply(this,arguments)};var S=e.getLinkForCellState;e.getLinkForCellState=function(F){return b.getAbsoluteUrl(S.apply(this,arguments))};return e};PrintDialog.previewEnabled=!0;-var PageSetupDialog=function(b){function e(){var k=Q;null!=k&&null!=k.originalSrc&&(k=b.createImageForPageLink(k.originalSrc,null));null!=k&&null!=k.src?(P.style.backgroundImage="url("+k.src+")",P.style.display="inline-block"):(P.style.backgroundImage="",P.style.display="none");P.style.backgroundColor="";null!=U&&U!=mxConstants.NONE&&(P.style.backgroundColor=U,P.style.display="inline-block")}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");+var PageSetupDialog=function(b){function e(){var k=Q;null!=k&&null!=k.originalSrc&&(k=b.createImageForPageLink(k.originalSrc,null));null!=k&&null!=k.src?(P.style.backgroundImage="url("+k.src+")",P.style.display="inline-block"):(P.style.backgroundImage="",P.style.display="none");P.style.backgroundColor="";null!=T&&T!=mxConstants.NONE&&(P.style.backgroundColor=T,P.style.display="inline-block")}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";mxUtils.write(A,mxResources.get("paperSize")+":");p.appendChild(A);A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";var G=PageSetupDialog.addPageFormatPanel(A,"pagesetupdialog",g.pageFormat);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("gridSize")+":");p.appendChild(A);-A=document.createElement("td");A.style.whiteSpace="nowrap";var T=document.createElement("input");T.setAttribute("type","number");T.setAttribute("min","0");T.style.width="40px";T.style.marginLeft="6px";T.value=g.getGridSize();A.appendChild(T);mxEvent.addListener(T,"change",function(){var k=parseInt(T.value);T.value=Math.max(1,isNaN(k)?g.getGridSize():k)});p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("background")+":");+A=document.createElement("td");A.style.whiteSpace="nowrap";var S=document.createElement("input");S.setAttribute("type","number");S.setAttribute("min","0");S.style.width="40px";S.style.marginLeft="6px";S.value=g.getGridSize();A.appendChild(S);mxEvent.addListener(S,"change",function(){var k=parseInt(S.value);S.value=Math.max(1,isNaN(k)?g.getGridSize():k)});p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("background")+":");p.appendChild(A);A=document.createElement("td");var F=document.createElement("button");F.className="geBtn";F.style.margin="0px";mxUtils.write(F,mxResources.get("change")+"...");var P=document.createElement("div");P.style.display="inline-block";P.style.verticalAlign="middle";P.style.backgroundPosition="center center";P.style.backgroundRepeat="no-repeat";P.style.backgroundSize="contain";P.style.border="1px solid lightGray";P.style.borderRadius="4px";P.style.marginRight="14px";P.style.height="32px";-P.style.width="64px";P.style.cursor="pointer";P.style.padding="4px";var Q=g.backgroundImage,U=g.background,c=g.shadowVisible,f=function(k){b.showBackgroundImageDialog(function(B,z,C,H){z||(null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src}),Q=B,c=H);U=C;e()},Q,U,!0);mxEvent.consume(k)};mxEvent.addListener(F,"click",f);mxEvent.addListener(P,"click",f);e();A.appendChild(P);A.appendChild(F);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");-A.colSpan=2;A.style.paddingTop="16px";A.setAttribute("align","right");F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";b.editor.cancelFirst&&A.appendChild(F);f=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var k=parseInt(T.value);isNaN(k)||g.gridSize===k||g.setGridSize(k);k=new ChangePageSetup(b,U,Q,G.get());k.ignoreColor=g.background==U;k.ignoreImage=(null!=g.backgroundImage?g.backgroundImage.src:null)===(null!=Q?Q.src:null);null!=c&&+P.style.width="64px";P.style.cursor="pointer";P.style.padding="4px";var Q=g.backgroundImage,T=g.background,c=g.shadowVisible,f=function(k){b.showBackgroundImageDialog(function(B,z,C,I){z||(null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src}),Q=B,c=I);T=C;e()},Q,T,!0);mxEvent.consume(k)};mxEvent.addListener(F,"click",f);mxEvent.addListener(P,"click",f);e();A.appendChild(P);A.appendChild(F);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");+A.colSpan=2;A.style.paddingTop="16px";A.setAttribute("align","right");F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";b.editor.cancelFirst&&A.appendChild(F);f=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var k=parseInt(S.value);isNaN(k)||g.gridSize===k||g.setGridSize(k);k=new ChangePageSetup(b,T,Q,G.get());k.ignoreColor=g.background==T;k.ignoreImage=(null!=g.backgroundImage?g.backgroundImage.src:null)===(null!=Q?Q.src:null);null!=c&&(k.shadowVisible=c);g.pageFormat.width==k.previousFormat.width&&g.pageFormat.height==k.previousFormat.height&&k.ignoreColor&&k.ignoreImage&&k.shadowVisible==g.shadowVisible||g.model.execute(k)});f.className="geBtn gePrimaryBtn";A.appendChild(f);b.editor.cancelFirst||A.appendChild(F);p.appendChild(A);v.appendChild(p);m.appendChild(v);this.container=m};PageSetupDialog.addPageFormatPanel=function(b,e,g,m){e="format-"+e;var v=document.createElement("input");v.setAttribute("name",e);v.setAttribute("type","radio");v.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",e);p.setAttribute("type","radio");p.setAttribute("value","landscape");var A=document.createElement("select");A.style.marginBottom="4px";A.style.borderRadius="4px";A.style.borderWidth="1px";A.style.borderStyle="solid";A.style.boxSizing="border-box";-A.style.padding="2px";A.style.width="210px";var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.marginLeft="4px";G.style.width="210px";G.style.height="24px";v.style.marginRight="6px";G.appendChild(v);e=document.createElement("span");e.style.maxWidth="100px";mxUtils.write(e,mxResources.get("portrait"));G.appendChild(e);p.style.marginLeft="10px";p.style.marginRight="6px";G.appendChild(p);var T=document.createElement("span");T.style.width="100px";mxUtils.write(T,mxResources.get("landscape"));-G.appendChild(T);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.marginLeft="4px";F.style.fontSize="12px";F.style.width="210px";F.style.height="24px";var P=document.createElement("input");P.setAttribute("size","7");P.setAttribute("title",mxResources.get("width"));P.style.textAlign="right";F.appendChild(P);mxUtils.write(F," x ");var Q=document.createElement("input");Q.setAttribute("size","7");Q.setAttribute("title",mxResources.get("height"));Q.style.textAlign="right";F.appendChild(Q);-var U=document.createElement("select");U.style.marginLeft="4px";U.style.maxWidth="78px";U.style.width="78px";for(var c=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],f=0;f<c.length;f++){var k=document.createElement("option");k.setAttribute("value",c[f].unit);mxUtils.write(k,c[f].label);U.appendChild(k)}U.value=Editor.pageSizeUnit;F.appendChild(U);G.style.display=-"none";F.style.display="none";var B={},z=PageSetupDialog.getFormats();for(f=0;f<z.length;f++)c=z[f],B[c.key]=c,k=document.createElement("option"),k.setAttribute("value",c.key),mxUtils.write(k,c.title),A.appendChild(k);var C=function(){A.value="custom";for(var K=0;K<z.length;K++){var M=z[K];null!=M.format&&("a4"==M.key?826==g.width?(g=mxRectangle.fromRectangle(g),g.width=827):826==g.height&&(g=mxRectangle.fromRectangle(g),g.height=827):"a5"==M.key&&(584==g.width?(g=mxRectangle.fromRectangle(g),g.width=-583):584==g.height&&(g=mxRectangle.fromRectangle(g),g.height=583)),g.width==M.format.width&&g.height==M.format.height?(A.value=M.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):g.width==M.format.height&&g.height==M.format.width&&(A.value=M.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==A.value?-(P.value=Editor.toUnit(g.width,U.value),Q.value=Editor.toUnit(g.height,U.value),v.setAttribute("checked","checked"),A.value="custom",G.style.display="none",F.style.display=""):(G.style.display="",F.style.display="none")};C();b.appendChild(A);mxUtils.br(b);b.appendChild(G);b.appendChild(F);var H=function(K,M){K=B[A.value];null!=K.format?(P.value=Editor.toUnit(p.checked?K.format.height:K.format.width,U.value),Q.value=Editor.toUnit(p.checked?K.format.width:K.format.height,U.value),F.style.display="none",-G.style.display=""):(G.style.display="none",F.style.display="");K=parseFloat(P.value);if(isNaN(K)||0>=K)P.value=Editor.toUnit(g.width,U.value);K=parseFloat(Q.value);if(isNaN(K)||0>=K)Q.value=Editor.toUnit(g.height,U.value);K=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(P.value),U.value)),Math.floor(Editor.fromUnit(parseFloat(Q.value),U.value)));M||K.width==g.width&&K.height==g.height||(g=K,null!=m&&m(g))};mxEvent.addListener(e,"click",function(K){v.checked=!0;H(K);mxEvent.consume(K)});-mxEvent.addListener(T,"click",function(K){p.checked=!0;H(K);mxEvent.consume(K)});mxEvent.addListener(P,"blur",H);mxEvent.addListener(P,"click",H);mxEvent.addListener(Q,"blur",H);mxEvent.addListener(Q,"click",H);mxEvent.addListener(p,"change",H);mxEvent.addListener(v,"change",H);mxEvent.addListener(A,"change",function(K){H(K,"custom"==A.value);mxEvent.consume(K)});mxEvent.addListener(U,"change",function(K){P.value=Editor.toUnit(Editor.fromUnit(P.value,Editor.pageSizeUnit),U.value);Q.value=Editor.toUnit(Editor.fromUnit(Q.value,-Editor.pageSizeUnit),U.value);Editor.pageSizeUnit=U.value;H(K,!0);mxEvent.consume(K)});H(null,!0);return{set:function(K){g=K;C(null,null,!0)},get:function(){return g},widthInput:P,heightInput:Q}};+A.style.padding="2px";A.style.width="210px";var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.marginLeft="4px";G.style.width="210px";G.style.height="24px";v.style.marginRight="6px";G.appendChild(v);e=document.createElement("span");e.style.maxWidth="100px";mxUtils.write(e,mxResources.get("portrait"));G.appendChild(e);p.style.marginLeft="10px";p.style.marginRight="6px";G.appendChild(p);var S=document.createElement("span");S.style.width="100px";mxUtils.write(S,mxResources.get("landscape"));+G.appendChild(S);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.marginLeft="4px";F.style.fontSize="12px";F.style.width="210px";F.style.height="24px";var P=document.createElement("input");P.setAttribute("size","7");P.setAttribute("title",mxResources.get("width"));P.style.textAlign="right";F.appendChild(P);mxUtils.write(F," x ");var Q=document.createElement("input");Q.setAttribute("size","7");Q.setAttribute("title",mxResources.get("height"));Q.style.textAlign="right";F.appendChild(Q);+var T=document.createElement("select");T.style.marginLeft="4px";T.style.maxWidth="78px";T.style.width="78px";for(var c=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],f=0;f<c.length;f++){var k=document.createElement("option");k.setAttribute("value",c[f].unit);mxUtils.write(k,c[f].label);T.appendChild(k)}T.value=Editor.pageSizeUnit;F.appendChild(T);G.style.display=+"none";F.style.display="none";var B={},z=PageSetupDialog.getFormats();for(f=0;f<z.length;f++)c=z[f],B[c.key]=c,k=document.createElement("option"),k.setAttribute("value",c.key),mxUtils.write(k,c.title),A.appendChild(k);var C=function(){A.value="custom";for(var L=0;L<z.length;L++){var J=z[L];null!=J.format&&("a4"==J.key?826==g.width?(g=mxRectangle.fromRectangle(g),g.width=827):826==g.height&&(g=mxRectangle.fromRectangle(g),g.height=827):"a5"==J.key&&(584==g.width?(g=mxRectangle.fromRectangle(g),g.width=+583):584==g.height&&(g=mxRectangle.fromRectangle(g),g.height=583)),g.width==J.format.width&&g.height==J.format.height?(A.value=J.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):g.width==J.format.height&&g.height==J.format.width&&(A.value=J.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==A.value?+(P.value=Editor.toUnit(g.width,T.value),Q.value=Editor.toUnit(g.height,T.value),v.setAttribute("checked","checked"),A.value="custom",G.style.display="none",F.style.display=""):(G.style.display="",F.style.display="none")};C();b.appendChild(A);mxUtils.br(b);b.appendChild(G);b.appendChild(F);var I=function(L,J){L=B[A.value];null!=L.format?(P.value=Editor.toUnit(p.checked?L.format.height:L.format.width,T.value),Q.value=Editor.toUnit(p.checked?L.format.width:L.format.height,T.value),F.style.display="none",+G.style.display=""):(G.style.display="none",F.style.display="");L=parseFloat(P.value);if(isNaN(L)||0>=L)P.value=Editor.toUnit(g.width,T.value);L=parseFloat(Q.value);if(isNaN(L)||0>=L)Q.value=Editor.toUnit(g.height,T.value);L=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(P.value),T.value)),Math.floor(Editor.fromUnit(parseFloat(Q.value),T.value)));J||L.width==g.width&&L.height==g.height||(g=L,null!=m&&m(g))};mxEvent.addListener(e,"click",function(L){v.checked=!0;I(L);mxEvent.consume(L)});+mxEvent.addListener(S,"click",function(L){p.checked=!0;I(L);mxEvent.consume(L)});mxEvent.addListener(P,"blur",I);mxEvent.addListener(P,"click",I);mxEvent.addListener(Q,"blur",I);mxEvent.addListener(Q,"click",I);mxEvent.addListener(p,"change",I);mxEvent.addListener(v,"change",I);mxEvent.addListener(A,"change",function(L){I(L,"custom"==A.value);mxEvent.consume(L)});mxEvent.addListener(T,"change",function(L){P.value=Editor.toUnit(Editor.fromUnit(P.value,Editor.pageSizeUnit),T.value);Q.value=Editor.toUnit(Editor.fromUnit(Q.value,+Editor.pageSizeUnit),T.value);Editor.pageSizeUnit=T.value;I(L,!0);mxEvent.consume(L)});I(null,!0);return{set:function(L){g=L;C(null,null,!0)},get:function(){return g},widthInput:P,heightInput:Q}};PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1E3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"b4",title:"B4 (250 mm x 353 mm)",format:new mxRectangle(0,0,980,1390)},{key:"b5",title:"B5 (176 mm x 250 mm)",format:new mxRectangle(0,0,690,980)},{key:"16-9",title:"16:9 (1600 x 900)",format:new mxRectangle(0,0,900,1600)},{key:"16-10",title:"16:10 (1920 x 1200)",format:new mxRectangle(0,0,1200,1920)},{key:"4-3",title:"4:3 (1600 x 1200)",format:new mxRectangle(0,0,1200,1600)},{key:"custom",title:mxResources.get("custom"),format:null}]};-var FilenameDialog=function(b,e,g,m,v,p,A,G,T,F,P){T=null!=T?T:!0;var Q=document.createElement("div"),U=document.createElement("div");U.style.width="100%";U.style.display="grid";U.style.gap="5px 8px";U.style.gridAutoColumns="auto 1fr";U.style.boxSizing="border-box";U.style.padding="3px";var c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.justifyContent="flex-end";c.style.minWidth="0";var f=document.createElement("div");f.style.display="inline-block";-f.style.textOverflow="ellipsis";f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.fontSize="10pt";f.style.padding="2px 0";f.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(f,(v||mxResources.get("filename"))+":");c.appendChild(f);U.appendChild(c);var k=document.createElement("input");k.setAttribute("value",e||"");k.style.flexGrow="1";var B=mxUtils.button(g,function(){if(null==p||p(k.value))T&&b.hideDialog(),m(k.value)});B.className="geBtn gePrimaryBtn";this.init=function(){if(null!=-v||null==A)if(null!=P?Editor.selectFilename(k):(k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var z=U.parentNode;if(null!=z){var C=null;mxEvent.addListener(z,"dragleave",function(H){null!=C&&(C.style.backgroundColor="",C=null);H.stopPropagation();H.preventDefault()});mxEvent.addListener(z,"dragover",mxUtils.bind(this,function(H){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=k,C.style.backgroundColor=-"#ebf2f9");H.stopPropagation();H.preventDefault()}));mxEvent.addListener(z,"drop",mxUtils.bind(this,function(H){null!=C&&(C.style.backgroundColor="",C=null);0<=mxUtils.indexOf(H.dataTransfer.types,"text/uri-list")&&(k.value=decodeURIComponent(H.dataTransfer.getData("text/uri-list")),B.click());H.stopPropagation();H.preventDefault()}))}}};c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.gap="4px";c.style.whiteSpace="nowrap";c.appendChild(k);U.appendChild(c);-null==v&&null!=A||null==P||null==b.editor.diagramFileTypes||(c=document.createElement("div"),c.style.display="inline-flex",c.style.alignItems="center",c.style.textOverflow="ellipsis",c.style.justifyContent="flex-end",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("type")+":"),U.appendChild(c),c=document.createElement("div"),c.style.display="inline-flex",c.style.alignItems="center",c.style.whiteSpace="nowrap",U.appendChild(c),e=FilenameDialog.createFileTypes(b,k,b.editor.diagramFileTypes),-e.style.width="100%",c.appendChild(e));null!=A&&U.appendChild(A);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=P?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");c=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=F&&F()});c.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));-b.editor.cancelFirst&&row.appendChild(c);mxEvent.addListener(k,"keypress",function(z){13==z.keyCode&&B.click()});row.appendChild(B);b.editor.cancelFirst||row.appendChild(c);U.appendChild(row);Q.appendChild(U);this.container=Q};FilenameDialog.filenameHelpLink=null;+var FilenameDialog=function(b,e,g,m,v,p,A,G,S,F,P){S=null!=S?S:!0;var Q=document.createElement("div"),T=document.createElement("div");T.style.width="100%";T.style.display="grid";T.style.gap="5px 8px";T.style.gridAutoColumns="auto 1fr";T.style.boxSizing="border-box";T.style.padding="3px";var c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.justifyContent="flex-end";c.style.minWidth="0";var f=document.createElement("div");f.style.display="inline-block";+f.style.textOverflow="ellipsis";f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.fontSize="10pt";f.style.padding="2px 0";f.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(f,(v||mxResources.get("filename"))+":");c.appendChild(f);T.appendChild(c);var k=document.createElement("input");k.setAttribute("value",e||"");k.style.flexGrow="1";var B=mxUtils.button(g,function(){if(null==p||p(k.value))S&&b.hideDialog(),m(k.value)});B.className="geBtn gePrimaryBtn";this.init=function(){if(null!=+v||null==A)if(null!=P?Editor.selectFilename(k):(k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var z=T.parentNode;if(null!=z){var C=null;mxEvent.addListener(z,"dragleave",function(I){null!=C&&(C.style.backgroundColor="",C=null);I.stopPropagation();I.preventDefault()});mxEvent.addListener(z,"dragover",mxUtils.bind(this,function(I){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=k,C.style.backgroundColor=+"#ebf2f9");I.stopPropagation();I.preventDefault()}));mxEvent.addListener(z,"drop",mxUtils.bind(this,function(I){null!=C&&(C.style.backgroundColor="",C=null);0<=mxUtils.indexOf(I.dataTransfer.types,"text/uri-list")&&(k.value=decodeURIComponent(I.dataTransfer.getData("text/uri-list")),B.click());I.stopPropagation();I.preventDefault()}))}}};c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.gap="4px";c.style.whiteSpace="nowrap";c.appendChild(k);T.appendChild(c);+null==v&&null!=A||null==P||null==b.editor.diagramFileTypes||(c=document.createElement("div"),c.style.display="inline-flex",c.style.alignItems="center",c.style.textOverflow="ellipsis",c.style.justifyContent="flex-end",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("type")+":"),T.appendChild(c),c=document.createElement("div"),c.style.display="inline-flex",c.style.alignItems="center",c.style.whiteSpace="nowrap",T.appendChild(c),e=FilenameDialog.createFileTypes(b,k,b.editor.diagramFileTypes),+e.style.width="100%",c.appendChild(e));null!=A&&T.appendChild(A);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=P?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");c=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=F&&F()});c.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));+b.editor.cancelFirst&&row.appendChild(c);mxEvent.addListener(k,"keypress",function(z){13==z.keyCode&&B.click()});row.appendChild(B);b.editor.cancelFirst||row.appendChild(c);T.appendChild(row);Q.appendChild(T);this.container=Q};FilenameDialog.filenameHelpLink=null;FilenameDialog.createFileTypes=function(b,e,g){var m=document.createElement("select");for(b=0;b<g.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(g[b].description)+" (."+g[b].extension+")");m.appendChild(v)}mxEvent.addListener(m,"change",function(p){p=g[m.value].extension;var A=e.value.lastIndexOf(".drawio.");A=0<A?A:e.value.lastIndexOf(".");"drawio"!=p&&(p="drawio."+p);e.value=0<A?e.value.substring(0,A+1)+p:e.value+"."+p;"createEvent"in-document?(p=document.createEvent("HTMLEvents"),p.initEvent("change",!1,!0),e.dispatchEvent(p)):e.fireEvent("onchange")});b=function(p){p=e.value.toLowerCase();for(var A=0,G=0;G<g.length;G++){var T=g[G].extension,F=null;"drawio"!=T&&(F=T,T=".drawio."+T);if(p.substring(p.length-T.length-1)=="."+T||null!=F&&p.substring(p.length-F.length-1)=="."+F){A=G;break}}m.value=A};mxEvent.addListener(e,"change",b);mxEvent.addListener(e,"keyup",b);b();return m};-var WrapperWindow=function(b,e,g,m,v,p,A){var G=b.createSidebarContainer();A(G);this.window=new mxWindow(e,G,g,m,v,p,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);mxClient.IS_SF&&(this.window.div.onselectstart=mxUtils.bind(this,function(T){null==T&&(T=window.event);return null!=T&&b.isSelectionAllowed(T)}))};-(function(){mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph;if(null!=A.container&&!A.transparentBackground){if(A.pageVisible){var G=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var T=A.container.firstChild;null!=T&&T.nodeType!=mxConstants.NODETYPE_ELEMENT;)T=T.nextSibling;null!=T&&(this.backgroundPageShape=this.createBackgroundPageShape(G),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,-this.backgroundPageShape.init(A.container),T.style.position="absolute",A.container.insertBefore(this.backgroundPageShape.node,T),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(F){A.dblClick(F)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){null!=+document?(p=document.createEvent("HTMLEvents"),p.initEvent("change",!1,!0),e.dispatchEvent(p)):e.fireEvent("onchange")});b=function(p){p=e.value.toLowerCase();for(var A=0,G=0;G<g.length;G++){var S=g[G].extension,F=null;"drawio"!=S&&(F=S,S=".drawio."+S);if(p.substring(p.length-S.length-1)=="."+S||null!=F&&p.substring(p.length-F.length-1)=="."+F){A=G;break}}m.value=A};mxEvent.addListener(e,"change",b);mxEvent.addListener(e,"keyup",b);b();return m};+var WrapperWindow=function(b,e,g,m,v,p,A){var G=b.createSidebarContainer();A(G);this.window=new mxWindow(e,G,g,m,v,p,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);mxClient.IS_SF&&(this.window.div.onselectstart=mxUtils.bind(this,function(S){null==S&&(S=window.event);return null!=S&&b.isSelectionAllowed(S)}))};+(function(){mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph;if(null!=A.container&&!A.transparentBackground){if(A.pageVisible){var G=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var S=A.container.firstChild;null!=S&&S.nodeType!=mxConstants.NODETYPE_ELEMENT;)S=S.nextSibling;null!=S&&(this.backgroundPageShape=this.createBackgroundPageShape(G),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,+this.backgroundPageShape.init(A.container),S.style.position="absolute",A.container.insertBefore(this.backgroundPageShape.node,S),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(F){A.dblClick(F)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){null!=A.tooltipHandler&&A.tooltipHandler.isHideOnHover()&&A.tooltipHandler.hide();A.isMouseDown&&!mxEvent.isConsumed(F)&&A.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(F))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=G,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};-mxGraphView.prototype.validateBackgroundStyles=function(A,G,T){var F=this.graph;A=null!=A?A:1;var P=mxUtils.getLightDarkColor(null==F.background||F.background==mxConstants.NONE?F.defaultPageBackgroundColor:F.background).cssText,Q=mxUtils.getLightDarkColor(F.defaultPageBorderColor).cssText,U=null!=P&&this.gridColor!=P.toLowerCase()?this.gridColor:"#ffffff",c="none",f="";if(F.isGridEnabled()||F.gridVisible){f=10;mxClient.IS_SVG?(c=unescape(encodeURIComponent(this.createSvgGrid(U,A))),c=window.btoa?-btoa(c):Base64.encode(c,!0),c="url(data:image/svg+xml;base64,"+c+")",f=F.gridSize*this.scale*this.gridSteps*A):c="url("+this.gridImage+")";var k=U=0;G=null!=G?G-this.translate.x*this.scale:0;T=null!=T?T-this.translate.y*this.scale:0;var B=F.gridSize*this.scale*this.gridSteps,z=G%B;B=T%B;null!=F.view.backgroundPageShape&&(k=this.getBackgroundPageBounds(),U=1+k.x,k=1+k.y);f=-Math.round(f-mxUtils.mod(this.translate.x*this.scale-U+G,f)+z*A)+"px "+-Math.round(f-mxUtils.mod(this.translate.y*this.scale--k+T,f)+B*A)+"px"}A=F.view.canvas;null!=A.ownerSVGElement&&(A=A.ownerSVGElement);U=!Editor.isDarkMode()&&F.enableDiagramBackground;null!=F.view.backgroundPageShape?(F.view.backgroundPageShape.node.style.backgroundPosition=f,F.view.backgroundPageShape.node.style.backgroundImage=c,F.view.backgroundPageShape.node.style.backgroundColor=P,F.view.backgroundPageShape.node.style.borderColor=Q,F.view.backgroundPageShape.node.style.colorScheme="none"==F.getAdaptiveColors()?"light":"",F.container.classList.add("geDiagramBackdrop"),-A.style.backgroundImage="none",A.style.backgroundColor="",F.container.style.backgroundColor=U?F.diagramBackgroundColor:""):(F.container.classList.remove("geDiagramBackdrop"),A.style.backgroundPosition=f,A.style.backgroundImage=c,!U||null!=F.background&&F.background!=mxConstants.NONE?A.style.backgroundColor=P:(A.style.backgroundColor=F.diagramBackgroundColor,F.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(A,G){for(var T=this.graph.gridSize*this.scale*(null!=G?G:-1);T<this.minGridSize;)T*=2;G=this.gridSteps*T;for(var F=[],P=1;P<this.gridSteps;P++){var Q=P*T;F.push("M 0 "+Q+" L "+G+" "+Q+" M "+Q+" 0 L "+Q+" "+G)}A=mxUtils.getLightDarkColor(A);T="color-scheme: light dark;";mxClient.IS_SF&&(T="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+T+'" width="'+G+'" height="'+G+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+G+'" height="'+G+'" patternUnits="userSpaceOnUse"><path d="'+-F.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" opacity="0.2" stroke-width="1"/><path d="M '+G+" 0 L 0 0 0 "+G+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){b.apply(this,arguments);if(null!=this.shiftPreview1){var T=this.view.canvas;null!=-T.ownerSVGElement&&(T=T.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+A,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+G,F))+"px";T.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(A,G,T){var F=this.view.scale,P=this.view.translate,Q=this.pageFormat,U=F*this.pageScale,c=this.view.getBackgroundPageBounds();G=c.width;T=c.height;var f=new mxRectangle(F*P.x,F*-P.y,Q.width*U,Q.height*U),k=(A=A&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.ceil(T/f.height)-1:0,B=A?Math.ceil(G/f.width)-1:0,z=c.x+G,C=c.y+T;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<B&&(this.verticalPageBreaks=[]);A=mxUtils.bind(this,function(H){if(null!=H){for(var K=H==this.horizontalPageBreaks?k:B,M=0;M<=K;M++){var O=H==this.horizontalPageBreaks?[new mxPoint(Math.round(c.x),Math.round(c.y+(M+1)*f.height)),new mxPoint(Math.round(z),-Math.round(c.y+(M+1)*f.height))]:[new mxPoint(Math.round(c.x+(M+1)*f.width),Math.round(c.y)),new mxPoint(Math.round(c.x+(M+1)*f.width),Math.round(C))];null!=H[M]?(H[M].points=O,H[M].redraw()):(O=new mxPolyline(O,this.pageBreakColor),O.dialect=this.dialect,O.isDashed=this.pageBreakDashed,O.pointerEvents=!1,O.init(this.view.backgroundPane),O.redraw(),H[M]=O)}for(M=K;M<H.length;M++)null!=H[M]&&H[M].destroy();H.splice(K,H.length-K)}});A(this.horizontalPageBreaks);A(this.verticalPageBreaks)};var e=mxGraphHandler.prototype.shouldRemoveCellsFromParent;-mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(A,G,T){for(var F=0;F<G.length;F++){if(this.graph.isTableCell(G[F])||this.graph.isTableRow(G[F]))return!1;if(this.graph.getModel().isVertex(G[F])){var P=this.graph.getCellGeometry(G[F]);if(null!=P&&P.relative)return!1}}return e.apply(this,arguments)};var g=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var A=g.apply(this,arguments);A.intersects=mxUtils.bind(this,function(G,T){return this.isConnecting()?-!0:mxCellMarker.prototype.intersects.apply(A,arguments)});return A};mxGraphView.prototype.createBackgroundPageShape=function(A){return new mxRectangleShape(A,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var A=this.getGraphBounds(),G=0<A.width?A.x/this.scale-this.translate.x:0,T=0<A.height?A.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,P=this.graph.pageScale,Q=F.width*P;F=F.height*P;P=Math.floor(Math.min(0,G)/Q);var U=Math.floor(Math.min(0,-T)/F);return new mxRectangle(this.scale*(this.translate.x+P*Q),this.scale*(this.translate.y+U*F),this.scale*(Math.ceil(Math.max(1,G+A.width/this.scale)/Q)-P)*Q,this.scale*(Math.ceil(Math.max(1,T+A.height/this.scale)/F)-U)*F)};var m=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){m.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=-A+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(A,G,T,F,P,Q){var U=v.apply(this,arguments);null==Q||Q||mxEvent.addListener(U,"mousedown",function(c){mxEvent.consume(c)});return U};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(A,G,T){var F=this.graph.model.getParent(A);if(G){var P=this.graph.model.isEdge(A)?null:this.graph.getCellGeometry(A);-P=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(A)&&(null!=P&&P.relative||!this.graph.isContainer(F)||this.graph.isPart(A))}else if(P=p.apply(this,arguments),this.graph.isTableCell(A)||this.graph.isTableRow(A))P=F,this.graph.isTable(P)||(P=this.graph.model.getParent(P)),P=!this.graph.selectionCellsHandler.isHandled(P)||this.graph.isCellSelected(P)&&this.graph.isToggleEvent(T.getEvent())||this.graph.isCellSelected(A)&&!this.graph.isToggleEvent(T.getEvent())||this.graph.isTableCell(A)&&-this.graph.isCellSelected(F);return P};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(A){A=A.getCell();for(var G=this.graph.getModel(),T=G.getParent(A),F=this.graph.view.getState(T),P=this.graph.isCellSelected(A);null!=F&&(G.isVertex(T)||G.isEdge(T));){var Q=this.graph.isCellSelected(T);P=P||Q;if(Q||!P&&(this.graph.isTableCell(A)||this.graph.isTableRow(A)))A=T;T=G.getParent(T)}return A}})();EditorUi=function(b,e,g){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=e||document.body;var m=this,v=this.editor.graph;v.lightbox=g;var p=v.getGraphBounds;v.getGraphBounds=function(){var S=p.apply(this,arguments),ca=this.backgroundImage;if(null!=ca&&null!=ca.width&&null!=ca.height){var ma=this.view.translate,la=this.view.scale;S=mxRectangle.fromRectangle(S);S.add(new mxRectangle((ma.x+ca.x)*la,(ma.y+ca.y)*la,ca.width*la,ca.height*la))}return S};v.useCssTransforms&&-(this.lazyZoomDelay=0);mxPopupMenu.prototype.submenuImage=Graph.createSvgImage(10,10,'<path d="M3,1L8,5L3,9Z" fill="light-dark(#3F3F3F, #C0C0C0)"/>').src;Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="light-dark(#3F3F3F, #C0C0C0)"/>').src;this.selectionStateListener=mxUtils.bind(this,function(S,ca){this.clearSelectionState()});-v.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);v.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);v.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){this.footerHeight=0;v.isEnabled=function(){return!1};v.panningHandler.isForcePanningEvent=function(S){for(var ca=-S.getSource();null!=ca&&ca!=v.container;){if("foreignObject"===ca.nodeName||"text"===ca.nodeName)return!1;ca=ca.parentNode}return!mxEvent.isPopupTrigger(S.getEvent())};var A=v.panningHandler.start;v.panningHandler.start=function(){A.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var G=!1,T=!1;this.setDefaultStyle=function(S){try{v.getModel().isEdge(S)?T=v.pasteEdgeStyle=!1:G=!1;var ca=v.getCellStyle(S,!1),ma=[],la=[],-Z;for(Z in ca)ma.push(ca[Z]),la.push(Z);v.getModel().isEdge(S)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",la,"values",ma,"cells",[S],"force",!0));v.getModel().isEdge(S)?T=v.pasteEdgeStyle=!0:G=!0}catch(da){this.handleError(da)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);G=T=v.pasteEdgeStyle=!1;this.fireEvent(new mxEventObject("styleChanged",-"keys",[],"values",[],"cells",[]))};v.addListener("cellsInserted",function(S,ca){v.pasteCellStyles(v.includeDescendants(ca.getProperty("cells")))});v.addListener("textInserted",function(S,ca){v.pasteCellStyles(ca.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var F=mxUtils.bind(this,function(S){null==S&&(S=window.event);return v.isEditing()||null!=S&&this.isSelectionAllowed(S)});this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=-F,this.menubarContainer.onmousedown=F,this.toolbarContainer.onselectstart=F,this.toolbarContainer.onmousedown=F,this.diagramContainer.onselectstart=F,this.diagramContainer.onmousedown=F,this.sidebarContainer.onselectstart=F,this.sidebarContainer.onmousedown=F,this.formatContainer.onselectstart=F,this.formatContainer.onmousedown=F,this.footerContainer.onselectstart=F,this.footerContainer.onmousedown=F,null!=this.tabContainer&&(this.tabContainer.onselectstart=F),mxClient.IS_IOS&&(e=function(){var S=-null;if(/iP(hone|od|ad)/.test(navigator.platform)){var ca=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{S=[parseInt(ca[1],10),parseInt(ca[2],10),parseInt(ca[3]||0,10)]}catch(ma){}}return S}(),null!=e&&16<=e[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect",-"none"),mxUtils.setPrefixedStyle(this.footerContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?(e=function(S){if(null!=S){var ca=mxEvent.getSource(S);if("A"==ca.nodeName)for(;null!=ca;){if("geHint"==ca.className)return!0;ca=ca.parentNode}}return F(S)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,+mxGraphView.prototype.validateBackgroundStyles=function(A,G,S){var F=this.graph;A=null!=A?A:1;var P=mxUtils.getLightDarkColor(null==F.background||F.background==mxConstants.NONE?F.defaultPageBackgroundColor:F.background).cssText,Q=mxUtils.getLightDarkColor(F.defaultPageBorderColor).cssText,T=null!=P&&this.gridColor!=P.toLowerCase()?this.gridColor:"#ffffff",c="none",f="";if(F.isGridEnabled()||F.gridVisible){f=10;mxClient.IS_SVG?(c=unescape(encodeURIComponent(this.createSvgGrid(T,A))),c=window.btoa?+btoa(c):Base64.encode(c,!0),c="url(data:image/svg+xml;base64,"+c+")",f=F.gridSize*this.scale*this.gridSteps*A):c="url("+this.gridImage+")";var k=T=0;G=null!=G?G-this.translate.x*this.scale:0;S=null!=S?S-this.translate.y*this.scale:0;var B=F.gridSize*this.scale*this.gridSteps,z=G%B;B=S%B;null!=F.view.backgroundPageShape&&(k=this.getBackgroundPageBounds(),T=1+k.x,k=1+k.y);f=-Math.round(f-mxUtils.mod(this.translate.x*this.scale-T+G,f)+z*A)+"px "+-Math.round(f-mxUtils.mod(this.translate.y*this.scale-+k+S,f)+B*A)+"px"}A=F.view.canvas;null!=A.ownerSVGElement&&(A=A.ownerSVGElement);T=!Editor.isDarkMode()&&F.enableDiagramBackground;null!=F.view.backgroundPageShape?(F.view.backgroundPageShape.node.style.backgroundPosition=f,F.view.backgroundPageShape.node.style.backgroundImage=c,F.view.backgroundPageShape.node.style.backgroundColor=P,F.view.backgroundPageShape.node.style.borderColor=Q,F.view.backgroundPageShape.node.style.colorScheme="none"==F.getAdaptiveColors()?"light":"",F.container.classList.add("geDiagramBackdrop"),+A.style.backgroundImage="none",A.style.backgroundColor="",F.container.style.backgroundColor=T?F.diagramBackgroundColor:""):(F.container.classList.remove("geDiagramBackdrop"),A.style.backgroundPosition=f,A.style.backgroundImage=c,!T||null!=F.background&&F.background!=mxConstants.NONE?A.style.backgroundColor=P:(A.style.backgroundColor=F.diagramBackgroundColor,F.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(A,G){for(var S=this.graph.gridSize*this.scale*(null!=G?G:+1);S<this.minGridSize;)S*=2;G=this.gridSteps*S;for(var F=[],P=1;P<this.gridSteps;P++){var Q=P*S;F.push("M 0 "+Q+" L "+G+" "+Q+" M "+Q+" 0 L "+Q+" "+G)}A=mxUtils.getLightDarkColor(A);S="color-scheme: light dark;";mxClient.IS_SF&&(S="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+S+'" width="'+G+'" height="'+G+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+G+'" height="'+G+'" patternUnits="userSpaceOnUse"><path d="'++F.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" opacity="0.2" stroke-width="1"/><path d="M '+G+" 0 L 0 0 0 "+G+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){b.apply(this,arguments);if(null!=this.shiftPreview1){var S=this.view.canvas;null!=+S.ownerSVGElement&&(S=S.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+A,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+G,F))+"px";S.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(A,G,S){var F=this.view.scale,P=this.view.translate,Q=this.pageFormat,T=F*this.pageScale,c=this.view.getBackgroundPageBounds();G=c.width;S=c.height;var f=new mxRectangle(F*P.x,F*+P.y,Q.width*T,Q.height*T),k=(A=A&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.ceil(S/f.height)-1:0,B=A?Math.ceil(G/f.width)-1:0,z=c.x+G,C=c.y+S;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<B&&(this.verticalPageBreaks=[]);A=mxUtils.bind(this,function(I){if(null!=I){for(var L=I==this.horizontalPageBreaks?k:B,J=0;J<=L;J++){var O=I==this.horizontalPageBreaks?[new mxPoint(Math.round(c.x),Math.round(c.y+(J+1)*f.height)),new mxPoint(Math.round(z),+Math.round(c.y+(J+1)*f.height))]:[new mxPoint(Math.round(c.x+(J+1)*f.width),Math.round(c.y)),new mxPoint(Math.round(c.x+(J+1)*f.width),Math.round(C))];null!=I[J]?(I[J].points=O,I[J].redraw()):(O=new mxPolyline(O,this.pageBreakColor),O.dialect=this.dialect,O.isDashed=this.pageBreakDashed,O.pointerEvents=!1,O.init(this.view.backgroundPane),O.redraw(),I[J]=O)}for(J=L;J<I.length;J++)null!=I[J]&&I[J].destroy();I.splice(L,I.length-L)}});A(this.horizontalPageBreaks);A(this.verticalPageBreaks)};var e=mxGraphHandler.prototype.shouldRemoveCellsFromParent;+mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(A,G,S){for(var F=0;F<G.length;F++){if(this.graph.isTableCell(G[F])||this.graph.isTableRow(G[F]))return!1;if(this.graph.getModel().isVertex(G[F])){var P=this.graph.getCellGeometry(G[F]);if(null!=P&&P.relative)return!1}}return e.apply(this,arguments)};var g=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var A=g.apply(this,arguments);A.intersects=mxUtils.bind(this,function(G,S){return this.isConnecting()?+!0:mxCellMarker.prototype.intersects.apply(A,arguments)});return A};mxGraphView.prototype.createBackgroundPageShape=function(A){return new mxRectangleShape(A,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var A=this.getGraphBounds(),G=0<A.width?A.x/this.scale-this.translate.x:0,S=0<A.height?A.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,P=this.graph.pageScale,Q=F.width*P;F=F.height*P;P=Math.floor(Math.min(0,G)/Q);var T=Math.floor(Math.min(0,+S)/F);return new mxRectangle(this.scale*(this.translate.x+P*Q),this.scale*(this.translate.y+T*F),this.scale*(Math.ceil(Math.max(1,G+A.width/this.scale)/Q)-P)*Q,this.scale*(Math.ceil(Math.max(1,S+A.height/this.scale)/F)-T)*F)};var m=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){m.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=+A+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(A,G,S,F,P,Q){var T=v.apply(this,arguments);null==Q||Q||mxEvent.addListener(T,"mousedown",function(c){mxEvent.consume(c)});return T};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(A,G,S){var F=this.graph.model.getParent(A);if(G){var P=this.graph.model.isEdge(A)?null:this.graph.getCellGeometry(A);+P=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(A)&&(null!=P&&P.relative||!this.graph.isContainer(F)||this.graph.isPart(A))}else if(P=p.apply(this,arguments),this.graph.isTableCell(A)||this.graph.isTableRow(A))P=F,this.graph.isTable(P)||(P=this.graph.model.getParent(P)),P=!this.graph.selectionCellsHandler.isHandled(P)||this.graph.isCellSelected(P)&&this.graph.isToggleEvent(S.getEvent())||this.graph.isCellSelected(A)&&!this.graph.isToggleEvent(S.getEvent())||this.graph.isTableCell(A)&&+this.graph.isCellSelected(F);return P};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(A){A=A.getCell();for(var G=this.graph.getModel(),S=G.getParent(A),F=this.graph.view.getState(S),P=this.graph.isCellSelected(A);null!=F&&(G.isVertex(S)||G.isEdge(S));){var Q=this.graph.isCellSelected(S);P=P||Q;if(Q||!P&&(this.graph.isTableCell(A)||this.graph.isTableRow(A)))A=S;S=G.getParent(S)}return A}})();EditorUi=function(b,e,g){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=e||document.body;var m=this,v=this.editor.graph;v.lightbox=g;var p=v.getGraphBounds;v.getGraphBounds=function(){var V=p.apply(this,arguments),ba=this.backgroundImage;if(null!=ba&&null!=ba.width&&null!=ba.height){var ma=this.view.translate,la=this.view.scale;V=mxRectangle.fromRectangle(V);V.add(new mxRectangle((ma.x+ba.x)*la,(ma.y+ba.y)*la,ba.width*la,ba.height*la))}return V};v.useCssTransforms&&+(this.lazyZoomDelay=0);mxPopupMenu.prototype.submenuImage=Graph.createSvgImage(10,10,'<path d="M3,1L8,5L3,9Z" fill="light-dark(#3F3F3F, #C0C0C0)"/>').src;Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="light-dark(#3F3F3F, #C0C0C0)"/>').src;this.selectionStateListener=mxUtils.bind(this,function(V,ba){this.clearSelectionState()});+v.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);v.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);v.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){this.footerHeight=0;v.isEnabled=function(){return!1};v.panningHandler.isForcePanningEvent=function(V){for(var ba=+V.getSource();null!=ba&&ba!=v.container;){if("foreignObject"===ba.nodeName||"text"===ba.nodeName)return!1;ba=ba.parentNode}return!mxEvent.isPopupTrigger(V.getEvent())};var A=v.panningHandler.start;v.panningHandler.start=function(){A.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var G=!1,S=!1;this.setDefaultStyle=function(V){try{v.getModel().isEdge(V)?S=v.pasteEdgeStyle=!1:G=!1;var ba=v.getCellStyle(V,!1),ma=[],la=[],+Z;for(Z in ba)ma.push(ba[Z]),la.push(Z);v.getModel().isEdge(V)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",la,"values",ma,"cells",[V],"force",!0));v.getModel().isEdge(V)?S=v.pasteEdgeStyle=!0:G=!0}catch(ea){this.handleError(ea)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);G=S=v.pasteEdgeStyle=!1;this.fireEvent(new mxEventObject("styleChanged",+"keys",[],"values",[],"cells",[]))};v.addListener("cellsInserted",function(V,ba){v.pasteCellStyles(v.includeDescendants(ba.getProperty("cells")))});v.addListener("textInserted",function(V,ba){v.pasteCellStyles(ba.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var F=mxUtils.bind(this,function(V){null==V&&(V=window.event);return v.isEditing()||null!=V&&this.isSelectionAllowed(V)});this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=+F,this.menubarContainer.onmousedown=F,this.toolbarContainer.onselectstart=F,this.toolbarContainer.onmousedown=F,this.diagramContainer.onselectstart=F,this.diagramContainer.onmousedown=F,this.sidebarContainer.onselectstart=F,this.sidebarContainer.onmousedown=F,this.formatContainer.onselectstart=F,this.formatContainer.onmousedown=F,this.footerContainer.onselectstart=F,this.footerContainer.onmousedown=F,null!=this.tabContainer&&(this.tabContainer.onselectstart=F),mxClient.IS_IOS&&(e=function(){var V=+null;if(/iP(hone|od|ad)/.test(navigator.platform)){var ba=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{V=[parseInt(ba[1],10),parseInt(ba[2],10),parseInt(ba[3]||0,10)]}catch(ma){}}return V}(),null!=e&&16<=e[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect",+"none"),mxUtils.setPrefixedStyle(this.footerContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?(e=function(V){if(null!=V){var ba=mxEvent.getSource(V);if("A"==ba.nodeName)for(;null!=ba;){if("geHint"==ba.className)return!0;ba=ba.parentNode}}return F(V)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",e):this.diagramContainer.oncontextmenu=e):v.panningHandler.usePopupTrigger=!1;v.init(this.diagramContainer);mxClient.IS_SVG&&null!=v.view.getDrawPane()&&(e=v.view.getDrawPane().ownerSVGElement,null!=e&&(e.style.position="absolute"));this.hoverIcons=this.createHoverIcons();if(null!=v.graphHandler){var P=v.graphHandler.start;v.graphHandler.start=function(){null!=m.hoverIcons&&m.hoverIcons.reset();P.apply(this,arguments)}}mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,-function(S){var ca=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(S)-ca.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(S)-ca.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var Q=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(S,ca){return m.isSpaceDown()||Q.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(S){16==S.which?-this.shiftDown=!0:32!=S.which||v.isEditing()?mxEvent.isConsumed(S)||27!=S.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),v.container.style.cursor="move",v.isEditing()||mxEvent.getSource(S)!=v.container||mxEvent.consume(S))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(S){v.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var U=v.panningHandler.isForcePanningEvent;-v.panningHandler.isForcePanningEvent=function(S){return U.apply(this,arguments)||m.isSpaceDown()||mxEvent.isMouseEvent(S.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(S.getEvent()))&&(!mxEvent.isControlDown(S.getEvent())&&mxEvent.isRightMouseButton(S.getEvent())||mxEvent.isMiddleMouseButton(S.getEvent()))};var c=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(S){return c.apply(this,arguments)||13==S.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(S)||mxClient.IS_MAC&&-mxEvent.isMetaDown(S)||mxClient.IS_SF&&mxEvent.isShiftDown(S))};var f=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return m.isSpaceDown()||f.apply(this,arguments)};var k=!1,B=null,z=null,C=null,H=mxUtils.bind(this,function(){if(null!=this.toolbar&&k!=v.cellEditor.isContentEditing()){for(var S=this.toolbar.container.firstChild,ca=[];null!=S;){var ma=S.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,S)&&(S.parentNode.removeChild(S),ca.push(S));S=ma}S=this.toolbar.fontMenu;ma=this.toolbar.sizeMenu;-if(null==C)this.toolbar.createTextToolbar();else{for(var la=0;la<C.length;la++)this.toolbar.container.appendChild(C[la]);this.toolbar.fontMenu=B;this.toolbar.sizeMenu=z}k=v.cellEditor.isContentEditing();B=S;z=ma;C=ca}}),K=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){K.apply(this,arguments);H();if(v.cellEditor.isContentEditing()){var S=!1,ca=function(){S||(S=!0,window.setTimeout(function(){var ma=v.getSelectedEditingElement();null!=ma&&(ma=mxUtils.getCurrentStyle(ma),null!=ma&&null!=-m.toolbar&&(m.toolbar.setFontName(mxUtils.getCssFontFamily(ma.fontFamily)),m.toolbar.setFontSize(parseInt(ma.fontSize))));S=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",ca);mxEvent.addListener(v.cellEditor.textarea,"touchend",ca);mxEvent.addListener(v.cellEditor.textarea,"mouseup",ca);mxEvent.addListener(v.cellEditor.textarea,"keyup",ca);ca()}};var M=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(S,ca){try{M.apply(this,arguments),H()}catch(ma){m.handleError(ma)}};v.container.setAttribute("tabindex",-"0");v.container.style.cursor="default";if(window.self===window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(S){}var O=v.fireMouseEvent;v.fireMouseEvent=function(S,ca,ma){try{S==mxEvent.MOUSE_DOWN&&this.container.focus(),O.apply(this,arguments)}catch(la){m.handleError(la)}};var ea=v.foldCells;v.foldCells=function(S,ca,ma,la,Z){try{ea.apply(this,arguments)}catch(da){m.handleError(da)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,-function(S,ca,ma){this.menus.createPopupMenu(S,ca,ma)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(S){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(S,ca){var ma=[ca.getProperty("cell")];ca.getProperty("terminalInserted")&&(ma.push(ca.getProperty("terminal")),window.setTimeout(function(){null!=m.hoverIcons&&m.hoverIcons.update(v.view.getState(ma[ma.length--1]))},0));v.pasteCellStyles(ma)});this.addListener("styleChanged",mxUtils.bind(this,function(S,ca){S=ca.getProperty("force");(this.updateDefaultStyle||S)&&v.copyCellStyles(ca.getProperty("cells"),ca.getProperty("keys"),ca.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,G,T);null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&+function(V){var ba=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(V)-ba.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(V)-ba.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var Q=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(V,ba){return m.isSpaceDown()||Q.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(V){16==V.which?+this.shiftDown=!0:32!=V.which||v.isEditing()?mxEvent.isConsumed(V)||27!=V.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),v.container.style.cursor="move",v.isEditing()||mxEvent.getSource(V)!=v.container||mxEvent.consume(V))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(V){v.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var T=v.panningHandler.isForcePanningEvent;+v.panningHandler.isForcePanningEvent=function(V){return T.apply(this,arguments)||m.isSpaceDown()||mxEvent.isMouseEvent(V.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(V.getEvent()))&&(!mxEvent.isControlDown(V.getEvent())&&mxEvent.isRightMouseButton(V.getEvent())||mxEvent.isMiddleMouseButton(V.getEvent()))};var c=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(V){return c.apply(this,arguments)||13==V.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(V)||mxClient.IS_MAC&&+mxEvent.isMetaDown(V)||mxClient.IS_SF&&mxEvent.isShiftDown(V))};var f=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return m.isSpaceDown()||f.apply(this,arguments)};var k=!1,B=null,z=null,C=null,I=mxUtils.bind(this,function(){if(null!=this.toolbar&&k!=v.cellEditor.isContentEditing()){for(var V=this.toolbar.container.firstChild,ba=[];null!=V;){var ma=V.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,V)&&(V.parentNode.removeChild(V),ba.push(V));V=ma}V=this.toolbar.fontMenu;ma=this.toolbar.sizeMenu;+if(null==C)this.toolbar.createTextToolbar();else{for(var la=0;la<C.length;la++)this.toolbar.container.appendChild(C[la]);this.toolbar.fontMenu=B;this.toolbar.sizeMenu=z}k=v.cellEditor.isContentEditing();B=V;z=ma;C=ba}}),L=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){L.apply(this,arguments);I();if(v.cellEditor.isContentEditing()){var V=!1,ba=function(){V||(V=!0,window.setTimeout(function(){var ma=v.getSelectedEditingElement();null!=ma&&(ma=mxUtils.getCurrentStyle(ma),null!=ma&&null!=+m.toolbar&&(m.toolbar.setFontName(mxUtils.getCssFontFamily(ma.fontFamily)),m.toolbar.setFontSize(parseInt(ma.fontSize))));V=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",ba);mxEvent.addListener(v.cellEditor.textarea,"touchend",ba);mxEvent.addListener(v.cellEditor.textarea,"mouseup",ba);mxEvent.addListener(v.cellEditor.textarea,"keyup",ba);ba()}};var J=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(V,ba){try{J.apply(this,arguments),I()}catch(ma){m.handleError(ma)}};v.container.setAttribute("tabindex",+"0");v.container.style.cursor="default";if(window.self===window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(V){}var O=v.fireMouseEvent;v.fireMouseEvent=function(V,ba,ma){try{V==mxEvent.MOUSE_DOWN&&this.container.focus(),O.apply(this,arguments)}catch(la){m.handleError(la)}};var da=v.foldCells;v.foldCells=function(V,ba,ma,la,Z){try{da.apply(this,arguments)}catch(ea){m.handleError(ea)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,+function(V,ba,ma){this.menus.createPopupMenu(V,ba,ma)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(V){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(V,ba){var ma=[ba.getProperty("cell")];ba.getProperty("terminalInserted")&&(ma.push(ba.getProperty("terminal")),window.setTimeout(function(){null!=m.hoverIcons&&m.hoverIcons.update(v.view.getState(ma[ma.length-+1]))},0));v.pasteCellStyles(ma)});this.addListener("styleChanged",mxUtils.bind(this,function(V,ba){V=ba.getProperty("force");(this.updateDefaultStyle||V)&&v.copyCellStyles(ba.getProperty("cells"),ba.getProperty("keys"),ba.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,G,S);null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==v.currentEdgeStyle.edgeStyle&&"1"==v.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==v.currentEdgeStyle.edgeStyle||"none"==v.currentEdgeStyle.edgeStyle||null==v.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==v.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==v.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==v.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==v.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==v.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==v.currentEdgeStyle.shape?"geSprite geSprite-linkedge":"flexArrow"==v.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==v.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":-"geSprite geSprite-connection"))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var S=v.currentVertexStyle.fontFamily||"Helvetica",ca=String(v.currentVertexStyle.fontSize||"12"),ma=v.getView().getState(v.getSelectionCell());null!=ma&&(S=ma.style[mxConstants.STYLE_FONTFAMILY]||S,ca=ma.style[mxConstants.STYLE_FONTSIZE]||ca,10<S.length&&(S=S.substring(0,8)+"..."));this.toolbar.setFontName(S);this.toolbar.setFontSize(ca)}),v.getSelectionModel().addListener(mxEvent.CHANGE,b),v.getModel().addListener(mxEvent.CHANGE,-b));v.addListener(mxEvent.CELLS_ADDED,function(S,ca){S=ca.getProperty("cells");ca=ca.getProperty("parent");null!=ca&&v.getModel().isLayer(ca)&&!v.isCellVisible(ca)&&null!=S&&0<S.length&&v.getModel().setVisible(ca,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&!v.isSelectionEmpty()){var S=v.getLayerForCells(v.getSelectionCells());null!=S&&v.setDefaultParent(S)}});this.gestureHandler=mxUtils.bind(this,function(S){null!=this.currentMenu&&mxEvent.getSource(S)!=+"geSprite geSprite-connection"))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var V=v.currentVertexStyle.fontFamily||"Helvetica",ba=String(v.currentVertexStyle.fontSize||"12"),ma=v.getView().getState(v.getSelectionCell());null!=ma&&(V=ma.style[mxConstants.STYLE_FONTFAMILY]||V,ba=ma.style[mxConstants.STYLE_FONTSIZE]||ba,10<V.length&&(V=V.substring(0,8)+"..."));this.toolbar.setFontName(V);this.toolbar.setFontSize(ba)}),v.getSelectionModel().addListener(mxEvent.CHANGE,b),v.getModel().addListener(mxEvent.CHANGE,+b));v.addListener(mxEvent.CELLS_ADDED,function(V,ba){V=ba.getProperty("cells");ba=ba.getProperty("parent");null!=ba&&v.getModel().isLayer(ba)&&!v.isCellVisible(ba)&&null!=V&&0<V.length&&v.getModel().setVisible(ba,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&!v.isSelectionEmpty()){var V=v.getLayerForCells(v.getSelectionCells());null!=V&&v.setDefaultParent(V)}});this.gestureHandler=mxUtils.bind(this,function(V){null!=this.currentMenu&&mxEvent.getSource(V)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var fa=null;this.resizeHandler=mxUtils.bind(this,function(){null!=fa&&window.clearTimeout(fa);fa=window.setTimeout(mxUtils.bind(this,function(){fa=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));v.addListener("gridSizeChanged",mxUtils.bind(this,function(){v.isGridEnabled()&&v.view.validateBackground()}));this.editor.resetGraph()}this.init();v.standalone||this.open()};EditorUi.compactUi=!0;-EditorUi.parsePng=function(b,e,g){function m(G,T){var F=p;p+=T;return G.substring(F,p)}function v(G){G=m(G,4);return G.charCodeAt(3)+(G.charCodeAt(2)<<8)+(G.charCodeAt(1)<<16)+(G.charCodeAt(0)<<24)}var p=0;if(m(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(m(b,4),"IHDR"!=m(b,4))null!=g&&g();else{m(b,17);do{g=v(b);var A=m(b,4);if(null!=e&&e(p-8,A,g))break;value=m(b,g);m(b,4);if("IEND"==A)break}while(g)}};mxUtils.extend(EditorUi,mxEventSource);+EditorUi.parsePng=function(b,e,g){function m(G,S){var F=p;p+=S;return G.substring(F,p)}function v(G){G=m(G,4);return G.charCodeAt(3)+(G.charCodeAt(2)<<8)+(G.charCodeAt(1)<<16)+(G.charCodeAt(0)<<24)}var p=0;if(m(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(m(b,4),"IHDR"!=m(b,4))null!=g&&g();else{m(b,17);do{g=v(b);var A=m(b,4);if(null!=e&&e(p-8,A,g))break;value=m(b,g);m(b,4);if("IEND"==A)break}while(g)}};mxUtils.extend(EditorUi,mxEventSource);EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=38;EditorUi.prototype.footerHeight=28;EditorUi.prototype.defaultSidebarWidth=Math.min(screen.width/2,"large"!=urlParams["sidebar-entries"]?212:240);EditorUi.prototype.hsplitPosition=screen.width<=Editor.smallScreenWidth?0:EditorUi.prototype.defaultSidebarWidth;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!1;EditorUi.prototype.spaceDown=!1;EditorUi.prototype.shiftDown=!1;EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(b.container,"scroll",mxUtils.bind(this,function(){b.tooltipHandler.hide();null!=b.connectionHandler&&null!=b.connectionHandler.constraintHandler&&b.connectionHandler.constraintHandler.reset()}));b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){b.tooltipHandler.hide();var m=b.getRubberband();null!=m&&m.cancel()}));mxEvent.addListener(b.container,@@ -2043,30 +2043,30 @@ EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"arguments);g.updateActionStates()};b.showLinkDialog=mxUtils.bind(g,g.showLinkDialog);b.editLink=g.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,e=b.getSelectionCells(),g=this.initSelectionState(),m=!0,v=0;v<e.length;v++){var p=b.getCurrentCellStyle(e[v]);"0"!=mxUtils.getValue(p,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(g,e[v],e,m),m=!1)}this.updateSelectionStateForTableCells(g);return g};EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,html:!0,rounded:!0,autoSize:!1,image:!1,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,unlocked:this.editor.graph.isEnabled(),connections:!1}};-EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var e=mxUtils.sortCells(b.cells),g=this.editor.graph.model,m=g.getParent(e[0]),v=g.getParent(m);if(null!=m&&null!=v){for(var p=m.getIndex(e[0]),A=v.getIndex(m),G=null,T=1,F=1,P=0,Q=A<v.getChildCount()-1?g.getChildAt(g.getChildAt(v,A+1),p):null;P<e.length-1;){var U=e[++P];null==Q||Q!=U||null!=G&&T!=G||(G=T,T=0,F++,m=g.getParent(Q),Q=A+F<v.getChildCount()?g.getChildAt(g.getChildAt(v,A+F),p):null);var c=this.editor.graph.view.getState(U);-if(U==g.getChildAt(m,p+T)&&null!=c&&1==mxUtils.getValue(c.style,"colspan",1)&&1==mxUtils.getValue(c.style,"rowspan",1))T++;else break}P==F*T-1&&(b.mergeCell=e[0],b.colspan=T,b.rowspan=F)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)};+EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var e=mxUtils.sortCells(b.cells),g=this.editor.graph.model,m=g.getParent(e[0]),v=g.getParent(m);if(null!=m&&null!=v){for(var p=m.getIndex(e[0]),A=v.getIndex(m),G=null,S=1,F=1,P=0,Q=A<v.getChildCount()-1?g.getChildAt(g.getChildAt(v,A+1),p):null;P<e.length-1;){var T=e[++P];null==Q||Q!=T||null!=G&&S!=G||(G=S,S=0,F++,m=g.getParent(Q),Q=A+F<v.getChildCount()?g.getChildAt(g.getChildAt(v,A+F),p):null);var c=this.editor.graph.view.getState(T);+if(T==g.getChildAt(m,p+S)&&null!=c&&1==mxUtils.getValue(c.style,"colspan",1)&&1==mxUtils.getValue(c.style,"rowspan",1))S++;else break}P==F*S-1&&(b.mergeCell=e[0],b.colspan=S,b.rowspan=F)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)};EditorUi.prototype.createTimeout=function(b,e,g){var m=!0,v=null,p=mxUtils.bind(this,function(G){v.clear()&&(m=!1,G=null!=G?G:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,e,g)})},null!=g?g(G):this.handleError(G))}),A=window.setTimeout(p,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(A);return m},isAlive:function(){return m}};null!=e&&this.tryAndHandle(mxUtils.bind(this,function(){e(v)}),p);return v};EditorUi.prototype.tryAndHandle=function(b,e){try{b()}catch(g){null!=e?e(g):this.handleError(g)}};-EditorUi.prototype.removeUserDefinedDarkColors=function(b,e,g){var m=this.editor.graph;b=null!=b?b:m.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");m.model.beginUpdate();try{for(var A=0;A<b.length;A++)if(m.model.isEdge(b[A])||m.model.isVertex(b[A])){var G=m.getCellStyle(b[A],!1);if(null!=G)for(var T=0;T<v.length;T++)try{var F=G[v[T]];if(mxUtils.isLightDarkColor(F)){var P=mxUtils.getLightDarkColor(F);m.setCellStyles(v[T],P.light,[b[A]])}}catch(U){}e&&m.isHtmlLabel(b[A])&&-"0"!=mxUtils.getValue(G,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(m.getLabel(b[A])),Graph.addLightDarkColors(p,null,null,function(U,c,f){return mxUtils.isLightDarkColor(f)?(f=mxUtils.getLightDarkColor(f),U.style.setProperty(c,f.light),!0):!1})&&m.cellLabelChanged(b[A],p.innerHTML))}if(g&&mxUtils.isLightDarkColor(m.background)){P=mxUtils.getLightDarkColor(m.background);var Q=new ChangePageSetup(this,P.light);Q.ignoreImage=!0;m.model.execute(Q)}}finally{m.model.endUpdate()}return b};+EditorUi.prototype.removeUserDefinedDarkColors=function(b,e,g){var m=this.editor.graph;b=null!=b?b:m.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");m.model.beginUpdate();try{for(var A=0;A<b.length;A++)if(m.model.isEdge(b[A])||m.model.isVertex(b[A])){var G=m.getCellStyle(b[A],!1);if(null!=G)for(var S=0;S<v.length;S++)try{var F=G[v[S]];if(mxUtils.isLightDarkColor(F)){var P=mxUtils.getLightDarkColor(F);m.setCellStyles(v[S],P.light,[b[A]])}}catch(T){}e&&m.isHtmlLabel(b[A])&&+"0"!=mxUtils.getValue(G,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(m.getLabel(b[A])),Graph.addLightDarkColors(p,null,null,function(T,c,f){return mxUtils.isLightDarkColor(f)?(f=mxUtils.getLightDarkColor(f),T.style.setProperty(c,f.light),!0):!1})&&m.cellLabelChanged(b[A],p.innerHTML))}if(g&&mxUtils.isLightDarkColor(m.background)){P=mxUtils.getLightDarkColor(m.background);var Q=new ChangePageSetup(this,P.light);Q.ignoreImage=!0;m.model.execute(Q)}}finally{m.model.endUpdate()}return b};EditorUi.prototype.updateSelectionStateForCell=function(b,e,g,m){g=this.editor.graph;b.cells.push(e);if(g.getModel().isVertex(e)){b.connections=0<g.model.getEdgeCount(e);b.unlocked=b.unlocked&&!g.isCellLocked(e);b.resizable=b.resizable&&g.isCellResizable(e);b.rotatable=b.rotatable&&g.isCellRotatable(e);b.movable=b.movable&&g.isCellMovable(e)&&!g.isTableRow(e)&&!g.isTableCell(e);b.swimlane=b.swimlane||g.isSwimlane(e);b.table=b.table||g.isTable(e);b.cell=b.cell||g.isTableCell(e);b.row=b.row||g.isTableRow(e);b.vertices.push(e);var v=g.getCellGeometry(e);if(null!=v&&(0<v.width?null==b.width?b.width=v.width:b.width!=v.width&&(b.width=""):b.containsLabel=!0,0<v.height?null==b.height?b.height=v.height:b.height!=v.height&&(b.height=""):b.containsLabel=!0,!v.relative||null!=v.offset)){var p=v.relative?v.offset.x:v.x;v=v.relative?v.offset.y:v.y;null==b.x?b.x=p:b.x!=p&&(b.x="");null==b.y?b.y=v:b.y!=v&&(b.y="")}}else g.getModel().isEdge(e)&&(b.edges.push(e),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=!1);p=g.view.getState(e);null!=p&&(b.html=b.html&&g.isHtmlLabel(e),b.autoSize=b.autoSize||g.isAutoSizeState(p),b.glass=b.glass&&g.isGlassState(p),b.rounded=b.rounded&&g.isRoundedState(p),b.lineJumps=b.lineJumps&&g.isLineJumpState(p),b.image=b.image||g.isImageState(p),b.shadow=b.shadow&&g.isShadowState(p),b.fill=b.fill&&g.isFillState(p),b.gradient=b.fill&&g.isGradientState(p),b.stroke=b.stroke&&g.isStrokeState(p),e=mxUtils.getValue(p.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||"image"==e,g.mergeStyle(p.style,b.style,m))};-EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,e=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(T,F){"mouseDown"==F.getProperty("eventName")&&e.hideShapePicker()}));var g=mxUtils.bind(this,function(){e.hideShapePicker(!0)});b.addListener("wheel",g);b.addListener(mxEvent.ESCAPE,g);b.view.addListener(mxEvent.SCALE,g);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,g);b.getSelectionModel().addListener(mxEvent.CHANGE,g);var m=b.popupMenuHandler.isMenuShowing;-b.popupMenuHandler.isMenuShowing=function(){return m.apply(this,arguments)||null!=e.shapePicker||null!=e.currentMenu};var v=b.dblClick;b.dblClick=function(T,F){if(this.isEnabled())if(null!=F||null==e.sidebar||mxEvent.isShiftDown(T)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var P=mxUtils.convertPoint(this.container,mxEvent.getClientX(T),mxEvent.getClientY(T));mxEvent.consume(T);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(P.x,P.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",-g);var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){e.hideShapePicker();p.apply(this,arguments)};var A=this.hoverIcons.execute;this.hoverIcons.execute=function(T,F,P){var Q=P.getEvent();this.graph.isCloneEvent(Q)||mxEvent.isShiftDown(Q)?A.apply(this,arguments):this.graph.connectVertex(T.cell,F,this.graph.defaultEdgeLength,Q,null,null,mxUtils.bind(this,function(U,c,f){var k=b.getCompositeParent(T.cell);U=b.getCellGeometry(k);for(P.consume();null!=k&&b.model.isVertex(k)&&null!=U&&U.relative;)cell=-k,k=b.model.getParent(cell),U=b.getCellGeometry(k);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(P.getGraphX(),P.getGraphY(),k,mxUtils.bind(this,function(B){f(B);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(B))}),F)}),30)}),mxUtils.bind(this,function(U){this.graph.selectCellsForConnectVertex(U,Q,this)}))};var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(T,F){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var P=-F.getProperty("arrow"),Q=F.getProperty("direction"),U=F.getProperty("event");P=P.getBoundingClientRect();var c=mxUtils.getOffset(b.container),f=b.container.scrollLeft+P.x-c.x;c=b.container.scrollTop+P.y-c.y;var k=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),B=e.showShapePicker(f,c,k,mxUtils.bind(this,function(z){null!=z&&b.connectVertex(k,Q,b.defaultEdgeLength,U,!0,!1,function(C,H,K){K(z);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(z))},-function(C){b.selectCellsForConnectVertex(C)},U,this.hoverIcons)}),Q,!0);null!=B&&(this.centerShapePicker(B,P,f,c,Q),mxUtils.setOpacity(B,30),mxEvent.addListener(B,"mouseenter",function(){mxUtils.setOpacity(B,100)}),mxEvent.addListener(B,"mouseleave",function(){e.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(T,F){null!=G&&window.clearTimeout(G)}))}};+EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,e=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(S,F){"mouseDown"==F.getProperty("eventName")&&e.hideShapePicker()}));var g=mxUtils.bind(this,function(){e.hideShapePicker(!0)});b.addListener("wheel",g);b.addListener(mxEvent.ESCAPE,g);b.view.addListener(mxEvent.SCALE,g);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,g);b.getSelectionModel().addListener(mxEvent.CHANGE,g);var m=b.popupMenuHandler.isMenuShowing;+b.popupMenuHandler.isMenuShowing=function(){return m.apply(this,arguments)||null!=e.shapePicker||null!=e.currentMenu};var v=b.dblClick;b.dblClick=function(S,F){if(this.isEnabled())if(null!=F||null==e.sidebar||mxEvent.isShiftDown(S)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var P=mxUtils.convertPoint(this.container,mxEvent.getClientX(S),mxEvent.getClientY(S));mxEvent.consume(S);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(P.x,P.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",+g);var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){e.hideShapePicker();p.apply(this,arguments)};var A=this.hoverIcons.execute;this.hoverIcons.execute=function(S,F,P){var Q=P.getEvent();this.graph.isCloneEvent(Q)||mxEvent.isShiftDown(Q)?A.apply(this,arguments):this.graph.connectVertex(S.cell,F,this.graph.defaultEdgeLength,Q,null,null,mxUtils.bind(this,function(T,c,f){var k=b.getCompositeParent(S.cell);T=b.getCellGeometry(k);for(P.consume();null!=k&&b.model.isVertex(k)&&null!=T&&T.relative;)cell=+k,k=b.model.getParent(cell),T=b.getCellGeometry(k);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(P.getGraphX(),P.getGraphY(),k,mxUtils.bind(this,function(B){f(B);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(B))}),F)}),30)}),mxUtils.bind(this,function(T){this.graph.selectCellsForConnectVertex(T,Q,this)}))};var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(S,F){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var P=+F.getProperty("arrow"),Q=F.getProperty("direction"),T=F.getProperty("event");P=P.getBoundingClientRect();var c=mxUtils.getOffset(b.container),f=b.container.scrollLeft+P.x-c.x;c=b.container.scrollTop+P.y-c.y;var k=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),B=e.showShapePicker(f,c,k,mxUtils.bind(this,function(z){null!=z&&b.connectVertex(k,Q,b.defaultEdgeLength,T,!0,!1,function(C,I,L){L(z);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(z))},+function(C){b.selectCellsForConnectVertex(C)},T,this.hoverIcons)}),Q,!0);null!=B&&(this.centerShapePicker(B,P,f,c,Q),mxUtils.setOpacity(B,30),mxEvent.addListener(B,"mouseenter",function(){mxUtils.setOpacity(B,100)}),mxEvent.addListener(B,"mouseleave",function(){e.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(S,F){null!=G&&window.clearTimeout(G)}))}};EditorUi.prototype.centerShapePicker=function(b,e,g,m,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var p=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(g-=p.width/2-10,m-=p.height+6):v==mxConstants.DIRECTION_SOUTH?(g-=p.width/2-10,m+=e.height+6):v==mxConstants.DIRECTION_WEST?(g-=p.width+6,m-=p.height/2-10):v==mxConstants.DIRECTION_EAST&&(g+=e.width+6,m-=p.height/2-10);b.style.left=g+"px";b.style.top=m+"px"};-EditorUi.prototype.showShapePicker=function(b,e,g,m,v,p,A,G,T){var F=null;this.editor.graph.freehand.isDrawing()||(G=G||null==g,F=this.createShapePicker(b,e,g,m,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(g,p,G),p,A,G,T),null!=F&&(null==this.hoverIcons||p||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=m,this.shapePicker=F));return F};-EditorUi.prototype.createShapePicker=function(b,e,g,m,v,p,A,G,T,F,P){P=null!=P?P:!0;var Q=this.editor.graph,U=null;T=null!=T?T:function(k){k=k[0];var B=0,z=0,C=k.geometry;null!=C&&(Q.model.isEdge(k)&&(k=C.getTerminalPoint(!1),C=new mxRectangle(0,0,k.x,k.y)),B=C.width/2,z=C.height/2);return new mxPoint(Q.snap(Math.round(b/Q.view.scale)-Q.view.translate.x-B),Q.snap(Math.round(e/Q.view.scale)-Q.view.translate.y-z))};if(null!=A&&0<A.length){var c=this;Q=this.editor.graph;U=document.createElement("div");-v=Q.view.getState(g);var f=null==g||null!=v&&Q.isTransparentState(v)?null:Q.copyStyle(g);v=6>A.length?35*A.length:140;U.className="geToolbarContainer geSidebarContainer geShapePicker";U.setAttribute("title",mxResources.get("sidebarTooltip"));U.style.left=Math.round(b)+"px";U.style.top=Math.round(e)+"px";U.style.width=v+"px";mxClient.IS_POINTER&&(U.style.touchAction="none");G||mxUtils.setPrefixedStyle(U.style,"transform","translate(-22px,-22px)");Q.container.appendChild(U);v=mxUtils.bind(this,function(k){var B=-document.createElement("a");B.className="geItem";B.style.display="inline-block";B.style.position="relative";B.style.overflow="hidden";B.style.cursor="pointer";B.style.width="30px";B.style.height="30px";B.style.padding="1px";U.appendChild(B);null!=f&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(f,[k]):this.sidebar.graph.pasteCellStyles([k],Q.currentVertexStyle,Q.currentEdgeStyle);var z=k.geometry;Q.model.isEdge(k)&&(z=z.getTerminalPoint(!1),z=new mxRectangle(0,0,z.x,z.y));null!=z&&B.appendChild(this.sidebar.createVertexTemplateFromCells([k],-z.width,z.height,"",!0,!1,null,!1,mxUtils.bind(this,function(C){if(!mxEvent.isShiftDown(C)||null==g&&Q.isSelectionEmpty()){var H=Q.cloneCell(k);if(null!=m)m(H);else{var K=T([H]);Q.model.isEdge(H)?H.geometry.translate(K.x,K.y):(H.geometry.x=K.x,H.geometry.y=K.y);Q.model.beginUpdate();try{Q.addCell(H),Q.model.isVertex(H)&&Q.isAutoSizeCell(H)&&Q.updateCellSize(H)}finally{Q.model.endUpdate()}Q.setSelectionCell(H);Q.scrollCellToVisible(H);P&&Q.startEditing(H);null!=c.hoverIcons&&c.hoverIcons.update(Q.view.getState(H))}}else H=-Q.getEditableCells(null!=g?[g]:Q.getSelectionCells()),Q.updateShapes(k,H);null!=p&&p(C);mxEvent.consume(C)}),25,25,null,null,g))});for(F=0;F<(G?Math.min(A.length,4):A.length);F++)v(A[F]);A=U.offsetTop+U.clientHeight-(Q.container.scrollTop+Q.container.offsetHeight);0<A&&(U.style.top=Math.max(Q.container.scrollTop+22,e-A)+"px");A=U.offsetLeft+U.clientWidth-(Q.container.scrollLeft+Q.container.offsetWidth);0<A&&(U.style.left=Math.max(Q.container.scrollLeft+22,b-A)+"px")}return U};-EditorUi.prototype.getCellsForShapePicker=function(b,e,g){var m=this.editor.graph,v=mxUtils.bind(this,function(p,A,G,T){return m.createVertex(null,null,T||"",0,0,A||120,G||60,p,!1)});e=mxUtils.bind(this,function(p,A,G){p=new mxCell(G||"",new mxGeometry(0,0,m.defaultEdgeLength+20,0),p);p.geometry.setTerminalPoint(new mxPoint(0,0),!0);p.geometry.setTerminalPoint(new mxPoint(p.geometry.width,null!=A?A:0),!1);p.geometry.points=null!=A?[new mxPoint(p.geometry.width/2,A)]:[];p.geometry.relative=!0;p.edge=+EditorUi.prototype.showShapePicker=function(b,e,g,m,v,p,A,G,S){var F=null;this.editor.graph.freehand.isDrawing()||(G=G||null==g,F=this.createShapePicker(b,e,g,m,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(g,p,G),p,A,G,S),null!=F&&(null==this.hoverIcons||p||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=m,this.shapePicker=F));return F};+EditorUi.prototype.createShapePicker=function(b,e,g,m,v,p,A,G,S,F,P){P=null!=P?P:!0;var Q=this.editor.graph,T=null;S=null!=S?S:function(k){k=k[0];var B=0,z=0,C=k.geometry;null!=C&&(Q.model.isEdge(k)&&(k=C.getTerminalPoint(!1),C=new mxRectangle(0,0,k.x,k.y)),B=C.width/2,z=C.height/2);return new mxPoint(Q.snap(Math.round(b/Q.view.scale)-Q.view.translate.x-B),Q.snap(Math.round(e/Q.view.scale)-Q.view.translate.y-z))};if(null!=A&&0<A.length){var c=this;Q=this.editor.graph;T=document.createElement("div");+v=Q.view.getState(g);var f=null==g||null!=v&&Q.isTransparentState(v)?null:Q.copyStyle(g);v=6>A.length?35*A.length:140;T.className="geToolbarContainer geSidebarContainer geShapePicker";T.setAttribute("title",mxResources.get("sidebarTooltip"));T.style.left=Math.round(b)+"px";T.style.top=Math.round(e)+"px";T.style.width=v+"px";mxClient.IS_POINTER&&(T.style.touchAction="none");G||mxUtils.setPrefixedStyle(T.style,"transform","translate(-22px,-22px)");Q.container.appendChild(T);v=mxUtils.bind(this,function(k){var B=+document.createElement("a");B.className="geItem";B.style.display="inline-block";B.style.position="relative";B.style.overflow="hidden";B.style.cursor="pointer";B.style.width="30px";B.style.height="30px";B.style.padding="1px";T.appendChild(B);null!=f&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(f,[k]):this.sidebar.graph.pasteCellStyles([k],Q.currentVertexStyle,Q.currentEdgeStyle);var z=k.geometry;Q.model.isEdge(k)&&(z=z.getTerminalPoint(!1),z=new mxRectangle(0,0,z.x,z.y));null!=z&&B.appendChild(this.sidebar.createVertexTemplateFromCells([k],+z.width,z.height,"",!0,!1,null,!1,mxUtils.bind(this,function(C){if(!mxEvent.isShiftDown(C)||null==g&&Q.isSelectionEmpty()){var I=Q.cloneCell(k);if(null!=m)m(I);else{var L=S([I]);Q.model.isEdge(I)?I.geometry.translate(L.x,L.y):(I.geometry.x=L.x,I.geometry.y=L.y);Q.model.beginUpdate();try{Q.addCell(I),Q.model.isVertex(I)&&Q.isAutoSizeCell(I)&&Q.updateCellSize(I)}finally{Q.model.endUpdate()}Q.setSelectionCell(I);Q.scrollCellToVisible(I);P&&Q.startEditing(I);null!=c.hoverIcons&&c.hoverIcons.update(Q.view.getState(I))}}else I=+Q.getEditableCells(null!=g?[g]:Q.getSelectionCells()),Q.updateShapes(k,I);null!=p&&p(C);mxEvent.consume(C)}),25,25,null,null,g))});for(F=0;F<(G?Math.min(A.length,4):A.length);F++)v(A[F]);A=T.offsetTop+T.clientHeight-(Q.container.scrollTop+Q.container.offsetHeight);0<A&&(T.style.top=Math.max(Q.container.scrollTop+22,e-A)+"px");A=T.offsetLeft+T.clientWidth-(Q.container.scrollLeft+Q.container.offsetWidth);0<A&&(T.style.left=Math.max(Q.container.scrollLeft+22,b-A)+"px")}return T};+EditorUi.prototype.getCellsForShapePicker=function(b,e,g){var m=this.editor.graph,v=mxUtils.bind(this,function(p,A,G,S){return m.createVertex(null,null,S||"",0,0,A||120,G||60,p,!1)});e=mxUtils.bind(this,function(p,A,G){p=new mxCell(G||"",new mxGeometry(0,0,m.defaultEdgeLength+20,0),p);p.geometry.setTerminalPoint(new mxPoint(0,0),!0);p.geometry.setTerminalPoint(new mxPoint(p.geometry.width,null!=A?A:0),!1);p.geometry.points=null!=A?[new mxPoint(p.geometry.width/2,A)]:[];p.geometry.relative=!0;p.edge=!0;return p});if(null!=b)try{b=m.cloneCell(b),m.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(p){b=null}null==b&&(b=v(m.appendFontSize("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;",m.vertexFontSize),40,20,"Text"),m.model.isVertex(b)&&m.isAutoSizeCell(b)&&Graph.createOffscreenGraph(m.getStylesheet()).updateCellSize(b));b=[b,v("whiteSpace=wrap;html=1;"),v("ellipse;whiteSpace=wrap;html=1;",80,80),v("rhombus;whiteSpace=wrap;html=1;",80,80),v("rounded=1;whiteSpace=wrap;html=1;"),v("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),v("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),v("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),v("triangle;whiteSpace=wrap;html=1;",60,80),v("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),v("shape=tape;whiteSpace=wrap;html=1;",120,100),v("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),v("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),v("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];g&&(b=b.concat([e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),@@ -2082,47 +2082,47 @@ b==mxConstants.ARROW_BLOCK_THIN?g="1"!=e?Format.blockThinMarkerImage.src:Format."box"==b?g=Format.boxMarkerImage.src:"halfCircle"==b?g=Format.halfCircleMarkerImage.src:"openAsync"==b?g=Format.openAsyncFilledMarkerImage.src:"async"==b?g="1"!=e?Format.asyncMarkerImage.src:Format.asyncFilledMarkerImage.src:"dash"==b?g=Format.dashMarkerImage.src:"baseDash"==b?g=Format.baseDashMarkerImage.src:"cross"==b?g=Format.crossMarkerImage.src:"circle"==b?g=Format.circleMarkerImage.src:"circlePlus"==b?g=Format.circlePlusMarkerImage.src:"ERone"==b?g=Format.EROneMarkerImage.src:"ERmandOne"==b?g=Format.ERmandOneMarkerImage.src:"ERmany"==b?g=Format.ERmanyMarkerImage.src:"ERoneToMany"==b?g=Format.ERoneToManyMarkerImage.src:"ERzeroToOne"==b?g=Format.ERzeroToOneMarkerImage.src:"ERzeroToMany"==b&&(g=Format.ERzeroToManyMarkerImage.src);return g};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,e=this.actions.get("paste"),g=this.actions.get("pasteHere");e.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(!mxClient.IS_FF&&null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));g.setEnabled(e.isEnabled())};-EditorUi.prototype.initClipboard=function(){var b=this,e=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var A=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{A=A||p.getSelectionCells();A=p.getExportableCells(p.model.getTopmostCells(A));for(var G={},T=p.createCellLookup(A),F=p.cloneCells(A,null,G),P=new mxGraphModel,Q=P.getChildAt(P.getRoot(),-0),U=0;U<F.length;U++){P.add(Q,F[U]);var c=p.view.getState(A[U]);if(null!=c){var f=p.getCellGeometry(F[U]);null!=f&&f.relative&&!P.isEdge(A[U])&&null==T[mxObjectIdentity.get(P.getParent(A[U]))]&&(f.offset=null,f.relative=!1,f.x=c.x/c.view.scale-c.view.translate.x,f.y=c.y/c.view.scale-c.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(G,T),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}b.updatePasteActionStates();return A};var g=mxClipboard.paste;mxClipboard.paste=function(p){var A=+EditorUi.prototype.initClipboard=function(){var b=this,e=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var A=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{A=A||p.getSelectionCells();A=p.getExportableCells(p.model.getTopmostCells(A));for(var G={},S=p.createCellLookup(A),F=p.cloneCells(A,null,G),P=new mxGraphModel,Q=P.getChildAt(P.getRoot(),+0),T=0;T<F.length;T++){P.add(Q,F[T]);var c=p.view.getState(A[T]);if(null!=c){var f=p.getCellGeometry(F[T]);null!=f&&f.relative&&!P.isEdge(A[T])&&null==S[mxObjectIdentity.get(P.getParent(A[T]))]&&(f.offset=null,f.relative=!1,f.x=c.x/c.view.scale-c.view.translate.x,f.y=c.y/c.view.scale-c.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(G,S),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}b.updatePasteActionStates();return A};var g=mxClipboard.paste;mxClipboard.paste=function(p){var A=null;p.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):A=g.apply(this,arguments);b.updatePasteActionStates();return A};var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(p,A){v.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;-EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var J=this.graph.getPageLayout(),W=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+J.x*W.width),this.scale*(this.translate.y+J.y*W.height),this.scale*J.width*W.width,-this.scale*J.height*W.height)};b.getPreferredPageSize=function(J,W,Y){J=this.getPageLayout();W=this.getPageSize();return new mxRectangle(0,0,J.width*W.width,J.height*W.height)};var e=null,g=this;if(this.editor.isChromelessView()){this.chromelessResize=e=mxUtils.bind(this,function(J,W,Y,ba){if(null!=b.container&&!b.isViewer()){Y=null!=Y?Y:0;ba=null!=ba?ba:0;var ja=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),oa=mxUtils.hasScrollbars(b.container),qa=b.view.translate,ra=b.view.scale,-xa=mxRectangle.fromRectangle(ja);xa.x=xa.x/ra-qa.x;xa.y=xa.y/ra-qa.y;xa.width/=ra;xa.height/=ra;qa=b.container.scrollTop;var Ba=b.container.scrollLeft,ya=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)ya+=3;var Da=b.container.offsetWidth-ya;ya=b.container.offsetHeight-ya;J=J?Math.max(.3,Math.min(W||1,Da/xa.width)):ra;W=(Da-J*xa.width)/2/J;var La=0==this.lightboxVerticalDivider?0:(ya-J*xa.height)/this.lightboxVerticalDivider/J;oa&&(W=Math.max(W,0),La=Math.max(La,-0));if(oa||ja.width<Da||ja.height<ya)b.view.scaleAndTranslate(J,Math.floor(W-xa.x),Math.floor(La-xa.y)),b.container.scrollTop=qa*J/ra,b.container.scrollLeft=Ba*J/ra;else if(0!=Y||0!=ba)ja=b.view.translate,b.view.setTranslate(Math.floor(ja.x+Y/ra),Math.floor(ja.y+ba/ra))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var m=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",m);this.destroyFunctions.push(function(){mxEvent.removeListener(window,-"resize",m)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(J){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(J){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position=+EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var K=this.graph.getPageLayout(),W=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+K.x*W.width),this.scale*(this.translate.y+K.y*W.height),this.scale*K.width*W.width,+this.scale*K.height*W.height)};b.getPreferredPageSize=function(K,W,Y){K=this.getPageLayout();W=this.getPageSize();return new mxRectangle(0,0,K.width*W.width,K.height*W.height)};var e=null,g=this;if(this.editor.isChromelessView()){this.chromelessResize=e=mxUtils.bind(this,function(K,W,Y,ca){if(null!=b.container&&!b.isViewer()){Y=null!=Y?Y:0;ca=null!=ca?ca:0;var ja=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),oa=mxUtils.hasScrollbars(b.container),qa=b.view.translate,ra=b.view.scale,+xa=mxRectangle.fromRectangle(ja);xa.x=xa.x/ra-qa.x;xa.y=xa.y/ra-qa.y;xa.width/=ra;xa.height/=ra;qa=b.container.scrollTop;var Ba=b.container.scrollLeft,ya=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)ya+=3;var Da=b.container.offsetWidth-ya;ya=b.container.offsetHeight-ya;K=K?Math.max(.3,Math.min(W||1,Da/xa.width)):ra;W=(Da-K*xa.width)/2/K;var La=0==this.lightboxVerticalDivider?0:(ya-K*xa.height)/this.lightboxVerticalDivider/K;oa&&(W=Math.max(W,0),La=Math.max(La,+0));if(oa||ja.width<Da||ja.height<ya)b.view.scaleAndTranslate(K,Math.floor(W-xa.x),Math.floor(La-xa.y)),b.container.scrollTop=qa*K/ra,b.container.scrollLeft=Ba*K/ra;else if(0!=Y||0!=ca)ja=b.view.translate,b.view.setTranslate(Math.floor(ja.x+Y/ra),Math.floor(ja.y+ca/ra))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var m=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",m);this.destroyFunctions.push(function(){mxEvent.removeListener(window,+"resize",m)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(K){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(K){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";mxClient.IS_IE||mxClient.IS_IE11?(this.chromelessToolbar.style.backgroundColor="#ffffff",this.chromelessToolbar.style.border="3px solid black"):this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,-"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var p=mxUtils.bind(this,function(){var J=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=J?parseInt(J["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var A=0;p=mxUtils.bind(this,function(J,W,Y){A++;-var ba=document.createElement("span");ba.style.paddingLeft="8px";ba.style.paddingRight="8px";ba.style.cursor="pointer";mxEvent.addListener(ba,"click",J);null!=Y&&ba.setAttribute("title",Y);J=document.createElement("img");J.setAttribute("border","0");J.setAttribute("src",W);J.style.width="36px";J.style.filter="invert(100%)";ba.appendChild(J);this.chromelessToolbar.appendChild(ba);return ba});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&p(mxUtils.bind(this,function(J){window.location.href=-G;mxEvent.consume(J)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var T=p(mxUtils.bind(this,function(J){this.actions.get("previousPage").funct();mxEvent.consume(J)}),Editor.previousImage,mxResources.get("previousPage")),F=document.createElement("div");F.style.fontFamily=Editor.defaultHtmlFont;F.style.display="inline-block";F.style.verticalAlign="top";F.style.fontWeight="bold";F.style.marginTop="8px";F.style.fontSize="14px";F.style.cursor="default";F.style.color=-mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(F);var P=p(mxUtils.bind(this,function(J){this.actions.get("nextPage").funct();mxEvent.consume(J)}),Editor.nextImage,mxResources.get("nextPage")),Q=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){F.innerText="";var J=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(F,J+1+" / "+this.pages.length);F.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());-T.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(J-1,this.pages.length)].getName());P.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(J+1,this.pages.length)].getName())}});T.style.paddingLeft="0px";T.style.paddingRight="4px";P.style.paddingLeft="4px";P.style.paddingRight="0px";var U=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(P.style.display="",T.style.display="",F.style.display="inline-block"):-(P.style.display="none",T.style.display="none",F.style.display="none");Q()});if(null!=this.menus){var c=this.menus.get("pages");null!=c&&mxEvent.addListener(F,"click",mxUtils.bind(this,function(J){var W=new mxPopupMenu(c.funct);W.div.className+=" geMenubarMenu";W.smartSeparators=!0;W.showDisabled=!0;W.autoExpand=!0;W.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(W,arguments);W.destroy()});var Y=mxUtils.getOffset(F);W.popup(Y.x,Y.y+F.offsetHeight,null,J);mxEvent.addListener(W.div,-"mouseleave",mxUtils.bind(this,function(){W.hideMenu()}))}))}this.editor.addListener("resetGraphView",U);this.editor.addListener("pageSelected",Q)}p(mxUtils.bind(this,function(J){this.actions.get("zoomOut").funct();mxEvent.consume(J)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(J){this.actions.get("zoomIn").funct();mxEvent.consume(J)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(J){b.isLightboxView()?-(1==b.view.scale?this.lightboxFit():b.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(J)}),Editor.zoomFitImage,mxResources.get("fit"));var f=null,k=null,B=mxUtils.bind(this,function(J){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);f=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);f=null;k=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";k=null}),-600)}),J||200)}),z=mxUtils.bind(this,function(J){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,J||30)});if("1"==urlParams.layers){this.layersDialog=null;var C=p(mxUtils.bind(this,function(J){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&+"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var p=mxUtils.bind(this,function(){var K=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=K?parseInt(K["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var A=0;p=mxUtils.bind(this,function(K,W,Y){A++;+var ca=document.createElement("span");ca.style.paddingLeft="8px";ca.style.paddingRight="8px";ca.style.cursor="pointer";mxEvent.addListener(ca,"click",K);null!=Y&&ca.setAttribute("title",Y);K=document.createElement("img");K.setAttribute("border","0");K.setAttribute("src",W);K.style.width="36px";K.style.filter="invert(100%)";ca.appendChild(K);this.chromelessToolbar.appendChild(ca);return ca});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&p(mxUtils.bind(this,function(K){window.location.href=+G;mxEvent.consume(K)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var S=p(mxUtils.bind(this,function(K){this.actions.get("previousPage").funct();mxEvent.consume(K)}),Editor.previousImage,mxResources.get("previousPage")),F=document.createElement("div");F.style.fontFamily=Editor.defaultHtmlFont;F.style.display="inline-block";F.style.verticalAlign="top";F.style.fontWeight="bold";F.style.marginTop="8px";F.style.fontSize="14px";F.style.cursor="default";F.style.color=+mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(F);var P=p(mxUtils.bind(this,function(K){this.actions.get("nextPage").funct();mxEvent.consume(K)}),Editor.nextImage,mxResources.get("nextPage")),Q=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){F.innerText="";var K=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(F,K+1+" / "+this.pages.length);F.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());+S.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(K-1,this.pages.length)].getName());P.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(K+1,this.pages.length)].getName())}});S.style.paddingLeft="0px";S.style.paddingRight="4px";P.style.paddingLeft="4px";P.style.paddingRight="0px";var T=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(P.style.display="",S.style.display="",F.style.display="inline-block"):+(P.style.display="none",S.style.display="none",F.style.display="none");Q()});if(null!=this.menus){var c=this.menus.get("pages");null!=c&&mxEvent.addListener(F,"click",mxUtils.bind(this,function(K){var W=new mxPopupMenu(c.funct);W.div.className+=" geMenubarMenu";W.smartSeparators=!0;W.showDisabled=!0;W.autoExpand=!0;W.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(W,arguments);W.destroy()});var Y=mxUtils.getOffset(F);W.popup(Y.x,Y.y+F.offsetHeight,null,K);mxEvent.addListener(W.div,+"mouseleave",mxUtils.bind(this,function(){W.hideMenu()}))}))}this.editor.addListener("resetGraphView",T);this.editor.addListener("pageSelected",Q)}p(mxUtils.bind(this,function(K){this.actions.get("zoomOut").funct();mxEvent.consume(K)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(K){this.actions.get("zoomIn").funct();mxEvent.consume(K)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(K){b.isLightboxView()?+(1==b.view.scale?this.lightboxFit():b.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(K)}),Editor.zoomFitImage,mxResources.get("fit"));var f=null,k=null,B=mxUtils.bind(this,function(K){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);f=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);f=null;k=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";k=null}),+600)}),K||200)}),z=mxUtils.bind(this,function(K){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,K||30)});if("1"==urlParams.layers){this.layersDialog=null;var C=p(mxUtils.bind(this,function(K){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&this.chromelessResize()}),!0);mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var W=C.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily=Editor.defaultHtmlFont;this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.left=W.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";mxClient.IS_IE||mxClient.IS_IE11?(this.layersDialog.style.backgroundColor="#ffffff",this.layersDialog.style.border="2px solid black",this.layersDialog.style.color="#000000"):(this.layersDialog.style.backgroundColor="#000000",this.layersDialog.style.color="#ffffff",mxUtils.setOpacity(this.layersDialog,80));W=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=-W.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(J)}),Editor.layersImage,mxResources.get("layers")),H=b.getModel();H.addListener(mxEvent.CHANGE,function(){C.style.display=1<H.getChildCount(H.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(J){null!=this.editor.editButtonFunc?-this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(J)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(U=0;U<this.lightboxToolbarActions.length;U++){var K=this.lightboxToolbarActions[U];K.elem=p(K.fn,K.icon,K.tooltip)}if(null!=v.refreshBtn){var M=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(J){null!=-M?window.location.href=M:window.location.reload();mxEvent.consume(J)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(J){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(J)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=-document.body))&&p(mxUtils.bind(this,function(J){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(J))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(J){mxEvent.isTouchEvent(J)||-(mxEvent.isShiftDown(J)||z(30),B())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(J){mxEvent.consume(J)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(J){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(J)?B():z(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(J){mxEvent.isShiftDown(J)?B():z(100);mxEvent.consume(J)}));mxEvent.addListener(this.chromelessToolbar,-"mouseleave",mxUtils.bind(this,function(J){mxEvent.isTouchEvent(J)||z(30)}));var O=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(J,W){this.startX=W.getGraphX();this.startY=W.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(J,W){},mouseUp:function(J,W){mxEvent.isTouchEvent(W.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<O&&Math.abs(this.scrollTop-b.container.scrollTop)<O&&-Math.abs(this.startX-W.getGraphX())<O&&Math.abs(this.startY-W.getGraphY())<O&&(0<parseFloat(g.chromelessToolbar.style.opacity||0)?B():z(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ea=b.view.validate,fa=new mxPoint,S=!1,ca=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=g.currentPage&&ca!=g.currentPage){ca=g.currentPage;S=!0;var J=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==-J&&(J=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));J=b.getPageLayout(J,fa,1);var W=b.getDefaultTranslate(J);this.x0=J.x;this.y0=J.y;if(W.x!=this.translate.x||W.y!=this.translate.y)this.invalidate(),this.translate.x=W.x,this.translate.y=W.y}W=b.getPagePadding();var Y=b.getPageSize();J=W.x-(this.x0||0)*Y.width;W=W.y-(this.y0||0)*Y.height;if(this.translate.x!=J||this.translate.y!=W)this.invalidate(),this.translate.x=J,this.translate.y=W}ea.apply(this,arguments)};-if(!b.isViewer()){var ma=b.sizeDidChange;b.sizeDidChange=function(){var J=S;S=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var W=this.getPageLayout(),Y=this.getDefaultTranslate(W),ba=this.view.translate.x,ja=this.view.translate.y;if(Y.x!=ba||Y.y!=ja){this.view.x0=W.x;this.view.y0=W.y;this.autoTranslate=!0;this.view.setTranslate(Y.x,Y.y);this.autoTranslate=!1;J||(this.container.scrollLeft+=Math.round((Y.x-ba)*this.view.scale),this.container.scrollTop+=-Math.round((Y.y-ja)*this.view.scale));return}}ma.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var la=b.view.getBackgroundPane(),Z=b.view.getDrawPane();b.cumulativeZoomFactor=1;var da=null,aa=null,l=null,t=null,I=null,V=function(J){null!=da&&window.clearTimeout(da);0<=J&&window.setTimeout(function(){if(!b.isMouseDown||t)da=window.setTimeout(mxUtils.bind(this,function(){b.isFastZoomEnabled()&&(null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&+W.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(K)}),Editor.layersImage,mxResources.get("layers")),I=b.getModel();I.addListener(mxEvent.CHANGE,function(){C.style.display=1<I.getChildCount(I.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(K){null!=this.editor.editButtonFunc?+this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(K)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(T=0;T<this.lightboxToolbarActions.length;T++){var L=this.lightboxToolbarActions[T];L.elem=p(L.fn,L.icon,L.tooltip)}if(null!=v.refreshBtn){var J=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(K){null!=+J?window.location.href=J:window.location.reload();mxEvent.consume(K)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(K){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(K)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=+document.body))&&p(mxUtils.bind(this,function(K){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(K))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(K){mxEvent.isTouchEvent(K)||+(mxEvent.isShiftDown(K)||z(30),B())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(K){mxEvent.consume(K)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(K){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(K)?B():z(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(K){mxEvent.isShiftDown(K)?B():z(100);mxEvent.consume(K)}));mxEvent.addListener(this.chromelessToolbar,+"mouseleave",mxUtils.bind(this,function(K){mxEvent.isTouchEvent(K)||z(30)}));var O=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(K,W){this.startX=W.getGraphX();this.startY=W.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(K,W){},mouseUp:function(K,W){mxEvent.isTouchEvent(W.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<O&&Math.abs(this.scrollTop-b.container.scrollTop)<O&&+Math.abs(this.startX-W.getGraphX())<O&&Math.abs(this.startY-W.getGraphY())<O&&(0<parseFloat(g.chromelessToolbar.style.opacity||0)?B():z(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var da=b.view.validate,fa=new mxPoint,V=!1,ba=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=g.currentPage&&ba!=g.currentPage){ba=g.currentPage;V=!0;var K=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==+K&&(K=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));K=b.getPageLayout(K,fa,1);var W=b.getDefaultTranslate(K);this.x0=K.x;this.y0=K.y;if(W.x!=this.translate.x||W.y!=this.translate.y)this.invalidate(),this.translate.x=W.x,this.translate.y=W.y}W=b.getPagePadding();var Y=b.getPageSize();K=W.x-(this.x0||0)*Y.width;W=W.y-(this.y0||0)*Y.height;if(this.translate.x!=K||this.translate.y!=W)this.invalidate(),this.translate.x=K,this.translate.y=W}da.apply(this,arguments)};+if(!b.isViewer()){var ma=b.sizeDidChange;b.sizeDidChange=function(){var K=V;V=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var W=this.getPageLayout(),Y=this.getDefaultTranslate(W),ca=this.view.translate.x,ja=this.view.translate.y;if(Y.x!=ca||Y.y!=ja){this.view.x0=W.x;this.view.y0=W.y;this.autoTranslate=!0;this.view.setTranslate(Y.x,Y.y);this.autoTranslate=!1;K||(this.container.scrollLeft+=Math.round((Y.x-ca)*this.view.scale),this.container.scrollTop+=+Math.round((Y.y-ja)*this.view.scale));return}}ma.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var la=b.view.getBackgroundPane(),Z=b.view.getDrawPane();b.cumulativeZoomFactor=1;var ea=null,aa=null,l=null,t=null,H=null,U=function(K){null!=ea&&window.clearTimeout(ea);0<=K&&window.setTimeout(function(){if(!b.isMouseDown||t)ea=window.setTimeout(mxUtils.bind(this,function(){b.isFastZoomEnabled()&&(null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform",null)),Z.style.transformOrigin="",la.style.transformOrigin="",mxClient.IS_SF?(Z.style.transform="scale(1)",la.style.transform="scale(1)",window.setTimeout(function(){Z.style.transform="";la.style.transform=""},0)):(Z.style.transform="",la.style.transform=""),b.view.getDecoratorPane().style.opacity="",b.view.getOverlayPane().style.opacity=-"");var W=new mxPoint(b.container.scrollLeft,b.container.scrollTop),Y=mxUtils.getOffset(b.container),ba=b.view.scale,ja=0,oa=0;null!=aa&&(ja=b.container.offsetWidth/2-aa.x+Y.x,oa=b.container.offsetHeight/2-aa.y+Y.y);b.zoom(b.cumulativeZoomFactor,null,b.isFastZoomEnabled()?20:null);b.view.scale!=ba&&(null!=l&&(ja+=W.x-l.x,oa+=W.y-l.y),null!=e&&g.chromelessResize(!1,null,ja*(b.cumulativeZoomFactor-1),oa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==ja&&0==oa||(b.container.scrollLeft-=-ja*(b.cumulativeZoomFactor-1),b.container.scrollTop-=oa*(b.cumulativeZoomFactor-1)));null!=I&&Z.setAttribute("filter",I);b.cumulativeZoomFactor=1;I=t=aa=l=da=null}),null!=J?J:b.isFastZoomEnabled()?g.wheelZoomDelay:g.lazyZoomDelay)},0)};b.lazyZoom=function(J,W,Y,ba){ba=null!=ba?ba:this.zoomFactor;(W=W||!b.scrollbars)&&(aa=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/2));J?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=-(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ba,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=ba,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,-160))/this.view.scale;if(b.isFastZoomEnabled()){null==I&&""!=Z.getAttribute("filter")&&(I=Z.getAttribute("filter"),Z.removeAttribute("filter"));l=new mxPoint(b.container.scrollLeft,b.container.scrollTop);J=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/(20*this.view.scale);ba=W||null==aa?b.container.scrollLeft+b.container.clientWidth/2:aa.x+b.container.scrollLeft-b.container.offsetLeft;var ja=W||null==aa?b.container.scrollTop+b.container.clientHeight/2:aa.y+b.container.scrollTop--b.container.offsetTop;Z.style.transformOrigin=ba+"px "+ja+"px";Z.style.transform="scale("+J+")";la.style.transformOrigin=ba+"px "+ja+"px";la.style.transform="scale("+J+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ba=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ba.style,"transform-origin",(W||null==aa?b.container.clientWidth/2+b.container.scrollLeft-ba.offsetLeft+"px":aa.x+b.container.scrollLeft-ba.offsetLeft-b.container.offsetLeft+"px")+" "+(W||null==aa?-b.container.clientHeight/2+b.container.scrollTop-ba.offsetTop+"px":aa.y+b.container.scrollTop-ba.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ba.style,"transform","scale("+J+")")):b.view.validateBackgroundStyles(J,ba,ja);b.view.getDecoratorPane().style.opacity="0";b.view.getOverlayPane().style.opacity="0";null!=g.hoverIcons&&g.hoverIcons.reset();b.fireEvent(new mxEventObject("zoomPreview","factor",J))}V(b.isFastZoomEnabled()?Y:0)};mxEvent.addGestureListeners(b.container,function(J){null!=-da&&window.clearTimeout(da)},null,function(J){1!=b.cumulativeZoomFactor&&V(0)});mxEvent.addListener(b.container,"scroll",function(J){null==da||b.isMouseDown||1==b.cumulativeZoomFactor||V(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(J,W,Y,ba,ja){b.fireEvent(new mxEventObject("wheel"));if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!Y&&b.isScrollWheelEvent(J))Y=b.view.getTranslate(),ba=40/b.view.scale,mxEvent.isShiftDown(J)?b.view.setTranslate(Y.x+(W?-ba:ba),Y.y):b.view.setTranslate(Y.x,-Y.y+(W?ba:-ba));else if(Y||b.isZoomWheelEvent(J))for(var oa=mxEvent.getSource(J);null!=oa;){if(oa==b.container)return b.tooltipHandler.hideTooltip(),aa=null!=ba&&null!=ja?new mxPoint(ba,ja):new mxPoint(mxEvent.getClientX(J),mxEvent.getClientY(J)),t=Y,Y=b.zoomFactor,ba=null,J.ctrlKey&&null!=J.deltaY&&40>Math.abs(J.deltaY)&&Math.round(J.deltaY)!=J.deltaY?Y=1+Math.abs(J.deltaY)/20*(Y-1):null!=J.movementY&&"pointermove"==J.type&&(Y=1+Math.max(1,Math.abs(J.movementY))/20*(Y-1),ba=-1),b.lazyZoom(W,null,-ba,Y),mxEvent.consume(J),!1;oa=oa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(J){b.cumulativeZoomFactor=J.scale;b.lazyZoom(0<J.scale,!0);mxEvent.consume(J)}};EditorUi.prototype.addChromelessToolbarItems=function(b){b(mxUtils.bind(this,function(e){this.actions.get("print").funct();mxEvent.consume(e)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};+"");var W=new mxPoint(b.container.scrollLeft,b.container.scrollTop),Y=mxUtils.getOffset(b.container),ca=b.view.scale,ja=0,oa=0;null!=aa&&(ja=b.container.offsetWidth/2-aa.x+Y.x,oa=b.container.offsetHeight/2-aa.y+Y.y);b.zoom(b.cumulativeZoomFactor,null,b.isFastZoomEnabled()?20:null);b.view.scale!=ca&&(null!=l&&(ja+=W.x-l.x,oa+=W.y-l.y),null!=e&&g.chromelessResize(!1,null,ja*(b.cumulativeZoomFactor-1),oa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==ja&&0==oa||(b.container.scrollLeft-=+ja*(b.cumulativeZoomFactor-1),b.container.scrollTop-=oa*(b.cumulativeZoomFactor-1)));null!=H&&Z.setAttribute("filter",H);b.cumulativeZoomFactor=1;H=t=aa=l=ea=null}),null!=K?K:b.isFastZoomEnabled()?g.wheelZoomDelay:g.lazyZoomDelay)},0)};b.lazyZoom=function(K,W,Y,ca){ca=null!=ca?ca:this.zoomFactor;(W=W||!b.scrollbars)&&(aa=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/2));K?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=+(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ca,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=ca,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,+160))/this.view.scale;if(b.isFastZoomEnabled()){null==H&&""!=Z.getAttribute("filter")&&(H=Z.getAttribute("filter"),Z.removeAttribute("filter"));l=new mxPoint(b.container.scrollLeft,b.container.scrollTop);K=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/(20*this.view.scale);ca=W||null==aa?b.container.scrollLeft+b.container.clientWidth/2:aa.x+b.container.scrollLeft-b.container.offsetLeft;var ja=W||null==aa?b.container.scrollTop+b.container.clientHeight/2:aa.y+b.container.scrollTop-+b.container.offsetTop;Z.style.transformOrigin=ca+"px "+ja+"px";Z.style.transform="scale("+K+")";la.style.transformOrigin=ca+"px "+ja+"px";la.style.transform="scale("+K+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ca=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ca.style,"transform-origin",(W||null==aa?b.container.clientWidth/2+b.container.scrollLeft-ca.offsetLeft+"px":aa.x+b.container.scrollLeft-ca.offsetLeft-b.container.offsetLeft+"px")+" "+(W||null==aa?+b.container.clientHeight/2+b.container.scrollTop-ca.offsetTop+"px":aa.y+b.container.scrollTop-ca.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ca.style,"transform","scale("+K+")")):b.view.validateBackgroundStyles(K,ca,ja);b.view.getDecoratorPane().style.opacity="0";b.view.getOverlayPane().style.opacity="0";null!=g.hoverIcons&&g.hoverIcons.reset();b.fireEvent(new mxEventObject("zoomPreview","factor",K))}U(b.isFastZoomEnabled()?Y:0)};mxEvent.addGestureListeners(b.container,function(K){null!=+ea&&window.clearTimeout(ea)},null,function(K){1!=b.cumulativeZoomFactor&&U(0)});mxEvent.addListener(b.container,"scroll",function(K){null==ea||b.isMouseDown||1==b.cumulativeZoomFactor||U(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(K,W,Y,ca,ja){b.fireEvent(new mxEventObject("wheel"));if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!Y&&b.isScrollWheelEvent(K))Y=b.view.getTranslate(),ca=40/b.view.scale,mxEvent.isShiftDown(K)?b.view.setTranslate(Y.x+(W?-ca:ca),Y.y):b.view.setTranslate(Y.x,+Y.y+(W?ca:-ca));else if(Y||b.isZoomWheelEvent(K))for(var oa=mxEvent.getSource(K);null!=oa;){if(oa==b.container)return b.tooltipHandler.hideTooltip(),aa=null!=ca&&null!=ja?new mxPoint(ca,ja):new mxPoint(mxEvent.getClientX(K),mxEvent.getClientY(K)),t=Y,Y=b.zoomFactor,ca=null,K.ctrlKey&&null!=K.deltaY&&40>Math.abs(K.deltaY)&&Math.round(K.deltaY)!=K.deltaY?Y=1+Math.abs(K.deltaY)/20*(Y-1):null!=K.movementY&&"pointermove"==K.type&&(Y=1+Math.max(1,Math.abs(K.movementY))/20*(Y-1),ca=-1),b.lazyZoom(W,null,+ca,Y),mxEvent.consume(K),!1;oa=oa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(K){b.cumulativeZoomFactor=K.scale;b.lazyZoom(0<K.scale,!0);mxEvent.consume(K)}};EditorUi.prototype.addChromelessToolbarItems=function(b){b(mxUtils.bind(this,function(e){this.actions.get("print").funct();mxEvent.consume(e)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};EditorUi.prototype.createTemporaryGraph=function(b){return Graph.createOffscreenGraph(b)};EditorUi.prototype.addChromelessClickHandler=function(){var b=urlParams.highlight;null!=b&&0<b.length&&(b="#"+b);this.editor.graph.addClickHandler(b)};EditorUi.prototype.toggleFormatPanel=function(b){b=null!=b?b:0==this.formatWidth;null!=this.format&&(this.formatWidth=b?240:0,this.formatContainer.style.width=this.formatWidth+"px",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged")))};EditorUi.prototype.isFormatPanelVisible=function(){return 0<this.formatWidth};EditorUi.prototype.lightboxFit=function(b){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var e=urlParams.border,g=60;null!=e&&(g=parseInt(e));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(g,null,null,null,null,null,b);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var b=this.editor.graph.getModel();return 1==b.getChildCount(b.root)&&0==b.getChildCount(b.getChildAt(b.root,0))};EditorUi.prototype.isSelectionAllowed=function(b){return"SELECT"==mxEvent.getSource(b).nodeName||"INPUT"==mxEvent.getSource(b).nodeName&&mxUtils.isAncestorNode(this.formatContainer,mxEvent.getSource(b))};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})};@@ -2143,7 +2143,7 @@ e.scrollTop=Math.floor(Math.max(0,g.y-Math.max(20,(e.clientHeight-m)/4)))}else{gEditorUi.prototype.setPageVisible=function(b){var e=this.editor.graph,g=mxUtils.hasScrollbars(e.container),m=0,v=0;g&&(m=e.view.translate.x*e.view.scale-e.container.scrollLeft,v=e.view.translate.y*e.view.scale-e.container.scrollTop);e.pageVisible=b;e.pageBreaksVisible=b;e.preferPageSize=b;e.view.validateBackground();if(g){var p=e.getSelectionCells();e.clearSelection();e.setSelectionCells(p)}e.sizeDidChange();g&&(e.container.scrollLeft=e.view.translate.x*e.view.scale-m,e.container.scrollTop=e.view.translate.y*e.view.scale-v);e.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};EditorUi.prototype.installResizeHandler=function(b,e,g){e&&(b.window.setSize=function(v,p){if(!this.minimized){var A=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;v=Math.min(v,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.getX());p=Math.min(p,A-this.getY())}mxWindow.prototype.setSize.apply(this,arguments)});b.window.setLocation=function(v,p){var A=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,-G=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,T=parseInt(this.div.style.width),F=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,A-T));p=Math.max(0,Math.min(p,G-F));this.getX()==v&&this.getY()==p||mxWindow.prototype.setLocation.apply(this,arguments);e&&!this.minimized&&this.setSize(T,F)};var m=mxUtils.bind(this,function(){var v=b.window.getX(),p=b.window.getY();b.window.setLocation(v,p)});mxEvent.addListener(window,"resize",m);b.destroy=function(){mxEvent.removeListener(window,+G=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,S=parseInt(this.div.style.width),F=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,A-S));p=Math.max(0,Math.min(p,G-F));this.getX()==v&&this.getY()==p||mxWindow.prototype.setLocation.apply(this,arguments);e&&!this.minimized&&this.setSize(S,F)};var m=mxUtils.bind(this,function(){var v=b.window.getX(),p=b.window.getY();b.window.setLocation(v,p)});mxEvent.addListener(window,"resize",m);b.destroy=function(){mxEvent.removeListener(window,"resize",m);b.window.destroy();null!=g&&g()}};function ChangeGridColor(b,e){this.ui=b;this.color=e}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);mxCodecRegistry.register(b)})();function ChangePageSetup(b,e,g,m,v){this.ui=b;this.previousColor=this.color=e;this.previousImage=this.image=g;this.previousFormat=this.format=m;this.previousPageScale=this.pageScale=v;this.ignoreImage=this.ignoreColor=!1}ChangePageSetup.prototype.execute=function(){var b=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var e=b.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=e}if(!this.ignoreImage){this.image=this.previousImage;e=b.backgroundImage;var g=this.previousImage;null!=g&&Graph.isPageLink(g.src)&&(g=this.ui.createImageForPageLink(g.src,this.ui.currentPage));this.ui.setBackgroundImage(g);this.previousImage=e}null!=this.previousFormat&&(this.format=this.previousFormat,@@ -2179,22 +2179,22 @@ EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=Grap"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(g,100);mxUtils.setPrefixedStyle(g.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(g.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(g.style,"transform","scaleX(0)");mxUtils.setOpacity(g,0);window.setTimeout(mxUtils.bind(this,function(){null!=g.parentNode&&g.parentNode.removeChild(g)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(b[e])};EditorUi.prototype.createStatusDiv=function(b){var e=document.createElement("div");e.style.textOverflow="ellipsis";e.style.display="inline-block";e.style.whiteSpace="nowrap";e.style.overflow="hidden";e.style.minWidth="0";e.setAttribute("title",b);e.innerHTML=Graph.sanitizeHtml(b);return e};EditorUi.prototype.createToolbar=function(b){return new Toolbar(this,b)};EditorUi.prototype.createSidebar=function(b){return new Sidebar(this,b)};EditorUi.prototype.createFormat=function(b){return new Format(this,b)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};EditorUi.prototype.createDiv=function(b){var e=document.createElement("div");e.className=b;return e};-EditorUi.prototype.addSplitHandler=function(b,e,g,m){function v(Q){if(null!=A){var U=new mxPoint(mxEvent.getClientX(Q),mxEvent.getClientY(Q));m(Math.max(0,G+(e?U.x-A.x:A.y-U.y)-g));mxEvent.consume(Q);G!=P()&&(T=!0,F=null)}}function p(Q){v(Q);A=G=null}var A=null,G=null,T=!0,F=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var P=mxUtils.bind(this,function(){var Q=parseInt(e?b.style.left:b.style.bottom);e||(Q=Q+g-this.footerHeight);return Q});mxEvent.addGestureListeners(b,function(Q){A=new mxPoint(mxEvent.getClientX(Q),-mxEvent.getClientY(Q));G=P();T=!1;mxEvent.consume(Q)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(Q){if(!T&&this.hsplitClickEnabled){var U=null!=F?F-g:0;F=P();m(U);mxEvent.consume(Q)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};+EditorUi.prototype.addSplitHandler=function(b,e,g,m){function v(Q){if(null!=A){var T=new mxPoint(mxEvent.getClientX(Q),mxEvent.getClientY(Q));m(Math.max(0,G+(e?T.x-A.x:A.y-T.y)-g));mxEvent.consume(Q);G!=P()&&(S=!0,F=null)}}function p(Q){v(Q);A=G=null}var A=null,G=null,S=!0,F=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var P=mxUtils.bind(this,function(){var Q=parseInt(e?b.style.left:b.style.bottom);e||(Q=Q+g-this.footerHeight);return Q});mxEvent.addGestureListeners(b,function(Q){A=new mxPoint(mxEvent.getClientX(Q),+mxEvent.getClientY(Q));G=P();S=!1;mxEvent.consume(Q)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(Q){if(!S&&this.hsplitClickEnabled){var T=null!=F?F-g:0;F=P();m(T);mxEvent.consume(Q)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};EditorUi.prototype.prompt=function(b,e,g){b=new FilenameDialog(this,e,mxResources.get("apply"),function(m){g(parseFloat(m))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};EditorUi.prototype.handleError=function(b,e,g,m,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=e){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var p=mxResources.get("ok");e=null!=e?e:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(e,v,p,g,null,null,null,null,null,null,null,null,m?g:null)}else null!=g&&g()};-EditorUi.prototype.showError=function(b,e,g,m,v,p,A,G,T,F,P,Q,U){b=new ErrorDialog(this,b,e,g||mxResources.get("ok"),m,v,p,A,Q,G,T);e=Math.ceil(null!=e?e.length/50:1);this.showDialog(b.container,F||340,P||100+20*e,!0,!1,U);b.init()};EditorUi.prototype.showDialog=function(b,e,g,m,v,p,A,G,T,F){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,e,g,m,v,p,A,G,T,F);this.dialogs.push(this.dialog)};+EditorUi.prototype.showError=function(b,e,g,m,v,p,A,G,S,F,P,Q,T){b=new ErrorDialog(this,b,e,g||mxResources.get("ok"),m,v,p,A,Q,G,S);e=Math.ceil(null!=e?e.length/50:1);this.showDialog(b.container,F||340,P||100+20*e,!0,!1,T);b.init()};EditorUi.prototype.showDialog=function(b,e,g,m,v,p,A,G,S,F){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,e,g,m,v,p,A,G,S,F);this.dialogs.push(this.dialog)};EditorUi.prototype.hideDialog=function(b,e,g){var m=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var v=this.dialogs.length-1;0<=v;v--)if(!this.dialogs[v].closing){m=this.dialogs[v];break}null==m||null!=g&&g!=this.dialog.container.firstChild||(m.closing=!0,0==m.close(b,e)?delete m.closing:(delete m.closing,b=mxUtils.lastIndexOf(this.dialogs,m),0<=b&&this.dialogs.splice(b,1),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog","dialog",m)),null==this.dialog&&null!=this.editor.graph.container&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){null==this.editor||null!=this.dialogs&&0!=this.dialogs.length||(this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?this.editor.graph.cellEditor.textarea.focus():(mxUtils.clearSelection(),this.editor.graph.container.focus()))}),0)))};EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var e=b.getSelectionCells(),g=new mxDictionary,m=[],v=0;v<e.length;v++){var p=b.isTableCell(e[v])?b.model.getParent(e[v]):e[v];null==p||g.get(p)||(g.put(p,!0),m.push(p))}b.setSelectionCells(b.duplicateCells(m,!1))}catch(A){this.handleError(A)}};-EditorUi.prototype.pickColor=function(b,e,g,m,v){var p=this.editor.graph,A=p.cellEditor.saveSelection(),G=(v?240:290)+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,b,function(T){p.cellEditor.restoreSelection(A);e(T)},function(){p.cellEditor.restoreSelection(A)},g,m,v);this.showDialog(b.container,230,G,!0,!1);b.init()};+EditorUi.prototype.pickColor=function(b,e,g,m,v){var p=this.editor.graph,A=p.cellEditor.saveSelection(),G=(v?240:290)+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,b,function(S){p.cellEditor.restoreSelection(A);e(S)},function(){p.cellEditor.restoreSelection(A)},g,m,v);this.showDialog(b.container,230,G,!0,!1);b.init()};EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};-EditorUi.prototype.base64ToBlob=function(b,e){e=e||"";b=atob(b);for(var g=b.length,m=Math.ceil(g/1024),v=Array(m),p=0;p<m;++p){for(var A=1024*p,G=Math.min(A+1024,g),T=Array(G-A),F=0;A<G;++F,++A)T[F]=b[A].charCodeAt(0);v[p]=new Uint8Array(T)}return new Blob(v,{type:e})};+EditorUi.prototype.base64ToBlob=function(b,e){e=e||"";b=atob(b);for(var g=b.length,m=Math.ceil(g/1024),v=Array(m),p=0;p<m;++p){for(var A=1024*p,G=Math.min(A+1024,g),S=Array(G-A),F=0;A<G;++F,++A)S[F]=b[A].charCodeAt(0);v[p]=new Uint8Array(S)}return new Blob(v,{type:e})};EditorUi.prototype.writeImageToClipboard=function(b,e,g,m){var v=this.base64ToBlob(b.substring(b.indexOf(",")+1),"image/png");b=new ClipboardItem({"image/png":v,"text/html":new Blob(['<img src="'+b+'" width="'+e+'" height="'+g+'">'],{type:"text/html"})});navigator.clipboard.write([b])["catch"](m)};EditorUi.prototype.writeHtmlToClipboard=function(b,e){b=new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(b)],{type:"text/plain"}),"text/html":new Blob([b],{type:"text/html"})});navigator.clipboard.write([b])["catch"](e)};EditorUi.prototype.writeTextToClipboard=function(b,e){navigator.clipboard.writeText(b)["catch"](e)};EditorUi.prototype.extractGraphModelFromHtml=function(b){var e=null;try{var g=b.indexOf("<mxGraphModel ");if(0<=g){var m=b.lastIndexOf("</mxGraphModel>");m>g&&(e=b.substring(g,m+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(v){}return e};EditorUi.prototype.readGraphModelFromClipboard=function(b){this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(e){null!=e?b(e):this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(g){if(null!=g){var m=decodeURIComponent(g);this.isCompatibleString(m)&&(g=m)}b(g)}),"text")}),"html")};EditorUi.prototype.readGraphModelFromClipboardWithType=function(b,e){navigator.clipboard.read().then(mxUtils.bind(this,function(g){if(null!=g&&0<g.length&&"html"==e&&0<=mxUtils.indexOf(g[0].types,"text/html"))g[0].getType("text/html").then(mxUtils.bind(this,function(m){m.text().then(mxUtils.bind(this,function(v){try{var p=this.parseHtmlData(v),A="text/plain"!=p.getAttribute("data-type")?p.innerHTML:mxUtils.trim(null==p.innerText?mxUtils.getTextContent(p):p.innerText);try{var G=A.lastIndexOf("%3E");-0<=G&&G<A.length-3&&(A=A.substring(0,G+3))}catch(P){}try{var T=p.getElementsByTagName("span"),F=null!=T&&0<T.length?mxUtils.trim(decodeURIComponent(T[0].textContent)):decodeURIComponent(A);this.isCompatibleString(F)&&(A=F)}catch(P){}}catch(P){}b(this.isCompatibleString(A)?A:null)}))["catch"](function(v){b(null)})}))["catch"](function(m){b(null)});else if(null!=g&&0<g.length&&"text"==e&&0<=mxUtils.indexOf(g[0].types,"text/plain"))g[0].getType("text/plain").then(function(m){m.text().then(function(v){b(v)})["catch"](function(){b(null)})})["catch"](function(){b(null)});+0<=G&&G<A.length-3&&(A=A.substring(0,G+3))}catch(P){}try{var S=p.getElementsByTagName("span"),F=null!=S&&0<S.length?mxUtils.trim(decodeURIComponent(S[0].textContent)):decodeURIComponent(A);this.isCompatibleString(F)&&(A=F)}catch(P){}}catch(P){}b(this.isCompatibleString(A)?A:null)}))["catch"](function(v){b(null)})}))["catch"](function(m){b(null)});else if(null!=g&&0<g.length&&"text"==e&&0<=mxUtils.indexOf(g[0].types,"text/plain"))g[0].getType("text/plain").then(function(m){m.text().then(function(v){b(v)})["catch"](function(){b(null)})})["catch"](function(){b(null)});else b(null)}))["catch"](function(g){b(null)})};EditorUi.prototype.parseHtmlData=function(b){var e=null;if(null!=b&&0<b.length){var g="<meta "==b.substring(0,6);e=document.createElement("div");e.innerHTML=(g?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(b);asHtml=!0;b=e.getElementsByTagName("style");if(null!=b)for(;0<b.length;)b[0].parentNode.removeChild(b[0]);null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=e.firstChild.nextSibling&&e.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==e.firstChild.nodeName&&"A"==e.firstChild.nextSibling.nodeName&&null==e.firstChild.nextSibling.nextSibling&&(b=null==e.firstChild.nextSibling.innerText?mxUtils.getTextContent(e.firstChild.nextSibling):e.firstChild.nextSibling.innerText,b==e.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(e,b),asHtml=!1));g=g&&null!=e.firstChild?e.firstChild.nextSibling:e.firstChild;null!=g&&null==g.nextSibling&&g.nodeType==mxConstants.NODETYPE_ELEMENT&&"IMG"==g.nodeName?(b=g.getAttribute("src"),null!=b&&(Editor.isPngDataUrl(b)&&@@ -2210,14 +2210,14 @@ EditorUi.prototype.showDataDialog=function(b){null!=b&&"undefined"!==typeof windEditorUi.prototype.showBackgroundImageDialog=function(b,e){b=null!=b?b:mxUtils.bind(this,function(m){m=new ChangePageSetup(this,null,m);m.ignoreColor=!0;this.editor.graph.model.execute(m)});var g=mxUtils.prompt(mxResources.get("backgroundImage"),null!=e?e.src:"");null!=g&&0<g.length?(e=new Image,e.onload=function(){b(new mxImage(g,e.width,e.height),!1)},e.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},e.src=g):b(null)};EditorUi.prototype.setBackgroundImage=function(b){this.editor.graph.setBackgroundImage(b);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(b,e,g){mxUtils.confirm(b)?null!=e&&e():null!=g&&g()};EditorUi.prototype.createOutline=function(b){var e=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){e.update(!1)});return e};EditorUi.prototype.altShiftActions={65:"connectionArrows",82:"clearWaypoints",76:"editLink",79:"connectionPoints",81:"editConnectionPoints",84:"editTooltip",86:"pasteSize",70:"copySize",66:"copyData",69:"pasteData"};EditorUi.prototype.ctrlAltShiftActions={70:"bringForward",66:"sendBackward"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};-EditorUi.prototype.createKeyHandler=function(b){function e(Q,U,c){if(!m.isSelectionEmpty()&&m.isEnabled()){U=null!=U?U:1;var f=m.getCompositeParents(m.getSelectionCells()),k=0<f.length?f[0]:null;if(null!=k)if(c){m.getModel().beginUpdate();try{for(k=0;k<f.length;k++)if(m.getModel().isVertex(f[k])&&m.isCellResizable(f[k])){var B=m.getCellGeometry(f[k]);null!=B&&(B=B.clone(),37==Q?B.width=Math.max(0,B.width-U):38==Q?B.height=Math.max(0,B.height-U):39==Q?B.width+=U:40==Q&&(B.height+=U),m.getModel().setGeometry(f[k],-B))}}finally{m.getModel().endUpdate()}}else{B=m.model.getParent(k);var z=m.getView().scale;c=null;1==m.getSelectionCount()&&m.model.isVertex(k)&&null!=m.layoutManager&&!m.isCellLocked(k)&&(c=m.layoutManager.getLayout(B));if(null!=c&&c.constructor==mxStackLayout)U=B.getIndex(k),37==Q||38==Q?m.model.add(B,k,Math.max(0,U-1)):(39==Q||40==Q)&&m.model.add(B,k,Math.min(m.model.getChildCount(B),U+1));else{var C=m.graphHandler;null!=C&&(null==C.first&&C.start(k,0,0,m.getMovableCells(f)),null!=C.first&&(k=-f=0,37==Q?f=-U:38==Q?k=-U:39==Q?f=U:40==Q&&(k=U),C.currentDx+=f*z,C.currentDy+=k*z,C.checkPreview(),C.updatePreview()),null!=A&&window.clearTimeout(A),A=window.setTimeout(function(){if(null!=C.first){var H=C.roundLength(C.currentDx/z),K=C.roundLength(C.currentDy/z);C.moveCells(C.cells,H,K);C.reset()}},400))}}}}var g=this,m=this.editor.graph,v=new mxKeyHandler(m),p=v.isEventIgnored;v.isEventIgnored=function(Q){return!(mxEvent.isShiftDown(Q)&&9==Q.keyCode)&&(!this.isControlDown(Q)||mxEvent.isShiftDown(Q)||+EditorUi.prototype.createKeyHandler=function(b){function e(Q,T,c){if(!m.isSelectionEmpty()&&m.isEnabled()){T=null!=T?T:1;var f=m.getCompositeParents(m.getSelectionCells()),k=0<f.length?f[0]:null;if(null!=k)if(c){m.getModel().beginUpdate();try{for(k=0;k<f.length;k++)if(m.getModel().isVertex(f[k])&&m.isCellResizable(f[k])){var B=m.getCellGeometry(f[k]);null!=B&&(B=B.clone(),37==Q?B.width=Math.max(0,B.width-T):38==Q?B.height=Math.max(0,B.height-T):39==Q?B.width+=T:40==Q&&(B.height+=T),m.getModel().setGeometry(f[k],+B))}}finally{m.getModel().endUpdate()}}else{B=m.model.getParent(k);var z=m.getView().scale;c=null;1==m.getSelectionCount()&&m.model.isVertex(k)&&null!=m.layoutManager&&!m.isCellLocked(k)&&(c=m.layoutManager.getLayout(B));if(null!=c&&c.constructor==mxStackLayout)T=B.getIndex(k),37==Q||38==Q?m.model.add(B,k,Math.max(0,T-1)):(39==Q||40==Q)&&m.model.add(B,k,Math.min(m.model.getChildCount(B),T+1));else{var C=m.graphHandler;null!=C&&(null==C.first&&C.start(k,0,0,m.getMovableCells(f)),null!=C.first&&(k=+f=0,37==Q?f=-T:38==Q?k=-T:39==Q?f=T:40==Q&&(k=T),C.currentDx+=f*z,C.currentDy+=k*z,C.checkPreview(),C.updatePreview()),null!=A&&window.clearTimeout(A),A=window.setTimeout(function(){if(null!=C.first){var I=C.roundLength(C.currentDx/z),L=C.roundLength(C.currentDy/z);C.moveCells(C.cells,I,L);C.reset()}},400))}}}}var g=this,m=this.editor.graph,v=new mxKeyHandler(m),p=v.isEventIgnored;v.isEventIgnored=function(Q){return!(mxEvent.isShiftDown(Q)&&9==Q.keyCode)&&(!this.isControlDown(Q)||mxEvent.isShiftDown(Q)||90!=Q.keyCode&&89!=Q.keyCode&&188!=Q.keyCode&&190!=Q.keyCode&&85!=Q.keyCode)&&(66!=Q.keyCode&&73!=Q.keyCode||!this.isControlDown(Q)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=Q.keyCode&&107!=Q.keyCode||!this.isControlDown(Q)&&!mxEvent.isShiftDown(Q)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&p.apply(this,arguments)};v.isEnabledForEvent=function(Q){return!mxEvent.isConsumed(Q)&&this.isGraphEvent(Q)&&this.isEnabled()&&(null==-g.dialogs||0==g.dialogs.length)};v.isControlDown=function(Q){return mxEvent.isControlDown(Q)||mxClient.IS_MAC&&Q.metaKey};var A=null,G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},T=v.getFunction;mxKeyHandler.prototype.getFunction=function(Q){if(m.isEnabled()){var U=null;mxEvent.isShiftDown(Q)&&this.isControlDown(Q)&&mxEvent.isAltDown(Q)?U=g.actions.get(g.ctrlAltShiftActions[Q.keyCode]):mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)?-U=g.actions.get(g.altShiftActions[Q.keyCode]):this.isControlDown(Q)&&mxEvent.isAltDown(Q)&&(U=g.actions.get(g.ctrlAltActions[Q.keyCode]));if(null!=U)return U.funct;if(null!=G[Q.keyCode]&&!m.isSelectionEmpty())if(!this.isControlDown(Q)&&mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)){if(m.model.isVertex(m.getSelectionCell()))return function(){var c=m.connectVertex(m.getSelectionCell(),G[Q.keyCode],m.defaultEdgeLength,Q,!0);null!=c&&0<c.length&&(1==c.length&&m.model.isEdge(c[0])?m.setSelectionCell(m.model.getTerminal(c[0],-!1)):m.setSelectionCell(c[c.length-1]),m.scrollCellToVisible(m.getSelectionCell()),null!=g.hoverIcons&&g.hoverIcons.update(m.view.getState(m.getSelectionCell())))}}else return this.isControlDown(Q)?function(){e(Q.keyCode,mxEvent.isShiftDown(Q)?m.gridSize:null,!0)}:function(){e(Q.keyCode,mxEvent.isShiftDown(Q)?m.gridSize:null)}}return T.apply(this,arguments)};v.bindAction=mxUtils.bind(this,function(Q,U,c,f){var k=this.actions.get(c);null!=k&&(c=function(){k.isEnabled()&&k.funct.apply(this,arguments)},-U?f?v.bindControlShiftKey(Q,c):v.bindControlKey(Q,c):f?v.bindShiftKey(Q,c):v.bindKey(Q,c))});var F=this,P=v.escape;v.escape=function(Q){P.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){m.exitGroup()});v.bindControlShiftKey(35,function(){m.enterGroup()});v.bindShiftKey(36,function(){m.home()});v.bindKey(35,function(){m.refresh()});v.bindAction(80,!0,"print");v.bindAction(107,!0,"zoomIn");v.bindAction(109,!0,"zoomOut");v.bindAction(61,!0,"zoomIn");v.bindAction(187,!0,+g.dialogs||0==g.dialogs.length)};v.isControlDown=function(Q){return mxEvent.isControlDown(Q)||mxClient.IS_MAC&&Q.metaKey};var A=null,G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},S=v.getFunction;mxKeyHandler.prototype.getFunction=function(Q){if(m.isEnabled()){var T=null;mxEvent.isShiftDown(Q)&&this.isControlDown(Q)&&mxEvent.isAltDown(Q)?T=g.actions.get(g.ctrlAltShiftActions[Q.keyCode]):mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)?+T=g.actions.get(g.altShiftActions[Q.keyCode]):this.isControlDown(Q)&&mxEvent.isAltDown(Q)&&(T=g.actions.get(g.ctrlAltActions[Q.keyCode]));if(null!=T)return T.funct;if(null!=G[Q.keyCode]&&!m.isSelectionEmpty())if(!this.isControlDown(Q)&&mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)){if(m.model.isVertex(m.getSelectionCell()))return function(){var c=m.connectVertex(m.getSelectionCell(),G[Q.keyCode],m.defaultEdgeLength,Q,!0);null!=c&&0<c.length&&(1==c.length&&m.model.isEdge(c[0])?m.setSelectionCell(m.model.getTerminal(c[0],+!1)):m.setSelectionCell(c[c.length-1]),m.scrollCellToVisible(m.getSelectionCell()),null!=g.hoverIcons&&g.hoverIcons.update(m.view.getState(m.getSelectionCell())))}}else return this.isControlDown(Q)?function(){e(Q.keyCode,mxEvent.isShiftDown(Q)?m.gridSize:null,!0)}:function(){e(Q.keyCode,mxEvent.isShiftDown(Q)?m.gridSize:null)}}return S.apply(this,arguments)};v.bindAction=mxUtils.bind(this,function(Q,T,c,f){var k=this.actions.get(c);null!=k&&(c=function(){k.isEnabled()&&k.funct.apply(this,arguments)},+T?f?v.bindControlShiftKey(Q,c):v.bindControlKey(Q,c):f?v.bindShiftKey(Q,c):v.bindKey(Q,c))});var F=this,P=v.escape;v.escape=function(Q){P.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){m.exitGroup()});v.bindControlShiftKey(35,function(){m.enterGroup()});v.bindShiftKey(36,function(){m.home()});v.bindKey(35,function(){m.refresh()});v.bindAction(80,!0,"print");v.bindAction(107,!0,"zoomIn");v.bindAction(109,!0,"zoomOut");v.bindAction(61,!0,"zoomIn");v.bindAction(187,!0,"zoomIn");v.bindAction(222,!0,"zoomIn");v.bindAction(173,!0,"zoomOut");v.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)v.bindAction(79,!0,"outline",!0),v.bindControlKey(36,function(){m.isEnabled()&&m.foldCells(!0)}),v.bindControlKey(35,function(){m.isEnabled()&&m.foldCells(!1)}),v.bindControlKey(13,function(){F.ctrlEnter()}),v.bindAction(8,!1,"delete"),v.bindAction(8,!0,"deleteAll"),v.bindAction(8,!1,"deleteLabels",!0),v.bindAction(46,!1,"delete"),v.bindAction(46,!0,"deleteAll"),v.bindAction(46,!1,"deleteLabels",!0),v.bindAction(36,!1,"resetView"),v.bindAction(72,!0,"fitWindow",!0),v.bindAction(74,!0,"fitPage"),v.bindAction(74,!0,"fitTwoPages",!0),v.bindAction(48,!0,"customZoom"),v.bindAction(82,!0,"turn"),v.bindAction(82,!0,"clearDefaultStyle",!0),v.bindAction(83,!0,"save"),v.bindAction(83,!0,"saveAs",!0),v.bindAction(65,!0,"selectAll"),v.bindAction(65,!0,"selectNone",!0),v.bindAction(73,!0,"selectVertices",!0),v.bindAction(69,!0,"selectEdges",!0),v.bindAction(69,!0,"editStyle"),v.bindAction(66,!0,"bold"),v.bindAction(66,!0,"toBack",!0),v.bindAction(70,!0,"toFront",!0),v.bindAction(68,!0,"duplicate"),v.bindAction(68,!0,"setAsDefaultStyle",!0),v.bindAction(90,!0,"undo"),v.bindAction(90,!0,"redo",!0),v.bindAction(89,!0,"redo"),v.bindAction(89,!0,"autosize",!0),v.bindAction(88,!0,"cut"),v.bindAction(67,!0,"copy"),v.bindAction(86,!0,"paste"),v.bindAction(71,!0,"group"),v.bindAction(77,!0,"editData"),v.bindAction(71,!0,"grid",!0),v.bindAction(73,!0,"italic"),v.bindAction(76,@@ -2230,42 +2230,42 @@ null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gnull}var e=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.layersDialog];for(b=0;b<e.length;b++)null!=e[b]&&null!=e[b].parentNode&&e[b].parentNode.removeChild(e[b])};(function(){var b=[["nbsp","160"],["shy","173"]],e=mxUtils.parseXml;mxUtils.parseXml=function(m){for(var v=0;v<b.length;v++)m=m.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return e(m)};var g=mxUtils.getSizeForString;mxUtils.getSizeForString=function(m,v,p,A){return g(Graph.sanitizeHtml(m),v,p,A)}})();Date.prototype.toISOString||function(){function b(e){e=String(e);1===e.length&&(e="0"+e);return e}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();Date.now||(Date.now=function(){return(new Date).getTime()});Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,e=function(m){return"function"===typeof m||"[object Function]"===b.call(m)},g=Math.pow(2,53)-1;return function(m){var v=Object(m);if(null==m)throw new TypeError("Array.from requires an array-like object - not null or undefined");var p=1<arguments.length?arguments[1]:void 0,A;if("undefined"!==typeof p){if(!e(p))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(A=-arguments[2])}var G=Number(v.length);G=isNaN(G)?0:0!==G&&isFinite(G)?(0<G?1:-1)*Math.floor(Math.abs(G)):G;G=Math.min(Math.max(G,0),g);for(var T=e(this)?Object(new this(G)):Array(G),F=0,P;F<G;)P=v[F],T[F]=p?"undefined"===typeof A?p(P,F):p.call(A,P,F):P,F+=1;T.length=G;return T}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");+arguments[2])}var G=Number(v.length);G=isNaN(G)?0:0!==G&&isFinite(G)?(0<G?1:-1)*Math.floor(Math.abs(G)):G;G=Math.min(Math.max(G,0),g);for(var S=e(this)?Object(new this(G)):Array(G),F=0,P;F<G;)P=v[F],S[F]=p?"undefined"===typeof A?p(P,F):p.call(A,P,F):P,F+=1;S.length=G;return S}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var b=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===b||"en-ca"===b||"es-mx"===b?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.defaultGridColor="#d0d0d0";mxGraphView.prototype.defaultDarkGridColor="#424242";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(b){this.unit!=b&&(this.unit=b,this.graph.refresh(),this.fireEvent(new mxEventObject("unitChanged","unit",b)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(b,e,g){return null};mxImageShape.prototype.getImageDataUri=function(){var b=String(this.image);if("data:image/svg+xml;base64,"==b.substring(0,26)&&null!=this.style&&"1"==mxUtils.getValue(this.style,"clipSvg","0")){if(null==this.clippedSvg||this.clippedImage!=b)this.clippedSvg=Graph.clipSvgDataUri(b,!0),this.clippedImage=b;b=this.clippedSvg}return b};(function(){var b=mxResources.get;mxResources.get=function(e,g,m){null==m&&(m=e);return b.apply(this,[e,g,m])}})();Graph=function(b,e,g,m,v,p){mxGraph.call(this,b,e,g,m);this.themes=v||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=p?p:!1;b=this.baseUrl;e=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<e&&(e=b.indexOf("/",e+2),0<e&&(this.domainUrl=b.substring(0,e)),e=b.lastIndexOf("/"),0<e&&(this.domainPathUrl=b.substring(0,e+1)));this.isHtmlLabel=function(aa){aa=this.getCurrentCellStyle(aa);-return null!=aa?"1"==aa.html||"wrap"==aa[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var A=null,G=null,T=null,F=null,P=!1,Q=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(aa,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){aa=l.getProperty("event");var t=aa.getState();l=this.view.scale;if(!mxEvent.isAltDown(aa.getEvent())&&null!=t&&(Q=this.isCellSelected(t.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(aa.getEvent()))){var I=-this.selectionCellsHandler.getHandler(t.cell);if(null==I||null==I.getHandleForEvent(aa)){var V=new mxRectangle(aa.getGraphX()-1,aa.getGraphY()-1),J=mxEvent.isTouchEvent(aa.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;I=J+2;V.grow(J);if(this.isTableCell(t.cell)&&this.isCellMovable(t.cell)&&!this.isCellSelected(t.cell)&&!(mxUtils.contains(t,aa.getGraphX()-I,aa.getGraphY()-I)&&mxUtils.contains(t,aa.getGraphX()-I,aa.getGraphY()+I)&&mxUtils.contains(t,aa.getGraphX()+-I,aa.getGraphY()+I)&&mxUtils.contains(t,aa.getGraphX()+I,aa.getGraphY()-I))){var W=this.model.getParent(t.cell);I=this.model.getParent(W);if(!this.isCellSelected(I)){J*=l;var Y=2*J;if(this.model.getChildAt(I,0)!=W&&mxUtils.intersects(V,new mxRectangle(t.x,t.y-J,t.width,Y))||this.model.getChildAt(W,0)!=t.cell&&mxUtils.intersects(V,new mxRectangle(t.x-J,t.y,Y,t.height))||mxUtils.intersects(V,new mxRectangle(t.x,t.y+t.height-J,t.width,Y))||mxUtils.intersects(V,new mxRectangle(t.x+t.width-J,t.y,Y,t.height)))W=-this.selectionCellsHandler.isHandled(I),this.selectCellForEvent(I,aa.getEvent()),I=this.selectionCellsHandler.getHandler(I),null!=I&&(J=I.getHandleForEvent(aa),null!=J&&(I.start(aa.getGraphX(),aa.getGraphY(),J),I.blockDelayedSelection=!W,aa.consume()))}}for(;!aa.isConsumed()&&null!=t&&(this.isTableCell(t.cell)||this.isTableRow(t.cell)||this.isTable(t.cell));)this.isSwimlane(t.cell)&&this.isCellMovable(t.cell)&&(I=this.getActualStartSize(t.cell),(0<I.x||0<I.width)&&mxUtils.intersects(V,new mxRectangle(t.x+-(I.x-I.width-1)*l+(0==I.x?t.width:0),t.y,1,t.height))||(0<I.y||0<I.height)&&mxUtils.intersects(V,new mxRectangle(t.x,t.y+(I.y-I.height-1)*l+(0==I.y?t.height:0),t.width,1)))&&(this.selectCellForEvent(t.cell,aa.getEvent()),I=this.selectionCellsHandler.getHandler(t.cell),null!=I&&null!=I.customHandles&&(J=mxEvent.CUSTOM_HANDLE-I.customHandles.length+1,I.start(aa.getGraphX(),aa.getGraphY(),J),aa.consume())),t=this.view.getState(this.model.getParent(t.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,-mxUtils.bind(this,function(aa,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){aa=l.getProperty("event");var t=aa.getState();mxEvent.isAltDown(aa.getEvent())||mxEvent.isControlDown(l)||mxEvent.isShiftDown(l)||Q||null==t||!this.model.isEdge(t.cell)||(A=new mxPoint(aa.getGraphX(),aa.getGraphY()),P=this.isCellSelected(t.cell),T=t,G=aa,null!=t.text&&null!=t.text.boundingBox&&mxUtils.contains(t.text.boundingBox,aa.getGraphX(),aa.getGraphY())?F=mxEvent.LABEL_HANDLE:(l=this.selectionCellsHandler.getHandler(t.cell),-null!=l&&null!=l.bends&&0<l.bends.length&&(F=l.getHandleForEvent(aa))))}}));this.addMouseListener({mouseDown:function(aa,l){},mouseMove:mxUtils.bind(this,function(aa,l){aa=this.selectionCellsHandler.handlers.map;for(var t in aa)if(null!=aa[t].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(l.getEvent())){var I=this.tolerance;if(null!=A&&null!=T&&null!=G){if(t=T,null!=F||Math.abs(A.x-l.getGraphX())>I||Math.abs(A.y-l.getGraphY())>I){var V=null;mxEvent.isShiftDown(l.getEvent())||-(V=this.selectionCellsHandler.getHandler(t.cell));if(null!=V&&null!=V.bends&&0<V.bends.length){V.redrawHandles();var J=null!=F?F:V.getHandleForEvent(G),W=this.view.getEdgeStyle(t),Y=W==mxEdgeStyle.EntityRelation;I=t.absolutePoints;P||(J=F);J!=mxEvent.LABEL_HANDLE&&null!=I&&(J=F,null==J&&(aa=new mxRectangle(A.x,A.y),aa.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(aa,I[0].x,I[0].y)?J=0:mxUtils.contains(aa,I[I.length-1].x,I[I.length-1].y)?J=V.bends.length-1:null!=I&&(null==W&&null==-J||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&(null!=W&&(2==I.length||3==I.length&&(0==Math.round(I[0].x-I[1].x)&&0==Math.round(I[1].x-I[2].x)||0==Math.round(I[0].y-I[1].y)&&0==Math.round(I[1].y-I[2].y)))?J=2:(J=mxUtils.findNearestSegment(t,A.x,A.y),J=null==W?mxEvent.VIRTUAL_HANDLE-J:J+1))),null==J&&(J=mxEvent.VIRTUAL_HANDLE));aa=J==mxEvent.LABEL_HANDLE||0==J||J==V.bends.length-1;if(!Y&&(null!=t.visibleSourceState||null!=t.visibleTargetState)||aa)V.start(l.getGraphX(),l.getGraphX(),-J),l.consume(),this.graphHandler.reset()}null!=V&&(this.selectionCellsHandler.isHandlerActive(V)?this.isCellSelected(t.cell)||(this.selectionCellsHandler.handlers.put(t.cell,V),this.selectCellForEvent(t.cell,l.getEvent())):this.isCellSelected(t.cell)||V.destroy());P=!1;A=G=T=F=null}}else if(t=l.getState(),null!=t&&this.isCellEditable(t.cell)){aa=this.model.getParent(t.cell);V=null;if(this.model.isEdge(t.cell)&&!this.isCellSelected(t.cell)&&!mxEvent.isAltDown(l.getEvent())&&!mxEvent.isShiftDown(l.getEvent())&&-!this.isAncestorSelected(t.cell)&&(this.isSwimlane(aa)||this.model.isLayer(aa)||this.getCurrentRoot()==aa)){if(aa=new mxRectangle(l.getGraphX(),l.getGraphY()),aa.grow(mxEdgeHandler.prototype.handleImage.width/2),I=t.absolutePoints,null!=I)null!=t.text&&null!=t.text.boundingBox&&mxUtils.contains(t.text.boundingBox,l.getGraphX(),l.getGraphY())?V="move":mxUtils.contains(aa,I[0].x,I[0].y)||mxUtils.contains(aa,I[I.length-1].x,I[I.length-1].y)?V="pointer":(W=this.view.getEdgeStyle(t),W==mxEdgeStyle.EntityRelation||-null==t.visibleSourceState&&null==t.visibleTargetState||(V="crosshair",W!=mxEdgeStyle.SegmentConnector&&W!=mxEdgeStyle.OrthConnector))||(l=mxUtils.findNearestSegment(t,l.getGraphX(),l.getGraphY()),l<I.length-1&&0<=l&&(V=0==Math.round(I[l].x-I[l+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(l.getEvent())){I=mxShape.prototype.svgStrokeTolerance/2;aa=new mxRectangle(l.getGraphX(),l.getGraphY());aa.grow(I);if(this.isTableCell(t.cell)&&this.isCellMovable(t.cell)&&(l=this.model.getParent(t.cell),-I=this.model.getParent(l),!this.isCellSelected(I)))if(mxUtils.intersects(aa,new mxRectangle(t.x,t.y-2,t.width,4))&&this.model.getChildAt(I,0)!=l||mxUtils.intersects(aa,new mxRectangle(t.x,t.y+t.height-2,t.width,4)))V="row-resize";else if(mxUtils.intersects(aa,new mxRectangle(t.x-2,t.y,4,t.height))&&this.model.getChildAt(l,0)!=t.cell||mxUtils.intersects(aa,new mxRectangle(t.x+t.width-2,t.y,4,t.height)))V="col-resize";for(l=t;null==V&&null!=l&&(this.isTableCell(l.cell)||this.isTableRow(l.cell)||this.isTable(l.cell));)this.isSwimlane(l.cell)&&-this.isCellMovable(l.cell)&&(I=this.getActualStartSize(l.cell),J=this.view.scale,(0<I.x||0<I.width)&&mxUtils.intersects(aa,new mxRectangle(l.x+(I.x-I.width-1)*J+(0==I.x?l.width*J:0),l.y,1,l.height))?V="col-resize":(0<I.y||0<I.height)&&mxUtils.intersects(aa,new mxRectangle(l.x,l.y+(I.y-I.height-1)*J+(0==I.y?l.height:0),l.width,1))&&(V="row-resize")),l=this.view.getState(this.model.getParent(l.cell))}null!=V&&t.setCursor(V)}}}),mouseUp:mxUtils.bind(this,function(aa,l){F=A=G=T=null})})}this.cellRenderer.minSvgStrokeWidth=-.1;var U=document.createElement("div");this.cellRenderer.getLabelValue=function(aa){var l=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);aa.view.graph.isHtmlLabel(aa.cell)&&("0"==mxUtils.getValue(aa.style,"html","0")?l=mxUtils.htmlEntities(l,!1):(aa.lastLabelValue!=l&&(aa.lastLabelValue=l,aa.lastSanitizedLabelValue=Graph.sanitizeHtml(l),U.innerHTML=aa.lastSanitizedLabelValue,Graph.addLightDarkColors(U,null,"simple"==aa.view.graph.getAdaptiveColors())&&(aa.lastSanitizedLabelValue=U.innerHTML)),+return null!=aa?"1"==aa.html||"wrap"==aa[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var A=null,G=null,S=null,F=null,P=!1,Q=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(aa,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){aa=l.getProperty("event");var t=aa.getState();l=this.view.scale;if(!mxEvent.isAltDown(aa.getEvent())&&null!=t&&(Q=this.isCellSelected(t.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(aa.getEvent()))){var H=+this.selectionCellsHandler.getHandler(t.cell);if(null==H||null==H.getHandleForEvent(aa)){var U=new mxRectangle(aa.getGraphX()-1,aa.getGraphY()-1),K=mxEvent.isTouchEvent(aa.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;H=K+2;U.grow(K);if(this.isTableCell(t.cell)&&this.isCellMovable(t.cell)&&!this.isCellSelected(t.cell)&&!(mxUtils.contains(t,aa.getGraphX()-H,aa.getGraphY()-H)&&mxUtils.contains(t,aa.getGraphX()-H,aa.getGraphY()+H)&&mxUtils.contains(t,aa.getGraphX()++H,aa.getGraphY()+H)&&mxUtils.contains(t,aa.getGraphX()+H,aa.getGraphY()-H))){var W=this.model.getParent(t.cell);H=this.model.getParent(W);if(!this.isCellSelected(H)){K*=l;var Y=2*K;if(this.model.getChildAt(H,0)!=W&&mxUtils.intersects(U,new mxRectangle(t.x,t.y-K,t.width,Y))||this.model.getChildAt(W,0)!=t.cell&&mxUtils.intersects(U,new mxRectangle(t.x-K,t.y,Y,t.height))||mxUtils.intersects(U,new mxRectangle(t.x,t.y+t.height-K,t.width,Y))||mxUtils.intersects(U,new mxRectangle(t.x+t.width-K,t.y,Y,t.height)))W=+this.selectionCellsHandler.isHandled(H),this.selectCellForEvent(H,aa.getEvent()),H=this.selectionCellsHandler.getHandler(H),null!=H&&(K=H.getHandleForEvent(aa),null!=K&&(H.start(aa.getGraphX(),aa.getGraphY(),K),H.blockDelayedSelection=!W,aa.consume()))}}for(;!aa.isConsumed()&&null!=t&&(this.isTableCell(t.cell)||this.isTableRow(t.cell)||this.isTable(t.cell));)this.isSwimlane(t.cell)&&this.isCellMovable(t.cell)&&(H=this.getActualStartSize(t.cell),(0<H.x||0<H.width)&&mxUtils.intersects(U,new mxRectangle(t.x++(H.x-H.width-1)*l+(0==H.x?t.width:0),t.y,1,t.height))||(0<H.y||0<H.height)&&mxUtils.intersects(U,new mxRectangle(t.x,t.y+(H.y-H.height-1)*l+(0==H.y?t.height:0),t.width,1)))&&(this.selectCellForEvent(t.cell,aa.getEvent()),H=this.selectionCellsHandler.getHandler(t.cell),null!=H&&null!=H.customHandles&&(K=mxEvent.CUSTOM_HANDLE-H.customHandles.length+1,H.start(aa.getGraphX(),aa.getGraphY(),K),aa.consume())),t=this.view.getState(this.model.getParent(t.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,+mxUtils.bind(this,function(aa,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){aa=l.getProperty("event");var t=aa.getState();mxEvent.isAltDown(aa.getEvent())||mxEvent.isControlDown(l)||mxEvent.isShiftDown(l)||Q||null==t||!this.model.isEdge(t.cell)||(A=new mxPoint(aa.getGraphX(),aa.getGraphY()),P=this.isCellSelected(t.cell),S=t,G=aa,null!=t.text&&null!=t.text.boundingBox&&mxUtils.contains(t.text.boundingBox,aa.getGraphX(),aa.getGraphY())?F=mxEvent.LABEL_HANDLE:(l=this.selectionCellsHandler.getHandler(t.cell),+null!=l&&null!=l.bends&&0<l.bends.length&&(F=l.getHandleForEvent(aa))))}}));this.addMouseListener({mouseDown:function(aa,l){},mouseMove:mxUtils.bind(this,function(aa,l){aa=this.selectionCellsHandler.handlers.map;for(var t in aa)if(null!=aa[t].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(l.getEvent())){var H=this.tolerance;if(null!=A&&null!=S&&null!=G){if(t=S,null!=F||Math.abs(A.x-l.getGraphX())>H||Math.abs(A.y-l.getGraphY())>H){var U=null;mxEvent.isShiftDown(l.getEvent())||+(U=this.selectionCellsHandler.getHandler(t.cell));if(null!=U&&null!=U.bends&&0<U.bends.length){U.redrawHandles();var K=null!=F?F:U.getHandleForEvent(G),W=this.view.getEdgeStyle(t),Y=W==mxEdgeStyle.EntityRelation;H=t.absolutePoints;P||(K=F);K!=mxEvent.LABEL_HANDLE&&null!=H&&(K=F,null==K&&(aa=new mxRectangle(A.x,A.y),aa.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(aa,H[0].x,H[0].y)?K=0:mxUtils.contains(aa,H[H.length-1].x,H[H.length-1].y)?K=U.bends.length-1:null!=H&&(null==W&&null==+K||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&(null!=W&&(2==H.length||3==H.length&&(0==Math.round(H[0].x-H[1].x)&&0==Math.round(H[1].x-H[2].x)||0==Math.round(H[0].y-H[1].y)&&0==Math.round(H[1].y-H[2].y)))?K=2:(K=mxUtils.findNearestSegment(t,A.x,A.y),K=null==W?mxEvent.VIRTUAL_HANDLE-K:K+1))),null==K&&(K=mxEvent.VIRTUAL_HANDLE));aa=K==mxEvent.LABEL_HANDLE||0==K||K==U.bends.length-1;if(!Y&&(null!=t.visibleSourceState||null!=t.visibleTargetState)||aa)U.start(l.getGraphX(),l.getGraphX(),+K),l.consume(),this.graphHandler.reset()}null!=U&&(this.selectionCellsHandler.isHandlerActive(U)?this.isCellSelected(t.cell)||(this.selectionCellsHandler.handlers.put(t.cell,U),this.selectCellForEvent(t.cell,l.getEvent())):this.isCellSelected(t.cell)||U.destroy());P=!1;A=G=S=F=null}}else if(t=l.getState(),null!=t&&this.isCellEditable(t.cell)){aa=this.model.getParent(t.cell);U=null;if(this.model.isEdge(t.cell)&&!this.isCellSelected(t.cell)&&!mxEvent.isAltDown(l.getEvent())&&!mxEvent.isShiftDown(l.getEvent())&&+!this.isAncestorSelected(t.cell)&&(this.isSwimlane(aa)||this.model.isLayer(aa)||this.getCurrentRoot()==aa)){if(aa=new mxRectangle(l.getGraphX(),l.getGraphY()),aa.grow(mxEdgeHandler.prototype.handleImage.width/2),H=t.absolutePoints,null!=H)null!=t.text&&null!=t.text.boundingBox&&mxUtils.contains(t.text.boundingBox,l.getGraphX(),l.getGraphY())?U="move":mxUtils.contains(aa,H[0].x,H[0].y)||mxUtils.contains(aa,H[H.length-1].x,H[H.length-1].y)?U="pointer":(W=this.view.getEdgeStyle(t),W==mxEdgeStyle.EntityRelation||+null==t.visibleSourceState&&null==t.visibleTargetState||(U="crosshair",W!=mxEdgeStyle.SegmentConnector&&W!=mxEdgeStyle.OrthConnector))||(l=mxUtils.findNearestSegment(t,l.getGraphX(),l.getGraphY()),l<H.length-1&&0<=l&&(U=0==Math.round(H[l].x-H[l+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(l.getEvent())){H=mxShape.prototype.svgStrokeTolerance/2;aa=new mxRectangle(l.getGraphX(),l.getGraphY());aa.grow(H);if(this.isTableCell(t.cell)&&this.isCellMovable(t.cell)&&(l=this.model.getParent(t.cell),+H=this.model.getParent(l),!this.isCellSelected(H)))if(mxUtils.intersects(aa,new mxRectangle(t.x,t.y-2,t.width,4))&&this.model.getChildAt(H,0)!=l||mxUtils.intersects(aa,new mxRectangle(t.x,t.y+t.height-2,t.width,4)))U="row-resize";else if(mxUtils.intersects(aa,new mxRectangle(t.x-2,t.y,4,t.height))&&this.model.getChildAt(l,0)!=t.cell||mxUtils.intersects(aa,new mxRectangle(t.x+t.width-2,t.y,4,t.height)))U="col-resize";for(l=t;null==U&&null!=l&&(this.isTableCell(l.cell)||this.isTableRow(l.cell)||this.isTable(l.cell));)this.isSwimlane(l.cell)&&+this.isCellMovable(l.cell)&&(H=this.getActualStartSize(l.cell),K=this.view.scale,(0<H.x||0<H.width)&&mxUtils.intersects(aa,new mxRectangle(l.x+(H.x-H.width-1)*K+(0==H.x?l.width*K:0),l.y,1,l.height))?U="col-resize":(0<H.y||0<H.height)&&mxUtils.intersects(aa,new mxRectangle(l.x,l.y+(H.y-H.height-1)*K+(0==H.y?l.height:0),l.width,1))&&(U="row-resize")),l=this.view.getState(this.model.getParent(l.cell))}null!=U&&t.setCursor(U)}}}),mouseUp:mxUtils.bind(this,function(aa,l){F=A=G=S=null})})}this.cellRenderer.minSvgStrokeWidth=+.1;var T=document.createElement("div");this.cellRenderer.getLabelValue=function(aa){var l=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);aa.view.graph.isHtmlLabel(aa.cell)&&("0"==mxUtils.getValue(aa.style,"html","0")?l=mxUtils.htmlEntities(l,!1):(aa.lastLabelValue!=l&&(aa.lastLabelValue=l,aa.lastSanitizedLabelValue=Graph.sanitizeHtml(l),T.innerHTML=aa.lastSanitizedLabelValue,Graph.addLightDarkColors(T,null,"simple"==aa.view.graph.getAdaptiveColors())&&(aa.lastSanitizedLabelValue=T.innerHTML)),l=aa.lastSanitizedLabelValue));return l};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(aa,-l){return!1};this.alternateEdgeStyle="vertical";null==m&&this.loadStylesheet();var c=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var aa=c.apply(this,arguments);if(this.graph.pageVisible){var l=[],t=this.graph.pageFormat,I=this.graph.pageScale,V=t.width*I;t=t.height*I;I=this.graph.view.translate;for(var J=this.graph.view.scale,W=this.graph.getPageLayout(),Y=0;Y<W.width;Y++)l.push(new mxRectangle(((W.x+Y)*V+I.x)*J,(W.y*t+I.y)*J,V*J,t*J));for(Y=1;Y<W.height;Y++)l.push(new mxRectangle((W.x*-V+I.x)*J,((W.y+Y)*t+I.y)*J,V*J,t*J));aa=l.concat(aa)}return aa};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(aa,l){return null==aa.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(aa){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var f=this.graphHandler.getCells;this.graphHandler.getCells=-function(aa){for(var l=f.apply(this,arguments),t=new mxDictionary,I=[],V=0;V<l.length;V++){var J=this.graph.isTableCell(aa)&&this.graph.isTableCell(l[V])&&this.graph.isCellSelected(l[V])?this.graph.model.getParent(l[V]):this.graph.isTableRow(aa)&&this.graph.isTableRow(l[V])&&this.graph.isCellSelected(l[V])?l[V]:this.graph.getCompositeParent(l[V]);null==J||t.get(J)||(t.put(J,!0),I.push(J))}return I};var k=this.graphHandler.start;this.graphHandler.start=function(aa,l,t,I){var V=!1;this.graph.isTableCell(aa)&&-(this.graph.isCellSelected(aa)?V=!0:aa=this.graph.model.getParent(aa));V||this.graph.isTableRow(aa)&&this.graph.isCellSelected(aa)||(aa=this.graph.getCompositeParent(aa));k.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(aa,l){l=this.graph.getCompositeParent(l);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(aa,l,t,I,V,J){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=I&&-this.graph.applyNewEdgeStyle(I,[W]);return W};var B=new mxRubberband(this);this.getRubberband=function(){return B};var z=(new Date).getTime(),C=0,H=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var aa=this.currentState;H.apply(this,arguments);aa!=this.currentState?(z=(new Date).getTime(),C=0):C=(new Date).getTime()-z};var K=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(aa){return mxEvent.isShiftDown(aa.getEvent())&&-mxEvent.isAltDown(aa.getEvent())?!1:null!=this.currentState&&aa.getState()==this.currentState&&2E3<C||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&K.apply(this,arguments)};var M=this.isToggleEvent;this.isToggleEvent=function(aa){return M.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(aa)};var O=B.isForceRubberbandEvent;B.isForceRubberbandEvent=function(aa){return O.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(aa.getEvent())||-mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==aa.getState()&&mxEvent.isTouchEvent(aa.getEvent())};var ea=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(ea=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=ea)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=-function(aa){return mxEvent.isMouseEvent(aa.getEvent())};var fa=this.click;this.click=function(aa){var l=null==aa.state&&null!=aa.sourceState&&this.isCellLocked(this.getLayerForCell(aa.sourceState.cell));if(this.isEnabled()&&!l||aa.isConsumed())return fa.apply(this,arguments);var t=l?aa.sourceState.cell:aa.getCell();if(null!=t){var I=this.getClickableLinkForCell(t);null!=I?this.isCustomLink(I)?this.customLinkClicked(I,t):this.openLink(I):l&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=-function(aa){return aa.sourceState};var S=this.tooltipHandler.show;this.tooltipHandler.show=function(){S.apply(this,arguments);if(null!=this.div)for(var aa=this.div.getElementsByTagName("a"),l=0;l<aa.length;l++)null!=aa[l].getAttribute("href")&&null==aa[l].getAttribute("target")&&aa[l].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(aa){return aa.sourceState};this.getCursorForMouseEvent=function(aa){var l=null==aa.state&&null!=aa.sourceState&&this.isCellLocked(aa.sourceState.cell);-return this.getCursorForCell(l?aa.sourceState.cell:aa.getCell())};var ca=this.getCursorForCell;this.getCursorForCell=function(aa){if(!this.isEnabled()||this.isCellLocked(aa)){if(null!=this.getClickableLinkForCell(aa))return"pointer";if(this.isCellLocked(aa))return"default"}return ca.apply(this,arguments)};this.selectRegion=function(aa,l){var t=mxEvent.isAltDown(l)?aa:null;aa=this.getCells(aa.x,aa.y,aa.width,aa.height,null,null,t,null,!0);if(this.isToggleEvent(l))for(t=0;t<aa.length;t++)this.selectCellForEvent(aa[t],+l){return!1};this.alternateEdgeStyle="vertical";null==m&&this.loadStylesheet();var c=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var aa=c.apply(this,arguments);if(this.graph.pageVisible){var l=[],t=this.graph.pageFormat,H=this.graph.pageScale,U=t.width*H;t=t.height*H;H=this.graph.view.translate;for(var K=this.graph.view.scale,W=this.graph.getPageLayout(),Y=0;Y<W.width;Y++)l.push(new mxRectangle(((W.x+Y)*U+H.x)*K,(W.y*t+H.y)*K,U*K,t*K));for(Y=1;Y<W.height;Y++)l.push(new mxRectangle((W.x*+U+H.x)*K,((W.y+Y)*t+H.y)*K,U*K,t*K));aa=l.concat(aa)}return aa};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(aa,l){return null==aa.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(aa){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var f=this.graphHandler.getCells;this.graphHandler.getCells=+function(aa){for(var l=f.apply(this,arguments),t=new mxDictionary,H=[],U=0;U<l.length;U++){var K=this.graph.isTableCell(aa)&&this.graph.isTableCell(l[U])&&this.graph.isCellSelected(l[U])?this.graph.model.getParent(l[U]):this.graph.isTableRow(aa)&&this.graph.isTableRow(l[U])&&this.graph.isCellSelected(l[U])?l[U]:this.graph.getCompositeParent(l[U]);null==K||t.get(K)||(t.put(K,!0),H.push(K))}return H};var k=this.graphHandler.start;this.graphHandler.start=function(aa,l,t,H){var U=!1;this.graph.isTableCell(aa)&&+(this.graph.isCellSelected(aa)?U=!0:aa=this.graph.model.getParent(aa));U||this.graph.isTableRow(aa)&&this.graph.isCellSelected(aa)||(aa=this.graph.getCompositeParent(aa));k.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(aa,l){l=this.graph.getCompositeParent(l);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(aa,l,t,H,U,K){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=H&&+this.graph.applyNewEdgeStyle(H,[W]);return W};var B=new mxRubberband(this);this.getRubberband=function(){return B};var z=(new Date).getTime(),C=0,I=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var aa=this.currentState;I.apply(this,arguments);aa!=this.currentState?(z=(new Date).getTime(),C=0):C=(new Date).getTime()-z};var L=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(aa){return mxEvent.isShiftDown(aa.getEvent())&&+mxEvent.isAltDown(aa.getEvent())?!1:null!=this.currentState&&aa.getState()==this.currentState&&2E3<C||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&L.apply(this,arguments)};var J=this.isToggleEvent;this.isToggleEvent=function(aa){return J.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(aa)};var O=B.isForceRubberbandEvent;B.isForceRubberbandEvent=function(aa){return O.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(aa.getEvent())||+mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==aa.getState()&&mxEvent.isTouchEvent(aa.getEvent())};var da=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(da=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=da)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=+function(aa){return mxEvent.isMouseEvent(aa.getEvent())};var fa=this.click;this.click=function(aa){var l=null==aa.state&&null!=aa.sourceState&&this.isCellLocked(this.getLayerForCell(aa.sourceState.cell));if(this.isEnabled()&&!l||aa.isConsumed())return fa.apply(this,arguments);var t=l?aa.sourceState.cell:aa.getCell();if(null!=t){var H=this.getClickableLinkForCell(t);null!=H?this.isCustomLink(H)?this.customLinkClicked(H,t):this.openLink(H):l&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=+function(aa){return aa.sourceState};var V=this.tooltipHandler.show;this.tooltipHandler.show=function(){V.apply(this,arguments);if(null!=this.div)for(var aa=this.div.getElementsByTagName("a"),l=0;l<aa.length;l++)null!=aa[l].getAttribute("href")&&null==aa[l].getAttribute("target")&&aa[l].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(aa){return aa.sourceState};this.getCursorForMouseEvent=function(aa){var l=null==aa.state&&null!=aa.sourceState&&this.isCellLocked(aa.sourceState.cell);+return this.getCursorForCell(l?aa.sourceState.cell:aa.getCell())};var ba=this.getCursorForCell;this.getCursorForCell=function(aa){if(!this.isEnabled()||this.isCellLocked(aa)){if(null!=this.getClickableLinkForCell(aa))return"pointer";if(this.isCellLocked(aa))return"default"}return ba.apply(this,arguments)};this.selectRegion=function(aa,l){var t=mxEvent.isAltDown(l)?aa:null;aa=this.getCells(aa.x,aa.y,aa.width,aa.height,null,null,t,null,!0);if(this.isToggleEvent(l))for(t=0;t<aa.length;t++)this.selectCellForEvent(aa[t],l);else this.selectCellsForEvent(aa,l);return aa};var ma=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(aa,l,t){return this.graph.isCellSelected(aa)?!1:ma.apply(this,arguments)};var la=this.updateMouseEvent;this.updateMouseEvent=function(aa){aa=la.apply(this,arguments);null!=aa.state&&this.isCellLocked(this.getLayerForCell(aa.getCell()))&&(null==this.getLinkForCell(aa.getCell())?aa.state=this.view.getState(this.getCellAt(aa.getGraphX(),aa.getGraphY(),-null,null,null,mxUtils.bind(this,function(l,t,I){return aa.state==l||this.isCellLocked(this.getLayerForCell(l.cell))&&null==this.getLinkForCell(l.cell)}))):aa.state=null);return aa};var Z=this.isCellSelectable;this.isCellSelectable=function(aa){return Z.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(aa))};this.isCellLocked=function(aa){for(;null!=aa;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(aa),"locked","0"))return!0;aa=this.model.getParent(aa)}return!1};var da=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,-mxUtils.bind(this,function(aa,l){"mouseDown"==l.getProperty("eventName")&&(aa=l.getProperty("event").getState(),da=null==aa||this.isSelectionEmpty()||this.isCellSelected(aa.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(aa,l){if(!mxEvent.isMultiTouchEvent(l)){aa=l.getProperty("event");var t=l.getProperty("cell");null==t?(aa=mxUtils.convertPoint(this.container,mxEvent.getClientX(aa),mxEvent.getClientY(aa)),B.start(aa.x,aa.y)):null!=da?this.addSelectionCells(da):-1<this.getSelectionCount()&&this.isCellSelected(t)&&this.removeSelectionCell(t);da=null;l.consume()}}));this.connectionHandler.selectCells=function(aa,l){this.graph.setSelectionCell(l||aa)};this.connectionHandler.constraintHandler.isStateIgnored=function(aa,l){var t=aa.view.graph;return l&&(t.isCellSelected(aa.cell)||t.isTableRow(aa.cell)&&t.selectionCellsHandler.isHandled(t.model.getParent(aa.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var aa=this.connectionHandler.constraintHandler;+null,null,null,mxUtils.bind(this,function(l,t,H){return aa.state==l||this.isCellLocked(this.getLayerForCell(l.cell))&&null==this.getLinkForCell(l.cell)}))):aa.state=null);return aa};var Z=this.isCellSelectable;this.isCellSelectable=function(aa){return Z.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(aa))};this.isCellLocked=function(aa){for(;null!=aa;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(aa),"locked","0"))return!0;aa=this.model.getParent(aa)}return!1};var ea=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,+mxUtils.bind(this,function(aa,l){"mouseDown"==l.getProperty("eventName")&&(aa=l.getProperty("event").getState(),ea=null==aa||this.isSelectionEmpty()||this.isCellSelected(aa.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(aa,l){if(!mxEvent.isMultiTouchEvent(l)){aa=l.getProperty("event");var t=l.getProperty("cell");null==t?(aa=mxUtils.convertPoint(this.container,mxEvent.getClientX(aa),mxEvent.getClientY(aa)),B.start(aa.x,aa.y)):null!=ea?this.addSelectionCells(ea):+1<this.getSelectionCount()&&this.isCellSelected(t)&&this.removeSelectionCell(t);ea=null;l.consume()}}));this.connectionHandler.selectCells=function(aa,l){this.graph.setSelectionCell(l||aa)};this.connectionHandler.constraintHandler.isStateIgnored=function(aa,l){var t=aa.view.graph;return l&&(t.isCellSelected(aa.cell)||t.isTableRow(aa.cell)&&t.selectionCellsHandler.isHandled(t.model.getParent(aa.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var aa=this.connectionHandler.constraintHandler;null!=aa.currentFocus&&aa.isStateIgnored(aa.currentFocus,!0)&&(aa.currentFocus=null,aa.constraints=null,aa.destroyIcons());aa.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch()}this.currentTranslate=new mxPoint(0,0)};Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.translateDiagram="1"==urlParams["translate-diagram"];Graph.diagramLanguage=null!=urlParams["diagram-language"]?urlParams["diagram-language"]:mxClient.language;Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;Graph.zoomWheel=!1;Graph.selectParentLayer=!1;Graph.minTableColumnWidth=20;Graph.minTableRowHeight=20;Graph.foreignObjectWarningText="Text is not SVG - cannot display";Graph.foreignObjectWarningLink="https://www.drawio.com/doc/faq/svg-export-text-problems";Graph.xmlDeclaration='<?xml version="1.0" encoding="UTF-8"?>';Graph.svgDoctype='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';Graph.svgFileComment="\x3c!-- Do not edit this file with editors other than draw.io --\x3e";@@ -2279,35 +2279,35 @@ Graph.createSvgImage=function(b,e,g,m,v){g=unescape(encodeURIComponent(Graph.svgGraph.getSvgFromDataUri=function(b){return null!=b&&"data:image/svg"==b.substring(0,14)?Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+decodeURIComponent(escape(atob(b.substring(b.indexOf(",")+1)))):null};Graph.createSvgNode=function(b,e,g,m,v){var p=mxUtils.createXmlDocument(),A=null!=p.createElementNS?p.createElementNS(mxConstants.NS_SVG,"svg"):p.createElement("svg");null!=v&&A.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==p.createElementNS?(A.setAttribute("xmlns",mxConstants.NS_SVG),A.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):A.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);A.setAttribute("version","1.1");A.setAttribute("width",g+"px");A.setAttribute("height",m+"px");A.setAttribute("viewBox",b+" "+e+" "+g+" "+m);p.appendChild(A);return A};-Graph.htmlToPng=function(b,e,g,m,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var A=document.createElement("canvas");A.width=e*p;A.height=g*p;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var F=A.getContext("2d");F.scale(p,p);F.drawImage(G,0,0);m(A.toDataURL())}catch(P){m(null)}});var T=mxUtils.createXmlDocument();T=null!=T.createElementNS?T.createElementNS(mxConstants.NS_SVG,"svg"):T.createElement("svg");b=(new mxSvgCanvas2D(T)).convertHtml(b);G.onerror=+Graph.htmlToPng=function(b,e,g,m,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var A=document.createElement("canvas");A.width=e*p;A.height=g*p;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var F=A.getContext("2d");F.scale(p,p);F.drawImage(G,0,0);m(A.toDataURL())}catch(P){m(null)}});var S=mxUtils.createXmlDocument();S=null!=S.createElementNS?S.createElementNS(mxConstants.NS_SVG,"svg"):S.createElement("svg");b=(new mxSvgCanvas2D(S)).convertHtml(b);G.onerror=function(F){m(null)};G.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+g+'">'+(""!=v?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+v+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};-Graph.addLightDarkColors=function(b,e,g,m){function v(U,c,f){return null!=m?m(U,c,f):mxUtils.isValidColor(f)?(null==T&&null!=e&&(T={}),null!=T&&(T[c]=U.style.getPropertyValue(c)),f=mxUtils.getLightDarkColor(f,null,null,g),U.style.setProperty(c,f.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),A=!1,G=0;G<p.length;G++)if(p[G]!=b){for(var T=null,F=0;F<p[G].style.length;F++){var P=p[G].style.item(F),Q=p[G].style.getPropertyValue(P);A=v(p[G],P,Q)||A}"FONT"==p[G].nodeName&&""==p[G].style.getPropertyValue("color")&&-(Q=p[G].getAttribute("color"),A=v(p[G],"color",Q)||A);null!=e&&null!=T&&p[G].setAttribute(e,JSON.stringify(T))}return A};Graph.removeLightDarkColors=function(b,e){b=b.getElementsByTagName("*");for(var g=!1,m=0;m<b.length;m++)try{var v=b[m].getAttribute(e);if(null!=v){b[m].removeAttribute(e);var p=JSON.parse(v),A;for(A in p){var G=p[A];""==G?(b[m].style[A]=null,""==b[m].getAttribute("style")&&b[m].removeAttribute("style")):b[m].style[A]=G;g=!0}}}catch(T){}return g};-Graph.setTextColor=function(b,e,g){for(var m=g?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=g?"color":"background-color",p=b.getElementsByTagName("*"),A=[],G=0;G<p.length;G++)A.push({node:p[G],value:p[G].style[v]});document.execCommand(g?"forecolor":"backcolor",!1,m);b=b.getElementsByTagName("*");for(G=0;G<b.length;G++){if(G<A.length&&A[G].node==b[G]&&A[G].value!=b[G].style[v]&&""==b[G].style[v])try{if(p=b[G].getAttribute(Graph.backupStyleAttribute),null!=p){var T=JSON.parse(p);T[v]=-"";b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(T))}}catch(F){}if(g&&b[G].getAttribute("color")==m||b[G].style[v]==m){g&&b[G].getAttribute("color")==m&&b[G].removeAttribute("color");b[G].style[v]=e!=mxConstants.NONE?mxUtils.getLightDarkColor(e).cssText:null;try{p=b[G].getAttribute(Graph.backupStyleAttribute),T=null!=p?JSON.parse(p):{},T[v]=e!=mxConstants.NONE?e:"",b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(T))}catch(F){}if(g&&mxClient.IS_FF){e=b[G];g=e.firstChild;if(null!=+Graph.addLightDarkColors=function(b,e,g,m){function v(T,c,f){return null!=m?m(T,c,f):mxUtils.isValidColor(f)?(null==S&&null!=e&&(S={}),null!=S&&(S[c]=T.style.getPropertyValue(c)),f=mxUtils.getLightDarkColor(f,null,null,g),T.style.setProperty(c,f.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),A=!1,G=0;G<p.length;G++)if(p[G]!=b){for(var S=null,F=0;F<p[G].style.length;F++){var P=p[G].style.item(F),Q=p[G].style.getPropertyValue(P);A=v(p[G],P,Q)||A}"FONT"==p[G].nodeName&&""==p[G].style.getPropertyValue("color")&&+(Q=p[G].getAttribute("color"),A=v(p[G],"color",Q)||A);null!=e&&null!=S&&p[G].setAttribute(e,JSON.stringify(S))}return A};Graph.removeLightDarkColors=function(b,e){b=b.getElementsByTagName("*");for(var g=!1,m=0;m<b.length;m++)try{var v=b[m].getAttribute(e);if(null!=v){b[m].removeAttribute(e);var p=JSON.parse(v),A;for(A in p){var G=p[A];""==G?(b[m].style[A]=null,""==b[m].getAttribute("style")&&b[m].removeAttribute("style")):b[m].style[A]=G;g=!0}}}catch(S){}return g};+Graph.setTextColor=function(b,e,g){for(var m=g?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=g?"color":"background-color",p=b.getElementsByTagName("*"),A=[],G=0;G<p.length;G++)A.push({node:p[G],value:p[G].style[v]});document.execCommand(g?"forecolor":"backcolor",!1,m);b=b.getElementsByTagName("*");for(G=0;G<b.length;G++){if(G<A.length&&A[G].node==b[G]&&A[G].value!=b[G].style[v]&&""==b[G].style[v])try{if(p=b[G].getAttribute(Graph.backupStyleAttribute),null!=p){var S=JSON.parse(p);S[v]=+"";b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}}catch(F){}if(g&&b[G].getAttribute("color")==m||b[G].style[v]==m){g&&b[G].getAttribute("color")==m&&b[G].removeAttribute("color");b[G].style[v]=e!=mxConstants.NONE?mxUtils.getLightDarkColor(e).cssText:null;try{p=b[G].getAttribute(Graph.backupStyleAttribute),S=null!=p?JSON.parse(p):{},S[v]=e!=mxConstants.NONE?e:"",b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}catch(F){}if(g&&mxClient.IS_FF){e=b[G];g=e.firstChild;if(null!=g&&"A"==g.nodeName&&null==g.nextSibling&&null!=g.firstChild){e.parentNode.insertBefore(g,e);for(m=g.firstChild;null!=m;)v=m.nextSibling,e.appendChild(m),m=v;g.appendChild(e)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=b.charCodeAt(g);return e};Graph.bytesToString=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=String.fromCharCode(b[g]);return e.join("")};Graph.base64EncodeUnicode=function(b){return btoa(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(e,g){return String.fromCharCode(parseInt(g,16))}))};Graph.base64DecodeUnicode=function(b){return decodeURIComponent(Array.prototype.map.call(atob(b),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))};Graph.compressNode=function(b,e){b=mxUtils.getXml(b);return Graph.compress(e?b:Graph.zapGremlins(b))};Graph.arrayBufferToString=function(b){var e="";b=new Uint8Array(b);for(var g=b.byteLength,m=0;m<g;m++)e+=String.fromCharCode(b[m]);return e};Graph.stringToArrayBuffer=function(b){return Uint8Array.from(b,function(e){return e.charCodeAt(0)})};Graph.arrayBufferIndexOfString=function(b,e,g){var m=e.charCodeAt(0),v=1,p=-1;for(g=g||0;g<b.byteLength;g++)if(b[g]==m){p=g;break}for(g=p+1;-1<p&&g<b.byteLength&&g<p+e.length-1;g++){if(b[g]!=e.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,e,p+1);v++}return v==e.length-1?p:-1};Graph.compress=function(b,e){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=e?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};Graph.decompress=function(b,e,g){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));e=decodeURIComponent(e?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return g?e:Graph.zapGremlins(e)};Graph.fadeNodes=function(b,e,g,m,v){v=null!=v?v:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,e);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+v+"ms ease-in-out");Graph.setOpacityForNodes(b,g);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=m&&m()},v)},0)};-Graph.exploreFromCell=function(b,e,g){pageSize=null!=g&&null!=g.pageSize?g.pageSize:8;minSize=null!=g&&null!=g.minSize?g.minSize:180;(function(m,v){function p(P,Q){if(P.getModel().isVertex(Q)){var U=P.container.scrollWidth/2,c=P.container.scrollHeight/2;P.rootCell=Q.referenceCell||Q;P.getModel().beginUpdate();try{for(var f=Q.referenceCell||Q,k=m.model.getCell(f.sourceCellId),B=m.getEdges(k,null,!0,!0,!1,!0),z=[],C=0;C<B.length;C++)null!=B[C].getTerminal(!0)&&null!=B[C].getTerminal(!1)&&m.isCellVisible(B[C])&&-!m.isEdgeIgnored(B[C])&&m.isCellVisible(B[C].getTerminal(!0))&&m.isCellVisible(B[C].getTerminal(!1))&&m.isCellVisible(m.getLayerForCell(B[C]))&&z.push(B[C]);z=B=z;if(null!=Q.startIndex||0<pageSize&&B.length>pageSize){var H=Q.startIndex||0;z=B.slice(Math.max(0,H),Math.min(B.length,H+pageSize))}z=m.getOpposites(z,k).concat(z);var K=P.cloneCells(z);for(C=0;C<z.length;C++)if(K[C].sourceCellId=z[C].id,P.model.isEdge(K[C]))for(K[C].geometry.x=0,K[C].geometry.y=0,K[C].geometry.points=null,K[C].setStyle(K[C].getStyle()+-";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffc0;textOpacity=100;"),K[C].setTerminal(f,null==K[C].getTerminal(!0)),k=0;k<K[C].getChildCount();k++){var M=K[C].getChildAt(k);null!=M.geometry&&M.geometry.relative&&(M.setStyle(M.getStyle()+";labelBackgroundColor=#ffffffc0;textOpacity=100;"),M.geometry.offset=new mxPoint(0,0),M.geometry.y=0,M.geometry.x=.5>M.geometry.x?-.8:.5<M.geometry.x?.8:0)}if(0<Q.startIndex){var O=P.createVertex(null,null,mxResources.get("previousPage")+-" ("+Math.ceil((Q.startIndex||0)/pageSize)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");O.referenceCell=f;O.startIndex=Math.max(0,(Q.startIndex||0)-pageSize);K.splice(0,0,O)}if(B.length>(Q.startIndex||0)+pageSize){var ea=P.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((Q.startIndex||0)/pageSize)+2)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ea.referenceCell=-f;ea.startIndex=(Q.startIndex||0)+pageSize;K.splice(0,0,ea)}for(var fa in P.getModel().cells){var S=P.getModel().getCell(fa);S!=P.rootCell&&!P.getModel().isAncestor(P.rootCell,S)&&P.getModel().isVertex(S)&&P.removeCells([S])}P.addCells(K);var ca=P.getModel().getGeometry(P.rootCell);null!=ca&&(ca=ca.clone(),ca.x=U-ca.width/2,ca.y=c-ca.height/3,P.getModel().setGeometry(P.rootCell,ca));Q=[];for(fa in P.getModel().cells)S=P.getModel().getCell(fa),S!=P.rootCell&&P.getModel().isVertex(S)&&P.getModel().getParent(S)==-P.getDefaultParent()&&(Q.push(S),ca=P.getModel().getGeometry(S),null!=ca&&(ca.x=U-ca.width/2,ca.y=c-ca.height/2));var ma=Q.length,la=2*Math.PI/ma,Z=Math.max(minSize,Math.min(P.container.scrollWidth/2.5-80,P.container.scrollHeight/2.5-80));for(U=0;U<ma;U++)ca=P.getModel().getGeometry(Q[U]),null!=ca&&(ca=ca.clone(),ca.x+=Z*Math.sin(U*la),ca.y+=Z*Math.cos(U*la),P.getModel().setGeometry(Q[U],ca))}finally{P.getModel().endUpdate()}}}var A=document.createElement("div");A.style.position="absolute";A.style.display=-"block";A.style.background=Editor.isDarkMode()?Editor.darkColor:"#ffffff";A.style.width="100%";A.style.height="100%";A.style.left="0px";A.style.top="0px";A.style.zIndex=2;var G=document.createElement("img");G.setAttribute("src",Editor.closeBlackImage);G.style.position="absolute";G.style.cursor="pointer";G.style.right="10px";G.style.top="10px";A.appendChild(G);var T=document.createElement("div");T.style.position="absolute";T.style.cursor="pointer";T.style.right="38px";T.style.top="14px";T.style.textAlign=-"right";T.style.verticalAlign="top";mxUtils.write(T,mxResources.get("close"));A.appendChild(T);document.body.appendChild(A);var F=function(P){27==P.keyCode&&G.click()};mxEvent.addListener(document,"keydown",F);(function(P){if(mxClient.isBrowserSupported()){var Q=new Graph(P);Q.keepEdgesInBackground=!0;Q.isCellResizable=function(){return!1};Q.isCellRotatable=function(){return!1};Q.getCursorForCell=function(z){return this.model.isVertex(z)?"pointer":null};Q.getFoldingImage=function(){return null};var U=-function(){mxEvent.removeListener(document,"keydown",F);P.parentNode.removeChild(P);m.scrollCellToVisible(v)};mxEvent.addListener(G,"click",U);mxEvent.addListener(T,"click",U);Q.setEnabled(!1);var c=Q.click;Q.click=function(z){var C=z.getCell(),H=null!=C?null!=C.referenceCell?C.referenceCell:C:null;null!=C&&Q.rootCell!=C&&0<Q.getEdges(H).length?p(Q,C):c.apply(this,arguments)};U=Q.container.scrollWidth/2;var f=Q.container.scrollHeight/3;Q.model.beginUpdate();var k=Q.importCells([v])[0];k.sourceCellId=-v.id;k.geometry.x=U-k.geometry.width/2;k.geometry.y=f-k.geometry.height/2;Q.model.endUpdate();var B=!1;Q.getModel().addListener(mxEvent.CHANGE,function(z,C){B||(z=C.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,Q.labelsVisible=!1,B=!0,mxEffects.animateChanges(Q,z,function(){var H=new mxParallelEdgeLayout(Q);H.spacing=60;var K=H.layout;H.layout=function(M){H.spacing=Math.min(60,Math.max(30,60-5*M.length));K.apply(this,arguments)};H.execute(Q.getDefaultParent());mxText.prototype.enableBoundingBox=+Graph.exploreFromCell=function(b,e,g){pageSize=null!=g&&null!=g.pageSize?g.pageSize:8;minSize=null!=g&&null!=g.minSize?g.minSize:180;(function(m,v){function p(P,Q){if(P.getModel().isVertex(Q)){var T=P.container.scrollWidth/2,c=P.container.scrollHeight/2;P.rootCell=Q.referenceCell||Q;P.getModel().beginUpdate();try{for(var f=Q.referenceCell||Q,k=m.model.getCell(f.sourceCellId),B=m.getEdges(k,null,!0,!0,!1,!0),z=[],C=0;C<B.length;C++)null!=B[C].getTerminal(!0)&&null!=B[C].getTerminal(!1)&&m.isCellVisible(B[C])&&+!m.isEdgeIgnored(B[C])&&m.isCellVisible(B[C].getTerminal(!0))&&m.isCellVisible(B[C].getTerminal(!1))&&m.isCellVisible(m.getLayerForCell(B[C]))&&z.push(B[C]);z=B=z;if(null!=Q.startIndex||0<pageSize&&B.length>pageSize){var I=Q.startIndex||0;z=B.slice(Math.max(0,I),Math.min(B.length,I+pageSize))}z=m.getOpposites(z,k).concat(z);var L=P.cloneCells(z);for(C=0;C<z.length;C++)if(L[C].sourceCellId=z[C].id,P.model.isEdge(L[C]))for(L[C].geometry.x=0,L[C].geometry.y=0,L[C].geometry.points=null,L[C].setStyle(L[C].getStyle()++";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffc0;textOpacity=100;"),L[C].setTerminal(f,null==L[C].getTerminal(!0)),k=0;k<L[C].getChildCount();k++){var J=L[C].getChildAt(k);null!=J.geometry&&J.geometry.relative&&(J.setStyle(J.getStyle()+";labelBackgroundColor=#ffffffc0;textOpacity=100;"),J.geometry.offset=new mxPoint(0,0),J.geometry.y=0,J.geometry.x=.5>J.geometry.x?-.8:.5<J.geometry.x?.8:0)}if(0<Q.startIndex){var O=P.createVertex(null,null,mxResources.get("previousPage")++" ("+Math.ceil((Q.startIndex||0)/pageSize)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");O.referenceCell=f;O.startIndex=Math.max(0,(Q.startIndex||0)-pageSize);L.splice(0,0,O)}if(B.length>(Q.startIndex||0)+pageSize){var da=P.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((Q.startIndex||0)/pageSize)+2)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");da.referenceCell=+f;da.startIndex=(Q.startIndex||0)+pageSize;L.splice(0,0,da)}for(var fa in P.getModel().cells){var V=P.getModel().getCell(fa);V!=P.rootCell&&!P.getModel().isAncestor(P.rootCell,V)&&P.getModel().isVertex(V)&&P.removeCells([V])}P.addCells(L);var ba=P.getModel().getGeometry(P.rootCell);null!=ba&&(ba=ba.clone(),ba.x=T-ba.width/2,ba.y=c-ba.height/3,P.getModel().setGeometry(P.rootCell,ba));Q=[];for(fa in P.getModel().cells)V=P.getModel().getCell(fa),V!=P.rootCell&&P.getModel().isVertex(V)&&P.getModel().getParent(V)==+P.getDefaultParent()&&(Q.push(V),ba=P.getModel().getGeometry(V),null!=ba&&(ba.x=T-ba.width/2,ba.y=c-ba.height/2));var ma=Q.length,la=2*Math.PI/ma,Z=Math.max(minSize,Math.min(P.container.scrollWidth/2.5-80,P.container.scrollHeight/2.5-80));for(T=0;T<ma;T++)ba=P.getModel().getGeometry(Q[T]),null!=ba&&(ba=ba.clone(),ba.x+=Z*Math.sin(T*la),ba.y+=Z*Math.cos(T*la),P.getModel().setGeometry(Q[T],ba))}finally{P.getModel().endUpdate()}}}var A=document.createElement("div");A.style.position="absolute";A.style.display=+"block";A.style.background=Editor.isDarkMode()?Editor.darkColor:"#ffffff";A.style.width="100%";A.style.height="100%";A.style.left="0px";A.style.top="0px";A.style.zIndex=2;var G=document.createElement("img");G.setAttribute("src",Editor.closeBlackImage);G.style.position="absolute";G.style.cursor="pointer";G.style.right="10px";G.style.top="10px";A.appendChild(G);var S=document.createElement("div");S.style.position="absolute";S.style.cursor="pointer";S.style.right="38px";S.style.top="14px";S.style.textAlign=+"right";S.style.verticalAlign="top";mxUtils.write(S,mxResources.get("close"));A.appendChild(S);document.body.appendChild(A);var F=function(P){27==P.keyCode&&G.click()};mxEvent.addListener(document,"keydown",F);(function(P){if(mxClient.isBrowserSupported()){var Q=new Graph(P);Q.keepEdgesInBackground=!0;Q.isCellResizable=function(){return!1};Q.isCellRotatable=function(){return!1};Q.getCursorForCell=function(z){return this.model.isVertex(z)?"pointer":null};Q.getFoldingImage=function(){return null};var T=+function(){mxEvent.removeListener(document,"keydown",F);P.parentNode.removeChild(P);m.scrollCellToVisible(v)};mxEvent.addListener(G,"click",T);mxEvent.addListener(S,"click",T);Q.setEnabled(!1);var c=Q.click;Q.click=function(z){var C=z.getCell(),I=null!=C?null!=C.referenceCell?C.referenceCell:C:null;null!=C&&Q.rootCell!=C&&0<Q.getEdges(I).length?p(Q,C):c.apply(this,arguments)};T=Q.container.scrollWidth/2;var f=Q.container.scrollHeight/3;Q.model.beginUpdate();var k=Q.importCells([v])[0];k.sourceCellId=+v.id;k.geometry.x=T-k.geometry.width/2;k.geometry.y=f-k.geometry.height/2;Q.model.endUpdate();var B=!1;Q.getModel().addListener(mxEvent.CHANGE,function(z,C){B||(z=C.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,Q.labelsVisible=!1,B=!0,mxEffects.animateChanges(Q,z,function(){var I=new mxParallelEdgeLayout(Q);I.spacing=60;var L=I.layout;I.layout=function(J){I.spacing=Math.min(60,Math.max(30,60-5*J.length));L.apply(this,arguments)};I.execute(Q.getDefaultParent());mxText.prototype.enableBoundingBox=!0;Q.labelsVisible=!0;Q.tooltipHandler.hide();Q.refresh();B=!1}))});p(Q,k)}else mxUtils.error("Browser is not supported!",200,!1)})(A)})(b,e)};Graph.removeKeys=function(b,e){for(var g in b)e(g)&&delete b[g]};Graph.setTransitionForNodes=function(b,e){for(var g=0;g<b.length;g++)mxUtils.setPrefixedStyle(b[g].style,"transition",e)};Graph.setOpacityForNodes=function(b,e){for(var g=0;g<b.length;g++)b[g].style.opacity=e};Graph.removePasteFormatting=function(b,e){for(;null!=b;){null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild,!0);var g=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style){"#000000"==b.style.color&&(b.style.color="");if("SPAN"==b.nodeName&&"Apple-tab-span"==b.className){var m=Graph.createTabNode(4);b.parentNode.replaceChild(m,b);b=m}if("P"==b.nodeName&&"p1"==b.className){for(;null!=b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);null!=g&&"P"==g.nodeName&&"p1"==g.className&&b.parentNode.insertBefore(b.ownerDocument.createElement("br"),b);b.parentNode.removeChild(b)}!e&&null!=b.innerHTML&&0<=b.innerHTML.indexOf("\t")&&(m=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,m.outerHTML))}b=g}};Graph.createTabNode=function(b){var e="\t";if(null!=b)for(e="";0<b;)e+=" ",b--;b=document.createElement("span");b.style.whiteSpace="pre";b.appendChild(document.createTextNode(e));return b};Graph.sanitizeHtml=function(b,e){return Graph.domPurify(b,!1)};Graph.sanitizeLink=function(b){if(null==b)return null;var e=document.createElement("a");e.setAttribute("href",b);Graph.sanitizeNode(e);return e.getAttribute("href")};Graph.sanitizeNode=function(b){return Graph.domPurify(b,!0)};DOMPurify.addHook("afterSanitizeAttributes",function(b){"use"==b.nodeName&&(null!=b.getAttribute("xlink:href")&&!b.getAttribute("xlink:href").startsWith("#")||null!=b.getAttribute("href")&&!b.getAttribute("href").startsWith("#"))&&b.remove()});Graph.domPurify=function(b,e){window.DOM_PURIFY_CONFIG.IN_PLACE=e;return DOMPurify.sanitize(b,window.DOM_PURIFY_CONFIG)};Graph.clipSvgDataUri=function(b,e){if(!mxClient.IS_IE&&!mxClient.IS_IE11&&null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var g=document.createElement("div");g.style.position="absolute";g.style.visibility="hidden";var m=decodeURIComponent(escape(atob(b.substring(26)))),v=m.indexOf("<svg");if(0<=v){g.innerHTML=Graph.sanitizeHtml(m.substring(v));var p=g.getElementsByTagName("svg");if(0<p.length){if(e||null!=p[0].getAttribute("preserveAspectRatio")){document.body.appendChild(g);try{m=e=-1;var A=p[0].getAttribute("width"),G=p[0].getAttribute("height");A=null!=A&&"%"!=A.charAt(A.length-1)?parseFloat(A):NaN;G=null!=G&&"%"!=G.charAt(G.length-1)?parseFloat(G):NaN;var T=p[0].getAttribute("viewBox");v=null;if(null!=T&&!isNaN(A)&&!isNaN(G)){var F=T.split(" ");4<=T.length&&(e=parseFloat(F[2])/A,m=parseFloat(F[3])/G,v=new mxRectangle(parseFloat(F[0]),parseFloat(F[1]),parseFloat(F[2]),parseFloat(F[3])))}var P=p[0].getBBox();0<P.width&&0<P.height&&(null==v||P.width*P.height<v.width*v.height*+1;var A=p[0].getAttribute("width"),G=p[0].getAttribute("height");A=null!=A&&"%"!=A.charAt(A.length-1)?parseFloat(A):NaN;G=null!=G&&"%"!=G.charAt(G.length-1)?parseFloat(G):NaN;var S=p[0].getAttribute("viewBox");v=null;if(null!=S&&!isNaN(A)&&!isNaN(G)){var F=S.split(" ");4<=S.length&&(e=parseFloat(F[2])/A,m=parseFloat(F[3])/G,v=new mxRectangle(parseFloat(F[0]),parseFloat(F[1]),parseFloat(F[2]),parseFloat(F[3])))}var P=p[0].getBBox();0<P.width&&0<P.height&&(null==v||P.width*P.height<v.width*v.height*.7)&&(g.getElementsByTagName("svg")[0].setAttribute("viewBox",P.x+" "+P.y+" "+P.width+" "+P.height),g.getElementsByTagName("svg")[0].setAttribute("width",P.width/e),g.getElementsByTagName("svg")[0].setAttribute("height",P.height/m))}catch(Q){}finally{document.body.removeChild(g)}}b=Editor.createSvgDataUri(mxUtils.getXml(p[0]))}}}catch(Q){}return b};Graph.createRemoveIcon=function(b,e){var g=document.createElement("img");g.setAttribute("src",Dialog.prototype.clearImage);g.setAttribute("title",b);g.setAttribute("width","13");g.setAttribute("height","10");g.style.marginLeft="4px";g.style.marginBottom="-1px";g.style.cursor="pointer";mxEvent.addListener(g,"click",e);return g};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};Graph.rewritePageLinks=function(b,e){function g(v,p){var A=v.getAttribute(p);if(null!=A){Graph.isPageLink(A)&&(A="#"+A.substring(A.indexOf(":")+1));var G=p;e&&"xlink:href"==p&&(v.removeAttribute(p),G="href");v.setAttribute(G,A)}}b=b.getElementsByTagName("a");if(null!=b)for(var m=0;m<b.length;m++)g(b[m],"href"),g(b[m],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};@@ -2316,32 +2316,32 @@ Graph.prototype.diagramBackgroundColor="#f0f0f0";Graph.prototype.enableDiagramBaGraph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;Graph.prototype.selectParentAfterDelete=!1;Graph.prototype.defaultEdgeLength=80;Graph.prototype.immediateHandling=!0;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}^ ^\"^ '^=^;]+)%","g");Graph.prototype.absoluteUrlPattern=RegExp("^(?:[a-z]+:)?//","i");Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=null!=urlParams.base?mxUtils.removeJavascriptProtocol(decodeURIComponent(urlParams.base)):(window!=window.top?document.referrer:document.location.toString()).split("#")[0];Graph.prototype.editAfterInsert=!1;Graph.prototype.builtInProperties=["label","tooltip","placeholders","placeholder"];Graph.prototype.standalone=!1;Graph.prototype.enableFlowAnimation=!1;Graph.prototype.roundableShapes="label rectangle internalStorage corner parallelogram swimlane triangle trapezoid ext step tee process link rhombus offPageConnector loopLimit hexagon manualInput card curlyBracket singleArrow callout doubleArrow flexArrow umlLifeline".split(" ");Graph.prototype.vertexFontSize=null;Graph.prototype.edgeFontSize=null;Graph.prototype.adaptiveColors="auto";-Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(g,m){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=g.view.graph.tolerance,p=!0,A=null,G=mxUtils.bind(this,function(P){p=!0;A=new mxPoint(mxEvent.getClientX(P),mxEvent.getClientY(P))}),T=mxUtils.bind(this,function(P){p=p&&null!=A&&Math.abs(A.x-mxEvent.getClientX(P))<v&&Math.abs(A.y-mxEvent.getClientY(P))<v}),F=mxUtils.bind(this,function(P){if(p)for(var Q=mxEvent.getSource(P);null!=-Q&&Q!=m.node;){if("a"==Q.nodeName.toLowerCase()){g.view.graph.labelLinkClicked(g,Q,P);break}Q=Q.parentNode}});mxEvent.addGestureListeners(m.node,G,T,F);mxEvent.addListener(m.node,"click",function(P){mxEvent.consume(P)})};if(null!=this.tooltipHandler){var e=this.tooltipHandler.init;this.tooltipHandler.init=function(){e.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(g){var m=mxEvent.getSource(g);"A"==m.nodeName&&(m=m.getAttribute("href"),null!=+Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(g,m){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=g.view.graph.tolerance,p=!0,A=null,G=mxUtils.bind(this,function(P){p=!0;A=new mxPoint(mxEvent.getClientX(P),mxEvent.getClientY(P))}),S=mxUtils.bind(this,function(P){p=p&&null!=A&&Math.abs(A.x-mxEvent.getClientX(P))<v&&Math.abs(A.y-mxEvent.getClientY(P))<v}),F=mxUtils.bind(this,function(P){if(p)for(var Q=mxEvent.getSource(P);null!=+Q&&Q!=m.node;){if("a"==Q.nodeName.toLowerCase()){g.view.graph.labelLinkClicked(g,Q,P);break}Q=Q.parentNode}});mxEvent.addGestureListeners(m.node,G,S,F);mxEvent.addListener(m.node,"click",function(P){mxEvent.consume(P)})};if(null!=this.tooltipHandler){var e=this.tooltipHandler.init;this.tooltipHandler.init=function(){e.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(g){var m=mxEvent.getSource(g);"A"==m.nodeName&&(m=m.getAttribute("href"),null!=m&&this.graph.isCustomLink(m)&&(mxEvent.isTouchEvent(g)||!mxEvent.isPopupTrigger(g))&&this.graph.customLinkClicked(m)&&mxEvent.consume(g))}))}}this.initLayoutManager()};(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.isFillState=function(A){return!this.isSpecialColor(A.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(A.style,"lineShape",null)&&(this.model.isVertex(A.cell)||"arrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"wire"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"filledEdge"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"flexArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"mxgraph.arrows2.wedgeArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isGradientState=function(A){return this.isFillState(A)&&"wire"!=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)};Graph.prototype.isStrokeState=function(A){return!0};Graph.prototype.isSpecialColor=function(A){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],A)};Graph.prototype.isGlassState=function(A){A=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return"label"==A||"rectangle"==A||"internalStorage"==A||"ext"==A||"umlLifeline"==A||"swimlane"==A||"process"==A};Graph.prototype.isRoundedState=function(A){return null!=A.shape?A.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(A){var G=mxUtils.getValue(A.style,-mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(A.style,mxConstants.STYLE_CURVED,!1)&&("connector"==G||"filledEdge"==G||"wire"==G)};Graph.prototype.isAutoSizeState=function(A){return"1"==mxUtils.getValue(A.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(A){return null!=mxUtils.getValue(A.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(A){return!0};Graph.prototype.getVerticesAndEdges=function(A,G){A=null!=A?A:!0;G=null!=G?G:!0;var T=this.model;-return T.filterDescendants(function(F){return A&&T.isVertex(F)||G&&T.isEdge(F)},T.getRoot())};Graph.prototype.applyNewEdgeStyle=function(A,G,T){A=this.getCellStyle(A).newEdgeStyle;if(null!=A){this.model.beginUpdate();try{var F=JSON.parse(A),P;for(P in F)this.setCellStyles(P,F[P],G),"edgeStyle"==P&&"elbowEdgeStyle"==F[P]&&null!=T&&this.setCellStyles("elbow",T==mxConstants.DIRECTION_SOUTH||T==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",G)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=-function(A){for(var G={},T=0;T<A.length;T++){var F=this.view.getState(A[T]);null!=F&&this.mergeStyle(F.style,G,0==T)}return G};Graph.prototype.mergeStyle=function(A,G,T){if(null!=A){var F={},P;for(P in A){var Q=A[P];null!=Q&&(F[P]=!0,null==G[P]&&T?G[P]=Q:G[P]!=Q&&delete G[P])}for(P in G)F[P]||delete G[P]}};Graph.prototype.getStartEditingCell=function(A,G){G=this.getCellStyle(A);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&-0<this.model.getChildCount(A)&&(A=this.model.getChildAt(A,0),G=this.getCellStyle(A),G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&0<this.model.getChildCount(A))for(G=0;G<this.model.getChildCount(A);G++){var T=this.model.getChildAt(A,G);if(this.isCellEditable(T)){A=T;break}}return A};Graph.prototype.copyStyle=function(A){return this.getCellStyle(A,!1)};Graph.prototype.pasteStyle=function(A,G,T,F){null!=A&&(F||-(T=null!=T?T:Graph.cellStyles,Graph.removeKeys(A,function(P){return 0>mxUtils.indexOf(T,P)})),this.updateCellStyles(A,G))};Graph.prototype.copyCellStyles=function(A,G,T,F,P,Q,U){var c=!1,f=!1;if(0<A.length)for(var k=0;k<A.length&&(c=this.getModel().isVertex(A[k])||c,!(f=this.getModel().isEdge(A[k])||f)||!c);k++);else f=c=!0;c=c&&!Q;f=f&&!U;for(k=0;k<G.length;k++)if(A=0<=mxUtils.indexOf(Graph.textStyles,G[k]),"strokeColor"!=G[k]||null!=T[k]&&"none"!=T[k])if(0<=mxUtils.indexOf(Graph.cellStyles,G[k])||-"shape"==G[k])if("shape"!=G[k]&&(c||A)&&(null==T[k]?delete F[G[k]]:F[G[k]]=T[k]),f||A)null==T[k]?delete P[G[k]]:P[G[k]]=T[k]};Graph.prototype.includeDescendants=function(A){for(var G=[],T=0;T<A.length;T++)G=G.concat(this.model.getDescendants(A[T]));return G};Graph.prototype.pasteCellStyles=function(A,G,T,F,P){G=null!=G?G:this.currentVertexStyle;T=null!=T?T:this.currentEdgeStyle;P=null!=P?P:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var Q=0;Q<A.length;Q++){var U=A[Q],c=this.model.getStyle(U),-f=!1;null!=U.style&&(pairs=U.style.split(";"),f=f||0<=mxUtils.indexOf(pairs,"text"));if(f)var k=Graph.textStyles;else if(k=Graph.cellStyles.slice(),!F)for(var B=null!=c?c.split(";"):[],z=0;z<B.length;z++){var C=B[z],H=C.indexOf("=");if(0<=H){var K=C.substring(0,H),M=mxUtils.indexOf(k,K);0<=M&&k.splice(M,1);for(f=0;f<Graph.cellStyleGroups.length;f++){var O=Graph.cellStyleGroups[f];if(0<=mxUtils.indexOf(O,K))for(var ea=0;ea<O.length;ea++){var fa=mxUtils.indexOf(k,O[ea]);0<=fa&&k.splice(fa,1)}}}}var S=-this.model.isEdge(U);f=S?T:G;for(z=0;z<k.length;z++){K=k[z];var ca=f[K];null!=ca&&("edgeStyle"!=K||P)&&(S||!S&&0>mxUtils.indexOf(Graph.edgeStyles,K))&&(c=mxUtils.setStyle(c,K,ca),"fontFamily"==K&&null==f.fontSource&&(c=mxUtils.setStyle(c,"fontSource",null)),S&&"rounded"==K&&"1"==ca&&null==f.curved&&(c=mxUtils.setStyle(c,"curved",null)))}Editor.simpleLabels&&(c=mxUtils.setStyle(mxUtils.setStyle(c,"html",null),"whiteSpace",null));this.model.setStyle(U,c)}}finally{this.model.endUpdate()}return A};Graph.prototype.updateCellStyles=-function(A,G){this.model.beginUpdate();try{for(var T=0;T<G.length;T++)if(this.model.isVertex(G[T])||this.model.isEdge(G[T])){var F=this.getCellStyle(G[T],!1),P=F[mxConstants.STYLE_PERIMETER],Q=!1;for(c in A){var U=A[c];if(F[c]!=U){if(c==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[c]&&"umlLifeline"!=U){Q=!0;var c="participant"}this.setCellStyles(c,U,[G[T]])}}Q&&this.setCellStyles(mxConstants.STYLE_PERIMETER,P,[G[T]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=-urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(A,G,T,F,P,Q){this.useCssTransforms&&(A=A/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=-function(A,G,T,F,P,Q){F=null!=F?F:!0;P=null!=P?P:!0;null==T&&(T=this.getCurrentRoot(),null==T&&(T=this.getModel().getRoot()));if(null!=T)for(var U=this.model.getChildCount(T)-1;0<=U;U--){var c=this.model.getChildAt(T,U),f=this.getScaledCellAt(A,G,c,F,P,Q);if(null!=f)return f;if(this.isCellVisible(c)&&(P&&this.model.isEdge(c)||F&&this.model.isVertex(c))&&(f=this.view.getState(c),null!=f&&(null==Q||!Q(f,A,G))&&this.intersects(f,A,G)))return c}return null};Graph.prototype.isRecursiveVertexResize=function(A){return!this.isSwimlane(A.cell)&&+mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(A.style,mxConstants.STYLE_CURVED,!1)&&("connector"==G||"filledEdge"==G||"wire"==G)};Graph.prototype.isAutoSizeState=function(A){return"1"==mxUtils.getValue(A.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(A){return null!=mxUtils.getValue(A.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(A){return!0};Graph.prototype.getVerticesAndEdges=function(A,G){A=null!=A?A:!0;G=null!=G?G:!0;var S=this.model;+return S.filterDescendants(function(F){return A&&S.isVertex(F)||G&&S.isEdge(F)},S.getRoot())};Graph.prototype.applyNewEdgeStyle=function(A,G,S){A=this.getCellStyle(A).newEdgeStyle;if(null!=A){this.model.beginUpdate();try{var F=JSON.parse(A),P;for(P in F)this.setCellStyles(P,F[P],G),"edgeStyle"==P&&"elbowEdgeStyle"==F[P]&&null!=S&&this.setCellStyles("elbow",S==mxConstants.DIRECTION_SOUTH||S==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",G)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=+function(A){for(var G={},S=0;S<A.length;S++){var F=this.view.getState(A[S]);null!=F&&this.mergeStyle(F.style,G,0==S)}return G};Graph.prototype.mergeStyle=function(A,G,S){if(null!=A){var F={},P;for(P in A){var Q=A[P];null!=Q&&(F[P]=!0,null==G[P]&&S?G[P]=Q:G[P]!=Q&&delete G[P])}for(P in G)F[P]||delete G[P]}};Graph.prototype.getStartEditingCell=function(A,G){G=this.getCellStyle(A);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&+0<this.model.getChildCount(A)&&(A=this.model.getChildAt(A,0),G=this.getCellStyle(A),G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&0<this.model.getChildCount(A))for(G=0;G<this.model.getChildCount(A);G++){var S=this.model.getChildAt(A,G);if(this.isCellEditable(S)){A=S;break}}return A};Graph.prototype.copyStyle=function(A){return this.getCellStyle(A,!1)};Graph.prototype.pasteStyle=function(A,G,S,F){null!=A&&(F||+(S=null!=S?S:Graph.cellStyles,Graph.removeKeys(A,function(P){return 0>mxUtils.indexOf(S,P)})),this.updateCellStyles(A,G))};Graph.prototype.copyCellStyles=function(A,G,S,F,P,Q,T){var c=!1,f=!1;if(0<A.length)for(var k=0;k<A.length&&(c=this.getModel().isVertex(A[k])||c,!(f=this.getModel().isEdge(A[k])||f)||!c);k++);else f=c=!0;c=c&&!Q;f=f&&!T;for(k=0;k<G.length;k++)if(A=0<=mxUtils.indexOf(Graph.textStyles,G[k]),"strokeColor"!=G[k]||null!=S[k]&&"none"!=S[k])if(0<=mxUtils.indexOf(Graph.cellStyles,G[k])||+"shape"==G[k])if("shape"!=G[k]&&(c||A)&&(null==S[k]?delete F[G[k]]:F[G[k]]=S[k]),f||A)null==S[k]?delete P[G[k]]:P[G[k]]=S[k]};Graph.prototype.includeDescendants=function(A){for(var G=[],S=0;S<A.length;S++)G=G.concat(this.model.getDescendants(A[S]));return G};Graph.prototype.pasteCellStyles=function(A,G,S,F,P){G=null!=G?G:this.currentVertexStyle;S=null!=S?S:this.currentEdgeStyle;P=null!=P?P:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var Q=0;Q<A.length;Q++){var T=A[Q],c=this.model.getStyle(T),+f=!1;null!=T.style&&(pairs=T.style.split(";"),f=f||0<=mxUtils.indexOf(pairs,"text"));if(f)var k=Graph.textStyles;else if(k=Graph.cellStyles.slice(),!F)for(var B=null!=c?c.split(";"):[],z=0;z<B.length;z++){var C=B[z],I=C.indexOf("=");if(0<=I){var L=C.substring(0,I),J=mxUtils.indexOf(k,L);0<=J&&k.splice(J,1);for(f=0;f<Graph.cellStyleGroups.length;f++){var O=Graph.cellStyleGroups[f];if(0<=mxUtils.indexOf(O,L))for(var da=0;da<O.length;da++){var fa=mxUtils.indexOf(k,O[da]);0<=fa&&k.splice(fa,1)}}}}var V=+this.model.isEdge(T);f=V?S:G;for(z=0;z<k.length;z++){L=k[z];var ba=f[L];null!=ba&&("edgeStyle"!=L||P)&&(V||!V&&0>mxUtils.indexOf(Graph.edgeStyles,L))&&(c=mxUtils.setStyle(c,L,ba),"fontFamily"==L&&null==f.fontSource&&(c=mxUtils.setStyle(c,"fontSource",null)),V&&"rounded"==L&&"1"==ba&&null==f.curved&&(c=mxUtils.setStyle(c,"curved",null)))}Editor.simpleLabels&&(c=mxUtils.setStyle(mxUtils.setStyle(c,"html",null),"whiteSpace",null));this.model.setStyle(T,c)}}finally{this.model.endUpdate()}return A};Graph.prototype.updateCellStyles=+function(A,G){this.model.beginUpdate();try{for(var S=0;S<G.length;S++)if(this.model.isVertex(G[S])||this.model.isEdge(G[S])){var F=this.getCellStyle(G[S],!1),P=F[mxConstants.STYLE_PERIMETER],Q=!1;for(c in A){var T=A[c];if(F[c]!=T){if(c==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[c]&&"umlLifeline"!=T){Q=!0;var c="participant"}this.setCellStyles(c,T,[G[S]])}}Q&&this.setCellStyles(mxConstants.STYLE_PERIMETER,P,[G[S]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=+urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(A,G,S,F,P,Q){this.useCssTransforms&&(A=A/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=+function(A,G,S,F,P,Q){F=null!=F?F:!0;P=null!=P?P:!0;null==S&&(S=this.getCurrentRoot(),null==S&&(S=this.getModel().getRoot()));if(null!=S)for(var T=this.model.getChildCount(S)-1;0<=T;T--){var c=this.model.getChildAt(S,T),f=this.getScaledCellAt(A,G,c,F,P,Q);if(null!=f)return f;if(this.isCellVisible(c)&&(P&&this.model.isEdge(c)||F&&this.model.isVertex(c))&&(f=this.view.getState(c),null!=f&&(null==Q||!Q(f,A,G))&&this.intersects(f,A,G)))return c}return null};Graph.prototype.isRecursiveVertexResize=function(A){return!this.isSwimlane(A.cell)&&0<this.model.getChildCount(A.cell)&&!this.isCellCollapsed(A.cell)&&"1"==mxUtils.getValue(A.style,"recursiveResize","1")&&null==mxUtils.getValue(A.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(A){for(var G=this.getCellGeometry(A);null!=G&&G.relative;)A=this.getModel().getParent(A),G=this.getCellGeometry(A);return A};Graph.prototype.isPart=function(A){return"1"==mxUtils.getValue(this.getCurrentCellStyle(A),"part","0")||this.isTableCell(A)||this.isTableRow(A)};Graph.prototype.getCompositeParents=-function(A){for(var G=new mxDictionary,T=[],F=0;F<A.length;F++){var P=this.getCompositeParent(A[F]);this.isTableCell(P)&&(P=this.graph.model.getParent(P));this.isTableRow(P)&&(P=this.graph.model.getParent(P));null==P||G.get(P)||(G.put(P,!0),T.push(P))}return T};Graph.prototype.getReferenceTerminal=function(A){if(null!=A){var G=this.getCellGeometry(A);null!=G&&G.relative&&(A=this.model.getParent(A))}null!=A&&this.model.isEdge(A)&&(A=this.model.getParent(A));null!=A&&(A=this.getCompositeParent(A));-return A};Graph.prototype.getCompositeParent=function(A){for(;this.isPart(A);){var G=this.model.getParent(A);if(!this.model.isVertex(G))break;A=G}return A};Graph.prototype.filterSelectionCells=function(A){var G=this.getSelectionCells();if(null!=A){for(var T=[],F=0;F<G.length;F++)A(G[F])||T.push(G[F]);G=T}return G};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(A){if(this.useCssTransforms){var G=this.currentScale,T=this.currentTranslate;A=new mxRectangle((A.x+-2*T.x)*G-T.x,(A.y+2*T.y)*G-T.y,A.width*G,A.height*G)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(A){A=this.strokeWidth;this.graph.useCssTransforms&&(A/=this.graph.currentScale);return A};mxGraphView.prototype.getGraphBounds=function(){var A=this.graphBounds;if(this.graph.useCssTransforms){var G=this.graph.currentTranslate,T=this.graph.currentScale;A=new mxRectangle((A.x+G.x)*T,(A.y+G.y)*T,A.width*T,A.height*T)}return A};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?+function(A){for(var G=new mxDictionary,S=[],F=0;F<A.length;F++){var P=this.getCompositeParent(A[F]);this.isTableCell(P)&&(P=this.graph.model.getParent(P));this.isTableRow(P)&&(P=this.graph.model.getParent(P));null==P||G.get(P)||(G.put(P,!0),S.push(P))}return S};Graph.prototype.getReferenceTerminal=function(A){if(null!=A){var G=this.getCellGeometry(A);null!=G&&G.relative&&(A=this.model.getParent(A))}null!=A&&this.model.isEdge(A)&&(A=this.model.getParent(A));null!=A&&(A=this.getCompositeParent(A));+return A};Graph.prototype.getCompositeParent=function(A){for(;this.isPart(A);){var G=this.model.getParent(A);if(!this.model.isVertex(G))break;A=G}return A};Graph.prototype.filterSelectionCells=function(A){var G=this.getSelectionCells();if(null!=A){for(var S=[],F=0;F<G.length;F++)A(G[F])||S.push(G[F]);G=S}return G};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(A){if(this.useCssTransforms){var G=this.currentScale,S=this.currentTranslate;A=new mxRectangle((A.x++2*S.x)*G-S.x,(A.y+2*S.y)*G-S.y,A.width*G,A.height*G)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(A){A=this.strokeWidth;this.graph.useCssTransforms&&(A/=this.graph.currentScale);return A};mxGraphView.prototype.getGraphBounds=function(){var A=this.graphBounds;if(this.graph.useCssTransforms){var G=this.graph.currentTranslate,S=this.graph.currentScale;A=new mxRectangle((A.x+G.x)*S,(A.y+G.y)*S,A.width*S,A.height*S)}return A};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var e=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(A){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0);e.apply(this,arguments);this.graph.useCssTransforms&&(this.graph.updateCssTransform(),this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,-this.translate.y=this.graph.currentTranslate.y)};var g=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(A){A=g.apply(this,arguments);for(var G=[],T=0;T<A.length;T++)this.isTableRow(A[T])||this.isTableCell(A[T])||G.push(A[T]);return G};var m=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(A){A=m.apply(this,arguments);for(var G=[],T=0;T<A.length;T++)this.isTable(A[T])||this.isTableRow(A[T])||this.isTableCell(A[T])||G.push(A[T]);return G};-Graph.prototype.updateCssTransform=function(){var A=this.view.getDrawPane();if(null!=A)if(A=A.parentNode,this.useCssTransforms){var G=A.getAttribute("transform");A.setAttribute("transformOrigin","0 0");var T=Math.round(100*this.currentScale)/100;A.setAttribute("transform","scale("+T+","+T+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");G!=A.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",-A.getAttribute("transform"))}else A.removeAttribute("transformOrigin"),A.removeAttribute("transform")};var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph.useCssTransforms,G=this.scale,T=this.translate;A&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);A&&(this.scale=G,this.translate=T)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(A,-G,T){var F=this.useCssTransforms,P=this.view.scale,Q=this.view.translate;F&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);F&&(this.view.scale=P,this.view.translate=Q,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};+this.translate.y=this.graph.currentTranslate.y)};var g=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(A){A=g.apply(this,arguments);for(var G=[],S=0;S<A.length;S++)this.isTableRow(A[S])||this.isTableCell(A[S])||G.push(A[S]);return G};var m=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(A){A=m.apply(this,arguments);for(var G=[],S=0;S<A.length;S++)this.isTable(A[S])||this.isTableRow(A[S])||this.isTableCell(A[S])||G.push(A[S]);return G};+Graph.prototype.updateCssTransform=function(){var A=this.view.getDrawPane();if(null!=A)if(A=A.parentNode,this.useCssTransforms){var G=A.getAttribute("transform");A.setAttribute("transformOrigin","0 0");var S=Math.round(100*this.currentScale)/100;A.setAttribute("transform","scale("+S+","+S+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");G!=A.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",+A.getAttribute("transform"))}else A.removeAttribute("transformOrigin"),A.removeAttribute("transform")};var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph.useCssTransforms,G=this.scale,S=this.translate;A&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);A&&(this.scale=G,this.translate=S)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(A,+G,S){var F=this.useCssTransforms,P=this.view.scale,Q=this.view.translate;F&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);F&&(this.view.scale=P,this.view.translate=Q,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};Graph.prototype.labelLinkClicked=function(b,e,g){var m=e.getAttribute("href");m!=Graph.sanitizeLink(m)&&Graph.sanitizeNode(e);if(null!=m&&!this.isCustomLink(m)&&(mxEvent.isLeftMouseButton(g)&&!mxEvent.isPopupTrigger(g)||mxEvent.isTouchEvent(g))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(m)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(m),b);mxEvent.consume(g)}};Graph.prototype.openLink=function(b,e,g){var m=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==e&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==b.charAt(this.baseUrl.length)&&"_top"==e&&window==window.top){var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=v}else m=window.open(b,null!=e?e:"_blank",g?null:"noopener,noreferrer"),null==m||g||(m.opener=null)}catch(p){}return m};Graph.prototype.getLinkTitle=function(b){return b.substring(b.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(b){return"data:"==b.substring(0,5)};Graph.prototype.customLinkClicked=function(b,e){return!1};Graph.prototype.isExternalProtocol=function(b){return"mailto:"===b.substring(0,7)};Graph.prototype.isBlankLink=function(b){return!this.isExternalProtocol(b)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(b)&&b.substring(0,this.domainUrl.length)!==this.domainUrl)};@@ -2356,7 +2356,7 @@ Graph.prototype.createLayouts=function(b){for(var e=[],g=0;g<b.length;g++)if(0<=Graph.prototype.getDataForCells=function(b,e){for(var g=[],m=0;m<b.length;m++){var v={};v.id=b[m].id;var p=null!=b[m].value?b[m].value.attributes:null;this.isReplacePlaceholders(b[m])&&e&&(v.value=this.getLabel(b[m]));if(null!=p)for(var A=0;A<p.length;A++)v[p[A].nodeName]=p[A].nodeValue;else v.label=this.convertValueToString(b[m]);g.push(v)}return g};Graph.prototype.getNodesForCells=function(b){for(var e=[],g=0;g<b.length;g++){var m=this.view.getState(b[g]);if(null!=m){for(var v=this.cellRenderer.getShapesForState(m),p=0;p<v.length;p++)null!=v[p]&&null!=v[p].node&&e.push(v[p].node);null!=m.control&&null!=m.control.node&&e.push(m.control.node)}}return e};Graph.prototype.createWipeAnimations=function(b,e){for(var g=[],m=0;m<b.length;m++){var v=this.view.getState(b[m]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?g.push(this.createEdgeWipeAnimation(v,e)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&g.push(this.createVertexWipeAnimation(v,e)))}return g};-Graph.prototype.createEdgeWipeAnimation=function(b,e){var g=b.absolutePoints.slice(),m=b.segments,v=b.length,p=g.length;return{execute:mxUtils.bind(this,function(A,G){if(null!=b.shape){var T=[g[0]];G=A/G;e||(G=1-G);for(var F=v*G,P=1;P<p;P++)if(F<=m[P-1]){T.push(new mxPoint(g[P-1].x+(g[P].x-g[P-1].x)*F/m[P-1],g[P-1].y+(g[P].y-g[P-1].y)*F/m[P-1]));break}else F-=m[P-1],T.push(g[P]);b.shape.points=T;b.shape.redraw();0==A&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=+Graph.prototype.createEdgeWipeAnimation=function(b,e){var g=b.absolutePoints.slice(),m=b.segments,v=b.length,p=g.length;return{execute:mxUtils.bind(this,function(A,G){if(null!=b.shape){var S=[g[0]];G=A/G;e||(G=1-G);for(var F=v*G,P=1;P<p;P++)if(F<=m[P-1]){S.push(new mxPoint(g[P-1].x+(g[P].x-g[P-1].x)*F/m[P-1],g[P-1].y+(g[P].y-g[P-1].y)*F/m[P-1]));break}else F-=m[P-1],S.push(g[P]);b.shape.points=S;b.shape.redraw();0==A&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=G)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.createVertexWipeAnimation=function(b,e){var g=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(m,v){null!=b.shape&&(v=m/v,e||(v=1-v),b.shape.bounds=new mxRectangle(g.x,g.y,g.width*v,g.height),b.shape.redraw(),0==m&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=v))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.executeAnimations=function(b,e,g,m){g=null!=g?g:30;m=null!=m?m:30;var v=null,p=0,A=mxUtils.bind(this,function(){if(p==g||this.stoppingCustomActions){window.clearInterval(v);for(var G=0;G<b.length;G++)b[G].stop();null!=e&&e()}else for(G=0;G<b.length;G++)b[G].execute(p,g);p++});v=window.setInterval(A,m);A()};@@ -2371,17 +2371,17 @@ Graph.prototype.isLabelMovable=function(b){var e=this.getCurrentCellStyle(b);retGraph.prototype.getClickableLinkForCell=function(b){do{var e=this.getLinkForCell(b);if(null!=e)return e;b=this.model.getParent(b)}while(null!=b);return null};Graph.prototype.getGlobalVariable=function(b){var e=null;"date"==b?e=(new Date).toLocaleDateString():"time"==b?e=(new Date).toLocaleTimeString():"timestamp"==b?e=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),e=this.formatDate(new Date,b));return e};Graph.prototype.formatDate=function(b,e,g){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var m=this.dateFormatCache,v=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,p=/[^-+\dA-Z]/g,A=function(z,C){z=String(z);for(C=C||2;z.length<C;)z="0"+z;return z};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||-/\d/.test(b)||(e=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");e=String(m.masks[e]||e||m.masks["default"]);"UTC:"==e.slice(0,4)&&(e=e.slice(4),g=!0);var G=g?"getUTC":"get",T=b[G+"Date"](),F=b[G+"Day"](),P=b[G+"Month"](),Q=b[G+"FullYear"](),U=b[G+"Hours"](),c=b[G+"Minutes"](),f=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var k=g?0:b.getTimezoneOffset(),B={d:T,dd:A(T),ddd:m.i18n.dayNames[F],dddd:m.i18n.dayNames[F+7],m:P+1,mm:A(P+1),mmm:m.i18n.monthNames[P],mmmm:m.i18n.monthNames[P+-12],yy:String(Q).slice(2),yyyy:Q,h:U%12||12,hh:A(U%12||12),H:U,HH:A(U),M:c,MM:A(c),s:f,ss:A(f),l:A(G,3),L:A(99<G?Math.round(G/10):G),t:12>U?"a":"p",tt:12>U?"am":"pm",T:12>U?"A":"P",TT:12>U?"AM":"PM",Z:g?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<k?"-":"+")+A(100*Math.floor(Math.abs(k)/60)+Math.abs(k)%60,4),S:["th","st","nd","rd"][3<T%10?0:(10!=T%100-T%10)*T%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(z){return z in B?B[z]:z.slice(1,+/\d/.test(b)||(e=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");e=String(m.masks[e]||e||m.masks["default"]);"UTC:"==e.slice(0,4)&&(e=e.slice(4),g=!0);var G=g?"getUTC":"get",S=b[G+"Date"](),F=b[G+"Day"](),P=b[G+"Month"](),Q=b[G+"FullYear"](),T=b[G+"Hours"](),c=b[G+"Minutes"](),f=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var k=g?0:b.getTimezoneOffset(),B={d:S,dd:A(S),ddd:m.i18n.dayNames[F],dddd:m.i18n.dayNames[F+7],m:P+1,mm:A(P+1),mmm:m.i18n.monthNames[P],mmmm:m.i18n.monthNames[P++12],yy:String(Q).slice(2),yyyy:Q,h:T%12||12,hh:A(T%12||12),H:T,HH:A(T),M:c,MM:A(c),s:f,ss:A(f),l:A(G,3),L:A(99<G?Math.round(G/10):G),t:12>T?"a":"p",tt:12>T?"am":"pm",T:12>T?"A":"P",TT:12>T?"AM":"PM",Z:g?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<k?"-":"+")+A(100*Math.floor(Math.abs(k)/60)+Math.abs(k)%60,4),S:["th","st","nd","rd"][3<S%10?0:(10!=S%100-S%10)*S%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(z){return z in B?B[z]:z.slice(1,z.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var e=null;if(0<b.length){e=this.getLayerForCell(b[0]);for(var g=1;g<b.length;g++)if(!this.model.isAncestor(e,b[g])){e=null;break}}return e};-Graph.prototype.createLayersDialog=function(b,e){var g=document.createElement("div");g.style.position="absolute";for(var m=this.getModel(),v=m.getChildCount(m.root),p=0;p<v;p++)mxUtils.bind(this,function(A){function G(){m.isVisible(A)?(P.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(F,75)):(P.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(F,25))}var T=this.convertValueToString(A)||mxResources.get("background")||"Background",F=document.createElement("div");F.style.overflow=-"hidden";F.style.textOverflow="ellipsis";F.style.padding="2px";F.style.whiteSpace="nowrap";F.style.cursor="pointer";F.setAttribute("title",mxResources.get(m.isVisible(A)?"hideIt":"show",[T]));var P=document.createElement("img");P.setAttribute("draggable","false");P.setAttribute("align","absmiddle");P.setAttribute("border","0");P.style.position="relative";P.style.width="16px";P.style.padding="0px 6px 0 4px";e&&(P.style.filter="invert(100%)",P.style.top="-2px");F.appendChild(P);mxUtils.write(F,T);g.appendChild(F);+Graph.prototype.createLayersDialog=function(b,e){var g=document.createElement("div");g.style.position="absolute";for(var m=this.getModel(),v=m.getChildCount(m.root),p=0;p<v;p++)mxUtils.bind(this,function(A){function G(){m.isVisible(A)?(P.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(F,75)):(P.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(F,25))}var S=this.convertValueToString(A)||mxResources.get("background")||"Background",F=document.createElement("div");F.style.overflow=+"hidden";F.style.textOverflow="ellipsis";F.style.padding="2px";F.style.whiteSpace="nowrap";F.style.cursor="pointer";F.setAttribute("title",mxResources.get(m.isVisible(A)?"hideIt":"show",[S]));var P=document.createElement("img");P.setAttribute("draggable","false");P.setAttribute("align","absmiddle");P.setAttribute("border","0");P.style.position="relative";P.style.width="16px";P.style.padding="0px 6px 0 4px";e&&(P.style.filter="invert(100%)",P.style.top="-2px");F.appendChild(P);mxUtils.write(F,S);g.appendChild(F);mxEvent.addListener(F,"click",function(){m.setVisible(A,!m.isVisible(A));G();null!=b&&b(A)});G()})(m.getChildAt(m.root,p));return g};-Graph.prototype.replacePlaceholders=function(b,e,g,m){m=[];if(null!=e){for(var v=0;match=this.placeholderPattern.exec(e);){var p=match[0];if(2<p.length&&"%label%"!=p&&"%tooltip%"!=p){var A=null;if(match.index>v&&"%"==e.charAt(match.index-1))A=p.substring(1);else{var G=p.substring(1,p.length-1),T={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==G)A=b.id;else if("width"===G.substring(0,5)&&this.model.isVertex(b)){var F=this.getCellGeometry(b);-null!=F&&(A=F.width,5<G.length&&(A=Editor.toUnit(A,T[G.substring(6)])))}else if("height"==G.substring(0,6)&&this.model.isVertex(b))F=this.getCellGeometry(b),null!=F&&(A=F.height,6<G.length&&(A=Editor.toUnit(A,T[G.substring(7)])));else if("length"==G.substring(0,6)){for(F=b;null!=F&&!this.model.isEdge(F);)F=this.model.getParent(F);F=this.view.getState(F);null!=F&&(A=Math.round(F.length/this.view.scale),6<G.length&&(A=Editor.toUnit(A,T[G.substring(7)])))}else if(0>G.indexOf("{"))for(T=b;null==A&&null!=-T;)null!=T.value&&"object"==typeof T.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(A=T.getAttribute(G+"_"+Graph.diagramLanguage)),null==A&&(A=T.hasAttribute(G)?null!=T.getAttribute(G)?T.getAttribute(G):"":null)),T=this.model.getParent(T);null==A&&(A=this.getGlobalVariable(G));null==A&&null!=g&&(A=g[G])}m.push(e.substring(v,match.index)+(null!=A?A:p));v=match.index+p.length}}m.push(e.substring(v))}return m.join("")};+Graph.prototype.replacePlaceholders=function(b,e,g,m){m=[];if(null!=e){for(var v=0;match=this.placeholderPattern.exec(e);){var p=match[0];if(2<p.length&&"%label%"!=p&&"%tooltip%"!=p){var A=null;if(match.index>v&&"%"==e.charAt(match.index-1))A=p.substring(1);else{var G=p.substring(1,p.length-1),S={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==G)A=b.id;else if("width"===G.substring(0,5)&&this.model.isVertex(b)){var F=this.getCellGeometry(b);+null!=F&&(A=F.width,5<G.length&&(A=Editor.toUnit(A,S[G.substring(6)])))}else if("height"==G.substring(0,6)&&this.model.isVertex(b))F=this.getCellGeometry(b),null!=F&&(A=F.height,6<G.length&&(A=Editor.toUnit(A,S[G.substring(7)])));else if("length"==G.substring(0,6)){for(F=b;null!=F&&!this.model.isEdge(F);)F=this.model.getParent(F);F=this.view.getState(F);null!=F&&(A=Math.round(F.length/this.view.scale),6<G.length&&(A=Editor.toUnit(A,S[G.substring(7)])))}else if(0>G.indexOf("{"))for(S=b;null==A&&null!=+S;)null!=S.value&&"object"==typeof S.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(A=S.getAttribute(G+"_"+Graph.diagramLanguage)),null==A&&(A=S.hasAttribute(G)?null!=S.getAttribute(G)?S.getAttribute(G):"":null)),S=this.model.getParent(S);null==A&&(A=this.getGlobalVariable(G));null==A&&null!=g&&(A=g[G])}m.push(e.substring(v,match.index)+(null!=A?A:p));v=match.index+p.length}}m.push(e.substring(v))}return m.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var e=[],g=0;g<b.length;g++){var m=this.model.getCell(b[g].id);null!=m&&e.push(m)}this.setSelectionCells(e)}else this.clearSelection()};Graph.prototype.selectCellForEvent=function(b,e){mxEvent.isShiftDown(e)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,arguments)};-Graph.prototype.selectTableRange=function(b,e){var g=!1;if(this.isTableCell(b)&&this.isTableCell(e)){var m=this.model.getParent(b),v=this.model.getParent(m),p=this.model.getParent(e);if(v==this.model.getParent(p)){b=m.getIndex(b);m=v.getIndex(m);var A=p.getIndex(e),G=v.getIndex(p);p=Math.max(m,G);e=Math.min(b,A);b=Math.max(b,A);A=[];for(m=Math.min(m,G);m<=p;m++){G=this.model.getChildAt(v,m);for(var T=e;T<=b;T++)A.push(this.model.getChildAt(G,T))}0<A.length&&(1<A.length||1<this.getSelectionCount()||+Graph.prototype.selectTableRange=function(b,e){var g=!1;if(this.isTableCell(b)&&this.isTableCell(e)){var m=this.model.getParent(b),v=this.model.getParent(m),p=this.model.getParent(e);if(v==this.model.getParent(p)){b=m.getIndex(b);m=v.getIndex(m);var A=p.getIndex(e),G=v.getIndex(p);p=Math.max(m,G);e=Math.min(b,A);b=Math.max(b,A);A=[];for(m=Math.min(m,G);m<=p;m++){G=this.model.getChildAt(v,m);for(var S=e;S<=b;S++)A.push(this.model.getChildAt(G,S))}0<A.length&&(1<A.length||1<this.getSelectionCount()||!this.isCellSelected(A[0]))&&(this.setSelectionCells(A),g=!0)}}return g};Graph.prototype.snapCellsToGrid=function(b,e){this.getModel().beginUpdate();try{for(var g=0;g<b.length;g++){var m=b[g],v=this.getCellGeometry(m);if(null!=v){v=v.clone();if(this.getModel().isVertex(m))v.x=Math.round(v.x/e)*e,v.y=Math.round(v.y/e)*e,v.width=Math.round(v.width/e)*e,v.height=Math.round(v.height/e)*e;else if(this.getModel().isEdge(m)&&null!=v.points)for(var p=0;p<v.points.length;p++)v.points[p].x=Math.round(v.points[p].x/e)*e,v.points[p].y=Math.round(v.points[p].y/e)*e;this.getModel().setGeometry(m,v)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var e=this.model.getChildCount(b);0<=e;e--)this.model.remove(this.model.getChildAt(b,e))}finally{this.model.endUpdate()}};@@ -2389,13 +2389,13 @@ Graph.prototype.updateShapes=function(b,e,g){this.model.beginUpdate();try{var m=this.model.isEdge(b)&&this.model.isEdge(e[p]))if(g){var A=this.model.getStyle(e[p]);if(null!=A){var G=A.split(";");0<G.length&&0>G[0].indexOf("=")&&(G=G.slice(1));this.model.setStyle(e[p],G.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[e[p]]);this.setCellStyles("points",null,[e[p]]);this.pasteStyle(v,[e[p]],null,!0)}else v=this.copyStyle(e[p]),this.model.setStyle(e[p],m),this.pasteStyle(v,[e[p]]);"1"==mxUtils.getValue(this.getCellStyle(e[p],!1),"composite","0")&&this.removeChildCells(e[p])}}finally{this.model.endUpdate()}};Graph.prototype.selectCellsForConnectVertex=function(b,e,g){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=g&&(mxEvent.isTouchEvent(e)?g.update(g.getState(this.view.getState(b[1]))):g.reset())):this.setSelectionCells(b)};Graph.prototype.isCloneConnectSource=function(b){var e=null;null!=this.layoutManager&&(e=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=e&&e.constructor==mxStackLayout};Graph.prototype.insertEdgeBeforeCell=function(b,e){for(var g=e;null!=g.parent&&null!=g.geometry&&g.geometry.relative&&g.parent!=b.parent;)g=this.model.getParent(g);null!=g&&null!=g.parent&&g.parent==b.parent&&(e=g.parent.getIndex(g),this.model.add(g.parent,b,e))};-Graph.prototype.connectVertex=function(b,e,g,m,v,p,A,G){p=p?p:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var T=this.isCloneConnectSource(b),F=T?b:this.getCompositeParent(b),P=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(F.geometry.x,F.geometry.y);e==mxConstants.DIRECTION_NORTH?(P.x+=F.geometry.width/2,P.y-=g):e==-mxConstants.DIRECTION_SOUTH?(P.x+=F.geometry.width/2,P.y+=F.geometry.height+g):(P.x=e==mxConstants.DIRECTION_WEST?P.x-g:P.x+(F.geometry.width+g),P.y+=F.geometry.height/2);var Q=this.view.getState(this.model.getParent(b));g=this.view.scale;var U=this.view.translate;F=U.x*g;U=U.y*g;null!=Q&&this.model.isVertex(Q.cell)&&(F=Q.x,U=Q.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(P.x+=b.parent.geometry.x,P.y+=b.parent.geometry.y);p=p?null:(new mxRectangle(F+P.x*g,U+P.y*g)).grow(40*g);p=null!=p?+Graph.prototype.connectVertex=function(b,e,g,m,v,p,A,G){p=p?p:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var S=this.isCloneConnectSource(b),F=S?b:this.getCompositeParent(b),P=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(F.geometry.x,F.geometry.y);e==mxConstants.DIRECTION_NORTH?(P.x+=F.geometry.width/2,P.y-=g):e==+mxConstants.DIRECTION_SOUTH?(P.x+=F.geometry.width/2,P.y+=F.geometry.height+g):(P.x=e==mxConstants.DIRECTION_WEST?P.x-g:P.x+(F.geometry.width+g),P.y+=F.geometry.height/2);var Q=this.view.getState(this.model.getParent(b));g=this.view.scale;var T=this.view.translate;F=T.x*g;T=T.y*g;null!=Q&&this.model.isVertex(Q.cell)&&(F=Q.x,T=Q.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(P.x+=b.parent.geometry.x,P.y+=b.parent.geometry.y);p=p?null:(new mxRectangle(F+P.x*g,T+P.y*g)).grow(40*g);p=null!=p?this.getCells(0,0,0,0,null,null,p,null,!0):null;Q=this.view.getState(b);var c=null,f=null;if(null!=p){p=p.reverse();for(var k=0;k<p.length;k++)if(!this.isCellLocked(p[k])&&!this.model.isEdge(p[k])&&p[k]!=b)if(!this.model.isAncestor(b,p[k])&&this.isContainer(p[k])&&(null==c||p[k]==this.model.getParent(b)))c=p[k];else if(null==f&&this.isCellConnectable(p[k])&&!this.model.isAncestor(p[k],b)&&!this.isSwimlane(p[k])){var B=this.view.getState(p[k]);null==Q||null==B||mxUtils.intersects(Q,B)||(f=p[k])}}var z=-!mxEvent.isShiftDown(m)||mxEvent.isControlDown(m)||v;z&&("1"!=urlParams.sketch||v)&&(e==mxConstants.DIRECTION_NORTH?P.y-=b.geometry.height/2:e==mxConstants.DIRECTION_SOUTH?P.y+=b.geometry.height/2:P.x=e==mxConstants.DIRECTION_WEST?P.x-b.geometry.width/2:P.x+b.geometry.width/2);var C=[],H=f;f=c;v=mxUtils.bind(this,function(K){if(null==A||null!=K||null==f&&T){this.model.beginUpdate();try{if(null==H&&z){var M=this.getAbsoluteParent(null!=K?K:b);M=T?b:this.getCompositeParent(M);H=null!=K?K:this.duplicateCells([M],-!1)[0];null!=K&&this.addCells([H],this.model.getParent(b),null,null,null,!0);var O=this.getCellGeometry(H);null!=O&&(null!=K&&"1"==urlParams.sketch&&(e==mxConstants.DIRECTION_NORTH?P.y-=O.height/2:e==mxConstants.DIRECTION_SOUTH?P.y+=O.height/2:P.x=e==mxConstants.DIRECTION_WEST?P.x-O.width/2:P.x+O.width/2),O.x=P.x-O.width/2,O.y=P.y-O.height/2);null!=c?(this.addCells([H],c,null,null,null,!0),f=null):z&&!T&&this.addCells([H],this.getDefaultParent(),null,null,null,!0)}var ea=mxEvent.isControlDown(m)&&-mxEvent.isShiftDown(m)&&z||null==f&&T?null:this.insertEdge(this.model.getParent(b),null,"",b,H,this.createCurrentEdgeStyle());null!=ea&&(C.push(ea),this.applyNewEdgeStyle(b,[ea],e),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ea,b));if(null==f&&null!=H&&null!=b.parent&&T&&e==mxConstants.DIRECTION_WEST){var fa=b.parent.getIndex(b);this.model.add(b.parent,H,fa)}null==f&&null!=H&&C.push(H);null==H&&null!=ea&&ea.geometry.setTerminalPoint(P,!1);null!=ea&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[ea]))}finally{this.model.endUpdate()}}if(null!=G)G(C);else return C});if(null==A||null!=H||!z||null==f&&T)return v(H);A(F+P.x*g,U+P.y*g,v)};+!mxEvent.isShiftDown(m)||mxEvent.isControlDown(m)||v;z&&("1"!=urlParams.sketch||v)&&(e==mxConstants.DIRECTION_NORTH?P.y-=b.geometry.height/2:e==mxConstants.DIRECTION_SOUTH?P.y+=b.geometry.height/2:P.x=e==mxConstants.DIRECTION_WEST?P.x-b.geometry.width/2:P.x+b.geometry.width/2);var C=[],I=f;f=c;v=mxUtils.bind(this,function(L){if(null==A||null!=L||null==f&&S){this.model.beginUpdate();try{if(null==I&&z){var J=this.getAbsoluteParent(null!=L?L:b);J=S?b:this.getCompositeParent(J);I=null!=L?L:this.duplicateCells([J],+!1)[0];null!=L&&this.addCells([I],this.model.getParent(b),null,null,null,!0);var O=this.getCellGeometry(I);null!=O&&(null!=L&&"1"==urlParams.sketch&&(e==mxConstants.DIRECTION_NORTH?P.y-=O.height/2:e==mxConstants.DIRECTION_SOUTH?P.y+=O.height/2:P.x=e==mxConstants.DIRECTION_WEST?P.x-O.width/2:P.x+O.width/2),O.x=P.x-O.width/2,O.y=P.y-O.height/2);null!=c?(this.addCells([I],c,null,null,null,!0),f=null):z&&!S&&this.addCells([I],this.getDefaultParent(),null,null,null,!0)}var da=mxEvent.isControlDown(m)&&+mxEvent.isShiftDown(m)&&z||null==f&&S?null:this.insertEdge(this.model.getParent(b),null,"",b,I,this.createCurrentEdgeStyle());null!=da&&(C.push(da),this.applyNewEdgeStyle(b,[da],e),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(da,b));if(null==f&&null!=I&&null!=b.parent&&S&&e==mxConstants.DIRECTION_WEST){var fa=b.parent.getIndex(b);this.model.add(b.parent,I,fa)}null==f&&null!=I&&C.push(I);null==I&&null!=da&&da.geometry.setTerminalPoint(P,!1);null!=da&&this.fireEvent(new mxEventObject("cellsInserted",+"cells",[da]))}finally{this.model.endUpdate()}}if(null!=G)G(C);else return C});if(null==A||null!=I||!z||null==f&&S)return v(I);A(F+P.x*g,T+P.y*g,v)};Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var e=document.createElement("div"),g=[],m,v=0;v<b.length;v++)if(m=b[v],this.model.isVertex(m)||this.model.isEdge(m))this.isHtmlLabel(m)?(e.innerHTML=Graph.sanitizeHtml(this.getLabel(m)),m=mxUtils.extractTextWithWhitespace([e])):m=this.getLabel(m),m=mxUtils.trim(m.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<m.length&&g.push(m);return g.join(" ")};Graph.prototype.convertValueToString=function(b){var e=this.model.getValue(b);if(null!=e&&"object"==typeof e){var g=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){e=b.getAttribute("placeholder");for(var m=b;null==g&&null!=m;)null!=m.value&&"object"==typeof m.value&&(g=m.hasAttribute(e)?null!=m.getAttribute(e)?m.getAttribute(e):"":null),m=this.model.getParent(m)}else g=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(g=e.getAttribute("label_"+Graph.diagramLanguage)),null==g&&(g=e.getAttribute("label")||"");return g||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(b){return null!=b&&null!=b.text&&null!=b.text.node?b.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(b,e){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),e||(b=mxUtils.removeJavascriptProtocol(b)),b):null};@@ -2406,8 +2406,8 @@ mxConstants.STYLE_IMAGE_BACKGROUND,b);this.replaceDefaultColor(e,mxConstants.STYGraph.prototype.getDefaultColor=function(b,e,g){e="default"+e.charAt(0).toUpperCase()+e.substring(1);"invert"==b[e]&&(b=mxUtils.getLightDarkColor(g),g="light-dark("+b.dark+", "+b.light+")");return g};Graph.prototype.setAdaptiveColors=function(b){this.adaptiveColors="default"==b?null:b;"1"==urlParams.embedInline?null!=this.container&&(this.container.style.colorScheme="none"==this.getAdaptiveColors()?"light":""):(b=this.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.colorScheme="none"==this.getAdaptiveColors()?"light":""))};Graph.prototype.getAdaptiveColors=function(){return null!=this.adaptiveColors?this.adaptiveColors:Graph.defaultAdaptiveColors};Graph.prototype.updateAlternateBounds=function(b,e,g){if(null!=b&&null!=e&&null!=this.layoutManager&&null!=e.alternateBounds){var m=this.layoutManager.getLayout(this.model.getParent(b));null!=m&&m.constructor==mxStackLayout&&(m.horizontal?e.alternateBounds.height=0:e.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(b,e){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(e.style,"moveCells","0")};-Graph.prototype.foldCells=function(b,e,g,m,v){e=null!=e?e:!1;null==g&&(g=this.getFoldableCells(this.getSelectionCells(),b));if(null!=g){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var p=0;p<g.length;p++){var A=this.view.getState(g[p]),G=this.getCellGeometry(g[p]);if(null!=A&&null!=G){var T=0,F=0;if(G.alternateBounds)T=G.width-G.alternateBounds.width,F=G.height-G.alternateBounds.height;else{var P=this.useCssTransforms?1:this.view.scale;-T=Math.round(G.width-A.width/P);F=Math.round(G.height-A.height/P)}if(0!=F||0!=T){var Q=this.model.getParent(g[p]),U=this.layoutManager.getLayout(Q);null==U?null!=v&&this.isMoveCellsEvent(v,A)&&this.moveSiblings(A,Q,T,F):null!=v&&mxEvent.isAltDown(v)||U.constructor!=mxStackLayout||U.resizeLast||this.resizeParentStacks(Q,U,T,F)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(g)}};+Graph.prototype.foldCells=function(b,e,g,m,v){e=null!=e?e:!1;null==g&&(g=this.getFoldableCells(this.getSelectionCells(),b));if(null!=g){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var p=0;p<g.length;p++){var A=this.view.getState(g[p]),G=this.getCellGeometry(g[p]);if(null!=A&&null!=G){var S=0,F=0;if(G.alternateBounds)S=G.width-G.alternateBounds.width,F=G.height-G.alternateBounds.height;else{var P=this.useCssTransforms?1:this.view.scale;+S=Math.round(G.width-A.width/P);F=Math.round(G.height-A.height/P)}if(0!=F||0!=S){var Q=this.model.getParent(g[p]),T=this.layoutManager.getLayout(Q);null==T?null!=v&&this.isMoveCellsEvent(v,A)&&this.moveSiblings(A,Q,S,F):null!=v&&mxEvent.isAltDown(v)||T.constructor!=mxStackLayout||T.resizeLast||this.resizeParentStacks(Q,T,S,F)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(g)}};Graph.prototype.moveSiblings=function(b,e,g,m){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,e,!0,!0);for(e=0;e<v.length;e++)if(v[e]!=b.cell){var p=this.view.getState(v[e]),A=this.getCellGeometry(v[e]);null!=p&&null!=A&&(A=A.clone(),A.translate(Math.round(g*Math.max(0,Math.min(1,(p.x-b.x)/b.width))),Math.round(m*Math.max(0,Math.min(1,(p.y-b.y)/b.height)))),this.model.setGeometry(v[e],A))}}finally{this.model.endUpdate()}};Graph.prototype.resizeParentStacks=function(b,e,g,m){if(null!=this.layoutManager&&null!=e&&e.constructor==mxStackLayout&&!e.resizeLast){this.model.beginUpdate();try{for(var v=e.horizontal;null!=b&&null!=e&&e.constructor==mxStackLayout&&e.horizontal==v&&!e.resizeLast;){var p=this.getCellGeometry(b),A=this.view.getState(b);null!=A&&null!=p&&(p=p.clone(),e.horizontal?p.width+=g+Math.min(0,A.width/this.view.scale-p.width):p.height+=m+Math.min(0,A.height/this.view.scale-p.height),this.model.setGeometry(b,p));b=this.model.getParent(b);e=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var e=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=e.container:"1"==e.container};Graph.prototype.isCellConnectable=function(b){var e=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=e.connectable?"0"!=e.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};@@ -2449,10 +2449,10 @@ HoverIcons.prototype.click=function(b,e,g){var m=g.getEvent(),v=g.getGraphX(),p=HoverIcons.prototype.execute=function(b,e,g){g=g.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,e,this.graph.defaultEdgeLength,g,this.graph.isCloneEvent(g),this.graph.isCloneEvent(g)),g,this)};HoverIcons.prototype.reset=function(b){null!=b&&!b||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null;this.fireEvent(new mxEventObject("reset"))};HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var b=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(b=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));b.grow(this.graph.tolerance);b.grow(this.arrowSpacing);var e=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(e=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var g=null;null!=e&&(b.x-=e.horizontalOffset/2,b.y-=e.verticalOffset/2,b.width+=e.horizontalOffset,b.height+=e.verticalOffset,null!=e.rotationShape&&null!=e.rotationShape.node&&"hidden"!=e.rotationShape.node.style.visibility&&"none"!=e.rotationShape.node.style.display&&null!=e.rotationShape.boundingBox&&-(g=e.rotationShape.boundingBox));e=mxUtils.bind(this,function(G,T,F){if(null!=g){var P=new mxRectangle(T,F,G.clientWidth,G.clientHeight);mxUtils.intersects(P,g)&&(G==this.arrowUp?F-=P.y+P.height-g.y:G==this.arrowRight?T+=g.x+g.width-P.x:G==this.arrowDown?F+=g.y+g.height-P.y:G==this.arrowLeft&&(T-=P.x+P.width-g.x))}G.style.left=T+"px";G.style.top=F+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});e(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-+(g=e.rotationShape.boundingBox));e=mxUtils.bind(this,function(G,S,F){if(null!=g){var P=new mxRectangle(S,F,G.clientWidth,G.clientHeight);mxUtils.intersects(P,g)&&(G==this.arrowUp?F-=P.y+P.height-g.y:G==this.arrowRight?S+=g.x+g.width-P.x:G==this.arrowDown?F+=g.y+g.height-P.y:G==this.arrowLeft&&(S-=P.x+P.width-g.x))}G.style.left=S+"px";G.style.top=F+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});e(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-this.triangleUp.height-this.tolerance));e(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));e(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));e(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){e=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());-var m=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=e&&e==m&&m==v&&v==b&&(b=v=m=e=null);var p=this.graph.getCellGeometry(this.currentState.cell),A=mxUtils.bind(this,function(G,T){var F=this.graph.model.isVertex(G)&&this.graph.getCellGeometry(G);null==G||this.graph.model.isAncestor(G,-this.currentState.cell)||this.graph.isSwimlane(G)||!(null==F||null==p||F.height<3*p.height&&F.width<3*p.width)?T.style.visibility="visible":T.style.visibility="hidden"});A(e,this.arrowRight);A(m,this.arrowLeft);A(v,this.arrowUp);A(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),+var m=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=e&&e==m&&m==v&&v==b&&(b=v=m=e=null);var p=this.graph.getCellGeometry(this.currentState.cell),A=mxUtils.bind(this,function(G,S){var F=this.graph.model.isVertex(G)&&this.graph.getCellGeometry(G);null==G||this.graph.model.isAncestor(G,+this.currentState.cell)||this.graph.isSwimlane(G)||!(null==F||null==p||F.height<3*p.height&&F.width<3*p.width)?S.style.visibility="visible":S.style.visibility="hidden"});A(e,this.arrowRight);A(m,this.arrowLeft);A(v,this.arrowUp);A(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};HoverIcons.prototype.computeBoundingBox=function(){var b=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(e){null!=e.parentNode&&(e=new mxRectangle(e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight),null==b?b=e:b.add(e))});return b};HoverIcons.prototype.getState=function(b){if(null!=b)if(b=b.cell,this.graph.getModel().contains(b)){if(this.graph.getModel().isVertex(b)&&!this.graph.isCellConnectable(b)){var e=this.graph.getModel().getParent(b);this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(b=e)}if(this.graph.isCellLocked(b)||this.graph.model.isEdge(b))b=null;b=this.graph.view.getState(b);null!=b&&null==b.style&&(b=null)}else b=null;return b};@@ -2462,43 +2462,43 @@ b||null==this.bbox||null==e||null==g||!mxUtils.contains(this.bbox,e,g))&&(null!=HoverIcons.prototype.setCurrentState=function(b){"eastwest"!=b.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=b};Graph.prototype.removeTextStyleForCell=function(b,e){var g=this.getCurrentCellStyle(b),m=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(g,"html","0")){var v=this.convertValueToString(b);"0"!=mxUtils.getValue(g,"nl2Br","1")&&(v=v.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));v=Editor.convertHtmlToText(v);this.cellLabelChanged(b,v);m=!0}e&&(this.setCellStyles("fontSource",null,[b]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return m};Graph.prototype.createParent=function(b,e,g,m,v){b=this.cloneCell(b);for(var p=0;p<g;p++){var A=this.cloneCell(e),G=this.getCellGeometry(A);null!=G&&(G.x+=p*m,G.y+=p*v);b.insert(A)}return b};-Graph.prototype.createTable=function(b,e,g,m,v,p,A,G,T){g=null!=g?g:60;m=null!=m?m:40;p=null!=p?p:30;G=null!=G?G:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";T=null!=T?T:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,-null,null!=v?v:"",0,0,e*g,b*m+(null!=v?p:0),null!=A?A:"shape=table;startSize="+(null!=v?p:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,e*g,m,G),this.createVertex(null,null,"",0,0,g,m,T),e,g,0),b,0,m)};+Graph.prototype.createTable=function(b,e,g,m,v,p,A,G,S){g=null!=g?g:60;m=null!=m?m:40;p=null!=p?p:30;G=null!=G?G:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";S=null!=S?S:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,+null,null!=v?v:"",0,0,e*g,b*m+(null!=v?p:0),null!=A?A:"shape=table;startSize="+(null!=v?p:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,e*g,m,G),this.createVertex(null,null,"",0,0,g,m,S),e,g,0),b,0,m)};Graph.prototype.setTableValues=function(b,e,g){for(var m=this.model.getChildCells(b,!0),v=0;v<m.length;v++)if(null!=g&&(m[v].value=g[v]),null!=e)for(var p=this.model.getChildCells(m[v],!0),A=0;A<p.length;A++)null!=e[v][A]&&(p[A].value=e[v][A]);return b};-Graph.prototype.createCrossFunctionalSwimlane=function(b,e,g,m,v,p,A,G,T){g=null!=g?g:120;m=null!=m?m:120;A=null!=A?A:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";G=null!=G?G:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";-T=null!=T?T:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,e*g,b*m,null!=p?p:"shape=table;childLayout=tableLayout;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");p=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=p;v.geometry.height+=-p;A=this.createVertex(null,null,"",0,p,e*g+p,m,A);v.insert(this.createParent(A,this.createVertex(null,null,"",p,0,g,m,G),e,g,0));return 1<b?(A.geometry.y=m+p,this.createParent(v,this.createParent(A,this.createVertex(null,null,"",p,0,g,m,T),e,g,0),b-1,0,m)):v};-Graph.prototype.visitTableCells=function(b,e){var g=null,m=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<m.length;v++){for(var p=this.getActualStartSize(m[v],!0),A=this.model.getChildCells(m[v],!0),G=this.getCellStyle(m[v],!0),T=null,F=[],P=0;P<A.length;P++){var Q=this.getCellGeometry(A[P]),U={cell:A[P],rospan:1,colspan:1,row:v,col:P,geo:Q};Q=null!=Q.alternateBounds?Q.alternateBounds:Q;U.point=new mxPoint(Q.width+(null!=T?T.point.x:b.x+p.x),Q.height+(null!=g&&null!=-g[0]?g[0].point.y:b.y+p.y));U.actual=U;null!=g&&null!=g[P]&&1<g[P].rowspan?(U.rowspan=g[P].rowspan-1,U.colspan=g[P].colspan,U.actual=g[P].actual):null!=T&&1<T.colspan?(U.rowspan=T.rowspan,U.colspan=T.colspan-1,U.actual=T.actual):(T=this.getCurrentCellStyle(A[P],!0),null!=T&&(U.rowspan=parseInt(T.rowspan||1),U.colspan=parseInt(T.colspan||1)));T=1==mxUtils.getValue(G,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(G,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;e(U,A.length,-m.length,b.x+(T?p.x:0),b.y+(T?p.y:0));F.push(U);T=U}g=F}};Graph.prototype.getTableLines=function(b,e,g){var m=[],v=[];(e||g)&&this.visitTableCells(b,mxUtils.bind(this,function(p,A,G,T,F){e&&p.row<G-1&&(null==m[p.row]&&(m[p.row]=[new mxPoint(T,p.point.y)]),1<p.rowspan&&m[p.row].push(null),m[p.row].push(p.point));g&&p.col<A-1&&(null==v[p.col]&&(v[p.col]=[new mxPoint(p.point.x,F)]),1<p.colspan&&v[p.col].push(null),v[p.col].push(p.point))}));return m.concat(v)};+Graph.prototype.createCrossFunctionalSwimlane=function(b,e,g,m,v,p,A,G,S){g=null!=g?g:120;m=null!=m?m:120;A=null!=A?A:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";G=null!=G?G:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";+S=null!=S?S:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,e*g,b*m,null!=p?p:"shape=table;childLayout=tableLayout;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");p=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=p;v.geometry.height+=+p;A=this.createVertex(null,null,"",0,p,e*g+p,m,A);v.insert(this.createParent(A,this.createVertex(null,null,"",p,0,g,m,G),e,g,0));return 1<b?(A.geometry.y=m+p,this.createParent(v,this.createParent(A,this.createVertex(null,null,"",p,0,g,m,S),e,g,0),b-1,0,m)):v};+Graph.prototype.visitTableCells=function(b,e){var g=null,m=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<m.length;v++){for(var p=this.getActualStartSize(m[v],!0),A=this.model.getChildCells(m[v],!0),G=this.getCellStyle(m[v],!0),S=null,F=[],P=0;P<A.length;P++){var Q=this.getCellGeometry(A[P]),T={cell:A[P],rospan:1,colspan:1,row:v,col:P,geo:Q};Q=null!=Q.alternateBounds?Q.alternateBounds:Q;T.point=new mxPoint(Q.width+(null!=S?S.point.x:b.x+p.x),Q.height+(null!=g&&null!=+g[0]?g[0].point.y:b.y+p.y));T.actual=T;null!=g&&null!=g[P]&&1<g[P].rowspan?(T.rowspan=g[P].rowspan-1,T.colspan=g[P].colspan,T.actual=g[P].actual):null!=S&&1<S.colspan?(T.rowspan=S.rowspan,T.colspan=S.colspan-1,T.actual=S.actual):(S=this.getCurrentCellStyle(A[P],!0),null!=S&&(T.rowspan=parseInt(S.rowspan||1),T.colspan=parseInt(S.colspan||1)));S=1==mxUtils.getValue(G,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(G,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;e(T,A.length,+m.length,b.x+(S?p.x:0),b.y+(S?p.y:0));F.push(T);S=T}g=F}};Graph.prototype.getTableLines=function(b,e,g){var m=[],v=[];(e||g)&&this.visitTableCells(b,mxUtils.bind(this,function(p,A,G,S,F){e&&p.row<G-1&&(null==m[p.row]&&(m[p.row]=[new mxPoint(S,p.point.y)]),1<p.rowspan&&m[p.row].push(null),m[p.row].push(p.point));g&&p.col<A-1&&(null==v[p.col]&&(v[p.col]=[new mxPoint(p.point.x,F)]),1<p.colspan&&v[p.col].push(null),v[p.col].push(p.point))}));return m.concat(v)};Graph.prototype.isTableCell=function(b){return this.model.isVertex(b)&&this.isTableRow(this.model.getParent(b))};Graph.prototype.isTableRow=function(b){return this.model.isVertex(b)&&this.isTable(this.model.getParent(b))};Graph.prototype.isTable=function(b){b=this.getCellStyle(b);return null!=b&&"tableLayout"==b.childLayout};Graph.prototype.isStack=function(b){b=this.getCellStyle(b);return null!=b&&"stackLayout"==b.childLayout};Graph.prototype.isStackChild=function(b){return this.model.isVertex(b)&&this.isStack(this.model.getParent(b))};-Graph.prototype.setTableRowHeight=function(b,e,g){g=null!=g?g:!0;var m=this.getModel();m.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=e;m.setGeometry(b,v);var p=m.getParent(b),A=m.getChildCells(p,!0);if(!g){var G=mxUtils.indexOf(A,b);if(G<A.length-1){var T=A[G+1],F=this.getCellGeometry(T);null!=F&&(F=F.clone(),F.y+=e,F.height-=e,m.setGeometry(T,F))}}var P=this.getCellGeometry(p);null!=P&&(g||(g=b==A[A.length-1]),g&&(P=P.clone(),P.height+=e,m.setGeometry(p,P)))}}finally{m.endUpdate()}};-Graph.prototype.setTableColumnWidth=function(b,e,g){g=null!=g?g:!1;var m=this.getModel(),v=m.getParent(b),p=m.getParent(v),A=m.getChildCells(v,!0);b=mxUtils.indexOf(A,b);var G=b==A.length-1;m.beginUpdate();try{for(var T=m.getChildCells(p,!0),F=0;F<T.length;F++){v=T[F];A=m.getChildCells(v,!0);var P=A[b],Q=this.getCellGeometry(P);null!=Q&&(Q=Q.clone(),Q.width+=e,null!=Q.alternateBounds&&(Q.alternateBounds.width+=e),m.setGeometry(P,Q));b<A.length-1&&(P=A[b+1],Q=this.getCellGeometry(P),null!=Q&&(Q=Q.clone(),-Q.x+=e,g||(Q.width-=e,null!=Q.alternateBounds&&(Q.alternateBounds.width-=e)),m.setGeometry(P,Q)))}if(G||g){var U=this.getCellGeometry(p);null!=U&&(U=U.clone(),U.width+=e,m.setGeometry(p,U))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{m.endUpdate()}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};+Graph.prototype.setTableRowHeight=function(b,e,g){g=null!=g?g:!0;var m=this.getModel();m.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=e;m.setGeometry(b,v);var p=m.getParent(b),A=m.getChildCells(p,!0);if(!g){var G=mxUtils.indexOf(A,b);if(G<A.length-1){var S=A[G+1],F=this.getCellGeometry(S);null!=F&&(F=F.clone(),F.y+=e,F.height-=e,m.setGeometry(S,F))}}var P=this.getCellGeometry(p);null!=P&&(g||(g=b==A[A.length-1]),g&&(P=P.clone(),P.height+=e,m.setGeometry(p,P)))}}finally{m.endUpdate()}};+Graph.prototype.setTableColumnWidth=function(b,e,g){g=null!=g?g:!1;var m=this.getModel(),v=m.getParent(b),p=m.getParent(v),A=m.getChildCells(v,!0);b=mxUtils.indexOf(A,b);var G=b==A.length-1;m.beginUpdate();try{for(var S=m.getChildCells(p,!0),F=0;F<S.length;F++){v=S[F];A=m.getChildCells(v,!0);var P=A[b],Q=this.getCellGeometry(P);null!=Q&&(Q=Q.clone(),Q.width+=e,null!=Q.alternateBounds&&(Q.alternateBounds.width+=e),m.setGeometry(P,Q));b<A.length-1&&(P=A[b+1],Q=this.getCellGeometry(P),null!=Q&&(Q=Q.clone(),+Q.x+=e,g||(Q.width-=e,null!=Q.alternateBounds&&(Q.alternateBounds.width-=e)),m.setGeometry(P,Q)))}if(G||g){var T=this.getCellGeometry(p);null!=T&&(T=T.clone(),T.width+=e,m.setGeometry(p,T))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{m.endUpdate()}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};TableLayout.prototype.isVertexIgnored=function(b){return!this.graph.getModel().isVertex(b)||!this.graph.isCellVisible(b)};TableLayout.prototype.getSize=function(b,e){for(var g=0,m=0;m<b.length;m++)if(!this.isVertexIgnored(b[m])){var v=this.graph.getCellGeometry(b[m]);null!=v&&(g+=e?v.width:v.height)}return g};TableLayout.prototype.getRowLayout=function(b,e){var g=this.graph.model.getChildCells(b,!0),m=this.graph.getActualStartSize(b,!0);b=this.getSize(g,!0);e=e-m.x-m.width;var v=[];m=m.x;for(var p=0;p<g.length;p++){var A=this.graph.getCellGeometry(g[p]);null!=A&&(m+=(null!=A.alternateBounds?A.alternateBounds.width:A.width)*e/b,v.push(Math.round(m)))}return v};-TableLayout.prototype.layoutRow=function(b,e,g,m){var v=this.graph.getModel(),p=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var A=b.x,G=0;null!=e&&(e=e.slice(),e.splice(0,0,b.x));for(var T=0;T<p.length;T++){var F=this.graph.getCellGeometry(p[T]);null!=F&&(F=F.clone(),F.y=b.y,F.height=g-b.y-b.height,null!=e?(F.x=e[T],F.width=e[T+1]-F.x,T==p.length-1&&T<e.length-2&&(F.width=m-F.x-b.x-b.width)):(F.x=A,A+=F.width,T==p.length-1?F.width=m-b.x-b.width-G:G+=F.width),F.alternateBounds=new mxRectangle(0,-0,F.width,F.height),v.setGeometry(p[T],F))}return G};-TableLayout.prototype.execute=function(b){if(null!=b){var e=this.graph.getActualStartSize(b,!0),g=this.graph.getCellGeometry(b),m=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(m,"resizeLastRow","0"),p="1"==mxUtils.getValue(m,"resizeLast","0");m="1"==mxUtils.getValue(m,"fixedRows","0");var A=this.graph.getModel(),G=0;A.beginUpdate();try{for(var T=g.height-e.y-e.height,F=g.width-e.x-e.width,P=A.getChildCells(b,!0),Q=0;Q<P.length;Q++)A.setVisible(P[Q],!0);var U=this.getSize(P,!1);if(0<T&&0<F&&0<-P.length&&0<U){if(v){var c=this.graph.getCellGeometry(P[P.length-1]);null!=c&&(c=c.clone(),c.height=T-U+c.height,A.setGeometry(P[P.length-1],c))}var f=p?null:this.getRowLayout(P[0],F),k=[],B=e.y;for(Q=0;Q<P.length;Q++)c=this.graph.getCellGeometry(P[Q]),null!=c&&(c=c.clone(),c.x=e.x,c.width=F,c.y=Math.round(B),B=v||m?B+c.height:B+c.height/U*T,c.height=Math.round(B)-c.y,A.setGeometry(P[Q],c)),G=Math.max(G,this.layoutRow(P[Q],f,c.height,F,k));m&&T<U&&(g=g.clone(),g.height=B+e.height,A.setGeometry(b,+TableLayout.prototype.layoutRow=function(b,e,g,m){var v=this.graph.getModel(),p=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var A=b.x,G=0;null!=e&&(e=e.slice(),e.splice(0,0,b.x));for(var S=0;S<p.length;S++){var F=this.graph.getCellGeometry(p[S]);null!=F&&(F=F.clone(),F.y=b.y,F.height=g-b.y-b.height,null!=e?(F.x=e[S],F.width=e[S+1]-F.x,S==p.length-1&&S<e.length-2&&(F.width=m-F.x-b.x-b.width)):(F.x=A,A+=F.width,S==p.length-1?F.width=m-b.x-b.width-G:G+=F.width),F.alternateBounds=new mxRectangle(0,+0,F.width,F.height),v.setGeometry(p[S],F))}return G};+TableLayout.prototype.execute=function(b){if(null!=b){var e=this.graph.getActualStartSize(b,!0),g=this.graph.getCellGeometry(b),m=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(m,"resizeLastRow","0"),p="1"==mxUtils.getValue(m,"resizeLast","0");m="1"==mxUtils.getValue(m,"fixedRows","0");var A=this.graph.getModel(),G=0;A.beginUpdate();try{for(var S=g.height-e.y-e.height,F=g.width-e.x-e.width,P=A.getChildCells(b,!0),Q=0;Q<P.length;Q++)A.setVisible(P[Q],!0);var T=this.getSize(P,!1);if(0<S&&0<F&&0<+P.length&&0<T){if(v){var c=this.graph.getCellGeometry(P[P.length-1]);null!=c&&(c=c.clone(),c.height=S-T+c.height,A.setGeometry(P[P.length-1],c))}var f=p?null:this.getRowLayout(P[0],F),k=[],B=e.y;for(Q=0;Q<P.length;Q++)c=this.graph.getCellGeometry(P[Q]),null!=c&&(c=c.clone(),c.x=e.x,c.width=F,c.y=Math.round(B),B=v||m?B+c.height:B+c.height/T*S,c.height=Math.round(B)-c.y,A.setGeometry(P[Q],c)),G=Math.max(G,this.layoutRow(P[Q],f,c.height,F,k));m&&S<T&&(g=g.clone(),g.height=B+e.height,A.setGeometry(b,g));p&&F<G+Graph.minTableColumnWidth&&(g=g.clone(),g.width=G+e.width+e.x+Graph.minTableColumnWidth,A.setGeometry(b,g));this.graph.visitTableCells(b,mxUtils.bind(this,function(z){A.setVisible(z.cell,z.actual.cell==z.cell);if(z.actual.cell!=z.cell){if(z.actual.row==z.row){var C=null!=z.geo.alternateBounds?z.geo.alternateBounds:z.geo;z.actual.geo.width+=C.width}z.actual.col==z.col&&(C=null!=z.geo.alternateBounds?z.geo.alternateBounds:z.geo,z.actual.geo.height+=C.height)}}))}else for(Q=0;Q<P.length;Q++)A.setVisible(P[Q],!1)}finally{A.endUpdate()}}};-(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var e=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(Q,U){U=null!=U?U:!0;var c=this.getState(Q);null!=c&&U&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&!c.invalid&&this.updateLineJumps(c)&&this.graph.cellRenderer.redraw(c,!1,this.isRendering());c=e.apply(this,-arguments);null!=c&&U&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(c);return c};mxShape.prototype.isFlowAnimationEnabled=function(){return null!=this.state&&this.state.view.graph.enableFlowAnimation&&this.state.view.graph.model.isEdge(this.state.cell)&&"1"==mxUtils.getValue(this.state.style,"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(){var Q=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=-Q)for(var U=0;U<Q.length;U++)if("hidden"!=Q[U].getAttribute("visibility"))return Q[U];return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,this.state.view.scale,this.state.view.graph.addFlowAnimationStyle())};var g=mxShape.prototype.paint;mxShape.prototype.paint=function(Q){g.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var m=mxShape.prototype.createSvgCanvas;-mxShape.prototype.createSvgCanvas=function(Q){Q=m.apply(this,arguments);null!=this.state&&(Q.adaptiveColors=this.state.view.graph.getAdaptiveColors());return Q};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(Q,U){return v.apply(this,arguments)||null!=Q.routedPoints&&null!=U.routedPoints&&!mxUtils.equalPoints(U.routedPoints,Q.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(Q){p.apply(this,arguments);-this.graph.model.isEdge(Q.cell)&&1!=Q.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(Q)};mxGraphView.prototype.updateLineJumps=function(Q){var U=Q.absolutePoints;if(Graph.lineJumpsEnabled){var c=null!=Q.routedPoints,f=null;if(null!=U&&null!=this.validEdges&&"none"!==mxUtils.getValue(Q.style,"jumpStyle","none")){var k=function(Z,da,aa){var l=new mxPoint(da,aa);l.type=Z;f.push(l);l=null!=Q.routedPoints?Q.routedPoints[f.length-1]:null;return null==l||l.type!=Z||l.x!=da||l.y!=aa},B=.5*this.scale;-c=!1;f=[];for(var z=0;z<U.length-1;z++){for(var C=U[z+1],H=U[z],K=[],M=U[z+2];z<U.length-2&&mxUtils.ptSegDistSq(H.x,H.y,M.x,M.y,C.x,C.y)<1*this.scale*this.scale;)C=M,z++,M=U[z+2];c=k(0,H.x,H.y)||c;for(var O=0;O<this.validEdges.length;O++){var ea=this.validEdges[O],fa=ea.absolutePoints;if(null!=fa&&mxUtils.intersects(Q,ea)&&"1"!=ea.style.noJump){var S=null;for(ea=0;ea<fa.length-1;ea++){var ca=fa[ea+1],ma=fa[ea];for(M=fa[ea+2];ea<fa.length-2&&mxUtils.ptSegDistSq(ma.x,ma.y,M.x,M.y,ca.x,ca.y)<1*this.scale*-this.scale;)ca=M,ea++,M=fa[ea+2];var la=mxUtils.intersection(H.x,H.y,C.x,C.y,ma.x,ma.y,ca.x,ca.y);if(null!=la&&(Math.abs(la.x-H.x)>B||Math.abs(la.y-H.y)>B)&&(Math.abs(la.x-C.x)>B||Math.abs(la.y-C.y)>B)&&(null==S||mxUtils.ptLineDist(H.x,H.y,C.x,C.y,S.x,S.y)>B||mxUtils.ptLineDist(H.x,H.y,C.x,C.y,ma.x,ma.y)>B)&&(null==M||mxUtils.ptLineDist(H.x,H.y,C.x,C.y,M.x,M.y)>B||mxUtils.ptLineDist(H.x,H.y,C.x,C.y,ca.x,ca.y)>B)){M=la.x-H.x;S=la.y-H.y;la={distSq:M*M+S*S,x:la.x,y:la.y};for(M=0;M<K.length;M++)if(K[M].distSq>-la.distSq){K.splice(M,0,la);la=null;break}null==la||0!=K.length&&K[K.length-1].x===la.x&&K[K.length-1].y===la.y||K.push(la)}S=ma}}}for(ea=0;ea<K.length;ea++)c=k(1,K[ea].x,K[ea].y)||c}la=U[U.length-1];c=k(0,la.x,la.y)||c}Q.routedPoints=f;return c}return!1};var A=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(Q,U,c){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)A.apply(this,-arguments);else{var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,k=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,B=mxUtils.getValue(this.style,"jumpStyle","none"),z=!0,C=null,H=null,K=[],M=null;Q.begin();for(var O=0;O<this.state.routedPoints.length;O++){var ea=this.state.routedPoints[O],fa=new mxPoint(ea.x/this.scale,ea.y/this.scale);0==O?fa=U[0]:O==this.state.routedPoints.length-1&&(fa=U[U.length-1]);var S=!1;-if(null!=C&&1==ea.type){var ca=this.state.routedPoints[O+1];ea=ca.x/this.scale-fa.x;ca=ca.y/this.scale-fa.y;ea=ea*ea+ca*ca;null==M&&(M=new mxPoint(fa.x-C.x,fa.y-C.y),H=Math.sqrt(M.x*M.x+M.y*M.y),0<H?(M.x=M.x*k/H,M.y=M.y*k/H):M=null);ea>k*k&&0<H&&(ea=C.x-fa.x,ca=C.y-fa.y,ea=ea*ea+ca*ca,ea>k*k&&(S=new mxPoint(fa.x-M.x,fa.y-M.y),ea=new mxPoint(fa.x+M.x,fa.y+M.y),K.push(S),this.addPoints(Q,K,c,f,!1,null,z),K=0>Math.round(M.x)||0==Math.round(M.x)&&0>=Math.round(M.y)?1:-1,z=!1,"sharp"==B?(Q.lineTo(S.x--M.y*K,S.y+M.x*K),Q.lineTo(ea.x-M.y*K,ea.y+M.x*K),Q.lineTo(ea.x,ea.y)):"line"==B?(Q.moveTo(S.x+M.y*K,S.y-M.x*K),Q.lineTo(S.x-M.y*K,S.y+M.x*K),Q.moveTo(ea.x-M.y*K,ea.y+M.x*K),Q.lineTo(ea.x+M.y*K,ea.y-M.x*K),Q.moveTo(ea.x,ea.y)):"arc"==B?(K*=1.3,Q.curveTo(S.x-M.y*K,S.y+M.x*K,ea.x-M.y*K,ea.y+M.x*K,ea.x,ea.y)):(Q.moveTo(ea.x,ea.y),z=!0),K=[ea],S=!0))}else M=null;S||(K.push(fa),C=fa)}this.addPoints(Q,K,c,f,!1,null,z);Q.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=-function(Q,U,c,f){return null!=U&&"centerPerimeter"==U.style[mxConstants.STYLE_PERIMETER]?new mxPoint(U.getCenterX(),U.getCenterY()):G.apply(this,arguments)};var T=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(Q,U,c,f){if(null==U||null==Q||"1"!=U.style.snapToPoint&&"1"!=Q.style.snapToPoint)T.apply(this,arguments);else{U=this.getTerminalPort(Q,U,f);var k=this.getNextPoint(Q,c,f),B=this.graph.isOrthogonal(Q),z=mxUtils.toRadians(Number(U.style[mxConstants.STYLE_ROTATION]||-"0")),C=new mxPoint(U.getCenterX(),U.getCenterY());if(0!=z){var H=Math.cos(-z),K=Math.sin(-z);k=mxUtils.getRotatedPoint(k,H,K,C)}H=parseFloat(Q.style[mxConstants.STYLE_PERIMETER_SPACING]||0);H+=parseFloat(Q.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(U,k,0==z&&B,H);0!=z&&(H=Math.cos(z),K=Math.sin(z),k=mxUtils.getRotatedPoint(k,H,K,C));Q.setAbsoluteTerminalPoint(this.snapToAnchorPoint(Q,U,c,f,k),f)}};mxGraphView.prototype.snapToAnchorPoint=-function(Q,U,c,f,k){if(null!=U&&null!=Q){Q=this.graph.getAllConnectionConstraints(U);f=c=null;if(null!=Q)for(var B=0;B<Q.length;B++){var z=this.graph.getConnectionPoint(U,Q[B]);if(null!=z){var C=(z.x-k.x)*(z.x-k.x)+(z.y-k.y)*(z.y-k.y);if(null==f||C<f)c=z,f=C}}null!=c&&(k=c)}return k};var F=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(Q,U,c){var f=F.apply(this,arguments);"1"==Q.getAttribute("placeholders")&&null!=c.state&&(f=c.state.view.graph.replacePlaceholders(c.state.cell,-f));return f};var P=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(Q){if(null!=Q.style&&"undefined"!==typeof pako){var U=mxUtils.getValue(Q.style,mxConstants.STYLE_SHAPE,null);if(null!=U&&"string"===typeof U&&"stencil("==U.substring(0,8))try{var c=U.substring(8,U.length-1),f=mxUtils.parseXml(Graph.decompress(c));return new mxShape(new mxStencil(f.documentElement))}catch(k){null!=window.console&&console.log("Error in shape: "+k)}}return P.apply(this,arguments)}})();+(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var e=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(Q,T){T=null!=T?T:!0;var c=this.getState(Q);null!=c&&T&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&!c.invalid&&this.updateLineJumps(c)&&this.graph.cellRenderer.redraw(c,!1,this.isRendering());c=e.apply(this,+arguments);null!=c&&T&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(c);return c};mxShape.prototype.isFlowAnimationEnabled=function(){return null!=this.state&&this.state.view.graph.enableFlowAnimation&&this.state.view.graph.model.isEdge(this.state.cell)&&"1"==mxUtils.getValue(this.state.style,"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(){var Q=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=+Q)for(var T=0;T<Q.length;T++)if("hidden"!=Q[T].getAttribute("visibility"))return Q[T];return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,this.state.view.scale,this.state.view.graph.addFlowAnimationStyle())};var g=mxShape.prototype.paint;mxShape.prototype.paint=function(Q){g.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var m=mxShape.prototype.createSvgCanvas;+mxShape.prototype.createSvgCanvas=function(Q){Q=m.apply(this,arguments);null!=this.state&&(Q.adaptiveColors=this.state.view.graph.getAdaptiveColors());return Q};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(Q,T){return v.apply(this,arguments)||null!=Q.routedPoints&&null!=T.routedPoints&&!mxUtils.equalPoints(T.routedPoints,Q.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(Q){p.apply(this,arguments);+this.graph.model.isEdge(Q.cell)&&1!=Q.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(Q)};mxGraphView.prototype.updateLineJumps=function(Q){var T=Q.absolutePoints;if(Graph.lineJumpsEnabled){var c=null!=Q.routedPoints,f=null;if(null!=T&&null!=this.validEdges&&"none"!==mxUtils.getValue(Q.style,"jumpStyle","none")){var k=function(Z,ea,aa){var l=new mxPoint(ea,aa);l.type=Z;f.push(l);l=null!=Q.routedPoints?Q.routedPoints[f.length-1]:null;return null==l||l.type!=Z||l.x!=ea||l.y!=aa},B=.5*this.scale;+c=!1;f=[];for(var z=0;z<T.length-1;z++){for(var C=T[z+1],I=T[z],L=[],J=T[z+2];z<T.length-2&&mxUtils.ptSegDistSq(I.x,I.y,J.x,J.y,C.x,C.y)<1*this.scale*this.scale;)C=J,z++,J=T[z+2];c=k(0,I.x,I.y)||c;for(var O=0;O<this.validEdges.length;O++){var da=this.validEdges[O],fa=da.absolutePoints;if(null!=fa&&mxUtils.intersects(Q,da)&&"1"!=da.style.noJump){var V=null;for(da=0;da<fa.length-1;da++){var ba=fa[da+1],ma=fa[da];for(J=fa[da+2];da<fa.length-2&&mxUtils.ptSegDistSq(ma.x,ma.y,J.x,J.y,ba.x,ba.y)<1*this.scale*+this.scale;)ba=J,da++,J=fa[da+2];var la=mxUtils.intersection(I.x,I.y,C.x,C.y,ma.x,ma.y,ba.x,ba.y);if(null!=la&&(Math.abs(la.x-I.x)>B||Math.abs(la.y-I.y)>B)&&(Math.abs(la.x-C.x)>B||Math.abs(la.y-C.y)>B)&&(null==V||mxUtils.ptLineDist(I.x,I.y,C.x,C.y,V.x,V.y)>B||mxUtils.ptLineDist(I.x,I.y,C.x,C.y,ma.x,ma.y)>B)&&(null==J||mxUtils.ptLineDist(I.x,I.y,C.x,C.y,J.x,J.y)>B||mxUtils.ptLineDist(I.x,I.y,C.x,C.y,ba.x,ba.y)>B)){J=la.x-I.x;V=la.y-I.y;la={distSq:J*J+V*V,x:la.x,y:la.y};for(J=0;J<L.length;J++)if(L[J].distSq>+la.distSq){L.splice(J,0,la);la=null;break}null==la||0!=L.length&&L[L.length-1].x===la.x&&L[L.length-1].y===la.y||L.push(la)}V=ma}}}for(da=0;da<L.length;da++)c=k(1,L[da].x,L[da].y)||c}la=T[T.length-1];c=k(0,la.x,la.y)||c}Q.routedPoints=f;return c}return!1};var A=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(Q,T,c){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)A.apply(this,+arguments);else{var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,k=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,B=mxUtils.getValue(this.style,"jumpStyle","none"),z=!0,C=null,I=null,L=[],J=null;Q.begin();for(var O=0;O<this.state.routedPoints.length;O++){var da=this.state.routedPoints[O],fa=new mxPoint(da.x/this.scale,da.y/this.scale);0==O?fa=T[0]:O==this.state.routedPoints.length-1&&(fa=T[T.length-1]);var V=!1;+if(null!=C&&1==da.type){var ba=this.state.routedPoints[O+1];da=ba.x/this.scale-fa.x;ba=ba.y/this.scale-fa.y;da=da*da+ba*ba;null==J&&(J=new mxPoint(fa.x-C.x,fa.y-C.y),I=Math.sqrt(J.x*J.x+J.y*J.y),0<I?(J.x=J.x*k/I,J.y=J.y*k/I):J=null);da>k*k&&0<I&&(da=C.x-fa.x,ba=C.y-fa.y,da=da*da+ba*ba,da>k*k&&(V=new mxPoint(fa.x-J.x,fa.y-J.y),da=new mxPoint(fa.x+J.x,fa.y+J.y),L.push(V),this.addPoints(Q,L,c,f,!1,null,z),L=0>Math.round(J.x)||0==Math.round(J.x)&&0>=Math.round(J.y)?1:-1,z=!1,"sharp"==B?(Q.lineTo(V.x-+J.y*L,V.y+J.x*L),Q.lineTo(da.x-J.y*L,da.y+J.x*L),Q.lineTo(da.x,da.y)):"line"==B?(Q.moveTo(V.x+J.y*L,V.y-J.x*L),Q.lineTo(V.x-J.y*L,V.y+J.x*L),Q.moveTo(da.x-J.y*L,da.y+J.x*L),Q.lineTo(da.x+J.y*L,da.y-J.x*L),Q.moveTo(da.x,da.y)):"arc"==B?(L*=1.3,Q.curveTo(V.x-J.y*L,V.y+J.x*L,da.x-J.y*L,da.y+J.x*L,da.x,da.y)):(Q.moveTo(da.x,da.y),z=!0),L=[da],V=!0))}else J=null;V||(L.push(fa),C=fa)}this.addPoints(Q,L,c,f,!1,null,z);Q.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=+function(Q,T,c,f){return null!=T&&"centerPerimeter"==T.style[mxConstants.STYLE_PERIMETER]?new mxPoint(T.getCenterX(),T.getCenterY()):G.apply(this,arguments)};var S=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(Q,T,c,f){if(null==T||null==Q||"1"!=T.style.snapToPoint&&"1"!=Q.style.snapToPoint)S.apply(this,arguments);else{T=this.getTerminalPort(Q,T,f);var k=this.getNextPoint(Q,c,f),B=this.graph.isOrthogonal(Q),z=mxUtils.toRadians(Number(T.style[mxConstants.STYLE_ROTATION]||+"0")),C=new mxPoint(T.getCenterX(),T.getCenterY());if(0!=z){var I=Math.cos(-z),L=Math.sin(-z);k=mxUtils.getRotatedPoint(k,I,L,C)}I=parseFloat(Q.style[mxConstants.STYLE_PERIMETER_SPACING]||0);I+=parseFloat(Q.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(T,k,0==z&&B,I);0!=z&&(I=Math.cos(z),L=Math.sin(z),k=mxUtils.getRotatedPoint(k,I,L,C));Q.setAbsoluteTerminalPoint(this.snapToAnchorPoint(Q,T,c,f,k),f)}};mxGraphView.prototype.snapToAnchorPoint=+function(Q,T,c,f,k){if(null!=T&&null!=Q){Q=this.graph.getAllConnectionConstraints(T);f=c=null;if(null!=Q)for(var B=0;B<Q.length;B++){var z=this.graph.getConnectionPoint(T,Q[B]);if(null!=z){var C=(z.x-k.x)*(z.x-k.x)+(z.y-k.y)*(z.y-k.y);if(null==f||C<f)c=z,f=C}}null!=c&&(k=c)}return k};var F=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(Q,T,c){var f=F.apply(this,arguments);"1"==Q.getAttribute("placeholders")&&null!=c.state&&(f=c.state.view.graph.replacePlaceholders(c.state.cell,+f));return f};var P=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(Q){if(null!=Q.style&&"undefined"!==typeof pako){var T=mxUtils.getValue(Q.style,mxConstants.STYLE_SHAPE,null);if(null!=T&&"string"===typeof T&&"stencil("==T.substring(0,8))try{var c=T.substring(8,T.length-1),f=mxUtils.parseXml(Graph.decompress(c));return new mxShape(new mxStencil(f.documentElement))}catch(k){null!=window.console&&console.log("Error in shape: "+k)}}return P.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(b){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[b]};mxStencilRegistry.setFileLoaded=function(b){mxStencilRegistry.filesLoaded[b]=!0};mxStencilRegistry.getStencil=function(b){var e=mxStencilRegistry.stencils[b];if(null==e&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var g=mxStencilRegistry.getBasenameForStencil(b);if(null!=g){e=mxStencilRegistry.libraries[g];if(null!=e){if(null==mxStencilRegistry.packages[g]){for(var m=0;m<e.length;m++){var v=e[m];if(!mxStencilRegistry.isFileLoaded(v))if(mxStencilRegistry.setFileLoaded(v),".xml"==v.toLowerCase().substring(v.length-4,v.length))mxStencilRegistry.loadStencilSet(v,null);else if(".js"==v.toLowerCase().substring(v.length-3,v.length))try{if(mxStencilRegistry.allowEval){var p=mxUtils.load(v);null!=p&&200<=p.getStatus()&&299>=p.getStatus()&&eval.call(window,p.getText())}}catch(A){null!=window.console&&console.log("error in getStencil:",b,g,e,v,A)}}mxStencilRegistry.packages[g]=1}}else g=g.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+g+".xml",null);e=mxStencilRegistry.stencils[b]}}return e};@@ -2522,14 +2522,14 @@ N,R,X){N=null!=N?N:0;R=null!=R?R:0;var ia=new mxCodec(u.ownerDocument),ka=new mxka.getChildren(wa[0]);null!=ua&&(u=this.moveCells(ua,N,R,!1,this.getDefaultParent()),pa[ka.getChildAt(ka.root,0).getId()]=this.getDefaultParent().getId())}if(null!=u&&(this.createCellMapping(ia,ta,pa),this.updateCustomLinks(pa,u),X)){this.isGridEnabled()&&(N=this.snap(N),R=this.snap(R));var Ca=this.getBoundingBoxFromGeometry(u,!0);null!=Ca&&this.moveCells(u,N-Ca.x,R-Ca.y)}}finally{this.model.endUpdate()}}return u};Graph.prototype.encodeCells=function(u){for(var N={},R=this.cloneCells(u,null,N),X=new mxDictionary,ia=0;ia<u.length;ia++)X.put(u[ia],!0);var ka=new mxCodec,pa=new mxGraphModel,wa=pa.getChildAt(pa.getRoot(),0);for(ia=0;ia<R.length;ia++){pa.add(wa,R[ia]);var ta=this.view.getState(u[ia]);if(null!=ta){var ua=this.getCellGeometry(R[ia]);null!=ua&&ua.relative&&!this.model.isEdge(u[ia])&&null==X.get(this.model.getParent(u[ia]))&&(ua.offset=null,ua.relative=!1,ua.x=ta.x/ta.view.scale-ta.view.translate.x,ua.y=ta.y/ta.view.scale-ta.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(N,this.createCellLookup(u)),R);return ka.encode(pa)};Graph.prototype.isSwimlane=function(u,N){var R=null;null==u||this.model.isEdge(u)||this.model.getParent(u)==this.model.getRoot()||(R=this.getCurrentCellStyle(u,N)[mxConstants.STYLE_SHAPE]);return R==mxConstants.SHAPE_SWIMLANE||"table"==R||"tableRow"==R};var G=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(u){return null!=u&&G.apply(this,arguments)?this.isTableCell(u)||this.isTableRow(u)?this.isCellEditable(this.model.getParent(u)):-!0:!1};var T=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(u){return null!=u&&T.apply(this,arguments)?this.isTableCell(u)||this.isTableRow(u)?this.isCellMovable(this.model.getParent(u)):!0:!1};var F=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(u){var N=this.model.getParent(u);if(null!=N){var R=this.getCurrentCellStyle(N);if(null!=R.expand)return"0"!=R.expand}return F.apply(this,arguments)&&(null==N||!this.isTable(N))};var P=Graph.prototype.splitEdge;+!0:!1};var S=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(u){return null!=u&&S.apply(this,arguments)?this.isTableCell(u)||this.isTableRow(u)?this.isCellMovable(this.model.getParent(u)):!0:!1};var F=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(u){var N=this.model.getParent(u);if(null!=N){var R=this.getCurrentCellStyle(N);if(null!=R.expand)return"0"!=R.expand}return F.apply(this,arguments)&&(null==N||!this.isTable(N))};var P=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(u,N,R,X,ia,ka,pa,wa){null==wa&&(wa=this.model.getParent(u),this.isTable(wa)||this.isTableRow(wa))&&(wa=this.getCellAt(ka,pa,null,!0,!1));R=null;this.model.beginUpdate();try{R=P.apply(this,[u,N,R,X,ia,ka,pa,wa]);this.model.setValue(R,"");var ta=this.getChildCells(R,!0);for(N=0;N<ta.length;N++){var ua=this.getCellGeometry(ta[N]);null!=ua&&ua.relative&&0<ua.x&&this.model.remove(ta[N])}var Ca=this.getChildCells(u,!0);for(N=0;N<Ca.length;N++)ua=this.getCellGeometry(Ca[N]),null!=ua&&ua.relative&&0>=ua.x&&this.model.remove(Ca[N]);var Na=this.model.getTerminal(R,!1);if(null!=Na){var Ya=this.getCurrentCellStyle(Na);null!=Ya&&"1"==Ya.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[u]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[u]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[R]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[R]))}}finally{this.model.endUpdate()}return R};var Q=Graph.prototype.selectCell;Graph.prototype.selectCell=function(u,N,R){if(N||R)Q.apply(this,arguments);else{var X=this.getSelectionCell(),ia=null,ka=[],pa=mxUtils.bind(this,function(wa){if(null!=this.view.getState(wa)&&(this.model.isVertex(wa)||this.model.isEdge(wa)))if(ka.push(wa),wa==X)ia=ka.length-1;else if(u&&null==X&&0<ka.length||null!=ia&&u&&ka.length>ia||!u&&0<ia)return;for(var ta=0;ta<this.model.getChildCount(wa);ta++)pa(this.model.getChildAt(wa,ta))});pa(this.model.root);0<ka.length&&(ia=null!=ia?mxUtils.mod(ia+(u?1:-1),ka.length):0,this.setSelectionCell(ka[ia]))}};-Graph.prototype.swapShapes=function(u,N){if(this.model.isVertex(u)&&this.model.isVertex(N)&&2==this.getMovableCells([u,N]).length){var R=this.getCellGeometry(u),X=this.getCellGeometry(N);if(null!=R&&null!=X){var ia=R.clone(),ka=X.clone();this.model.beginUpdate();try{ia.x=X.getCenterX()-R.width/2,ia.y=X.getCenterY()-R.height/2,ka.x=R.getCenterX()-X.width/2,ka.y=R.getCenterY()-X.height/2,this.model.setGeometry(u,ia),this.model.setGeometry(N,ka)}finally{this.model.endUpdate()}}}};var U=Graph.prototype.moveCells;+Graph.prototype.swapShapes=function(u,N){if(this.model.isVertex(u)&&this.model.isVertex(N)&&2==this.getMovableCells([u,N]).length){var R=this.getCellGeometry(u),X=this.getCellGeometry(N);if(null!=R&&null!=X){var ia=R.clone(),ka=X.clone();this.model.beginUpdate();try{ia.x=X.getCenterX()-R.width/2,ia.y=X.getCenterY()-R.height/2,ka.x=R.getCenterX()-X.width/2,ka.y=R.getCenterY()-X.height/2,this.model.setGeometry(u,ia),this.model.setGeometry(N,ka)}finally{this.model.endUpdate()}}}};var T=Graph.prototype.moveCells;Graph.prototype.moveCells=function(u,N,R,X,ia,ka,pa){pa=null!=pa?pa:{};if(this.isTable(ia)){for(var wa=[],ta=0;ta<u.length;ta++)this.isTable(u[ta])?wa=wa.concat(this.model.getChildCells(u[ta],!0).reverse()):wa.push(u[ta]);u=wa}this.model.beginUpdate();try{wa=[];for(ta=0;ta<u.length;ta++)if(null!=ia&&this.isTableRow(u[ta])){var ua=this.model.getParent(u[ta]),Ca=this.getCellGeometry(u[ta]);this.isTable(ua)&&wa.push(ua);if(null!=ua&&null!=Ca&&this.isTable(ua)&&this.isTable(ia)&&(X||ua!=ia)){if(!X){var Na=this.getCellGeometry(ua);null!=Na&&(Na=Na.clone(),Na.height-=Ca.height,this.model.setGeometry(ua,Na))}Na=this.getCellGeometry(ia);null!=Na&&(Na=Na.clone(),Na.height+=Ca.height,this.model.setGeometry(ia,Na));var Ya=this.model.getChildCells(ia,!0);if(0<Ya.length){u[ta]=X?this.cloneCell(u[ta]):u[ta];var Za=this.model.getChildCells(u[ta],!0),ab=this.model.getChildCells(Ya[0],!0),Ra=ab.length-Za.length;if(0<Ra)for(var Oa=0;Oa<Ra;Oa++){var kb=this.cloneCell(Za[Za.length-1]);null!=kb&&(kb.value="",this.model.add(u[ta],-kb))}else if(0>Ra)for(Oa=0;Oa>Ra;Oa--)this.model.remove(Za[Za.length+Oa-1]);Za=this.model.getChildCells(u[ta],!0);for(Oa=0;Oa<ab.length;Oa++){var cb=this.getCellGeometry(ab[Oa]),$a=this.getCellGeometry(Za[Oa]);null!=cb&&null!=$a&&($a=$a.clone(),$a.width=cb.width,this.model.setGeometry(Za[Oa],$a))}}}}var fb=U.apply(this,arguments);for(ta=0;ta<wa.length;ta++)!X&&this.model.contains(wa[ta])&&0==this.model.getChildCount(wa[ta])&&this.model.remove(wa[ta]);X&&this.updateCustomLinks(this.createCellMapping(pa,+kb))}else if(0>Ra)for(Oa=0;Oa>Ra;Oa--)this.model.remove(Za[Za.length+Oa-1]);Za=this.model.getChildCells(u[ta],!0);for(Oa=0;Oa<ab.length;Oa++){var cb=this.getCellGeometry(ab[Oa]),$a=this.getCellGeometry(Za[Oa]);null!=cb&&null!=$a&&($a=$a.clone(),$a.width=cb.width,this.model.setGeometry(Za[Oa],$a))}}}}var fb=T.apply(this,arguments);for(ta=0;ta<wa.length;ta++)!X&&this.model.contains(wa[ta])&&0==this.model.getChildCount(wa[ta])&&this.model.remove(wa[ta]);X&&this.updateCustomLinks(this.createCellMapping(pa,this.createCellLookup(u)),fb)}finally{this.model.endUpdate()}return fb};var c=Graph.prototype.removeCells;Graph.prototype.removeCells=function(u,N){var R=[];this.model.beginUpdate();try{for(var X=0;X<u.length;X++)if(this.isTableCell(u[X])){var ia=this.model.getParent(u[X]),ka=this.model.getParent(ia);1==this.model.getChildCount(ia)&&1==this.model.getChildCount(ka)?0>mxUtils.indexOf(u,ka)&&0>mxUtils.indexOf(R,ka)&&R.push(ka):this.labelChanged(u[X],"")}else{if(this.isTableRow(u[X])&&(ka=this.model.getParent(u[X]),0>mxUtils.indexOf(u,ka)&&0>mxUtils.indexOf(R,ka))){for(var pa=this.model.getChildCells(ka,!0),wa=0,ta=0;ta<pa.length;ta++)0<=mxUtils.indexOf(u,pa[ta])&&wa++;wa==pa.length&&R.push(ka)}R.push(u[X])}R=c.apply(this,[R,N])}finally{this.model.endUpdate()}return R};Graph.prototype.updateCustomLinks=function(u,N,R){R=null!=R?R:new Graph;for(var X=0;X<N.length;X++)null!=N[X]&&R.updateCustomLinksForCell(u,N[X],R)};Graph.prototype.updateCustomLinksForCell=function(u,N){this.doUpdateCustomLinksForCell(u,N);for(var R=this.model.getChildCount(N),X=0;X<R;X++)this.updateCustomLinksForCell(u,this.model.getChildAt(N,X))};Graph.prototype.doUpdateCustomLinksForCell=function(u,N){};Graph.prototype.getAllConnectionConstraints=function(u,N){if(null!=u){N=mxUtils.getValue(u.style,"points",null);if(null!=N){u=[];try{var R=JSON.parse(N);for(N=0;N<R.length;N++){var X=R[N];u.push(new mxConnectionConstraint(new mxPoint(X[0],X[1]),2<X.length?"0"!=X[2]:!0,null,3<X.length?X[3]:0,4<X.length?X[4]:0))}}catch(ka){}return u}if(null!=@@ -2578,7 +2578,7 @@ ia.root=this.addCellData(X.cell,null!=wa.createElementNS?wa.createElementNS(mxConull!=ia?ia:!0;ka=null!=ka?ka:!0;pa=null!=pa?pa:!0;ua=null!=ua?ua:!1;var cb="page"==Ya?this.view.getBackgroundPageBounds():ka&&null==Oa||X||"diagram"==Ya?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),$a=this.backgroundImage,fb=this.view.translate,jb=this.view.scale;"diagram"==Ya&&null!=$a&&null!=$a.width&&null!=$a.height&&(cb=mxRectangle.fromRectangle(cb),cb.add(new mxRectangle((fb.x+$a.x)*jb,(fb.y+$a.y)*jb,$a.width*jb,$a.height*jb)));if(null==cb)throw Error(mxResources.get("drawingEmpty"));X=N/jb;var sb=Math.max(1,Math.ceil(cb.width*X)+2*R)+(ua&&0==R?5:0),Ab=Math.max(1,Math.ceil(cb.height*X)+2*R)+(ua&&0==R?5:0);ua=ia?-.5:0;var nb=mxUtils.getLightDarkColor(u),lb=Graph.createSvgNode(ua,ua,sb,Ab,nb),db=lb.ownerDocument;if(null!=u){var mb=mxUtils.createElementNs(db,mxConstants.NS_SVG,"rect");mb.setAttribute("fill",nb.light);mb.style.fill=nb.cssText;mb.setAttribute("width","100%");mb.setAttribute("height","100%");mb.setAttribute("x","0");mb.setAttribute("y","0");lb.appendChild(mb)}var ub=mxUtils.createElementNs(db,mxConstants.NS_SVG,"g");lb.appendChild(ub);var eb=this.createSvgCanvas(ub);eb.foOffset=ia?-.5:0;eb.textOffset=ia?-.5:0;eb.imageOffset=ia?-.5:0;eb.translate(Math.floor(R/N-cb.x/jb),Math.floor(R/N-cb.y/jb));eb.idPrefix="drawio-svg-"+Editor.guid();var ob=document.createElement("div"),tb=eb.getAlternateText;eb.getAlternateText=function(hb,Bb,rb,yb,zb,qb,Cb,d,n,y,q,x,D){if(null!=qb&&0<this.state.fontSize)try{mxUtils.isNode(qb)?qb=qb.innerText:(ob.innerHTML=qb,qb=mxUtils.extractTextWithWhitespace(ob.childNodes));-for(var E=Math.ceil(2*yb/this.state.fontSize),ha=[],L=0,va=0;(0==E||L<E)&&va<qb.length;){var na=qb.charCodeAt(va);if(10==na||13==na){if(0<L)break}else ha.push(qb.charAt(va)),255>na&&L++;va++}ha.length<qb.length&&1<qb.length-ha.length&&(qb=mxUtils.trim(ha.join(""))+"...");return qb}catch(Va){return tb.apply(this,arguments)}else return tb.apply(this,arguments)};null!=$a&&null!=$a.width&&null!=$a.height&&(u=jb/N,ua=new mxRectangle(($a.x+fb.x)*u,($a.y+fb.y)*u,$a.width*u,$a.height*u),mxUtils.intersects(cb,+for(var E=Math.ceil(2*yb/this.state.fontSize),ha=[],M=0,va=0;(0==E||M<E)&&va<qb.length;){var na=qb.charCodeAt(va);if(10==na||13==na){if(0<M)break}else ha.push(qb.charAt(va)),255>na&&M++;va++}ha.length<qb.length&&1<qb.length-ha.length&&(qb=mxUtils.trim(ha.join(""))+"...");return qb}catch(Va){return tb.apply(this,arguments)}else return tb.apply(this,arguments)};null!=$a&&null!=$a.width&&null!=$a.height&&(u=jb/N,ua=new mxRectangle(($a.x+fb.x)*u,($a.y+fb.y)*u,$a.width*u,$a.height*u),mxUtils.intersects(cb,ua)&&eb.image($a.x+fb.x,$a.y+fb.y,$a.width,$a.height,$a.src,!0));eb.scale(X);eb.textEnabled=pa;wa=null!=wa?wa:this.createSvgImageExport();var pb=wa.getLinkForCellState;wa.getLinkForCellState=function(hb,Bb){var rb=hb.view.graph.getAbsoluteUrl(pb.apply(this,arguments));return null==rb||hb.view.graph.isCustomLink(rb)?null:rb};wa.getLinkTargetForCellState=function(hb,Bb){return hb.view.graph.getLinkTargetForCell(hb.cell)};var wb=wa.drawCellState,vb=null,xb=mxUtils.bind(this,function(){if(null==vb){vb="ge-flow-animation-"+Editor.guid();var hb=null!=db.createElementNS?db.createElementNS(mxConstants.NS_SVG,"style"):db.createElement("style");hb.innerHTML=this.createFlowAnimationCss(vb);db.getElementsByTagName("defs")[0].appendChild(hb)}return vb});wa.drawCellState=function(hb,Bb){for(var rb=hb.view.graph,yb=null!=Oa?Oa.get(hb.cell):rb.isCellSelected(hb.cell),zb=rb.model.getParent(hb.cell);!(ka&&null==Oa||yb)&&null!=zb;)yb=null!=Oa?Oa.get(zb):rb.isCellSelected(zb),zb=rb.model.getParent(zb);if(null!=hb.shape)try{var qb=hb.shape.isFlowAnimationEnabled,Cb=hb.shape.addFlowAnimationToShape;hb.shape.isFlowAnimationEnabled=function(){return kb&&rb.model.isEdge(hb.cell)&&"1"==mxUtils.getValue(hb.style,"flowAnimation","0")};hb.shape.addFlowAnimationToShape=function(){rb.addFlowAnimationToNode(this.getFlowAnimationPath(),hb.style,N,xb())};if(ka&&null==Oa||yb)rb.view.redrawEnumerationState(hb),wb.apply(this,arguments),this.doDrawShape(hb.secondLabel,Bb)}finally{hb.shape.isFlowAnimationEnabled=qb,hb.shape.addFlowAnimationToShape=@@ -2618,23 +2618,23 @@ mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALICMath.round(ta)+"px";this.textarea.style.textDecoration=pa.join(" ");this.textarea.style.fontWeight=ia?"bold":"normal";this.textarea.style.fontStyle=ka?"italic":"";this.textarea.style.fontFamily=N;this.textarea.style.textAlign=X;this.textarea.style.padding="0px";this.textarea.innerHTML!=wa&&(this.textarea.innerHTML=wa,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors());this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var wa=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(wa=mxUtils.replaceTrailingNewlines(wa,"<div><br></div>"));wa=Graph.sanitizeHtml(N?wa.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):wa,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ta=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ta*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ta)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.width="";this.textarea.style.padding=-"2px";this.textarea.innerHTML!=wa&&(this.textarea.innerHTML=wa);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=R;this.resize()}};var H=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(u,N){if(null!=this.textarea)if(u=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=u){var R=u.view.scale;this.bounds=mxRectangle.fromRectangle(u);if(0==this.bounds.width&&+"2px";this.textarea.innerHTML!=wa&&(this.textarea.innerHTML=wa);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=R;this.resize()}};var I=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(u,N){if(null!=this.textarea)if(u=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=u){var R=u.view.scale;this.bounds=mxRectangle.fromRectangle(u);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*R;this.bounds.height=60*R;var X=null!=u.text?u.text.margin:null;null==X&&(X=mxUtils.getAlignmentAsPoint(mxUtils.getValue(u.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(u.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=X.x*this.bounds.width;this.bounds.y+=X.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/R)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/R)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/R)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*R);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/R)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*-R);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+R+","+R+")")}else this.textarea.style.height="",this.textarea.style.overflow="",H.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(u,N){if("0"==mxUtils.getValue(u.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);+R);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+R+","+R+")")}else this.textarea.style.height="",this.textarea.style.overflow="",I.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(u,N){if("0"==mxUtils.getValue(u.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var R=this.graph.getEditingValue(u.cell,N);"1"==mxUtils.getValue(u.style,"nl2Br","1")&&(R=R.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(R,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(u,N){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(u.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(u){if("0"==mxUtils.getValue(u.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var N=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(u.style,"nl2Br","1")?(N=N.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<N.length&&("<br/>"==N.substring(N.length-5)||"<br>"==N.substring(N.length-4))&&(N=N.substring(0,N.lastIndexOf("<br"))+"<div><br/></div>")):-N=N.replace(/\r\n/g,"").replace(/\n/g,"");return N};var K=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(u){this.codeViewMode&&this.toggleViewMode();K.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(u){}};var M=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(u,N){this.graph.getModel().beginUpdate();try{M.apply(this,arguments),""==N&&this.graph.isCellDeletable(u.cell)&&+N=N.replace(/\r\n/g,"").replace(/\n/g,"");return N};var L=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(u){this.codeViewMode&&this.toggleViewMode();L.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(u){}};var J=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(u,N){this.graph.getModel().beginUpdate();try{J.apply(this,arguments),""==N&&this.graph.isCellDeletable(u.cell)&&0==this.graph.model.getChildCount(u.cell)&&this.graph.isTransparentState(u)&&this.graph.removeCells([u.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(u){u=mxUtils.getValue(u.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);u==mxConstants.NONE&&(u=null);return u};mxCellEditor.prototype.getBorderColor=function(u){u=mxUtils.getValue(u.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);u==mxConstants.NONE&&(u=null);return u};mxCellEditor.prototype.getMinimumSize=function(u){var N=this.graph.getView().scale;return new mxRectangle(0,0,null==u.text?30:u.text.size*N+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(u,N){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(N.getEvent)};mxGraphView.prototype.formatUnitText=function(u){return u?e(u,this.unit):u};mxGraphHandler.prototype.updateHint=function(u){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var N=this.graph.view.translate,R=this.graph.view.scale;u=this.roundLength((this.bounds.x+this.currentDx)/R-N.x);N=this.roundLength((this.bounds.y+this.currentDy)/R-N.y);R=this.graph.view.unit;this.hint.innerHTML=e(u,R)+", "+e(N,R);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var O=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(u,N){O.apply(this,arguments);var R=this.graph.getCellStyle(u);if(null==R.childLayout){var X=this.graph.model.getParent(u),ia=null!=X?this.graph.getCellGeometry(X):null;if(null!=ia&&(R=this.graph.getCellStyle(X),"stackLayout"==R.childLayout)){var ka=-parseFloat(mxUtils.getValue(R,"stackBorder",mxStackLayout.prototype.border));R="1"==mxUtils.getValue(R,"horizontalStack","1");var pa=this.graph.getActualStartSize(X);ia=ia.clone();R?ia.height=N.height+pa.y+pa.height+2*ka:ia.width=N.width+pa.x+pa.width+2*ka;this.graph.model.setGeometry(X,ia)}}};var ea=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function u(wa){R.get(wa)||(R.put(wa,!0),ia.push(wa))}for(var N=ea.apply(this,-arguments),R=new mxDictionary,X=this.graph.model,ia=[],ka=0;ka<N.length;ka++){var pa=N[ka];this.graph.isTableCell(pa)?u(X.getParent(X.getParent(pa))):this.graph.isTableRow(pa)&&u(X.getParent(pa));u(pa)}return ia};var fa=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(u){return fa.apply(this,arguments)&&!mxEvent.isControlDown(u.getEvent())&&!mxEvent.isShiftDown(u.getEvent())};var S=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=-function(){return S.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var ca=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(u){var N=ca.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=1;return N};var ma=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=+parseFloat(mxUtils.getValue(R,"stackBorder",mxStackLayout.prototype.border));R="1"==mxUtils.getValue(R,"horizontalStack","1");var pa=this.graph.getActualStartSize(X);ia=ia.clone();R?ia.height=N.height+pa.y+pa.height+2*ka:ia.width=N.width+pa.x+pa.width+2*ka;this.graph.model.setGeometry(X,ia)}}};var da=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function u(wa){R.get(wa)||(R.put(wa,!0),ia.push(wa))}for(var N=da.apply(this,+arguments),R=new mxDictionary,X=this.graph.model,ia=[],ka=0;ka<N.length;ka++){var pa=N[ka];this.graph.isTableCell(pa)?u(X.getParent(X.getParent(pa))):this.graph.isTableRow(pa)&&u(X.getParent(pa));u(pa)}return ia};var fa=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(u){return fa.apply(this,arguments)&&!mxEvent.isControlDown(u.getEvent())&&!mxEvent.isShiftDown(u.getEvent())};var V=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=+function(){return V.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var ba=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(u){var N=ba.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=1;return N};var ma=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(u){var N=ma.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=1;return N};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var u=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+u.x/2,this.bounds.y+this.rotationHandleVSpacing-u.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(u,N){return this.graph.isRecursiveVertexResize(u)&&!mxEvent.isAltDown(N.getEvent())};mxVertexHandler.prototype.isCenteredEvent=function(u,N){return mxEvent.isControlDown(N.getEvent())||mxEvent.isMetaDown(N.getEvent())};var la=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return la.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?-this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var Z=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return Z.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var da=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(u){return u.tableHandle||da.apply(this,arguments)&&+this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var Z=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return Z.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var ea=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(u){return u.tableHandle||ea.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var u=0;this.graph.isTableRow(this.state.cell)?u=1:this.graph.isTableCell(this.state.cell)&&(u=2);return u};var aa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return aa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var l=null,t=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==l&&(l=mxCellRenderer.defaultShapes.tableLine);var u=t.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var N=function(ab,Ra,Oa){for(var kb=[],cb=0;cb<ab.length;cb++){var $a=ab[cb];kb.push(null==$a?null:new mxPoint((ta+$a.x+Ra)*ka,(ua+$a.y+Oa)*ka))}return kb},R=this,X=this.graph,ia=X.model,ka=X.view.scale,pa=this.state,wa=this.selectionBorder,ta=this.state.origin.x+X.view.translate.x,ua=this.state.origin.y+X.view.translate.y;null==u&&(u=[]);var Ca=X.view.getCellStates(ia.getChildCells(this.state.cell,!0));if(0<Ca.length){var Na=ia.getChildCells(Ca[0].cell,!0),Ya=X.getTableLines(this.state.cell,!1,!0),Za=X.getTableLines(this.state.cell,!0,!1);for(ia=0;ia<Ca.length;ia++)mxUtils.bind(this,function(ab){var Ra=Ca[ab],Oa=null;if(X.isCellMovable(Ra.cell)){Oa=ab<Ca.length-1?Ca[ab+1]:null;Oa=null!=Oa?X.getCellGeometry(Oa.cell):null;var kb=null!=Oa&&null!=Oa.alternateBounds?Oa.alternateBounds:@@ -2643,20 +2643,20 @@ X.getActualStartSize(pa.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=cb)X.setTableRowHeight(this.state.cell,cb,!$a);else if(!R.blockDelayedSelection){var jb=X.getCellAt(fb.getGraphX(),fb.getGraphY())||pa.cell;X.graphHandler.selectCellForEvent(jb,fb)}cb=0};Oa.reset=function(){cb=0}}u.push(Oa)})(ia);for(ia=0;ia<Na.length;ia++)mxUtils.bind(this,function(ab){var Ra=X.view.getState(Na[ab]),Oa=X.getCellGeometry(Na[ab]),kb=null!=Oa.alternateBounds?Oa.alternateBounds:Oa;null==Ra&&(Ra=new mxCellState(X.view,Na[ab],X.getCellStyle(Na[ab])),Ra.x=pa.x+Oa.x*ka,Ra.y=pa.y+Oa.y*ka,Ra.width=kb.width*ka,Ra.height=kb.height*ka,Ra.updateCachedBounds());Oa=ab<Na.length-1?Na[ab+1]:null;Oa=null!=Oa?X.getCellGeometry(Oa):null;var cb=null!=Oa&&null!=Oa.alternateBounds?Oa.alternateBounds:Oa;Oa=null!=Ya[ab]?new l(Ya[ab],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Oa.isDashed=wa.isDashed;Oa.svgStrokeTolerance++;Ra=new mxHandle(Ra,"col-resize",null,Oa);Ra.tableHandle=!0;var $a=0;Ra.shape.node.parentNode.insertBefore(Ra.shape.node,Ra.shape.node.parentNode.firstChild);Ra.redraw=function(){if(null!=this.shape){this.shape.stroke=0==$a?mxConstants.NONE:wa.stroke;if(this.shape.constructor==l)this.shape.line=N(Ya[ab],$a,0),this.shape.updateBoundsFromLine();else{var jb=X.getActualStartSize(pa.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(kb.width+$a)*ka;this.shape.bounds.y=pa.y+(ab==Na.length-1?0:jb.y*ka);this.shape.bounds.height=pa.height-(ab==Na.length-1?0:(jb.height+jb.y)*ka)}this.shape.redraw()}};var fb=!1;Ra.setPosition=function(jb,sb,Ab){$a=-Math.max(Graph.minTableColumnWidth-kb.width,sb.x-jb.x-kb.width);fb=mxEvent.isShiftDown(Ab.getEvent());null==cb||fb||($a=Math.min($a,cb.width-Graph.minTableColumnWidth))};Ra.execute=function(jb){if(0!=$a)X.setTableColumnWidth(this.state.cell,$a,fb);else if(!R.blockDelayedSelection){var sb=X.getCellAt(jb.getGraphX(),jb.getGraphY())||pa.cell;X.graphHandler.selectCellForEvent(sb,jb)}$a=0};Ra.positionChanged=function(){};Ra.reset=function(){$a=0};u.push(Ra)})(ia)}}return null!=u?u.reverse():null};var I=-mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(u){I.apply(this,arguments);if(null!=this.moveHandles)for(var N=0;N<this.moveHandles.length;N++)null!=this.moveHandles[N]&&(this.moveHandles[N].node.style.visibility=u?"":"hidden");if(null!=this.cornerHandles)for(N=0;N<this.cornerHandles.length;N++)this.cornerHandles[N].node.style.visibility=u?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&+Math.max(Graph.minTableColumnWidth-kb.width,sb.x-jb.x-kb.width);fb=mxEvent.isShiftDown(Ab.getEvent());null==cb||fb||($a=Math.min($a,cb.width-Graph.minTableColumnWidth))};Ra.execute=function(jb){if(0!=$a)X.setTableColumnWidth(this.state.cell,$a,fb);else if(!R.blockDelayedSelection){var sb=X.getCellAt(jb.getGraphX(),jb.getGraphY())||pa.cell;X.graphHandler.selectCellForEvent(sb,jb)}$a=0};Ra.positionChanged=function(){};Ra.reset=function(){$a=0};u.push(Ra)})(ia)}}return null!=u?u.reverse():null};var H=+mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(u){H.apply(this,arguments);if(null!=this.moveHandles)for(var N=0;N<this.moveHandles.length;N++)null!=this.moveHandles[N]&&(this.moveHandles[N].node.style.visibility=u?"":"hidden");if(null!=this.cornerHandles)for(N=0;N<this.cornerHandles.length;N++)this.cornerHandles[N].node.style.visibility=u?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var u=this.isMoveHandlesVisible();u&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():u||null==this.moveHandles||this.destroyMoveHandles();if(u&&null==this.moveHandles){for(u=0;u<this.moveHandles.length;u++)null!=this.moveHandles[u]&&this.moveHandles[u].parentNode.removeChild(this.moveHandles[u]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var u=this.graph,N=u.model,R=[],X=0;X<N.getChildCount(this.state.cell);X++)mxUtils.bind(this,function(ia){if(null!=ia&&N.isVertex(ia.cell)&&u.isCellMovable(ia.cell)){var ka=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ka=new mxImageShape(ka,this.rowHandleImage.src);ka.rowState=ia;ka.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ka.init(this.graph.getView().getOverlayPane());ka.node.style.cursor="move";mxEvent.addGestureListeners(ka.node,mxUtils.bind(this,function(pa){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(pa)&&this.graph.isCellSelected(ia.cell)||this.graph.selectCellForEvent(ia.cell,pa);mxEvent.isPopupTrigger(pa)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(pa),mxEvent.getClientY(pa),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(pa),this.graph.isMouseDown=!0);mxEvent.consume(pa)}),null,mxUtils.bind(this,function(pa){mxEvent.isPopupTrigger(pa)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(pa),mxEvent.getClientY(pa),ia.cell,pa),mxEvent.consume(pa))}));R.push(ka)}else R.push(null)})(this.graph.view.getState(N.getChildAt(this.state.cell,X)));return R};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var u=0;u<this.moveHandles.length;u++)null!=this.moveHandles[u]&&this.moveHandles[u].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=-function(){if(null!=this.cornerHandles){for(var u=0;u<this.cornerHandles.length;u++)null!=this.cornerHandles[u]&&null!=this.cornerHandles[u].node&&null!=this.cornerHandles[u].node.parentNode&&this.cornerHandles[u].node.parentNode.removeChild(this.cornerHandles[u].node);this.cornerHandles=null}};var V=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){V.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();+function(){if(null!=this.cornerHandles){for(var u=0;u<this.cornerHandles.length;u++)null!=this.cornerHandles[u]&&null!=this.cornerHandles[u].node&&null!=this.cornerHandles[u].node.parentNode&&this.cornerHandles[u].node.parentNode.removeChild(this.cornerHandles[u].node);this.cornerHandles=null}};var U=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){U.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(1==this.graph.getSelectionCount()&&this.graph.isCellMovable(this.state.cell)&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell))){this.cornerHandles=[];for(var u=0;4>u;u++){var N=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);N.dialect=mxConstants.DIALECT_SVG;N.init(this.graph.view.getOverlayPane());this.cornerHandles.push(N)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();-u=this.graph.getLinkForCell(this.state.cell);N=this.graph.getLinksForState(this.state);this.updateLinkHint(u,N)};var J=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var u=new mxPoint(0,0),N=this.tolerance,R=this.state.style.shape;null==mxCellRenderer.defaultShapes[R]&&mxStencilRegistry.getStencil(R);R=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!R&&null!=this.customHandles)for(var X=0;X<this.customHandles.length;X++)if(null!=+u=this.graph.getLinkForCell(this.state.cell);N=this.graph.getLinksForState(this.state);this.updateLinkHint(u,N)};var K=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var u=new mxPoint(0,0),N=this.tolerance,R=this.state.style.shape;null==mxCellRenderer.defaultShapes[R]&&mxStencilRegistry.getStencil(R);R=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!R&&null!=this.customHandles)for(var X=0;X<this.customHandles.length;X++)if(null!=this.customHandles[X]&&null!=this.customHandles[X].shape&&null!=this.customHandles[X].shape.bounds){var ia=this.customHandles[X].shape.bounds,ka=ia.getCenterX(),pa=ia.getCenterY();if(Math.abs(this.state.x-ka)<ia.width/2||Math.abs(this.state.y-pa)<ia.height/2||Math.abs(this.state.x+this.state.width-ka)<ia.width/2||Math.abs(this.state.y+this.state.height-pa)<ia.height/2){R=!0;break}}R&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(N/=2,this.graph.isTable(this.state.cell)&&(N+=7),u.x=-this.sizers[0].bounds.width+N,u.y=this.sizers[0].bounds.height+N):u=J.apply(this,arguments);return u};mxVertexHandler.prototype.updateHint=function(u){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{u=this.state.view.scale;var N=this.state.view.unit;this.hint.innerHTML=e(this.roundLength(this.bounds.width/u),N)+" x "+e(this.roundLength(this.bounds.height/+this.sizers[0].bounds.width+N,u.y=this.sizers[0].bounds.height+N):u=K.apply(this,arguments);return u};mxVertexHandler.prototype.updateHint=function(u){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{u=this.state.view.scale;var N=this.state.view.unit;this.hint.innerHTML=e(this.roundLength(this.bounds.width/u),N)+" x "+e(this.roundLength(this.bounds.height/u),N)}u=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==u&&(u=this.bounds);this.hint.style.left=u.x+Math.round((u.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=u.y+u.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var W=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){W.apply(this,arguments);var u=this.graph.getLinkForCell(this.state.cell),N=this.graph.getLinksForState(this.state);this.updateLinkHint(u,N)};var Y=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(u,N){Y.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};-var ba=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(u,N){ba.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(u,N,R){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var X=this.graph.view.translate,ia=this.graph.view.scale,ka=this.roundLength(N.x/ia-X.x);X=this.roundLength(N.y/ia-X.y);var pa=+var ca=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(u,N){ca.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(u,N,R){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var X=this.graph.view.translate,ia=this.graph.view.scale,ka=this.roundLength(N.x/ia-X.x);X=this.roundLength(N.y/ia-X.y);var pa=this.graph.view.unit;this.hint.innerHTML=e(ka,pa)+", "+e(X,pa);this.hint.style.visibility="visible";null!=R&&(R.view.updateEdgeBounds(R),this.hint.innerHTML+=" ("+(pa==mxConstants.POINTS?Math.round(R.length/ia):e(R.length/ia,pa))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(R=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*R.x)+"%, "+Math.round(100*R.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(u.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(u.getGraphY(),N.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.prototype.expandedImage=Graph.createSvgImage(9,9,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>');Graph.prototype.collapsedImage=Graph.createSvgImage(9,9,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>');mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=@@ -2699,14 +2699,14 @@ mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=ththis.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,N=null!=this.state.text?this.state.text.boundingBox:null,null==R&&(R=this.state),R=R.y+R.height,null!=N&&(R=Math.max(R,N.y+N.height)),this.linkHint.style.left=u.x+u.width/2+"px",this.linkHint.style.top=Math.round(R+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Wa=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Wa.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();null!=this.linkHint&&(null!=this.linkHint.parentNode&&this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Ia=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Ia.apply(this),null!=this.state&&null!=this.linkHint)){var u=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(u=new mxRectangle(u.x,u.y,u.width,u.height),u.add(this.state.text.bounds));this.linkHint.style.left=u.x+u.width/2+"px";this.linkHint.style.top=Math.round(u.y+u.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var Xa=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=-function(){Xa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Pa=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Pa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(d,n,y){mxShape.call(this);this.line=d;this.stroke=n;this.strokewidth=null!=y?y:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function g(){mxSwimlane.call(this)}function m(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function A(){mxActor.call(this)}function G(){mxCylinder.call(this)}function T(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function Q(){mxShape.call(this)}-function U(){mxShape.call(this)}function c(d,n,y,q){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=y;this.strokewidth=null!=q?q:1}function f(){mxActor.call(this)}function k(){mxCylinder.call(this)}function B(){mxCylinder.call(this)}function z(){mxActor.call(this)}function C(){mxActor.call(this)}function H(){mxActor.call(this)}function K(){mxActor.call(this)}function M(){mxActor.call(this)}function O(){mxActor.call(this)}function ea(){mxActor.call(this)}function fa(d,n){this.canvas=d;this.canvas.setLineJoin("round");+function(){Xa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Pa=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Pa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(d,n,y){mxShape.call(this);this.line=d;this.stroke=n;this.strokewidth=null!=y?y:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function g(){mxSwimlane.call(this)}function m(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function A(){mxActor.call(this)}function G(){mxCylinder.call(this)}function S(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function Q(){mxShape.call(this)}+function T(){mxShape.call(this)}function c(d,n,y,q){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=y;this.strokewidth=null!=q?q:1}function f(){mxActor.call(this)}function k(){mxCylinder.call(this)}function B(){mxCylinder.call(this)}function z(){mxActor.call(this)}function C(){mxActor.call(this)}function I(){mxActor.call(this)}function L(){mxActor.call(this)}function J(){mxActor.call(this)}function O(){mxActor.call(this)}function da(){mxActor.call(this)}function fa(d,n){this.canvas=d;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=n;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,fa.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,fa.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,fa.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,fa.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=-mxUtils.bind(this,fa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,fa.prototype.arcTo)}function S(){mxRectangleShape.call(this)}function ca(){mxRectangleShape.call(this)}function ma(){mxActor.call(this)}function la(){mxActor.call(this)}function Z(){mxActor.call(this)}function da(){mxRectangleShape.call(this)}function aa(){mxRectangleShape.call(this)}function l(){mxCylinder.call(this)}function t(){mxShape.call(this)}function I(){mxShape.call(this)}function V(){mxEllipse.call(this)}-function J(){mxShape.call(this)}function W(){mxShape.call(this)}function Y(){mxRectangleShape.call(this)}function ba(){mxShape.call(this)}function ja(){mxShape.call(this)}function oa(){mxShape.call(this)}function qa(){mxShape.call(this)}function ra(){mxShape.call(this)}function xa(){mxCylinder.call(this)}function Ba(){mxCylinder.call(this)}function ya(){mxRectangleShape.call(this)}function Da(){mxDoubleEllipse.call(this)}function La(){mxDoubleEllipse.call(this)}function sa(){mxArrowConnector.call(this);+mxUtils.bind(this,fa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,fa.prototype.arcTo)}function V(){mxRectangleShape.call(this)}function ba(){mxRectangleShape.call(this)}function ma(){mxActor.call(this)}function la(){mxActor.call(this)}function Z(){mxActor.call(this)}function ea(){mxRectangleShape.call(this)}function aa(){mxRectangleShape.call(this)}function l(){mxCylinder.call(this)}function t(){mxShape.call(this)}function H(){mxShape.call(this)}function U(){mxEllipse.call(this)}+function K(){mxShape.call(this)}function W(){mxShape.call(this)}function Y(){mxRectangleShape.call(this)}function ca(){mxShape.call(this)}function ja(){mxShape.call(this)}function oa(){mxShape.call(this)}function qa(){mxShape.call(this)}function ra(){mxShape.call(this)}function xa(){mxCylinder.call(this)}function Ba(){mxCylinder.call(this)}function ya(){mxRectangleShape.call(this)}function Da(){mxDoubleEllipse.call(this)}function La(){mxDoubleEllipse.call(this)}function sa(){mxArrowConnector.call(this);this.spacing=0}function Aa(){mxArrowConnector.call(this);this.spacing=0}function Ea(){mxActor.call(this)}function Ka(){mxRectangleShape.call(this)}function Ma(){mxActor.call(this)}function za(){mxActor.call(this)}function Wa(){mxActor.call(this)}function Ia(){mxActor.call(this)}function Xa(){mxActor.call(this)}function Pa(){mxActor.call(this)}function u(){mxActor.call(this)}function N(){mxActor.call(this)}function R(){mxActor.call(this)}function X(){mxActor.call(this)}function ia(){mxEllipse.call(this)}function ka(){mxEllipse.call(this)}function pa(){mxEllipse.call(this)}function wa(){mxRhombus.call(this)}function ta(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}function Ca(){mxEllipse.call(this)}function Na(){mxEllipse.call(this)}function Ya(){mxActor.call(this)}function Za(){mxActor.call(this)}function ab(){mxActor.call(this)}function Ra(d,n,y,q){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=y;this.strokewidth=null!=q?q:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=-!0;this.indent=2;this.rectOutline="single"}function Oa(){mxConnector.call(this)}function kb(d,n,y,q,x,D,E,ha,L,va){E+=L;var na=q.clone();q.x-=x*(2*E+L);q.y-=D*(2*E+L);x*=E+L;D*=E+L;return function(){d.ellipse(na.x-x-E,na.y-D-E,2*E,2*E);va?d.fillAndStroke():d.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var d=null;if(null!=this.line)for(var n=0;n<this.line.length;n++){var y=this.line[n];null!=y&&(y=new mxRectangle(y.x,y.y,this.strokewidth,this.strokewidth),null==+!0;this.indent=2;this.rectOutline="single"}function Oa(){mxConnector.call(this)}function kb(d,n,y,q,x,D,E,ha,M,va){E+=M;var na=q.clone();q.x-=x*(2*E+M);q.y-=D*(2*E+M);x*=E+M;D*=E+M;return function(){d.ellipse(na.x-x-E,na.y-D-E,2*E,2*E);va?d.fillAndStroke():d.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var d=null;if(null!=this.line)for(var n=0;n<this.line.length;n++){var y=this.line[n];null!=y&&(y=new mxRectangle(y.x,y.y,this.strokewidth,this.strokewidth),null==d?d=y:d.add(y))}this.bounds=null!=d?d:new mxRectangle};b.prototype.paintVertexShape=function(d,n,y,q,x){this.paintTableLine(d,this.line,0,0)};b.prototype.paintTableLine=function(d,n,y,q){if(null!=n){var x=null;d.begin();for(var D=0;D<n.length;D++){var E=n[D];null!=E&&(null==x?d.moveTo(E.x+y,E.y+q):null!=x&&d.lineTo(E.x+y,E.y+q));x=E}d.end();d.stroke()}};b.prototype.intersectsRectangle=function(d){var n=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var y=null,q=0;q<this.line.length&&!n;q++){var x=this.line[q];null!=x&&null!=y&&(n=mxUtils.rectangleIntersectsSegment(d,y,x));y=x}return n};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(e,mxSwimlane);e.prototype.getLabelBounds=function(d){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};e.prototype.paintVertexShape=function(d,n,y,q,x){var D=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,E=this.isHorizontal(),ha=this.getTitleSize();0==ha||this.outline?Ca.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),d.translate(-n,-y));D||this.outline||!(E&&ha<x||!E&&ha<q)||this.paintForeground(d,n,y,q,x)};e.prototype.paintForeground=function(d,n,y,q,x){if(null!=this.state){var D=this.flipH,E=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ha=D;D=E;E=ha}d.rotate(-this.getShapeRotation(),@@ -2717,80 +2717,80 @@ d.lineTo(D,D),d.close(),d.fill()),0!=ha&&(d.setFillAlpha(Math.abs(ha)),d.setFillm);var cb=Math.tan(mxUtils.toRadians(30)),$a=(.5-cb)/2;mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(v,mxConnector);v.prototype.paintEdgeShape=function(d,n){var y=this.createMarker(d,n,!0),q=this.createMarker(d,n,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);d.setShadow(!1);d.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);d.setStrokeColor(this.stroke);d.setFillColor(this.stroke);d.setDashed(!1);null!=y&&y();null!=q&&q()};mxCellRenderer.registerShape("wire",v);mxUtils.extend(p,mxCylinder);p.prototype.size=6;p.prototype.paintVertexShape=function(d,n,y,q,x){d.setFillColor(this.stroke);var D=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;d.ellipse(n+.5*(q-D),y+.5*(x-D),D,D);d.fill();d.setFillColor(mxConstants.NONE);d.rect(n,y,q,x);d.fill()};mxCellRenderer.registerShape("waypoint",p);mxUtils.extend(A,mxActor);A.prototype.size=20;A.prototype.redrawPath=function(d,n,y,q,x){n=Math.min(q,x/cb);d.translate((q-n)/2,(x-n)/2+n/4);d.moveTo(0,.25*n);d.lineTo(.5*n,n*$a);d.lineTo(n,.25*n);d.lineTo(.5*n,(.5-$a)*n);d.lineTo(0,.25*n);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(G,mxCylinder);G.prototype.size=20;G.prototype.redrawPath=function(d,n,y,q,x,D){n=Math.min(q,x/(.5+cb));D?(d.moveTo(0,.25*n),d.lineTo(.5*n,(.5-$a)*n),d.lineTo(n,.25*n),d.moveTo(.5*-n,(.5-$a)*n),d.lineTo(.5*n,(1-$a)*n)):(d.translate((q-n)/2,(x-n)/2),d.moveTo(0,.25*n),d.lineTo(.5*n,n*$a),d.lineTo(n,.25*n),d.lineTo(n,.75*n),d.lineTo(.5*n,(1-$a)*n),d.lineTo(0,.75*n),d.close());d.end()};mxCellRenderer.registerShape("isoCube",G);mxUtils.extend(T,mxCylinder);T.prototype.redrawPath=function(d,n,y,q,x,D){n=Math.min(x/2,Math.round(x/8)+this.strokewidth-1);if(D&&null!=this.fill||!D&&null==this.fill)d.moveTo(0,n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,-n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,-n);D||(d.moveTo(0,n),d.curveTo(0,-n/3,q,-n/3,q,n),d.lineTo(q,x-n),d.curveTo(q,x+n/3,0,x+n/3,0,x-n),d.close())};T.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",T);mxUtils.extend(F,mxCylinder);F.prototype.size=30;F.prototype.darkOpacity=+n,(.5-$a)*n),d.lineTo(.5*n,(1-$a)*n)):(d.translate((q-n)/2,(x-n)/2),d.moveTo(0,.25*n),d.lineTo(.5*n,n*$a),d.lineTo(n,.25*n),d.lineTo(n,.75*n),d.lineTo(.5*n,(1-$a)*n),d.lineTo(0,.75*n),d.close());d.end()};mxCellRenderer.registerShape("isoCube",G);mxUtils.extend(S,mxCylinder);S.prototype.redrawPath=function(d,n,y,q,x,D){n=Math.min(x/2,Math.round(x/8)+this.strokewidth-1);if(D&&null!=this.fill||!D&&null==this.fill)d.moveTo(0,n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,+n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,-n);D||(d.moveTo(0,n),d.curveTo(0,-n/3,q,-n/3,q,n),d.lineTo(q,x-n),d.curveTo(q,x+n/3,0,x+n/3,0,x-n),d.close())};S.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",S);mxUtils.extend(F,mxCylinder);F.prototype.size=30;F.prototype.darkOpacity=0;F.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(q,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));d.translate(n,y);d.begin();d.moveTo(0,0);d.lineTo(q-D,0);d.lineTo(q,D);d.lineTo(q,x);d.lineTo(0,x);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),d.begin(),d.moveTo(q-D,0),d.lineTo(q-D,D),d.lineTo(q,D),d.close(),d.fill()),d.begin(),d.moveTo(q-D,0),d.lineTo(q-D,D),d.lineTo(q,D),d.end(),d.stroke())};mxCellRenderer.registerShape("note",F);mxUtils.extend(P,F);mxCellRenderer.registerShape("note2",P);P.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,0)}return null};mxUtils.extend(Q,mxShape);Q.prototype.isoAngle=15;Q.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;D=Math.min(q*Math.tan(D),.5*x);d.translate(n,y);d.begin();d.moveTo(.5*q,0);d.lineTo(q,D);d.lineTo(q,x-D);d.lineTo(.5*q,x);d.lineTo(0,x-D);d.lineTo(0,D);d.close();d.fillAndStroke();d.setShadow(!1);d.begin();d.moveTo(0,D);d.lineTo(.5*q,2*D);d.lineTo(q,D);d.moveTo(.5*q,2*D);d.lineTo(.5*q,x);d.stroke()};mxCellRenderer.registerShape("isoCube2",-Q);mxUtils.extend(U,mxShape);U.prototype.size=15;U.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(n,y);0==D?(d.rect(0,0,q,x),d.fillAndStroke()):(d.begin(),d.moveTo(0,D),d.arcTo(.5*q,D,0,0,1,.5*q,0),d.arcTo(.5*q,D,0,0,1,q,D),d.lineTo(q,x-D),d.arcTo(.5*q,D,0,0,1,.5*q,x),d.arcTo(.5*q,D,0,0,1,0,x-D),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(q,D),d.arcTo(.5*q,D,0,0,1,.5*q,2*D),d.arcTo(.5*-q,D,0,0,1,0,D),d.stroke())};mxCellRenderer.registerShape("cylinder2",U);mxUtils.extend(c,mxCylinder);c.prototype.size=15;c.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"lid",!0);d.translate(n,y);0==D?(d.rect(0,0,q,x),d.fillAndStroke()):(d.begin(),E?(d.moveTo(0,D),d.arcTo(.5*q,D,0,0,1,.5*q,0),d.arcTo(.5*q,D,0,0,1,q,D)):(d.moveTo(0,0),d.arcTo(.5*q,D,0,0,0,.5*q,D),d.arcTo(.5*q,D,+Q);mxUtils.extend(T,mxShape);T.prototype.size=15;T.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(n,y);0==D?(d.rect(0,0,q,x),d.fillAndStroke()):(d.begin(),d.moveTo(0,D),d.arcTo(.5*q,D,0,0,1,.5*q,0),d.arcTo(.5*q,D,0,0,1,q,D),d.lineTo(q,x-D),d.arcTo(.5*q,D,0,0,1,.5*q,x),d.arcTo(.5*q,D,0,0,1,0,x-D),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(q,D),d.arcTo(.5*q,D,0,0,1,.5*q,2*D),d.arcTo(.5*+q,D,0,0,1,0,D),d.stroke())};mxCellRenderer.registerShape("cylinder2",T);mxUtils.extend(c,mxCylinder);c.prototype.size=15;c.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"lid",!0);d.translate(n,y);0==D?(d.rect(0,0,q,x),d.fillAndStroke()):(d.begin(),E?(d.moveTo(0,D),d.arcTo(.5*q,D,0,0,1,.5*q,0),d.arcTo(.5*q,D,0,0,1,q,D)):(d.moveTo(0,0),d.arcTo(.5*q,D,0,0,0,.5*q,D),d.arcTo(.5*q,D,0,0,0,q,0)),d.lineTo(q,x-D),d.arcTo(.5*q,D,0,0,1,.5*q,x),d.arcTo(.5*q,D,0,0,1,0,x-D),d.close(),d.fillAndStroke(),d.setShadow(!1),E&&(d.begin(),d.moveTo(q,D),d.arcTo(.5*q,D,0,0,1,.5*q,2*D),d.arcTo(.5*q,D,0,0,1,0,D),d.stroke()))};mxCellRenderer.registerShape("cylinder3",c);mxUtils.extend(f,mxActor);f.prototype.redrawPath=function(d,n,y,q,x){d.moveTo(0,0);d.quadTo(q/2,.5*x,q,0);d.quadTo(.5*q,x/2,q,x);d.quadTo(q/2,.5*x,0,x);d.quadTo(.5*q,x/2,0,0);d.end()};mxCellRenderer.registerShape("switch",f);mxUtils.extend(k,mxCylinder);k.prototype.tabWidth=60;k.prototype.tabHeight=20;k.prototype.tabPosition="right";k.prototype.arcSize=.1;k.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);n=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));y=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var D=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),E=mxUtils.getValue(this.style,"rounded",!1),ha=mxUtils.getValue(this.style,-"absoluteArcSize",!1),L=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ha||(L*=Math.min(q,x));L=Math.min(L,.5*q,.5*(x-y));n=Math.max(n,L);n=Math.min(q-L,n);E||(L=0);d.begin();"left"==D?(d.moveTo(Math.max(L,0),y),d.lineTo(Math.max(L,0),0),d.lineTo(n,0),d.lineTo(n,y)):(d.moveTo(q-n,y),d.lineTo(q-n,0),d.lineTo(q-Math.max(L,0),0),d.lineTo(q-Math.max(L,0),y));E?(d.moveTo(0,L+y),d.arcTo(L,L,0,0,1,L,y),d.lineTo(q-L,y),d.arcTo(L,L,0,0,1,q,L+y),d.lineTo(q,x-L),d.arcTo(L,L,0,0,1,q-L,x),d.lineTo(L,-x),d.arcTo(L,L,0,0,1,0,x-L)):(d.moveTo(0,y),d.lineTo(q,y),d.lineTo(q,x),d.lineTo(0,x));d.close();d.fillAndStroke();d.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(d.begin(),d.moveTo(q-30,y+20),d.lineTo(q-20,y+10),d.lineTo(q-10,y+20),d.close(),d.stroke())};mxCellRenderer.registerShape("folder",k);k.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,+"absoluteArcSize",!1),M=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ha||(M*=Math.min(q,x));M=Math.min(M,.5*q,.5*(x-y));n=Math.max(n,M);n=Math.min(q-M,n);E||(M=0);d.begin();"left"==D?(d.moveTo(Math.max(M,0),y),d.lineTo(Math.max(M,0),0),d.lineTo(n,0),d.lineTo(n,y)):(d.moveTo(q-n,y),d.lineTo(q-n,0),d.lineTo(q-Math.max(M,0),0),d.lineTo(q-Math.max(M,0),y));E?(d.moveTo(0,M+y),d.arcTo(M,M,0,0,1,M,y),d.lineTo(q-M,y),d.arcTo(M,M,0,0,1,q,M+y),d.lineTo(q,x-M),d.arcTo(M,M,0,0,1,q-M,x),d.lineTo(M,+x),d.arcTo(M,M,0,0,1,0,x-M)):(d.moveTo(0,y),d.lineTo(q,y),d.lineTo(q,x),d.lineTo(0,x));d.close();d.fillAndStroke();d.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(d.begin(),d.moveTo(q-30,y+20),d.lineTo(q-20,y+10),d.lineTo(q-10,y+20),d.close(),d.stroke())};mxCellRenderer.registerShape("folder",k);k.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var y=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var q=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),D=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));x||(D*=Math.min(d.width,d.height));D=Math.min(D,.5*d.width,.5*(d.height-n));q||(D=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(D,0,Math.min(d.width,d.width-y),Math.min(d.height,d.height-n)):new mxRectangle(Math.min(d.width,d.width-y),0,D,Math.min(d.height,d.height-n))}return new mxRectangle(0,Math.min(d.height,n),0,0)}return null};mxUtils.extend(B,mxCylinder);B.prototype.arcSize=.1;B.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);var D=mxUtils.getValue(this.style,"rounded",!1),E=mxUtils.getValue(this.style,"absoluteArcSize",!1);n=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));y=mxUtils.getValue(this.style,"umlStateConnection",null);E||(n*=Math.min(q,x));n=Math.min(n,.5*q,.5*x);D||(n=0);D=0;null!=y&&(D=10);d.begin();d.moveTo(D,n);d.arcTo(n,n,0,0,1,D+n,0);d.lineTo(q-n,0);d.arcTo(n,n,0,0,1,q,n);d.lineTo(q,x-n);d.arcTo(n,n,0,0,1,q-n,x);d.lineTo(D+n,x);d.arcTo(n,n,0,0,1,D,x-n);d.close();d.fillAndStroke();d.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(d.roundrect(q-40,x-20,10,10,3,3),d.stroke(),d.roundrect(q-20,x-20,10,10,3,3),d.stroke(),d.begin(),d.moveTo(q-30,x-15),d.lineTo(q-20,x-15),d.stroke());"connPointRefEntry"==y?(d.ellipse(0,.5*x-10,20,20),d.fillAndStroke()):"connPointRefExit"==y&&(d.ellipse(0,.5*x-10,20,20),d.fillAndStroke(),d.begin(),d.moveTo(5,.5*x-5),d.lineTo(15,.5*x+5),d.moveTo(15,.5*x-5),d.lineTo(5,.5*x+5),d.stroke())};B.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};mxCellRenderer.registerShape("umlState",B);mxUtils.extend(z,mxActor);z.prototype.size=30;z.prototype.isRoundable=function(){return!0};z.prototype.redrawPath=function(d,n,y,q,x){n=Math.max(0,Math.min(q,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,0),new mxPoint(q,0),new mxPoint(q,x),new mxPoint(0,x),new mxPoint(0,n)],this.isRounded,y,!0);d.end()};mxCellRenderer.registerShape("card",z);mxUtils.extend(C,mxActor);C.prototype.size=.4;C.prototype.redrawPath=function(d,n,y,q,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,n/2);d.quadTo(q/4,1.4*n,q/2,n/2);d.quadTo(3*q/4,n*(1-1.4),q,n/2);d.lineTo(q,x-n/2);d.quadTo(3*q/4,x-1.4*n,q/2,x-n/2);d.quadTo(q/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};C.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",this.size),y=d.width,q=d.height;if(null==this.direction||-this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return n*=q,new mxRectangle(d.x,d.y+n,y,q-2*n);n*=y;return new mxRectangle(d.x+n,d.y,y-2*n,q)}return d};mxCellRenderer.registerShape("tape",C);mxUtils.extend(H,mxActor);H.prototype.size=.3;H.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*d.height):null};H.prototype.redrawPath=function(d,n,y,-q,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,0);d.lineTo(q,0);d.lineTo(q,x-n/2);d.quadTo(3*q/4,x-1.4*n,q/2,x-n/2);d.quadTo(q/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};mxCellRenderer.registerShape("document",H);var fb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(d,n,y,q){var x=mxUtils.getValue(this.style,"size");return null!=x?q*Math.max(0,Math.min(1,x)):fb.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=+this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return n*=q,new mxRectangle(d.x,d.y+n,y,q-2*n);n*=y;return new mxRectangle(d.x+n,d.y,y-2*n,q)}return d};mxCellRenderer.registerShape("tape",C);mxUtils.extend(I,mxActor);I.prototype.size=.3;I.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*d.height):null};I.prototype.redrawPath=function(d,n,y,+q,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,0);d.lineTo(q,0);d.lineTo(q,x-n/2);d.quadTo(3*q/4,x-1.4*n,q/2,x-n/2);d.quadTo(q/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};mxCellRenderer.registerShape("document",I);var fb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(d,n,y,q){var x=mxUtils.getValue(this.style,"size");return null!=x?q*Math.max(0,Math.min(1,x)):fb.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,d.height*n),0,0)}return null};c.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(n/=2);return new mxRectangle(0,Math.min(d.height*this.scale,2*n*this.scale),0,Math.max(0,.3*n*this.scale))}return null};k.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var y=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var q=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),D=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));x||(D*=Math.min(d.width,d.height));D=Math.min(D,.5*d.width,.5*(d.height-n));q||(D=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(D,0,Math.min(d.width,d.width-y),Math.min(d.height,d.height-n)):new mxRectangle(Math.min(d.width,d.width-y),0,D,Math.min(d.height,d.height-n))}return new mxRectangle(0,Math.min(d.height,n),0,0)}return null};B.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*-this.scale,0,0,0):null};P.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,Math.max(0,n*this.scale))}return null};mxUtils.extend(K,mxActor);K.prototype.size=.2;K.prototype.fixedSize=20;K.prototype.isRoundable=function(){return!0};K.prototype.redrawPath=function(d,n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,-"size",this.fixedSize)))):q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(q,0),new mxPoint(q-n,x)],this.isRounded,y,!0);d.end()};mxCellRenderer.registerShape("parallelogram",K);mxUtils.extend(M,mxActor);M.prototype.size=.2;M.prototype.fixedSize=20;M.prototype.isRoundable=function(){return!0};M.prototype.redrawPath=function(d,-n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*q,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):q*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(q-n,0),new mxPoint(q,x)],this.isRounded,y,!0)};mxCellRenderer.registerShape("trapezoid",M);mxUtils.extend(O,mxActor);-O.prototype.size=.5;O.prototype.redrawPath=function(d,n,y,q,x){d.setFillColor(null);n=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(q,0),new mxPoint(n,0),new mxPoint(n,x/2),new mxPoint(0,x/2),new mxPoint(n,x/2),new mxPoint(n,x),new mxPoint(q,x)],this.isRounded,y,!1);d.end()};mxCellRenderer.registerShape("curlyBracket",O);mxUtils.extend(ea,mxActor);-ea.prototype.redrawPath=function(d,n,y,q,x){d.setStrokeWidth(1);d.setFillColor(this.stroke);n=q/5;d.rect(0,0,n,x);d.fillAndStroke();d.rect(2*n,0,n,x);d.fillAndStroke();d.rect(4*n,0,n,x);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ea);fa.prototype.moveTo=function(d,n){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;this.firstX=d;this.firstY=n};fa.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,+this.scale,0,0,0):null};P.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,Math.max(0,n*this.scale))}return null};mxUtils.extend(L,mxActor);L.prototype.size=.2;L.prototype.fixedSize=20;L.prototype.isRoundable=function(){return!0};L.prototype.redrawPath=function(d,n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,+"size",this.fixedSize)))):q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(q,0),new mxPoint(q-n,x)],this.isRounded,y,!0);d.end()};mxCellRenderer.registerShape("parallelogram",L);mxUtils.extend(J,mxActor);J.prototype.size=.2;J.prototype.fixedSize=20;J.prototype.isRoundable=function(){return!0};J.prototype.redrawPath=function(d,+n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*q,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):q*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(q-n,0),new mxPoint(q,x)],this.isRounded,y,!0)};mxCellRenderer.registerShape("trapezoid",J);mxUtils.extend(O,mxActor);+O.prototype.size=.5;O.prototype.redrawPath=function(d,n,y,q,x){d.setFillColor(null);n=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(q,0),new mxPoint(n,0),new mxPoint(n,x/2),new mxPoint(0,x/2),new mxPoint(n,x/2),new mxPoint(n,x),new mxPoint(q,x)],this.isRounded,y,!1);d.end()};mxCellRenderer.registerShape("curlyBracket",O);mxUtils.extend(da,mxActor);+da.prototype.redrawPath=function(d,n,y,q,x){d.setStrokeWidth(1);d.setFillColor(this.stroke);n=q/5;d.rect(0,0,n,x);d.fillAndStroke();d.rect(2*n,0,n,x);d.fillAndStroke();d.rect(4*n,0,n,x);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",da);fa.prototype.moveTo=function(d,n){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;this.firstX=d;this.firstY=n};fa.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};fa.prototype.quadTo=function(d,n,y,q){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=y;this.lastY=q};fa.prototype.curveTo=function(d,n,y,q,x,D){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=x;this.lastY=D};fa.prototype.arcTo=function(d,n,y,q,x,D,E){this.originalArcTo.apply(this.canvas,arguments);this.lastX=D;this.lastY=E};fa.prototype.lineTo=function(d,n){if(null!=this.lastX&&null!=this.lastY){var y=function(na){return"number"===-typeof na?na?0>na?-1:1:na===na?0:NaN:NaN},q=Math.abs(d-this.lastX),x=Math.abs(n-this.lastY),D=Math.sqrt(q*q+x*x);if(2>D){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;return}var E=Math.round(D/10),ha=this.defaultVariation;5>E&&(E=5,ha/=3);var L=y(d-this.lastX)*q/E;y=y(n-this.lastY)*x/E;q/=D;x/=D;for(D=0;D<E;D++){var va=(Math.random()-.5)*ha;this.originalLineTo.call(this.canvas,L*D+this.lastX-va*x,y*D+this.lastY-va*q)}this.originalLineTo.call(this.canvas,d,n)}else this.originalLineTo.apply(this.canvas,+typeof na?na?0>na?-1:1:na===na?0:NaN:NaN},q=Math.abs(d-this.lastX),x=Math.abs(n-this.lastY),D=Math.sqrt(q*q+x*x);if(2>D){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;return}var E=Math.round(D/10),ha=this.defaultVariation;5>E&&(E=5,ha/=3);var M=y(d-this.lastX)*q/E;y=y(n-this.lastY)*x/E;q/=D;x/=D;for(D=0;D<E;D++){var va=(Math.random()-.5)*ha;this.originalLineTo.call(this.canvas,M*D+this.lastX-va*x,y*D+this.lastY-va*q)}this.originalLineTo.call(this.canvas,d,n)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n};fa.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var jb=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(d){jb.apply(this,arguments);null==d.handJiggle&&(d.handJiggle=this.createHandJiggle(d))};var sb=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(d){sb.apply(this,arguments);null!=d.handJiggle&&(d.handJiggle.destroy(),delete d.handJiggle)};mxShape.prototype.createComicCanvas=function(d){return new fa(d,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(d){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(d)};var Ab=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&Ab.apply(this,arguments)};var nb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(d,n,y,q,x){if(null==d.handJiggle||d.handJiggle.constructor!=fa)nb.apply(this,arguments);else{var D=!0;null!=this.style&&(D="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(D||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)D||null!=this.fill&&this.fill!=mxConstants.NONE||(d.pointerEvents=!1),d.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?D=Math.min(q/2,Math.min(x/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,D=Math.min(q*D,x*D)),d.moveTo(n+-D,y),d.lineTo(n+q-D,y),d.quadTo(n+q,y,n+q,y+D),d.lineTo(n+q,y+x-D),d.quadTo(n+q,y+x,n+q-D,y+x),d.lineTo(n+D,y+x),d.quadTo(n,y+x,n,y+x-D),d.lineTo(n,y+D),d.quadTo(n,y,n+D,y)):(d.moveTo(n,y),d.lineTo(n+q,y),d.lineTo(n+q,y+x),d.lineTo(n,y+x),d.lineTo(n,y)),d.close(),d.end(),d.fillAndStroke()}};mxUtils.extend(S,mxRectangleShape);S.prototype.size=.1;S.prototype.fixedSize=!1;S.prototype.isHtmlAllowed=function(){return!1};S.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,-!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var n=d.width,y=d.height;d=new mxRectangle(d.x,d.y,n,y);var q=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var x=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;q=Math.max(q,Math.min(n*x,y*x))}d.x+=Math.round(q);d.width-=Math.round(2*q);return d}return d};S.prototype.paintForeground=+D,y),d.lineTo(n+q-D,y),d.quadTo(n+q,y,n+q,y+D),d.lineTo(n+q,y+x-D),d.quadTo(n+q,y+x,n+q-D,y+x),d.lineTo(n+D,y+x),d.quadTo(n,y+x,n,y+x-D),d.lineTo(n,y+D),d.quadTo(n,y,n+D,y)):(d.moveTo(n,y),d.lineTo(n+q,y),d.lineTo(n+q,y+x),d.lineTo(n,y+x),d.lineTo(n,y)),d.close(),d.end(),d.fillAndStroke()}};mxUtils.extend(V,mxRectangleShape);V.prototype.size=.1;V.prototype.fixedSize=!1;V.prototype.isHtmlAllowed=function(){return!1};V.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,+!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var n=d.width,y=d.height;d=new mxRectangle(d.x,d.y,n,y);var q=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var x=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;q=Math.max(q,Math.min(n*x,y*x))}d.x+=Math.round(q);d.width-=Math.round(2*q);return d}return d};V.prototype.paintForeground=function(d,n,y,q,x){var D=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),E=parseFloat(mxUtils.getValue(this.style,"size",this.size));E=D?Math.max(0,Math.min(q,E)):q*Math.max(0,Math.min(1,E));this.isRounded&&(D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,E=Math.max(E,Math.min(q*D,x*D)));E=Math.round(E);d.begin();d.moveTo(n+E,y);d.lineTo(n+E,y+x);d.moveTo(n+q-E,y);d.lineTo(n+q-E,y+x);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,-arguments)};mxCellRenderer.registerShape("process",S);mxCellRenderer.registerShape("process2",S);mxUtils.extend(ca,mxRectangleShape);ca.prototype.paintBackground=function(d,n,y,q,x){d.setFillColor(mxConstants.NONE);d.rect(n,y,q,x);d.fill()};ca.prototype.paintForeground=function(d,n,y,q,x){};mxCellRenderer.registerShape("transparent",ca);mxUtils.extend(ma,mxHexagon);ma.prototype.size=30;ma.prototype.position=.5;ma.prototype.position2=.5;ma.prototype.base=20;ma.prototype.getLabelMargins=function(){return new mxRectangle(0,+arguments)};mxCellRenderer.registerShape("process",V);mxCellRenderer.registerShape("process2",V);mxUtils.extend(ba,mxRectangleShape);ba.prototype.paintBackground=function(d,n,y,q,x){d.setFillColor(mxConstants.NONE);d.rect(n,y,q,x);d.fill()};ba.prototype.paintForeground=function(d,n,y,q,x){};mxCellRenderer.registerShape("transparent",ba);mxUtils.extend(ma,mxHexagon);ma.prototype.size=30;ma.prototype.position=.5;ma.prototype.position2=.5;ma.prototype.base=20;ma.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};ma.prototype.isRoundable=function(){return!0};ma.prototype.redrawPath=function(d,n,y,q,x){n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;y=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var D=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),E=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),ha=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(d,[new mxPoint(0,0),new mxPoint(q,0),new mxPoint(q,x-y),new mxPoint(Math.min(q,D+ha),x-y),new mxPoint(E,x),new mxPoint(Math.max(0,D),x-y),new mxPoint(0,x-y)],this.isRounded,n,!0,[4])};mxCellRenderer.registerShape("callout",ma);mxUtils.extend(la,mxActor);la.prototype.size=.2;la.prototype.fixedSize=20;la.prototype.isRoundable=function(){return!0};la.prototype.redrawPath=function(d,n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(q-n,0),new mxPoint(q,x/2),new mxPoint(q-n,x),new mxPoint(0,x),new mxPoint(n,x/2)],this.isRounded,y,!0);d.end()};mxCellRenderer.registerShape("step",la);mxUtils.extend(Z,mxHexagon);Z.prototype.size=.25;Z.prototype.fixedSize=20;Z.prototype.isRoundable=function(){return!0};Z.prototype.redrawPath=function(d,n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*q,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,-0),new mxPoint(q-n,0),new mxPoint(q,.5*x),new mxPoint(q-n,x),new mxPoint(n,x),new mxPoint(0,.5*x)],this.isRounded,y,!0)};mxCellRenderer.registerShape("hexagon",Z);mxUtils.extend(da,mxRectangleShape);da.prototype.isHtmlAllowed=function(){return!1};da.prototype.paintForeground=function(d,n,y,q,x){var D=Math.min(q/5,x/5)+1;d.begin();d.moveTo(n+q/2,y+D);d.lineTo(n+q/2,y+x-D);d.moveTo(n+D,y+x/2);d.lineTo(n+q-D,y+x/2);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};-mxCellRenderer.registerShape("plus",da);var lb=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};mxRhombus.prototype.paintVertexShape=function(d,n,y,q,x){lb.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var D=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||+0),new mxPoint(q-n,0),new mxPoint(q,.5*x),new mxPoint(q-n,x),new mxPoint(n,x),new mxPoint(0,.5*x)],this.isRounded,y,!0)};mxCellRenderer.registerShape("hexagon",Z);mxUtils.extend(ea,mxRectangleShape);ea.prototype.isHtmlAllowed=function(){return!1};ea.prototype.paintForeground=function(d,n,y,q,x){var D=Math.min(q/5,x/5)+1;d.begin();d.moveTo(n+q/2,y+D);d.lineTo(n+q/2,y+x-D);d.moveTo(n+D,y+x/2);d.lineTo(n+q-D,y+x/2);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};+mxCellRenderer.registerShape("plus",ea);var lb=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};mxRhombus.prototype.paintVertexShape=function(d,n,y,q,x){lb.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var D=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=D;y+=D;q-=2*D;x-=2*D;0<q&&0<x&&(d.setShadow(!1),lb.apply(this,[d,n,y,q,x]))}};mxUtils.extend(aa,mxRectangleShape);aa.prototype.isHtmlAllowed=function(){return!1};aa.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};aa.prototype.paintForeground=function(d,n,y,q,x){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var D=-Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=D;y+=D;q-=2*D;x-=2*D;0<q&&0<x&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}d.setDashed(!1);D=0;do{var E=mxCellRenderer.defaultShapes[this.style["symbol"+D]];if(null!=E){var ha=this.style["symbol"+D+"Align"],L=this.style["symbol"+D+"VerticalAlign"],va=this.style["symbol"+D+"Width"],na=this.style["symbol"+D+"Height"],Va=this.style["symbol"+D+"Spacing"]||0,gb=this.style["symbol"+D+"VSpacing"]||-Va,bb=this.style["symbol"+D+"ArcSpacing"];null!=bb&&(bb*=this.getArcSize(q+this.strokewidth,x+this.strokewidth),Va+=bb,gb+=bb);bb=n;var Fa=y;bb=ha==mxConstants.ALIGN_CENTER?bb+(q-va)/2:ha==mxConstants.ALIGN_RIGHT?bb+(q-va-Va):bb+Va;Fa=L==mxConstants.ALIGN_MIDDLE?Fa+(x-na)/2:L==mxConstants.ALIGN_BOTTOM?Fa+(x-na-gb):Fa+gb;d.save();ha=new E;ha.style=this.style;E.prototype.paintVertexShape.call(ha,d,bb,Fa,va,na);d.restore()}D++}while(null!=E)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};+Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=D;y+=D;q-=2*D;x-=2*D;0<q&&0<x&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}d.setDashed(!1);D=0;do{var E=mxCellRenderer.defaultShapes[this.style["symbol"+D]];if(null!=E){var ha=this.style["symbol"+D+"Align"],M=this.style["symbol"+D+"VerticalAlign"],va=this.style["symbol"+D+"Width"],na=this.style["symbol"+D+"Height"],Va=this.style["symbol"+D+"Spacing"]||0,gb=this.style["symbol"+D+"VSpacing"]||+Va,bb=this.style["symbol"+D+"ArcSpacing"];null!=bb&&(bb*=this.getArcSize(q+this.strokewidth,x+this.strokewidth),Va+=bb,gb+=bb);bb=n;var Fa=y;bb=ha==mxConstants.ALIGN_CENTER?bb+(q-va)/2:ha==mxConstants.ALIGN_RIGHT?bb+(q-va-Va):bb+Va;Fa=M==mxConstants.ALIGN_MIDDLE?Fa+(x-na)/2:M==mxConstants.ALIGN_BOTTOM?Fa+(x-na-gb):Fa+gb;d.save();ha=new E;ha.style=this.style;E.prototype.paintVertexShape.call(ha,d,bb,Fa,va,na);d.restore()}D++}while(null!=E)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",aa);mxUtils.extend(l,mxCylinder);l.prototype.redrawPath=function(d,n,y,q,x,D){D?(d.moveTo(0,0),d.lineTo(q/2,x/2),d.lineTo(q,0),d.end()):(d.moveTo(0,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(0,x),d.close())};mxCellRenderer.registerShape("message",l);mxUtils.extend(t,mxShape);t.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.ellipse(q/4,0,q/2,x/4);d.fillAndStroke();d.begin();d.moveTo(q/2,x/4);d.lineTo(q/2,2*x/3);d.moveTo(q/2,x/3);d.lineTo(0,x/3);d.moveTo(q/-2,x/3);d.lineTo(q,x/3);d.moveTo(q/2,2*x/3);d.lineTo(0,x);d.moveTo(q/2,2*x/3);d.lineTo(q,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlActor",t);mxUtils.extend(I,mxShape);I.prototype.getLabelMargins=function(d){return new mxRectangle(d.width/6,0,0,0)};I.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(0,x/4);d.lineTo(0,3*x/4);d.end();d.stroke();d.begin();d.moveTo(0,x/2);d.lineTo(q/6,x/2);d.end();d.stroke();d.ellipse(q/6,0,5*q/6,x);d.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",-I);mxUtils.extend(V,mxEllipse);V.prototype.paintVertexShape=function(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(n+q/8,y+x);d.lineTo(n+7*q/8,y+x);d.end();d.stroke()};mxCellRenderer.registerShape("umlEntity",V);mxUtils.extend(J,mxShape);J.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(q,0);d.lineTo(0,x);d.moveTo(0,0);d.lineTo(q,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlDestroy",J);mxUtils.extend(W,mxShape);+2,x/3);d.lineTo(q,x/3);d.moveTo(q/2,2*x/3);d.lineTo(0,x);d.moveTo(q/2,2*x/3);d.lineTo(q,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlActor",t);mxUtils.extend(H,mxShape);H.prototype.getLabelMargins=function(d){return new mxRectangle(d.width/6,0,0,0)};H.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(0,x/4);d.lineTo(0,3*x/4);d.end();d.stroke();d.begin();d.moveTo(0,x/2);d.lineTo(q/6,x/2);d.end();d.stroke();d.ellipse(q/6,0,5*q/6,x);d.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",+H);mxUtils.extend(U,mxEllipse);U.prototype.paintVertexShape=function(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(n+q/8,y+x);d.lineTo(n+7*q/8,y+x);d.end();d.stroke()};mxCellRenderer.registerShape("umlEntity",U);mxUtils.extend(K,mxShape);K.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(q,0);d.lineTo(0,x);d.moveTo(0,0);d.lineTo(q,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlDestroy",K);mxUtils.extend(W,mxShape);W.prototype.getLabelBounds=function(d){return new mxRectangle(d.x,d.y+d.height/8,d.width,7*d.height/8)};W.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(3*q/8,x/8*1.1);d.lineTo(5*q/8,0);d.end();d.stroke();d.ellipse(0,x/8,q,7*x/8);d.fillAndStroke()};W.prototype.paintForeground=function(d,n,y,q,x){d.begin();d.moveTo(3*q/8,x/8*1.1);d.lineTo(5*q/8,x/4);d.end();d.stroke()};mxCellRenderer.registerShape("umlControl",W);mxUtils.extend(Y,mxRectangleShape);Y.prototype.size=40;Y.prototype.isHtmlAllowed=function(){return!1};Y.prototype.getLabelBounds=function(d){var n=Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(d.x,d.y,d.width,n)};Y.prototype.paintBackground=function(d,n,y,q,x){var D=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"participant");null==E||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,d,n,y,q,D):(E=this.state.view.graph.cellRenderer.getShape(E),null!=E&&E!=Y&&(E=new E,E.apply(this.state),d.save(),E.paintVertexShape(d,n,y,q,D),d.restore()));D<x&&(d.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),d.begin(),d.moveTo(n+q/2,y+D),d.lineTo(n+q/2,y+x),d.end(),d.stroke())};Y.prototype.paintForeground=function(d,n,y,q,x){var D=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,d,n,y,q,Math.min(x,-D))};mxCellRenderer.registerShape("umlLifeline",Y);mxUtils.extend(ba,mxShape);ba.prototype.width=60;ba.prototype.height=30;ba.prototype.corner=10;ba.prototype.configurePointerEvents=function(d){var n=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=n&&n!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(d.pointerEvents=!1)};ba.prototype.getLabelMargins=function(d){return new mxRectangle(0,-0,d.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),d.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};ba.prototype.paintBackground=function(d,n,y,q,x){var D=this.corner,E=Math.min(q,Math.max(D,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ha=Math.min(x,Math.max(1.5*D,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),L=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);L!=mxConstants.NONE&&-(d.setFillColor(L),d.rect(n,y,q,x),d.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(d,n,y,q,x),d.setGradient(this.fill,this.gradient,n,y,q,x,this.gradientDirection)):d.setFillColor(this.fill);d.pointerEvents=!0;d.begin();d.moveTo(n,y);d.lineTo(n+E,y);d.lineTo(n+E,y+Math.max(0,ha-1.5*D));d.lineTo(n+Math.max(0,E-D),y+ha);d.lineTo(n,y+ha);d.close();d.fillAndStroke();this.configurePointerEvents(d);d.begin();d.moveTo(n+E,y);-d.lineTo(n+q,y);d.lineTo(n+q,y+x);d.lineTo(n,y+x);d.lineTo(n,y+ha);d.stroke()};mxCellRenderer.registerShape("umlFrame",ba);mxPerimeter.CenterPerimeter=function(d,n,y,q){return new mxPoint(d.getCenterX(),d.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(d,n,y,q){q=Y.prototype.size;null!=n&&(q=mxUtils.getValue(n.style,"size",q)*n.view.scale);n=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;y.x<d.getCenterX()&&+D))};mxCellRenderer.registerShape("umlLifeline",Y);mxUtils.extend(ca,mxShape);ca.prototype.width=60;ca.prototype.height=30;ca.prototype.corner=10;ca.prototype.configurePointerEvents=function(d){var n=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=n&&n!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(d.pointerEvents=!1)};ca.prototype.getLabelMargins=function(d){return new mxRectangle(0,+0,d.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),d.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};ca.prototype.paintBackground=function(d,n,y,q,x){var D=this.corner,E=Math.min(q,Math.max(D,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ha=Math.min(x,Math.max(1.5*D,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),M=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);M!=mxConstants.NONE&&+(d.setFillColor(M),d.rect(n,y,q,x),d.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(d,n,y,q,x),d.setGradient(this.fill,this.gradient,n,y,q,x,this.gradientDirection)):d.setFillColor(this.fill);d.pointerEvents=!0;d.begin();d.moveTo(n,y);d.lineTo(n+E,y);d.lineTo(n+E,y+Math.max(0,ha-1.5*D));d.lineTo(n+Math.max(0,E-D),y+ha);d.lineTo(n,y+ha);d.close();d.fillAndStroke();this.configurePointerEvents(d);d.begin();d.moveTo(n+E,y);+d.lineTo(n+q,y);d.lineTo(n+q,y+x);d.lineTo(n,y+x);d.lineTo(n,y+ha);d.stroke()};mxCellRenderer.registerShape("umlFrame",ca);mxPerimeter.CenterPerimeter=function(d,n,y,q){return new mxPoint(d.getCenterX(),d.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(d,n,y,q){q=Y.prototype.size;null!=n&&(q=mxUtils.getValue(n.style,"size",q)*n.view.scale);n=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;y.x<d.getCenterX()&&(n=-1*(n+1));return new mxPoint(d.getCenterX()+n,Math.min(d.y+d.height,Math.max(d.y+q,y.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(d,n,y,q){q=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(d,n,y,q){q=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;null!=n.style.backboneSize&&(q+=parseFloat(n.style.backboneSize)*n.view.scale/2-1);if("south"==n.style[mxConstants.STYLE_DIRECTION]||"north"==n.style[mxConstants.STYLE_DIRECTION])return y.x<d.getCenterX()&&(q=-1*(q+1)),new mxPoint(d.getCenterX()+q,Math.min(d.y+d.height,Math.max(d.y,y.y)));y.y<d.getCenterY()&&(q=-1*(q+1));return new mxPoint(Math.min(d.x+d.width,Math.max(d.x,y.x)),d.getCenterY()+q)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(d,n,y,q){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(d,-new mxRectangle(0,0,0,Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(n.style,"size",ma.prototype.size))*n.view.scale))),n.style),n,y,q)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?K.prototype.fixedSize:K.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,L=d.width,va=d.height;n=null!=n?mxUtils.getValue(n.style,-mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+L,ha+x),new mxPoint(E+L,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha)]):(x=x?Math.max(0,Math.min(.5*L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+L,ha),new mxPoint(E+L-x,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,ha)]);va=d.getCenterX();-d=d.getCenterY();d=new mxPoint(va,d);q&&(y.x<E||y.x>E+L?d.y=y.y:d.x=y.x);return mxUtils.getPerimeterPoint(ha,d,y)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?M.prototype.fixedSize:M.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,L=d.width,va=d.height;n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,-mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(.5*L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+L-x,ha),new mxPoint(E+L,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,ha)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+L,ha),new mxPoint(E+L-x,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,ha)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,-Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha+x),new mxPoint(E+L,ha),new mxPoint(E+L,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha+x)]):(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+L,ha+x),new mxPoint(E+L,ha+va-x),new mxPoint(E,ha+va),new mxPoint(E,ha)]);va=d.getCenterX();d=d.getCenterY();d=new mxPoint(va,d);q&&(y.x<E||y.x>E+L?d.y=y.y:d.x=y.x);return mxUtils.getPerimeterPoint(ha,d,y)};mxStyleRegistry.putValue("trapezoidPerimeter",-mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?la.prototype.fixedSize:la.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,L=d.width,va=d.height,na=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(L,D)):L*Math.max(0,-Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+L-x,ha),new mxPoint(E+L,d),new mxPoint(E+L-x,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,d),new mxPoint(E,ha)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+L,ha),new mxPoint(E+L-x,d),new mxPoint(E+L,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,d),new mxPoint(E+x,ha)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,-ha+x),new mxPoint(na,ha),new mxPoint(E+L,ha+x),new mxPoint(E+L,ha+va),new mxPoint(na,ha+va-x),new mxPoint(E,ha+va),new mxPoint(E,ha+x)]):(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(na,ha+x),new mxPoint(E+L,ha),new mxPoint(E+L,ha+va-x),new mxPoint(na,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha)]);na=new mxPoint(na,d);q&&(y.x<E||y.x>E+L?na.y=y.y:na.x=y.x);return mxUtils.getPerimeterPoint(ha,na,y)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);-mxPerimeter.HexagonPerimeter2=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?Z.prototype.fixedSize:Z.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,L=d.width,va=d.height,na=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(va,D)):va*-Math.max(0,Math.min(1,D)),ha=[new mxPoint(na,ha),new mxPoint(E+L,ha+x),new mxPoint(E+L,ha+va-x),new mxPoint(na,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha+x),new mxPoint(na,ha)]):(x=x?Math.max(0,Math.min(L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+L-x,ha),new mxPoint(E+L,d),new mxPoint(E+L-x,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,d),new mxPoint(E+x,ha)]);na=new mxPoint(na,d);q&&(y.x<E||y.x>E+L?na.y=y.y:na.x=y.x);return mxUtils.getPerimeterPoint(ha,na,y)};mxStyleRegistry.putValue("hexagonPerimeter2",+new mxRectangle(0,0,0,Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(n.style,"size",ma.prototype.size))*n.view.scale))),n.style),n,y,q)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?L.prototype.fixedSize:L.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,M=d.width,va=d.height;n=null!=n?mxUtils.getValue(n.style,+mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+M,ha+x),new mxPoint(E+M,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha)]):(x=x?Math.max(0,Math.min(.5*M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+M,ha),new mxPoint(E+M-x,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,ha)]);va=d.getCenterX();+d=d.getCenterY();d=new mxPoint(va,d);q&&(y.x<E||y.x>E+M?d.y=y.y:d.x=y.x);return mxUtils.getPerimeterPoint(ha,d,y)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?J.prototype.fixedSize:J.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,M=d.width,va=d.height;n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,+mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(.5*M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+M-x,ha),new mxPoint(E+M,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,ha)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+M,ha),new mxPoint(E+M-x,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,ha)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,+Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha+x),new mxPoint(E+M,ha),new mxPoint(E+M,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha+x)]):(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+M,ha+x),new mxPoint(E+M,ha+va-x),new mxPoint(E,ha+va),new mxPoint(E,ha)]);va=d.getCenterX();d=d.getCenterY();d=new mxPoint(va,d);q&&(y.x<E||y.x>E+M?d.y=y.y:d.x=y.x);return mxUtils.getPerimeterPoint(ha,d,y)};mxStyleRegistry.putValue("trapezoidPerimeter",+mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?la.prototype.fixedSize:la.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,M=d.width,va=d.height,na=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(M,D)):M*Math.max(0,+Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+M-x,ha),new mxPoint(E+M,d),new mxPoint(E+M-x,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,d),new mxPoint(E,ha)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+M,ha),new mxPoint(E+M-x,d),new mxPoint(E+M,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,d),new mxPoint(E+x,ha)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,+ha+x),new mxPoint(na,ha),new mxPoint(E+M,ha+x),new mxPoint(E+M,ha+va),new mxPoint(na,ha+va-x),new mxPoint(E,ha+va),new mxPoint(E,ha+x)]):(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(na,ha+x),new mxPoint(E+M,ha),new mxPoint(E+M,ha+va-x),new mxPoint(na,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha)]);na=new mxPoint(na,d);q&&(y.x<E||y.x>E+M?na.y=y.y:na.x=y.x);return mxUtils.getPerimeterPoint(ha,na,y)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);+mxPerimeter.HexagonPerimeter2=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?Z.prototype.fixedSize:Z.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,M=d.width,va=d.height,na=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(va,D)):va*+Math.max(0,Math.min(1,D)),ha=[new mxPoint(na,ha),new mxPoint(E+M,ha+x),new mxPoint(E+M,ha+va-x),new mxPoint(na,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha+x),new mxPoint(na,ha)]):(x=x?Math.max(0,Math.min(M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+M-x,ha),new mxPoint(E+M,d),new mxPoint(E+M-x,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,d),new mxPoint(E+x,ha)]);na=new mxPoint(na,d);q&&(y.x<E||y.x>E+M?na.y=y.y:na.x=y.x);return mxUtils.getPerimeterPoint(ha,na,y)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ja,mxShape);ja.prototype.size=10;ja.prototype.paintBackground=function(d,n,y,q,x){var D=parseFloat(mxUtils.getValue(this.style,"size",this.size));d.translate(n,y);d.ellipse((q-D)/2,0,D,D);d.fillAndStroke();d.begin();d.moveTo(q/2,D);d.lineTo(q/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("lollipop",ja);mxUtils.extend(oa,mxShape);oa.prototype.size=10;oa.prototype.inset=2;oa.prototype.paintBackground=function(d,n,y,q,x){var D=parseFloat(mxUtils.getValue(this.style,"size",this.size)),E=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(n,y);d.begin();d.moveTo(q/2,D+E);d.lineTo(q/2,x);d.end();d.stroke();d.begin();d.moveTo((q-D)/2-E,D/2);d.quadTo((q-D)/2-E,D+E,q/2,D+E);d.quadTo((q+D)/2+E,D+E,(q+D)/2+E,D/2);d.end();d.stroke()};mxCellRenderer.registerShape("requires",oa);mxUtils.extend(qa,mxShape);qa.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(0,0);d.quadTo(q,0,q,x/2);d.quadTo(q,x,0,x);d.end();d.stroke()};mxCellRenderer.registerShape("requiredInterface",qa);mxUtils.extend(ra,mxShape);ra.prototype.inset=2;ra.prototype.paintBackground=function(d,n,y,q,x){var D=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(n,y);d.ellipse(0,D,q-2*D,x-2*D);d.fillAndStroke();d.begin();d.moveTo(q/2,0);d.quadTo(q,0,q,x/2);d.quadTo(q,x,q/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",ra);mxUtils.extend(xa,mxCylinder);xa.prototype.jettyWidth=-20;xa.prototype.jettyHeight=10;xa.prototype.redrawPath=function(d,n,y,q,x,D){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));y=E/2;E=y+E/2;var ha=Math.min(n,x-n),L=Math.min(ha+2*n,x-n);D?(d.moveTo(y,ha),d.lineTo(E,ha),d.lineTo(E,ha+n),d.lineTo(y,ha+n),d.moveTo(y,L),d.lineTo(E,L),d.lineTo(E,L+n),d.lineTo(y,L+n)):(d.moveTo(y,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(y,x),d.lineTo(y,L+n),d.lineTo(0,L+-n),d.lineTo(0,L),d.lineTo(y,L),d.lineTo(y,ha+n),d.lineTo(0,ha+n),d.lineTo(0,ha),d.lineTo(y,ha),d.close());d.end()};mxCellRenderer.registerShape("module",xa);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=32;Ba.prototype.jettyHeight=12;Ba.prototype.redrawPath=function(d,n,y,q,x,D){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));y=E/2;E=y+E/2;var ha=.3*x-n/2,L=.7*x-n/2;D?(d.moveTo(y,ha),d.lineTo(E,-ha),d.lineTo(E,ha+n),d.lineTo(y,ha+n),d.moveTo(y,L),d.lineTo(E,L),d.lineTo(E,L+n),d.lineTo(y,L+n)):(d.moveTo(y,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(y,x),d.lineTo(y,L+n),d.lineTo(0,L+n),d.lineTo(0,L),d.lineTo(y,L),d.lineTo(y,ha+n),d.lineTo(0,ha+n),d.lineTo(0,ha),d.lineTo(y,ha),d.close());d.end()};mxCellRenderer.registerShape("component",Ba);mxUtils.extend(ya,mxRectangleShape);ya.prototype.paintForeground=function(d,n,y,q,x){var D=q/2,E=x/2,ha=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,+20;xa.prototype.jettyHeight=10;xa.prototype.redrawPath=function(d,n,y,q,x,D){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));y=E/2;E=y+E/2;var ha=Math.min(n,x-n),M=Math.min(ha+2*n,x-n);D?(d.moveTo(y,ha),d.lineTo(E,ha),d.lineTo(E,ha+n),d.lineTo(y,ha+n),d.moveTo(y,M),d.lineTo(E,M),d.lineTo(E,M+n),d.lineTo(y,M+n)):(d.moveTo(y,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(y,x),d.lineTo(y,M+n),d.lineTo(0,M++n),d.lineTo(0,M),d.lineTo(y,M),d.lineTo(y,ha+n),d.lineTo(0,ha+n),d.lineTo(0,ha),d.lineTo(y,ha),d.close());d.end()};mxCellRenderer.registerShape("module",xa);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=32;Ba.prototype.jettyHeight=12;Ba.prototype.redrawPath=function(d,n,y,q,x,D){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));y=E/2;E=y+E/2;var ha=.3*x-n/2,M=.7*x-n/2;D?(d.moveTo(y,ha),d.lineTo(E,+ha),d.lineTo(E,ha+n),d.lineTo(y,ha+n),d.moveTo(y,M),d.lineTo(E,M),d.lineTo(E,M+n),d.lineTo(y,M+n)):(d.moveTo(y,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(y,x),d.lineTo(y,M+n),d.lineTo(0,M+n),d.lineTo(0,M),d.lineTo(y,M),d.lineTo(y,ha+n),d.lineTo(0,ha+n),d.lineTo(0,ha),d.lineTo(y,ha),d.close());d.end()};mxCellRenderer.registerShape("component",Ba);mxUtils.extend(ya,mxRectangleShape);ya.prototype.paintForeground=function(d,n,y,q,x){var D=q/2,E=x/2,ha=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;d.begin();this.addPoints(d,[new mxPoint(n+D,y),new mxPoint(n+q,y+E),new mxPoint(n+D,y+x),new mxPoint(n,y+E)],this.isRounded,ha,!0);d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",ya);mxUtils.extend(Da,mxDoubleEllipse);Da.prototype.outerStroke=!0;Da.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.min(4,Math.min(q/5,x/5));0<q&&0<x&&(d.ellipse(n+D,y+D,q-2*D,x-2*D),d.fillAndStroke());d.setShadow(!1);this.outerStroke&&(d.ellipse(n,y,q,x),d.stroke())};mxCellRenderer.registerShape("endState",Da);mxUtils.extend(La,Da);La.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",La);mxUtils.extend(sa,mxArrowConnector);sa.prototype.defaultWidth=4;sa.prototype.isOpenEnded=function(){return!0};sa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};sa.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",sa);mxUtils.extend(Aa,mxArrowConnector);Aa.prototype.defaultWidth=10;Aa.prototype.defaultArrowWidth=20;Aa.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Aa.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Aa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-@@ -2810,8 +2810,8 @@ d.begin();d.moveTo(n+q/2,y+x);d.lineTo(n+q,y+x);d.end();d.stroke()};mxCellRenderfunction(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(n+.145*q,y+.145*x);d.lineTo(n+.855*q,y+.855*x);d.end();d.stroke();d.begin();d.moveTo(n+.855*q,y+.145*x);d.lineTo(n+.145*q,y+.855*x);d.end();d.stroke()};mxCellRenderer.registerShape("sumEllipse",pa);mxUtils.extend(wa,mxRhombus);wa.prototype.paintVertexShape=function(d,n,y,q,x){mxRhombus.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(n,y+x/2);d.lineTo(n+q,y+x/2);d.end();d.stroke()};mxCellRenderer.registerShape("sortShape",wa);mxUtils.extend(ta,mxEllipse);ta.prototype.paintVertexShape=function(d,n,y,q,x){d.begin();d.moveTo(n,y);d.lineTo(n+q,y);d.lineTo(n+q/2,y+x/2);d.close();d.fillAndStroke();d.begin();d.moveTo(n,y+x);d.lineTo(n+q,y+x);d.lineTo(n+q/2,y+x/2);d.close();d.fillAndStroke()};mxCellRenderer.registerShape("collate",ta);mxUtils.extend(ua,mxEllipse);ua.prototype.paintVertexShape=function(d,n,y,q,x){var D=d.state.strokeWidth/2,E=10+2*D,ha=y+x-E/2;d.begin();d.moveTo(n,y);d.lineTo(n,y+x);d.moveTo(n+D,ha);d.lineTo(n+D+E,ha-E/2);d.moveTo(n+D,ha);d.lineTo(n+D+E,ha+E/2);d.moveTo(n+D,ha);d.lineTo(n+q-D,ha);d.moveTo(n+q,y);d.lineTo(n+q,y+x);d.moveTo(n+q-D,ha);d.lineTo(n+q-E-D,ha-E/2);d.moveTo(n+q-D,ha);d.lineTo(n+q-E-D,ha+E/2);d.end();d.stroke()};mxCellRenderer.registerShape("dimension",ua);mxUtils.extend(Ca,mxEllipse);Ca.prototype.drawHidden=!0;Ca.prototype.paintVertexShape=function(d,n,y,q,x){this.outline||d.setStrokeColor(null);if(null!=-this.style){var D=d.pointerEvents,E=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||E||(d.pointerEvents=!1);var ha="1"==mxUtils.getValue(this.style,"top","1"),L="1"==mxUtils.getValue(this.style,"left","1"),va="1"==mxUtils.getValue(this.style,"right","1"),na="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||E||this.outline||ha||va||na||L?(d.rect(n,y,q,x),d.fill(),d.pointerEvents=D,d.setStrokeColor(this.stroke),d.setLineCap("square"),-d.begin(),d.moveTo(n,y),this.outline||ha?d.lineTo(n+q,y):d.moveTo(n+q,y),this.outline||va?d.lineTo(n+q,y+x):d.moveTo(n+q,y+x),this.outline||na?d.lineTo(n,y+x):d.moveTo(n,y+x),(this.outline||L)&&d.lineTo(n,y),d.end(),d.stroke(),d.setLineCap("flat")):d.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Ca);mxUtils.extend(Na,mxEllipse);Na.prototype.paintVertexShape=function(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();"vertical"==+this.style){var D=d.pointerEvents,E=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||E||(d.pointerEvents=!1);var ha="1"==mxUtils.getValue(this.style,"top","1"),M="1"==mxUtils.getValue(this.style,"left","1"),va="1"==mxUtils.getValue(this.style,"right","1"),na="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||E||this.outline||ha||va||na||M?(d.rect(n,y,q,x),d.fill(),d.pointerEvents=D,d.setStrokeColor(this.stroke),d.setLineCap("square"),+d.begin(),d.moveTo(n,y),this.outline||ha?d.lineTo(n+q,y):d.moveTo(n+q,y),this.outline||va?d.lineTo(n+q,y+x):d.moveTo(n+q,y+x),this.outline||na?d.lineTo(n,y+x):d.moveTo(n,y+x),(this.outline||M)&&d.lineTo(n,y),d.end(),d.stroke(),d.setLineCap("flat")):d.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Ca);mxUtils.extend(Na,mxEllipse);Na.prototype.paintVertexShape=function(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();"vertical"==mxUtils.getValue(this.style,"line")?(d.moveTo(n+q/2,y),d.lineTo(n+q/2,y+x)):(d.moveTo(n,y+x/2),d.lineTo(n+q,y+x/2));d.end();d.stroke()};mxCellRenderer.registerShape("lineEllipse",Na);mxUtils.extend(Ya,mxActor);Ya.prototype.redrawPath=function(d,n,y,q,x){n=Math.min(q,x/2);d.moveTo(0,0);d.lineTo(q-n,0);d.quadTo(q,0,q,x/2);d.quadTo(q,x,q-n,x);d.lineTo(0,x);d.close();d.end()};mxCellRenderer.registerShape("delay",Ya);mxUtils.extend(Za,mxActor);Za.prototype.size=.2;Za.prototype.redrawPath=function(d,n,y,q,x){n=Math.min(x,q);var D=Math.max(0,Math.min(n,n*parseFloat(mxUtils.getValue(this.style,"size",this.size))));n=(x-D)/2;y=n+D;var E=(q-D)/2;D=E+D;d.moveTo(0,n);d.lineTo(E,n);d.lineTo(E,0);d.lineTo(D,0);d.lineTo(D,n);d.lineTo(q,n);d.lineTo(q,y);d.lineTo(D,y);d.lineTo(D,x);d.lineTo(E,x);d.lineTo(E,y);d.lineTo(0,y);d.close();d.end()};mxCellRenderer.registerShape("cross",Za);mxUtils.extend(ab,mxActor);ab.prototype.size=.25;ab.prototype.redrawPath=function(d,n,y,q,x){n=Math.min(q,x/2);y=Math.min(q-n,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*q);d.moveTo(0,x/2);d.lineTo(y,0);d.lineTo(q-n,0);d.quadTo(q,0,q,x/2);d.quadTo(q,x,q-n,x);d.lineTo(y,x);d.close();d.end()};mxCellRenderer.registerShape("display",ab);mxUtils.extend(Ra,mxActor);Ra.prototype.cst={RECT2:"mxgraph.basic.rect"};Ra.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},@@ -2820,82 +2820,82 @@ defVal:"none"},{name:"gradientColor2",dispName:"Inside Gradient Color",type:"coldispName:"Left ",type:"bool",defVal:!0},{name:"topLeftStyle",dispName:"Top Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"topRightStyle",dispName:"Top Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomRightStyle",dispName:"Bottom Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomLeftStyle",dispName:"Bottom Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]}];Ra.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);this.strictDrawShape(d,0,0,q,x)};Ra.prototype.strictDrawShape=function(d,n,y,q,x,D){var E=D&&D.rectStyle?D.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ha=D&&D.absoluteCornerSize?D.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",-this.absoluteCornerSize),L=D&&D.size?D.size:Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),va=D&&D.rectOutline?D.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),na=D&&D.indent?D.indent:Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Va=D&&D.dashed?D.dashed:mxUtils.getValue(this.style,"dashed",!1),gb=D&&D.dashPattern?D.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),bb=D&&D.relIndent?D.relIndent:+this.absoluteCornerSize),M=D&&D.size?D.size:Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),va=D&&D.rectOutline?D.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),na=D&&D.indent?D.indent:Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Va=D&&D.dashed?D.dashed:mxUtils.getValue(this.style,"dashed",!1),gb=D&&D.dashPattern?D.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),bb=D&&D.relIndent?D.relIndent:Math.max(0,Math.min(50,na)),Fa=D&&D.top?D.top:mxUtils.getValue(this.style,"top",!0),Ja=D&&D.right?D.right:mxUtils.getValue(this.style,"right",!0),Ha=D&&D.bottom?D.bottom:mxUtils.getValue(this.style,"bottom",!0),Ga=D&&D.left?D.left:mxUtils.getValue(this.style,"left",!0),Qa=D&&D.topLeftStyle?D.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),Sa=D&&D.topRightStyle?D.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),Ta=D&&D.bottomRightStyle?D.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),Ua=D&&D.bottomLeftStyle?D.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Fb=D&&D.fillColor?D.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");D&&D.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Gb=D&&D.strokeWidth?D.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Db=D&&D.fillColor2?D.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Eb=D&&D.gradientColor2?D.gradientColor2:mxUtils.getValue(this.style,-"gradientColor2","none"),Hb=D&&D.gradientDirection2?D.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Ib=D&&D.opacity?D.opacity:mxUtils.getValue(this.style,"opacity","100"),Jb=Math.max(0,Math.min(50,L));D=Ra.prototype;d.setDashed(Va);gb&&""!=gb&&d.setDashPattern(gb);d.setStrokeWidth(Gb);L=Math.min(.5*x,.5*q,L);ha||(L=Jb*Math.min(q,x)/100);L=Math.min(L,.5*Math.min(q,x));ha||(na=Math.min(bb*Math.min(q,x)/100));na=Math.min(na,.5*Math.min(q,x)-L);(Fa||Ja||Ha||Ga)&&"frame"!=-va&&(d.begin(),Fa?D.moveNW(d,n,y,q,x,E,Qa,L,Ga):d.moveTo(0,0),Fa&&D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),Ja&&D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),Ha&&D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),Ga&&D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),d.close(),d.fill(),d.setShadow(!1),d.setFillColor(Db),Va=ha=Ib,"none"==Db&&(ha=0),"none"==Eb&&(Va=0),d.setGradient(Db,Eb,0,0,q,x,Hb,ha,Va),d.begin(),Fa?D.moveNWInner(d,-n,y,q,x,E,Qa,L,na,Fa,Ga):d.moveTo(na,0),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),Ga&&Ha&&D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),Ha&&Ja&&D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),Ja&&Fa&&D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),Fa&&Ga&&D.paintNWInner(d,n,y,q,x,E,Qa,L,na),d.fill(),"none"==Fb&&(d.begin(),D.paintFolds(d,n,y,q,x,E,Qa,Sa,Ta,Ua,L,Fa,Ja,Ha,Ga),d.stroke()));Fa||Ja||-Ha||!Ga?Fa||Ja||!Ha||Ga?!Fa&&!Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,-n,y,q,x,E,Qa,L,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa||!Ja||Ha||Ga?!Fa&&Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga)),d.stroke(),d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,-n,y,q,x,E,Ta,L,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke(),d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),d.close(),d.fillAndStroke()):-!Fa&&Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),-D.lineSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),d.close(),d.fillAndStroke()):!Fa&&Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,-n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,-n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),d.close(),d.fillAndStroke()):!Fa||Ja||Ha||Ga?Fa&&!Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,-n,y,q,x,E,Ua,L,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke()):Fa&&!Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),"double"==va&&(D.moveNEInner(d,n,y,-q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa)),d.stroke(),d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),d.close(),d.fillAndStroke(),d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,-q,x,E,Ua,L,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa&&!Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,-n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,-n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa&&Ja&&!Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,-n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,-Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.lineSEInner(d,n,y,q,x,E,-Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke()):Fa&&Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),"double"==va&&(D.moveSWInner(d,-n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,-n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ja&&Ha&&Ga&&("frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,-L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),d.close(),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close()),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintNW(d,-n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),d.close(),D.moveSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,-n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke())):"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),d.close(),d.fillAndStroke()):-"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),d.close(),d.fillAndStroke()):"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),"double"==va&&(D.moveSWInner(d,-n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),d.close(),d.fillAndStroke()):"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,-Qa,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke());d.begin();D.paintFolds(d,n,y,q,x,E,Qa,Sa,Ta,Ua,L,Fa,Ja,Ha,Ga);d.stroke()};Ra.prototype.moveNW=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.moveTo(0,0):d.moveTo(0,ha)};Ra.prototype.moveNE=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.moveTo(q,0):d.moveTo(q-ha,0)};Ra.prototype.moveSE=function(d,-n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.moveTo(q,x):d.moveTo(q,x-ha)};Ra.prototype.moveSW=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.moveTo(0,x):d.moveTo(ha,x)};Ra.prototype.paintNW=function(d,n,y,q,x,D,E,ha,L){if(L)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,ha,0)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==E&&-"fold"==D)&&d.lineTo(ha,0);else d.lineTo(0,0)};Ra.prototype.paintTop=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.lineTo(q,0):d.lineTo(q-ha,0)};Ra.prototype.paintNE=function(d,n,y,q,x,D,E,ha,L){if(L)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,q,ha)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q,ha);else d.lineTo(q,-0)};Ra.prototype.paintRight=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.lineTo(q,x):d.lineTo(q,x-ha)};Ra.prototype.paintLeft=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.lineTo(0,0):d.lineTo(0,ha)};Ra.prototype.paintSE=function(d,n,y,q,x,D,E,ha,L){if(L)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,q-ha,x)}else("snip"==E||"default"==-E&&"snip"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-ha,x);else d.lineTo(q,x)};Ra.prototype.paintBottom=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.lineTo(0,x):d.lineTo(ha,x)};Ra.prototype.paintSW=function(d,n,y,q,x,D,E,ha,L){if(L)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,0,x-ha)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==-E&&"fold"==D)&&d.lineTo(0,x-ha);else d.lineTo(0,x)};Ra.prototype.paintNWInner=function(d,n,y,q,x,D,E,ha,L){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*L,ha-.5*L,0,0,0,L,.5*L+ha);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+L,ha+L,0,0,1,L,L+ha);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(L,.5*L+ha);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(L+ha,L+ha),d.lineTo(L,L+ha)};Ra.prototype.paintTopInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(0,-L):va&&!na?d.lineTo(L,0):va?"square"==E||"default"==E&&"square"==D?d.lineTo(L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(ha+.5*L,L):d.lineTo(ha+L,L):d.lineTo(0,L):d.lineTo(0,0)};Ra.prototype.paintNEInner=function(d,n,y,q,x,D,E,ha,L){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*L,ha-.5*L,0,0,0,q-ha-.5*L,L);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+L,ha+L,0,0,1,q-ha-L,L);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(q--ha-.5*L,L);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(q-ha-L,ha+L),d.lineTo(q-ha-L,L)};Ra.prototype.paintRightInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(q-L,0):va&&!na?d.lineTo(q,L):va?"square"==E||"default"==E&&"square"==D?d.lineTo(q-L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-L,ha+.5*L):d.lineTo(q-L,ha+L):d.lineTo(q-L,0):d.lineTo(q,0)};Ra.prototype.paintLeftInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(L,-x):va&&!na?d.lineTo(0,x-L):va?"square"==E||"default"==E&&"square"==D?d.lineTo(L,x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(L,x-ha-.5*L):d.lineTo(L,x-ha-L):d.lineTo(L,x):d.lineTo(0,x)};Ra.prototype.paintSEInner=function(d,n,y,q,x,D,E,ha,L){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*L,ha-.5*L,0,0,0,q-L,x-ha-.5*L);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+L,ha+L,0,0,1,q-L,x-ha-L);else if("snip"==E||"default"==E&&"snip"==-D)d.lineTo(q-L,x-ha-.5*L);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(q-ha-L,x-ha-L),d.lineTo(q-L,x-ha-L)};Ra.prototype.paintBottomInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(q,x-L):va&&!na?d.lineTo(q-L,x):"square"==E||"default"==E&&"square"==D||!va?d.lineTo(q-L,x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-ha-.5*L,x-L):d.lineTo(q-ha-L,x-L):d.lineTo(q,x)};Ra.prototype.paintSWInner=function(d,n,y,q,x,D,E,ha,L,va){if(!va)d.lineTo(L,-x);else if("square"==E||"default"==E&&"square"==D)d.lineTo(L,x-L);else if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*L,ha-.5*L,0,0,0,ha+.5*L,x-L);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+L,ha+L,0,0,1,ha+L,x-L);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(ha+.5*L,x-L);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(L+ha,x-ha-L),d.lineTo(L+ha,x-L)};Ra.prototype.moveSWInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D?d.moveTo(L,-x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(L,x-ha-.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(L,x-ha-L):d.moveTo(0,x-L)};Ra.prototype.lineSWInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D?d.lineTo(L,x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(L,x-ha-.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==-E&&"fold"==D)&&d.lineTo(L,x-ha-L):d.lineTo(0,x-L)};Ra.prototype.moveSEInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D?d.moveTo(q-L,x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(q-L,x-ha-.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(q-L,x-ha-L):d.moveTo(q-L,x)};Ra.prototype.lineSEInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D?d.lineTo(q-L,-x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-L,x-ha-.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-L,x-ha-L):d.lineTo(q-L,x)};Ra.prototype.moveNEInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D||va?d.moveTo(q-L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(q-L,ha+.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==-E&&"fold"==D)&&d.moveTo(q-L,ha+L):d.moveTo(q,L)};Ra.prototype.lineNEInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D||va?d.lineTo(q-L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-L,ha+.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-L,ha+L):d.lineTo(q,L)};Ra.prototype.moveNWInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.moveTo(L,0):va&&!na?d.moveTo(0,L):"square"==-E||"default"==E&&"square"==D?d.moveTo(L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(L,ha+.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(L,ha+L):d.moveTo(0,0)};Ra.prototype.lineNWInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(L,0):va&&!na?d.lineTo(0,L):"square"==E||"default"==E&&"square"==D?d.lineTo(L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(L,-ha+.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(L,ha+L):d.lineTo(0,0)};Ra.prototype.paintFolds=function(d,n,y,q,x,D,E,ha,L,va,na,Va,gb,bb,Fa){if("fold"==D||"fold"==E||"fold"==ha||"fold"==L||"fold"==va)("fold"==E||"default"==E&&"fold"==D)&&Va&&Fa&&(d.moveTo(0,na),d.lineTo(na,na),d.lineTo(na,0)),("fold"==ha||"default"==ha&&"fold"==D)&&Va&&gb&&(d.moveTo(q-na,0),d.lineTo(q-na,na),d.lineTo(q,na)),("fold"==L||"default"==L&&"fold"==D)&&bb&&gb&&(d.moveTo(q-+"gradientColor2","none"),Hb=D&&D.gradientDirection2?D.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Ib=D&&D.opacity?D.opacity:mxUtils.getValue(this.style,"opacity","100"),Jb=Math.max(0,Math.min(50,M));D=Ra.prototype;d.setDashed(Va);gb&&""!=gb&&d.setDashPattern(gb);d.setStrokeWidth(Gb);M=Math.min(.5*x,.5*q,M);ha||(M=Jb*Math.min(q,x)/100);M=Math.min(M,.5*Math.min(q,x));ha||(na=Math.min(bb*Math.min(q,x)/100));na=Math.min(na,.5*Math.min(q,x)-M);(Fa||Ja||Ha||Ga)&&"frame"!=+va&&(d.begin(),Fa?D.moveNW(d,n,y,q,x,E,Qa,M,Ga):d.moveTo(0,0),Fa&&D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),Ja&&D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),Ha&&D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),Ga&&D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),d.close(),d.fill(),d.setShadow(!1),d.setFillColor(Db),Va=ha=Ib,"none"==Db&&(ha=0),"none"==Eb&&(Va=0),d.setGradient(Db,Eb,0,0,q,x,Hb,ha,Va),d.begin(),Fa?D.moveNWInner(d,+n,y,q,x,E,Qa,M,na,Fa,Ga):d.moveTo(na,0),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),Ga&&Ha&&D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),Ha&&Ja&&D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),Ja&&Fa&&D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),Fa&&Ga&&D.paintNWInner(d,n,y,q,x,E,Qa,M,na),d.fill(),"none"==Fb&&(d.begin(),D.paintFolds(d,n,y,q,x,E,Qa,Sa,Ta,Ua,M,Fa,Ja,Ha,Ga),d.stroke()));Fa||Ja||+Ha||!Ga?Fa||Ja||!Ha||Ga?!Fa&&!Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,+n,y,q,x,E,Qa,M,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa||!Ja||Ha||Ga?!Fa&&Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga)),d.stroke(),d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,+n,y,q,x,E,Ta,M,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke(),d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),d.close(),d.fillAndStroke()):+!Fa&&Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),+D.lineSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),d.close(),d.fillAndStroke()):!Fa&&Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,+n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,+n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),d.close(),d.fillAndStroke()):!Fa||Ja||Ha||Ga?Fa&&!Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,+n,y,q,x,E,Ua,M,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke()):Fa&&!Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),"double"==va&&(D.moveNEInner(d,n,y,+q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa)),d.stroke(),d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),d.close(),d.fillAndStroke(),d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,+q,x,E,Ua,M,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa&&!Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,+n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,+n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa&&Ja&&!Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,+n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,+Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.lineSEInner(d,n,y,q,x,E,+Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke()):Fa&&Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),"double"==va&&(D.moveSWInner(d,+n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,+n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ja&&Ha&&Ga&&("frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,+M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),d.close(),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close()),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintNW(d,+n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),d.close(),D.moveSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,+n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke())):"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),d.close(),d.fillAndStroke()):+"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),d.close(),d.fillAndStroke()):"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),"double"==va&&(D.moveSWInner(d,+n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),d.close(),d.fillAndStroke()):"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,+Qa,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke());d.begin();D.paintFolds(d,n,y,q,x,E,Qa,Sa,Ta,Ua,M,Fa,Ja,Ha,Ga);d.stroke()};Ra.prototype.moveNW=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.moveTo(0,0):d.moveTo(0,ha)};Ra.prototype.moveNE=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.moveTo(q,0):d.moveTo(q-ha,0)};Ra.prototype.moveSE=function(d,+n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.moveTo(q,x):d.moveTo(q,x-ha)};Ra.prototype.moveSW=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.moveTo(0,x):d.moveTo(ha,x)};Ra.prototype.paintNW=function(d,n,y,q,x,D,E,ha,M){if(M)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,ha,0)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==E&&+"fold"==D)&&d.lineTo(ha,0);else d.lineTo(0,0)};Ra.prototype.paintTop=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.lineTo(q,0):d.lineTo(q-ha,0)};Ra.prototype.paintNE=function(d,n,y,q,x,D,E,ha,M){if(M)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,q,ha)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q,ha);else d.lineTo(q,+0)};Ra.prototype.paintRight=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.lineTo(q,x):d.lineTo(q,x-ha)};Ra.prototype.paintLeft=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.lineTo(0,0):d.lineTo(0,ha)};Ra.prototype.paintSE=function(d,n,y,q,x,D,E,ha,M){if(M)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,q-ha,x)}else("snip"==E||"default"==+E&&"snip"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-ha,x);else d.lineTo(q,x)};Ra.prototype.paintBottom=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.lineTo(0,x):d.lineTo(ha,x)};Ra.prototype.paintSW=function(d,n,y,q,x,D,E,ha,M){if(M)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,0,x-ha)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==+E&&"fold"==D)&&d.lineTo(0,x-ha);else d.lineTo(0,x)};Ra.prototype.paintNWInner=function(d,n,y,q,x,D,E,ha,M){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*M,ha-.5*M,0,0,0,M,.5*M+ha);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+M,ha+M,0,0,1,M,M+ha);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(M,.5*M+ha);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(M+ha,M+ha),d.lineTo(M,M+ha)};Ra.prototype.paintTopInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(0,+M):va&&!na?d.lineTo(M,0):va?"square"==E||"default"==E&&"square"==D?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(ha+.5*M,M):d.lineTo(ha+M,M):d.lineTo(0,M):d.lineTo(0,0)};Ra.prototype.paintNEInner=function(d,n,y,q,x,D,E,ha,M){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*M,ha-.5*M,0,0,0,q-ha-.5*M,M);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+M,ha+M,0,0,1,q-ha-M,M);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(q-+ha-.5*M,M);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(q-ha-M,ha+M),d.lineTo(q-ha-M,M)};Ra.prototype.paintRightInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(q-M,0):va&&!na?d.lineTo(q,M):va?"square"==E||"default"==E&&"square"==D?d.lineTo(q-M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-M,ha+.5*M):d.lineTo(q-M,ha+M):d.lineTo(q-M,0):d.lineTo(q,0)};Ra.prototype.paintLeftInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(M,+x):va&&!na?d.lineTo(0,x-M):va?"square"==E||"default"==E&&"square"==D?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(M,x-ha-.5*M):d.lineTo(M,x-ha-M):d.lineTo(M,x):d.lineTo(0,x)};Ra.prototype.paintSEInner=function(d,n,y,q,x,D,E,ha,M){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*M,ha-.5*M,0,0,0,q-M,x-ha-.5*M);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+M,ha+M,0,0,1,q-M,x-ha-M);else if("snip"==E||"default"==E&&"snip"==+D)d.lineTo(q-M,x-ha-.5*M);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(q-ha-M,x-ha-M),d.lineTo(q-M,x-ha-M)};Ra.prototype.paintBottomInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(q,x-M):va&&!na?d.lineTo(q-M,x):"square"==E||"default"==E&&"square"==D||!va?d.lineTo(q-M,x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-ha-.5*M,x-M):d.lineTo(q-ha-M,x-M):d.lineTo(q,x)};Ra.prototype.paintSWInner=function(d,n,y,q,x,D,E,ha,M,va){if(!va)d.lineTo(M,+x);else if("square"==E||"default"==E&&"square"==D)d.lineTo(M,x-M);else if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*M,ha-.5*M,0,0,0,ha+.5*M,x-M);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+M,ha+M,0,0,1,ha+M,x-M);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(ha+.5*M,x-M);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(M+ha,x-ha-M),d.lineTo(M+ha,x-M)};Ra.prototype.moveSWInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D?d.moveTo(M,+x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(M,x-ha-.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(M,x-ha-M):d.moveTo(0,x-M)};Ra.prototype.lineSWInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(M,x-ha-.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==+E&&"fold"==D)&&d.lineTo(M,x-ha-M):d.lineTo(0,x-M)};Ra.prototype.moveSEInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D?d.moveTo(q-M,x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(q-M,x-ha-.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(q-M,x-ha-M):d.moveTo(q-M,x)};Ra.prototype.lineSEInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D?d.lineTo(q-M,+x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-M,x-ha-.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-M,x-ha-M):d.lineTo(q-M,x)};Ra.prototype.moveNEInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D||va?d.moveTo(q-M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(q-M,ha+.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==+E&&"fold"==D)&&d.moveTo(q-M,ha+M):d.moveTo(q,M)};Ra.prototype.lineNEInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D||va?d.lineTo(q-M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-M,ha+.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-M,ha+M):d.lineTo(q,M)};Ra.prototype.moveNWInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.moveTo(M,0):va&&!na?d.moveTo(0,M):"square"==+E||"default"==E&&"square"==D?d.moveTo(M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(M,ha+.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(M,ha+M):d.moveTo(0,0)};Ra.prototype.lineNWInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(M,0):va&&!na?d.lineTo(0,M):"square"==E||"default"==E&&"square"==D?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(M,+ha+.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(M,ha+M):d.lineTo(0,0)};Ra.prototype.paintFolds=function(d,n,y,q,x,D,E,ha,M,va,na,Va,gb,bb,Fa){if("fold"==D||"fold"==E||"fold"==ha||"fold"==M||"fold"==va)("fold"==E||"default"==E&&"fold"==D)&&Va&&Fa&&(d.moveTo(0,na),d.lineTo(na,na),d.lineTo(na,0)),("fold"==ha||"default"==ha&&"fold"==D)&&Va&&gb&&(d.moveTo(q-na,0),d.lineTo(q-na,na),d.lineTo(q,na)),("fold"==M||"default"==M&&"fold"==D)&&bb&&gb&&(d.moveTo(q-na,x),d.lineTo(q-na,x-na),d.lineTo(q,x-na)),("fold"==va||"default"==va&&"fold"==D)&&bb&&Fa&&(d.moveTo(0,x-na),d.lineTo(na,x-na),d.lineTo(na,x))};mxCellRenderer.registerShape(Ra.prototype.cst.RECT2,Ra);Ra.prototype.constraints=null;mxUtils.extend(Oa,mxConnector);Oa.prototype.origPaintEdgeShape=Oa.prototype.paintEdgeShape;Oa.prototype.paintEdgeShape=function(d,n,y){for(var q=[],x=0;x<n.length;x++)q.push(mxUtils.clone(n[x]));x=d.state.dashed;var D=d.state.fixDash;Oa.prototype.origPaintEdgeShape.apply(this,[d,q,y]);3<=d.state.strokeWidth&&(q=mxUtils.getValue(this.style,"fillColor",null),null!=q&&(d.setStrokeColor(q),d.setStrokeWidth(d.state.strokeWidth-2),d.setDashed(x,D),Oa.prototype.origPaintEdgeShape.apply(this,[d,n,y])))};mxCellRenderer.registerShape("filledEdge",Oa);"undefined"!==typeof StyleFormatPanel&&function(){var d=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var n=this.editorUi.getSelectionState(),y=d.apply(this,arguments);"umlFrame"==-n.style.shape&&y.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return y}}();mxMarker.addMarker("dash",function(d,n,y,q,x,D,E,ha,L,va){var na=x*(E+L+1),Va=D*(E+L+1);return function(){d.begin();d.moveTo(q.x-na/2-Va/2,q.y-Va/2+na/2);d.lineTo(q.x+Va/2-3*na/2,q.y-3*Va/2-na/2);d.stroke()}});mxMarker.addMarker("box",function(d,n,y,q,x,D,E,ha,L,va){var na=x*(E+L+1),Va=D*(E+L+1),gb=q.x+na/2,bb=q.y+Va/2;q.x-=na;q.y-=Va;return function(){d.begin();d.moveTo(gb-na/2--Va/2,bb-Va/2+na/2);d.lineTo(gb-na/2+Va/2,bb-Va/2-na/2);d.lineTo(gb+Va/2-3*na/2,bb-3*Va/2-na/2);d.lineTo(gb-Va/2-3*na/2,bb-3*Va/2+na/2);d.close();va?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("cross",function(d,n,y,q,x,D,E,ha,L,va){var na=x*(E+L+1),Va=D*(E+L+1);return function(){d.begin();d.moveTo(q.x-na/2-Va/2,q.y-Va/2+na/2);d.lineTo(q.x+Va/2-3*na/2,q.y-3*Va/2-na/2);d.moveTo(q.x-na/2+Va/2,q.y-Va/2-na/2);d.lineTo(q.x-Va/2-3*na/2,q.y-3*Va/2+na/2);d.stroke()}});mxMarker.addMarker("circle",kb);-mxMarker.addMarker("circlePlus",function(d,n,y,q,x,D,E,ha,L,va){var na=q.clone(),Va=kb.apply(this,arguments),gb=x*(E+2*L),bb=D*(E+2*L);return function(){Va.apply(this,arguments);d.begin();d.moveTo(na.x-x*L,na.y-D*L);d.lineTo(na.x-2*gb+x*L,na.y-2*bb+D*L);d.moveTo(na.x-gb-bb+D*L,na.y-bb+gb-x*L);d.lineTo(na.x+bb-gb-D*L,na.y-bb-gb+x*L);d.stroke()}});mxMarker.addMarker("halfCircle",function(d,n,y,q,x,D,E,ha,L,va){var na=x*(E+L+1),Va=D*(E+L+1),gb=q.clone();q.x-=na;q.y-=Va;return function(){d.begin();d.moveTo(gb.x--Va,gb.y+na);d.quadTo(q.x-Va,q.y+na,q.x,q.y);d.quadTo(q.x+Va,q.y-na,gb.x+Va,gb.y-na);d.stroke()}});mxMarker.addMarker("async",function(d,n,y,q,x,D,E,ha,L,va){n=x*L*1.118;y=D*L*1.118;x*=E+L;D*=E+L;var na=q.clone();na.x-=n;na.y-=y;q.x+=-x-n;q.y+=-D-y;return function(){d.begin();d.moveTo(na.x,na.y);ha?d.lineTo(na.x-x-D/2,na.y-D+x/2):d.lineTo(na.x+D/2-x,na.y-D-x/2);d.lineTo(na.x-x,na.y-D);d.close();va?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("openAsync",function(d){d=null!=d?d:2;return function(n,-y,q,x,D,E,ha,L,va,na){D*=ha+va;E*=ha+va;var Va=x.clone();return function(){n.begin();n.moveTo(Va.x,Va.y);L?n.lineTo(Va.x-D-E/d,Va.y-E+D/d):n.lineTo(Va.x+E/d-D,Va.y-E-D/d);n.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var db=function(d,n,y){return mb(d,["width"],n,function(q,x,D,E,ha){ha=d.shape.getEdgeWidth()*d.view.scale+y;return new mxPoint(E.x+x*q/4+D*ha/2,E.y+D*q/4-x*ha/2)},function(q,x,D,E,ha,L){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));d.style.width=Math.round(2*-q)/d.view.scale-y})},mb=function(d,n,y,q,x){return ib(d,n,function(D){var E=d.absolutePoints;if(null!=E&&0<E.length){var ha=E.length-1;D=d.view.translate;var L=d.view.scale,va=y?E[0]:E[ha];E=y?E[1]:E[ha-1];ha=E.x-va.x;var na=E.y-va.y,Va=Math.sqrt(ha*ha+na*na);va=q.call(this,Va,ha/Va,na/Va,va,E);return new mxPoint(va.x/L-D.x,va.y/L-D.y)}return null},function(D,E,ha){var L=d.absolutePoints,va=L.length-1;D=d.view.translate;var na=d.view.scale,Va=y?L[0]:L[va];L=y?L[1]:L[va-1];va=L.x-Va.x;var gb=L.y-Va.y,-bb=Math.sqrt(va*va+gb*gb);E.x=(E.x+D.x)*na;E.y=(E.y+D.y)*na;x.call(this,bb,va/bb,gb/bb,Va,L,E,ha)})},ub=function(d,n){return function(y){return[mb(y,["startWidth"],!0,function(q,x,D,E,ha){ha=mxUtils.getNumber(y.style,"startWidth",d)*y.view.scale+n;return new mxPoint(E.x+x*q/4+D*ha/2,E.y+D*q/4-x*ha/2)},function(q,x,D,E,ha,L){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));y.style.startWidth=Math.round(2*q)/y.view.scale-n})]}},eb=function(d){return function(n){return[ib(n,["arrowWidth",+n.style.shape&&y.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return y}}();mxMarker.addMarker("dash",function(d,n,y,q,x,D,E,ha,M,va){var na=x*(E+M+1),Va=D*(E+M+1);return function(){d.begin();d.moveTo(q.x-na/2-Va/2,q.y-Va/2+na/2);d.lineTo(q.x+Va/2-3*na/2,q.y-3*Va/2-na/2);d.stroke()}});mxMarker.addMarker("box",function(d,n,y,q,x,D,E,ha,M,va){var na=x*(E+M+1),Va=D*(E+M+1),gb=q.x+na/2,bb=q.y+Va/2;q.x-=na;q.y-=Va;return function(){d.begin();d.moveTo(gb-na/2-+Va/2,bb-Va/2+na/2);d.lineTo(gb-na/2+Va/2,bb-Va/2-na/2);d.lineTo(gb+Va/2-3*na/2,bb-3*Va/2-na/2);d.lineTo(gb-Va/2-3*na/2,bb-3*Va/2+na/2);d.close();va?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("cross",function(d,n,y,q,x,D,E,ha,M,va){var na=x*(E+M+1),Va=D*(E+M+1);return function(){d.begin();d.moveTo(q.x-na/2-Va/2,q.y-Va/2+na/2);d.lineTo(q.x+Va/2-3*na/2,q.y-3*Va/2-na/2);d.moveTo(q.x-na/2+Va/2,q.y-Va/2-na/2);d.lineTo(q.x-Va/2-3*na/2,q.y-3*Va/2+na/2);d.stroke()}});mxMarker.addMarker("circle",kb);+mxMarker.addMarker("circlePlus",function(d,n,y,q,x,D,E,ha,M,va){var na=q.clone(),Va=kb.apply(this,arguments),gb=x*(E+2*M),bb=D*(E+2*M);return function(){Va.apply(this,arguments);d.begin();d.moveTo(na.x-x*M,na.y-D*M);d.lineTo(na.x-2*gb+x*M,na.y-2*bb+D*M);d.moveTo(na.x-gb-bb+D*M,na.y-bb+gb-x*M);d.lineTo(na.x+bb-gb-D*M,na.y-bb-gb+x*M);d.stroke()}});mxMarker.addMarker("halfCircle",function(d,n,y,q,x,D,E,ha,M,va){var na=x*(E+M+1),Va=D*(E+M+1),gb=q.clone();q.x-=na;q.y-=Va;return function(){d.begin();d.moveTo(gb.x-+Va,gb.y+na);d.quadTo(q.x-Va,q.y+na,q.x,q.y);d.quadTo(q.x+Va,q.y-na,gb.x+Va,gb.y-na);d.stroke()}});mxMarker.addMarker("async",function(d,n,y,q,x,D,E,ha,M,va){n=x*M*1.118;y=D*M*1.118;x*=E+M;D*=E+M;var na=q.clone();na.x-=n;na.y-=y;q.x+=-x-n;q.y+=-D-y;return function(){d.begin();d.moveTo(na.x,na.y);ha?d.lineTo(na.x-x-D/2,na.y-D+x/2):d.lineTo(na.x+D/2-x,na.y-D-x/2);d.lineTo(na.x-x,na.y-D);d.close();va?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("openAsync",function(d){d=null!=d?d:2;return function(n,+y,q,x,D,E,ha,M,va,na){D*=ha+va;E*=ha+va;var Va=x.clone();return function(){n.begin();n.moveTo(Va.x,Va.y);M?n.lineTo(Va.x-D-E/d,Va.y-E+D/d):n.lineTo(Va.x+E/d-D,Va.y-E-D/d);n.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var db=function(d,n,y){return mb(d,["width"],n,function(q,x,D,E,ha){ha=d.shape.getEdgeWidth()*d.view.scale+y;return new mxPoint(E.x+x*q/4+D*ha/2,E.y+D*q/4-x*ha/2)},function(q,x,D,E,ha,M){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));d.style.width=Math.round(2*+q)/d.view.scale-y})},mb=function(d,n,y,q,x){return ib(d,n,function(D){var E=d.absolutePoints;if(null!=E&&0<E.length){var ha=E.length-1;D=d.view.translate;var M=d.view.scale,va=y?E[0]:E[ha];E=y?E[1]:E[ha-1];ha=E.x-va.x;var na=E.y-va.y,Va=Math.sqrt(ha*ha+na*na);va=q.call(this,Va,ha/Va,na/Va,va,E);return new mxPoint(va.x/M-D.x,va.y/M-D.y)}return null},function(D,E,ha){var M=d.absolutePoints,va=M.length-1;D=d.view.translate;var na=d.view.scale,Va=y?M[0]:M[va];M=y?M[1]:M[va-1];va=M.x-Va.x;var gb=M.y-Va.y,+bb=Math.sqrt(va*va+gb*gb);E.x=(E.x+D.x)*na;E.y=(E.y+D.y)*na;x.call(this,bb,va/bb,gb/bb,Va,M,E,ha)})},ub=function(d,n){return function(y){return[mb(y,["startWidth"],!0,function(q,x,D,E,ha){ha=mxUtils.getNumber(y.style,"startWidth",d)*y.view.scale+n;return new mxPoint(E.x+x*q/4+D*ha/2,E.y+D*q/4-x*ha/2)},function(q,x,D,E,ha,M){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));y.style.startWidth=Math.round(2*q)/y.view.scale-n})]}},eb=function(d){return function(n){return[ib(n,["arrowWidth","arrowSize"],function(y){var q=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Ia.prototype.arrowWidth))),x=Math.max(0,Math.min(d,mxUtils.getValue(this.state.style,"arrowSize",Ia.prototype.arrowSize)));return new mxPoint(y.x+(1-x)*y.width,y.y+(1-q)*y.height/2)},function(y,q){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(y.y+y.height/2-q.y)/y.height*2));this.state.style.arrowSize=Math.max(0,Math.min(d,(y.x+y.width-q.x)/y.width))})]}},ob=function(d){return function(n){return[ib(n,["size"],function(y){var q=Math.max(0,Math.min(.5*y.height,parseFloat(mxUtils.getValue(this.state.style,"size",d))));return new mxPoint(y.x,y.y+q)},function(y,q){this.state.style.size=Math.max(0,q.y-y.y)},!0)]}},tb=function(d,n,y){return function(q){var x=[ib(q,["size"],function(D){var E=Math.max(0,Math.min(D.width,Math.min(D.height,parseFloat(mxUtils.getValue(this.state.style,"size",n)))))*d;return new mxPoint(D.x+E,D.y+E)},function(D,E){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(D.width,-E.x-D.x),Math.min(D.height,E.y-D.y)))/d)},!1)];y&&mxUtils.getValue(q.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(xb(q));return x}},pb=function(d,n,y,q,x){y=null!=y?y:.5;return function(D){var E=[ib(D,["size"],function(ha){var L=null!=x?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,va=parseFloat(mxUtils.getValue(this.state.style,"size",L?x:d));return new mxPoint(ha.x+Math.max(0,Math.min(.5*ha.width,va*(L?1:ha.width))),ha.getCenterY())},function(ha,L,va){ha=null!=x&&"0"!=mxUtils.getValue(this.state.style,-"fixedSize","0")?L.x-ha.x:Math.max(0,Math.min(y,(L.x-ha.x)/ha.width));this.state.style.size=ha},!1,q)];n&&mxUtils.getValue(D.style,mxConstants.STYLE_ROUNDED,!1)&&E.push(xb(D));return E}},wb=function(d,n,y){d=null!=d?d:.5;return function(q){var x=[ib(q,["size"],function(D){var E=null!=y?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ha=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",E?y:n)));return new mxPoint(D.x+Math.min(.75*D.width*d,ha*(E?.75:.75*D.width)),D.y+D.height/+E.x-D.x),Math.min(D.height,E.y-D.y)))/d)},!1)];y&&mxUtils.getValue(q.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(xb(q));return x}},pb=function(d,n,y,q,x){y=null!=y?y:.5;return function(D){var E=[ib(D,["size"],function(ha){var M=null!=x?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,va=parseFloat(mxUtils.getValue(this.state.style,"size",M?x:d));return new mxPoint(ha.x+Math.max(0,Math.min(.5*ha.width,va*(M?1:ha.width))),ha.getCenterY())},function(ha,M,va){ha=null!=x&&"0"!=mxUtils.getValue(this.state.style,+"fixedSize","0")?M.x-ha.x:Math.max(0,Math.min(y,(M.x-ha.x)/ha.width));this.state.style.size=ha},!1,q)];n&&mxUtils.getValue(D.style,mxConstants.STYLE_ROUNDED,!1)&&E.push(xb(D));return E}},wb=function(d,n,y){d=null!=d?d:.5;return function(q){var x=[ib(q,["size"],function(D){var E=null!=y?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ha=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",E?y:n)));return new mxPoint(D.x+Math.min(.75*D.width*d,ha*(E?.75:.75*D.width)),D.y+D.height/4)},function(D,E){D=null!=y&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?E.x-D.x:Math.max(0,Math.min(d,(E.x-D.x)/D.width*.75));this.state.style.size=D},!1,!0)];mxUtils.getValue(q.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(xb(q));return x}},vb=function(){return function(d){var n=[];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(xb(d));return n}},xb=function(d,n){return ib(d,[mxConstants.STYLE_ARCSIZE],function(y){var q=null!=n?n:y.height/8;if("1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var x=mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(y.x+y.width-Math.min(y.width/2,x),y.y+q)}x=Math.max(0,parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(y.x+y.width-Math.min(Math.max(y.width/2,y.height/2),Math.min(y.width,y.height)*x),y.y+q)},function(y,q,x){"1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?-this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(y.width,2*(y.x+y.width-q.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(y.width-q.x+y.x)/Math.min(y.width,y.height))))})},ib=function(d,n,y,q,x,D,E){var ha=new mxHandle(d,null,mxVertexHandler.prototype.secondaryHandleImage);ha.execute=function(va){for(var na=0;na<n.length;na++)this.copyStyle(n[na]);E&&E(va)};ha.getPosition=y;ha.setPosition=q;ha.ignoreGrid=null!=x?x:!0;if(D){var L=ha.positionChanged;-ha.positionChanged=function(){L.apply(this,arguments);d.view.invalidate(this.state.cell);d.view.validate()}}return ha},hb={link:function(d){return[db(d,!0,10),db(d,!1,10)]},flexArrow:function(d){var n=d.view.graph.gridSize/d.view.scale,y=[];mxUtils.getValue(d.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(y.push(mb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(q,x,D,E,ha){q=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,-mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)+D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)-x*q/2)},function(q,x,D,E,ha,L,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,L.x,L.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*q)/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||+this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(y.width,2*(y.x+y.width-q.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(y.width-q.x+y.x)/Math.min(y.width,y.height))))})},ib=function(d,n,y,q,x,D,E){var ha=new mxHandle(d,null,mxVertexHandler.prototype.secondaryHandleImage);ha.execute=function(va){for(var na=0;na<n.length;na++)this.copyStyle(n[na]);E&&E(va)};ha.getPosition=y;ha.setPosition=q;ha.ignoreGrid=null!=x?x:!0;if(D){var M=ha.positionChanged;+ha.positionChanged=function(){M.apply(this,arguments);d.view.invalidate(this.state.cell);d.view.validate()}}return ha},hb={link:function(d){return[db(d,!0,10),db(d,!1,10)]},flexArrow:function(d){var n=d.view.graph.gridSize/d.view.scale,y=[];mxUtils.getValue(d.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(y.push(mb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(q,x,D,E,ha){q=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,+mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)+D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)-x*q/2)},function(q,x,D,E,ha,M,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*q)/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(va.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<n/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE])})),y.push(mb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(q,x,D,E,ha){q=(d.shape.getStartArrowWidth()-d.shape.strokewidth)*d.view.scale;-ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)+D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)-x*q/2)},function(q,x,D,E,ha,L,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,L.x,L.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.startWidth=Math.max(0,Math.round(2*q)-d.shape.getEdgeWidth())/+ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)+D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)-x*q/2)},function(q,x,D,E,ha,M,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.startWidth=Math.max(0,Math.round(2*q)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE],d.style.endWidth=d.style.startWidth;mxEvent.isAltDown(va.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<n/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(d.style.startWidth)-parseFloat(d.style.endWidth))<n&&(d.style.startWidth=d.style.endWidth))})));mxUtils.getValue(d.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(y.push(mb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(q,x,D,E,ha){q=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)-D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)+x*q/2)},function(q,-x,D,E,ha,L,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,L.x,L.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*q)/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(va.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<-n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE])})),y.push(mb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(q,x,D,E,ha){q=(d.shape.getEndArrowWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)-D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)+x*q/2)},function(q,x,D,E,ha,L,-va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,L.x,L.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.endWidth=Math.max(0,Math.round(2*q)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE],d.style.startWidth=d.style.endWidth;mxEvent.isAltDown(va.getEvent())||+x,D,E,ha,M,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*q)/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(va.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<+n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE])})),y.push(mb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(q,x,D,E,ha){q=(d.shape.getEndArrowWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)-D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)+x*q/2)},function(q,x,D,E,ha,M,+va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.endWidth=Math.max(0,Math.round(2*q)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE],d.style.startWidth=d.style.endWidth;mxEvent.isAltDown(va.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(d.style.endWidth)-parseFloat(d.style.startWidth))<n&&(d.style.endWidth=d.style.startWidth))})));return y},swimlane:function(d){var n=[];if(mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED)){var y=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));n.push(xb(d,y/2))}n.push(ib(d,[mxConstants.STYLE_STARTSIZE],function(q){var x=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(d.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(q.getCenterX(),q.y+Math.max(0,Math.min(q.height,x))):new mxPoint(q.x+Math.max(0,Math.min(q.width,x)),q.getCenterY())},function(q,x){d.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(q.height,x.y-q.y))):Math.round(Math.max(0,Math.min(q.width,x.x-q.x)))},!1,null,function(q){var x=d.view.graph;if(!mxEvent.isShiftDown(q.getEvent())&&!mxEvent.isControlDown(q.getEvent())&&(x.isTableRow(d.cell)||x.isTableCell(d.cell))){q=x.getSwimlaneDirection(d.style);var D=x.model.getParent(d.cell);D=x.model.getChildCells(D,!0);for(var E=[],ha=0;ha<D.length;ha++)D[ha]!=d.cell&&x.isSwimlane(D[ha])&&x.getSwimlaneDirection(x.getCurrentCellStyle(D[ha]))==q&&E.push(D[ha]);x.setCellStyles(mxConstants.STYLE_STARTSIZE,-d.style[mxConstants.STYLE_STARTSIZE],E)}}));return n},label:vb(),ext:vb(),rectangle:vb(),triangle:vb(),rhombus:vb(),umlLifeline:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",Y.prototype.size))));return new mxPoint(n.getCenterX(),n.y+y)},function(n,y){this.state.style.size=Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},umlFrame:function(d){return[ib(d,["width","height"],function(n){var y=Math.max(ba.prototype.corner,-Math.min(n.width,mxUtils.getValue(this.state.style,"width",ba.prototype.width))),q=Math.max(1.5*ba.prototype.corner,Math.min(n.height,mxUtils.getValue(this.state.style,"height",ba.prototype.height)));return new mxPoint(n.x+y,n.y+q)},function(n,y){this.state.style.width=Math.round(Math.max(ba.prototype.corner,Math.min(n.width,y.x-n.x)));this.state.style.height=Math.round(Math.max(1.5*ba.prototype.corner,Math.min(n.height,y.y-n.y)))},!1)]},process:function(d){var n=[ib(d,["size"],function(y){var q=-"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),x=parseFloat(mxUtils.getValue(this.state.style,"size",S.prototype.size));return q?new mxPoint(y.x+x,y.y+y.height/4):new mxPoint(y.x+y.width*x,y.y+y.height/4)},function(y,q){y="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*y.width,q.x-y.x)):Math.max(0,Math.min(.5,(q.x-y.x)/y.width));this.state.style.size=y},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(xb(d));return n},cross:function(d){return[ib(d,+d.style[mxConstants.STYLE_STARTSIZE],E)}}));return n},label:vb(),ext:vb(),rectangle:vb(),triangle:vb(),rhombus:vb(),umlLifeline:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",Y.prototype.size))));return new mxPoint(n.getCenterX(),n.y+y)},function(n,y){this.state.style.size=Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},umlFrame:function(d){return[ib(d,["width","height"],function(n){var y=Math.max(ca.prototype.corner,+Math.min(n.width,mxUtils.getValue(this.state.style,"width",ca.prototype.width))),q=Math.max(1.5*ca.prototype.corner,Math.min(n.height,mxUtils.getValue(this.state.style,"height",ca.prototype.height)));return new mxPoint(n.x+y,n.y+q)},function(n,y){this.state.style.width=Math.round(Math.max(ca.prototype.corner,Math.min(n.width,y.x-n.x)));this.state.style.height=Math.round(Math.max(1.5*ca.prototype.corner,Math.min(n.height,y.y-n.y)))},!1)]},process:function(d){var n=[ib(d,["size"],function(y){var q=+"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),x=parseFloat(mxUtils.getValue(this.state.style,"size",V.prototype.size));return q?new mxPoint(y.x+x,y.y+y.height/4):new mxPoint(y.x+y.width*x,y.y+y.height/4)},function(y,q){y="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*y.width,q.x-y.x)):Math.max(0,Math.min(.5,(q.x-y.x)/y.width));this.state.style.size=y},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(xb(d));return n},cross:function(d){return[ib(d,["size"],function(n){var y=Math.min(n.width,n.height);y=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Za.prototype.size)))*y/2;return new mxPoint(n.getCenterX()-y,n.getCenterY()-y)},function(n,y){var q=Math.min(n.width,n.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,n.getCenterY()-y.y)/q*2,Math.max(0,n.getCenterX()-y.x)/q*2)))})]},note:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(n.width,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",F.prototype.size)))));return new mxPoint(n.x+n.width-y,n.y+y)},function(n,y){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(n.width,n.x+n.width-y.x),Math.min(n.height,y.y-n.y))))})]},note2:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(n.width,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",P.prototype.size)))));return new mxPoint(n.x+n.width-y,n.y+y)},function(n,y){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(n.width,n.x+n.width-y.x),Math.min(n.height,y.y-n.y))))})]},manualInput:function(d){var n=[ib(d,["size"],function(y){var q=Math.max(0,Math.min(y.height,mxUtils.getValue(this.state.style,"size",Ea.prototype.size)));return new mxPoint(y.x+y.width/4,y.y+3*q/4)},function(y,q){this.state.style.size=Math.round(Math.max(0,Math.min(y.height,4*(q.y-y.y)/3)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(xb(d));return n},dataStorage:function(d){return[ib(d,["size"],function(n){var y="0"!=mxUtils.getValue(this.state.style,@@ -2908,15 +2908,15 @@ Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",ma.prototypeq=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"dy",Ma.prototype.dy)));return new mxPoint(n.x+y,n.y+q)},function(n,y){this.state.style.dx=Math.round(Math.max(0,Math.min(n.width,y.x-n.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},tee:function(d){return[ib(d,["dx","dy"],function(n){var y=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"dx",Wa.prototype.dx))),q=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"dy",Wa.prototype.dy)));return new mxPoint(n.x+(n.width+y)/2,n.y+q)},function(n,y){this.state.style.dx=Math.round(Math.max(0,2*Math.min(n.width/2,y.x-n.x-n.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},singleArrow:eb(1),doubleArrow:eb(.5),"mxgraph.arrows2.wedgeArrow":ub(20,20),"mxgraph.arrows2.wedgeArrowDashed":ub(20,20),"mxgraph.arrows2.wedgeArrowDashed2":ub(20,20),folder:function(d){return[ib(d,["tabWidth","tabHeight"],function(n){var y=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"tabWidth",k.prototype.tabWidth))),q=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"tabHeight",k.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",k.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(y=n.width-y);return new mxPoint(n.x+y,n.y+q)},function(n,y){var q=Math.max(0,Math.min(n.width,y.x-n.x));mxUtils.getValue(this.state.style,"tabPosition",k.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(q=n.width-q);this.state.style.tabWidth=Math.round(q);this.state.style.tabHeight=-Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},document:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",H.prototype.size))));return new mxPoint(n.x+3*n.width/4,n.y+(1-y)*n.height)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-y.y)/n.height))},!1)]},tape:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",C.prototype.size))));-return new mxPoint(n.getCenterX(),n.y+y*n.height/2)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(y.y-n.y)/n.height*2))},!1)]},isoCube2:function(d){return[ib(d,["isoAngle"],function(n){var y=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",Q.isoAngle))))*Math.PI/200;return new mxPoint(n.x,n.y+Math.min(n.width*Math.tan(y),.5*n.height))},function(n,y){this.state.style.isoAngle=Math.max(0,50*(y.y-n.y)/n.height)},!0)]},cylinder2:ob(U.prototype.size),cylinder3:ob(c.prototype.size),+Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},document:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",I.prototype.size))));return new mxPoint(n.x+3*n.width/4,n.y+(1-y)*n.height)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-y.y)/n.height))},!1)]},tape:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",C.prototype.size))));+return new mxPoint(n.getCenterX(),n.y+y*n.height/2)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(y.y-n.y)/n.height*2))},!1)]},isoCube2:function(d){return[ib(d,["isoAngle"],function(n){var y=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",Q.isoAngle))))*Math.PI/200;return new mxPoint(n.x,n.y+Math.min(n.width*Math.tan(y),.5*n.height))},function(n,y){this.state.style.isoAngle=Math.max(0,50*(y.y-n.y)/n.height)},!0)]},cylinder2:ob(T.prototype.size),cylinder3:ob(c.prototype.size),offPageConnector:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",X.prototype.size))));return new mxPoint(n.getCenterX(),n.y+(1-y)*n.height)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-y.y)/n.height))},!1)]},"mxgraph.basic.rect":function(d){var n=[Graph.createHandle(d,["size"],function(y){var q=Math.max(0,Math.min(y.width/2,y.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(y.x+q,y.y+q)},function(y,q){this.state.style.size=Math.round(100*Math.max(0,Math.min(y.height/2,y.width/2,q.x-y.x)))/100})];d=Graph.createHandle(d,["indent"],function(y){var q=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(y.x+.75*y.width,y.y+q*y.height/200)},function(y,q){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(q.y-y.y)/y.height)))/100});n.push(d);return n},step:pb(la.prototype.size,!0,null,-!0,la.prototype.fixedSize),hexagon:pb(Z.prototype.size,!0,.5,!0,Z.prototype.fixedSize),curlyBracket:pb(O.prototype.size,!1),display:pb(ab.prototype.size,!1),cube:tb(1,m.prototype.size,!1),card:tb(.5,z.prototype.size,!0),loopLimit:tb(.5,R.prototype.size,!0),trapezoid:wb(.5,M.prototype.size,M.prototype.fixedSize),parallelogram:wb(1,K.prototype.size,K.prototype.fixedSize)};Graph.createHandle=ib;Graph.handleFactory=hb;var Bb=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=+!0,la.prototype.fixedSize),hexagon:pb(Z.prototype.size,!0,.5,!0,Z.prototype.fixedSize),curlyBracket:pb(O.prototype.size,!1),display:pb(ab.prototype.size,!1),cube:tb(1,m.prototype.size,!1),card:tb(.5,z.prototype.size,!0),loopLimit:tb(.5,R.prototype.size,!0),trapezoid:wb(.5,J.prototype.size,J.prototype.fixedSize),parallelogram:wb(1,L.prototype.size,L.prototype.fixedSize)};Graph.createHandle=ib;Graph.handleFactory=hb;var Bb=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var d=Bb.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var n=this.state.style.shape;null==mxCellRenderer.defaultShapes[n]&&null==mxStencilRegistry.getStencil(n)?n=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(n=mxConstants.SHAPE_SWIMLANE);n=hb[n];null==n&&null!=this.state.shape&&this.state.shape.isRoundable()&&(n=hb[mxConstants.SHAPE_RECTANGLE]);null!=n&&(n=n(this.state),null!=n&&(d=null==d?n:d.concat(n)))}return d};mxEdgeHandler.prototype.createCustomHandles=function(){var d=this.state.style.shape;null==mxCellRenderer.defaultShapes[d]&&null==mxStencilRegistry.getStencil(d)&&(d=mxConstants.SHAPE_CONNECTOR);d=hb[d];return null!=d?d(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var rb=new mxPoint(1,0),yb=new mxPoint(1,0),zb=mxUtils.toRadians(-30);rb=mxUtils.getRotatedPoint(rb,Math.cos(zb),Math.sin(zb));var qb=mxUtils.toRadians(-150);yb=mxUtils.getRotatedPoint(yb,Math.cos(qb),Math.sin(qb));mxEdgeStyle.IsometricConnector=function(d,-n,y,q,x){var D=d.view;q=null!=q&&0<q.length?q[0]:null;var E=d.absolutePoints,ha=E[0];E=E[E.length-1];null!=q&&(q=D.transformControlPoint(d,q));null==ha&&null!=n&&(ha=new mxPoint(n.getCenterX(),n.getCenterY()));null==E&&null!=y&&(E=new mxPoint(y.getCenterX(),y.getCenterY()));var L=rb.x,va=rb.y,na=yb.x,Va=yb.y,gb="horizontal"==mxUtils.getValue(d.style,"elbow","horizontal");if(null!=E&&null!=ha){d=function(Fa,Ja,Ha){Fa-=bb.x;var Ga=Ja-bb.y;Ja=(Va*Fa-na*Ga)/(L*Va-va*na);Fa=(va*Fa-L*Ga)/(va*na-L*Va);gb?-(Ha&&(bb=new mxPoint(bb.x+L*Ja,bb.y+va*Ja),x.push(bb)),bb=new mxPoint(bb.x+na*Fa,bb.y+Va*Fa)):(Ha&&(bb=new mxPoint(bb.x+na*Fa,bb.y+Va*Fa),x.push(bb)),bb=new mxPoint(bb.x+L*Ja,bb.y+va*Ja));x.push(bb)};var bb=ha;null==q&&(q=new mxPoint(ha.x+(E.x-ha.x)/2,ha.y+(E.y-ha.y)/2));d(q.x,q.y,!0);d(E.x,E.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Cb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(d,n){if(n==mxEdgeStyle.IsometricConnector){var y=+n,y,q,x){var D=d.view;q=null!=q&&0<q.length?q[0]:null;var E=d.absolutePoints,ha=E[0];E=E[E.length-1];null!=q&&(q=D.transformControlPoint(d,q));null==ha&&null!=n&&(ha=new mxPoint(n.getCenterX(),n.getCenterY()));null==E&&null!=y&&(E=new mxPoint(y.getCenterX(),y.getCenterY()));var M=rb.x,va=rb.y,na=yb.x,Va=yb.y,gb="horizontal"==mxUtils.getValue(d.style,"elbow","horizontal");if(null!=E&&null!=ha){d=function(Fa,Ja,Ha){Fa-=bb.x;var Ga=Ja-bb.y;Ja=(Va*Fa-na*Ga)/(M*Va-va*na);Fa=(va*Fa-M*Ga)/(va*na-M*Va);gb?+(Ha&&(bb=new mxPoint(bb.x+M*Ja,bb.y+va*Ja),x.push(bb)),bb=new mxPoint(bb.x+na*Fa,bb.y+Va*Fa)):(Ha&&(bb=new mxPoint(bb.x+na*Fa,bb.y+Va*Fa),x.push(bb)),bb=new mxPoint(bb.x+M*Ja,bb.y+va*Ja));x.push(bb)};var bb=ha;null==q&&(q=new mxPoint(ha.x+(E.x-ha.x)/2,ha.y+(E.y-ha.y)/2));d(q.x,q.y,!0);d(E.x,E.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Cb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(d,n){if(n==mxEdgeStyle.IsometricConnector){var y=new mxElbowEdgeHandler(d);y.snapToTerminals=!1;return y}return Cb.apply(this,arguments)};A.prototype.constraints=[];G.prototype.getConstraints=function(d,n,y){d=[];var q=Math.tan(mxUtils.toRadians(30)),x=(.5-q)/2;q=Math.min(n,y/(.5+q));n=(n-q)/2;y=(y-q)/2;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,y+.25*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+.5*q,y+q*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+q,y+.25*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+q,y+.75*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+.5*q,y+(1-x)*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,y+.75*q));return d};Q.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;q=Math.min(n*Math.tan(q),.5*y);d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,q));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,y-q));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,y-q));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,q));return d};ma.prototype.getConstraints=function(d,n,y){d=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var q=Math.max(0,Math.min(y,parseFloat(mxUtils.getValue(this.style,@@ -2924,7 +2924,7 @@ new mxElbowEdgeHandler(d);y.snapToTerminals=!1;return y}return Cb.apply(this,arg0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(y-q)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,y-q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,y));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,y-q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(y-q)));n>=2*q&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,-0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Ca.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;da.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;F.prototype.getConstraints=+0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Ca.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;ea.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;F.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(0,Math.min(n,Math.min(y,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-q),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-q,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-.5*q,.5*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(y+q)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));n>=2*q&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};z.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(0,Math.min(n,Math.min(y,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+q),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*q,.5*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(y+q)));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,@@ -2952,7 +2952,7 @@ mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),n[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,-.25),!1)];K.prototype.constraints=mxRectangleShape.prototype.constraints;M.prototype.constraints=mxRectangleShape.prototype.constraints;H.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),+.25),!1)];L.prototype.constraints=mxRectangleShape.prototype.constraints;J.prototype.constraints=mxRectangleShape.prototype.constraints;I.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;Wa.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(y,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*n+.25*q,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+q),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+q),.5*(y+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+q),y));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-q),y));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-q),.5*(y+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-q),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*n-.25*q,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*x));return d};Ma.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,@@ -2967,19 +2967,19 @@ mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),n0),!1,null,.5*(n+x),D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,q));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,q));return d};Y.prototype.constraints=null;u.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];N.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ra.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}-Actions.prototype.init=function(){function b(F){p.escape();F=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),F);null!=F&&p.setSelectionCells(F)}function e(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),P=0;P<F.length;P++)p.cellLabelChanged(F[P],"")}finally{p.getModel().endUpdate()}}}function g(F,P,Q,U,c){c.getModel().beginUpdate();try{var f=c.getCellGeometry(F);null!=f&&Q&&U&&(Q/=U,f=f.clone(),1<Q?f.height=f.width/Q:f.width=f.height*Q,c.getModel().setGeometry(F,+Actions.prototype.init=function(){function b(F){p.escape();F=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),F);null!=F&&p.setSelectionCells(F)}function e(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),P=0;P<F.length;P++)p.cellLabelChanged(F[P],"")}finally{p.getModel().endUpdate()}}}function g(F,P,Q,T,c){c.getModel().beginUpdate();try{var f=c.getCellGeometry(F);null!=f&&Q&&T&&(Q/=T,f=f.clone(),1<Q?f.height=f.width/Q:f.width=f.height*Q,c.getModel().setGeometry(F,f));c.setCellStyles(mxConstants.STYLE_CLIP_PATH,P,[F]);c.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[F])}finally{c.getModel().endUpdate()}}var m=this.editorUi,v=m.editor,p=v.graph,A=function(){return Action.prototype.isEnabled.apply(this,arguments)&&p.isEnabled()};this.addAction("new...",function(){p.openLink(m.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";m.openFile()});this.put("smartFit",new Action(mxResources.get("fitWindow")+" / "+mxResources.get("resetView"),-function(){p.popupMenuHandler.hideMenu();var F=p.view.scale,P=p.container.scrollLeft,Q=p.container.scrollTop,U=p.view.translate.x,c=p.view.translate.y;m.actions.get("resetView").funct();1E-5>Math.abs(F-p.view.scale)&&5>Math.abs(P-p.container.scrollLeft)&&5>Math.abs(Q-p.container.scrollTop)&&U==p.view.translate.x&&c==p.view.translate.y&&m.actions.get("fitWindow").funct()},null,null,"Enter"));this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?m.actions.get("smartFit").funct():p.isEnabled()&&-p.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){m.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(F,P){try{var Q=mxUtils.parseXml(F);v.graph.setSelectionCells(v.graph.importGraphModel(Q.documentElement))}catch(U){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+U.message)}}));m.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=+function(){p.popupMenuHandler.hideMenu();var F=p.view.scale,P=p.container.scrollLeft,Q=p.container.scrollTop,T=p.view.translate.x,c=p.view.translate.y;m.actions.get("resetView").funct();1E-5>Math.abs(F-p.view.scale)&&5>Math.abs(P-p.container.scrollLeft)&&5>Math.abs(Q-p.container.scrollTop)&&T==p.view.translate.x&&c==p.view.translate.y&&m.actions.get("fitWindow").funct()},null,null,"Enter"));this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?m.actions.get("smartFit").funct():p.isEnabled()&&+p.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){m.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(F,P){try{var Q=mxUtils.parseXml(F);v.graph.setSelectionCells(v.graph.importGraphModel(Q.documentElement))}catch(T){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+T.message)}}));m.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=A;this.addAction("save",function(){m.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=A;this.addAction("saveAs...",function(){m.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S");this.addAction("export...",function(){m.showDialog((new ExportDialog(m)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var F=new EditDiagramDialog(m);m.showDialog(F.container,620,420,!0,!1);F.init()}).isEnabled=A;this.addAction("pageSetup...",function(){m.showDialog((new PageSetupDialog(m)).container,320,240,!0,!0)}).isEnabled=A;this.addAction("print...",function(){m.showPrintDialog()},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(p,null,10,10)});this.addAction("undo",function(){m.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){m.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){var F=null;try{F=m.copyXml(),null!=F&&p.removeCells(F,!1)}catch(P){}try{null==F&&mxClipboard.cut(p)}catch(P){m.handleError(P)}},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{m.copyXml()}catch(F){}try{mxClipboard.copy(p)}catch(F){m.handleError(F)}},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(P){if(null!=P){p.getModel().beginUpdate();try{m.pasteXml(P,!0)}finally{p.getModel().endUpdate()}}else mxClipboard.paste(p)}),-F=!0)}catch(P){}F||mxClipboard.paste(p)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(F){function P(U){if(null!=U){for(var c=!0,f=0;f<U.length&&c;f++)c=c&&p.model.isEdge(U[f]);var k=p.view.translate;f=p.view.scale;var B=k.x,z=k.y;k=null;if(1==U.length&&c){var C=p.getCellGeometry(U[0]);null!=C&&(k=C.getTerminalPoint(!0))}k=null!=k?k:p.getBoundingBoxFromGeometry(U,c);null!=k&&(c=Math.round(p.snap(p.popupMenuHandler.triggerX/f-B)),f=Math.round(p.snap(p.popupMenuHandler.triggerY/-f-z)),p.cellsMoved(U,c-k.x,f-k.y))}}function Q(){p.getModel().beginUpdate();try{P(mxClipboard.paste(p))}finally{p.getModel().endUpdate()}}if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(U){if(null!=U){p.getModel().beginUpdate();try{P(m.pasteXml(U,!0))}finally{p.getModel().endUpdate()}}else Q()}),F=!0)}catch(U){}F||Q()}});this.addAction("swap",function(){var F=p.getSelectionCells();2==F.length&&p.swapShapes(F[0],+F=!0)}catch(P){}F||mxClipboard.paste(p)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(F){function P(T){if(null!=T){for(var c=!0,f=0;f<T.length&&c;f++)c=c&&p.model.isEdge(T[f]);var k=p.view.translate;f=p.view.scale;var B=k.x,z=k.y;k=null;if(1==T.length&&c){var C=p.getCellGeometry(T[0]);null!=C&&(k=C.getTerminalPoint(!0))}k=null!=k?k:p.getBoundingBoxFromGeometry(T,c);null!=k&&(c=Math.round(p.snap(p.popupMenuHandler.triggerX/f-B)),f=Math.round(p.snap(p.popupMenuHandler.triggerY/+f-z)),p.cellsMoved(T,c-k.x,f-k.y))}}function Q(){p.getModel().beginUpdate();try{P(mxClipboard.paste(p))}finally{p.getModel().endUpdate()}}if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(T){if(null!=T){p.getModel().beginUpdate();try{P(m.pasteXml(T,!0))}finally{p.getModel().endUpdate()}}else Q()}),F=!0)}catch(T){}F||Q()}});this.addAction("swap",function(){var F=p.getSelectionCells();2==F.length&&p.swapShapes(F[0],F[1])});this.addAction("copySize",function(){var F=p.getSelectionCell();p.isEnabled()&&null!=F&&p.getModel().isVertex(F)&&(F=p.getCellGeometry(F),null!=F&&(m.copiedSize=new mxRectangle(F.x,F.y,F.width,F.height)))},null,null,"Alt+Shift+F");this.addAction("pasteSize",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedSize){p.getModel().beginUpdate();try{for(var F=p.getResizableCells(p.getSelectionCells()),P=0;P<F.length;P++)if(p.getModel().isVertex(F[P])){var Q=p.getCellGeometry(F[P]);null!=Q&&(Q=Q.clone(),Q.width=m.copiedSize.width,Q.height=m.copiedSize.height,p.getModel().setGeometry(F[P],Q))}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+V");this.addAction("copyData",function(){var F=p.getSelectionCell()||p.getModel().getRoot();p.isEnabled()&&null!=F&&(F=F.cloneValue(),null==F||isNaN(F.nodeType)||(m.copiedValue=F))},null,null,"Alt+Shift+B");this.addAction("copyAsText",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F)try{p.isHtmlLabel(F)?m.writeHtmlToClipboard(p.getLabel(F),-mxUtils.bind(this,function(P){m.handleError(P)})):m.writeTextToClipboard(p.getLabel(F),mxUtils.bind(this,function(P){m.handleError(P)}))}catch(P){m.handleError(P)}});this.addAction("pasteData",function(F,P){function Q(f,k){var B=U.getValue(f);k=f.cloneValue(k);k.removeAttribute("placeholders");null==B||isNaN(B.nodeType)||k.setAttribute("placeholders",B.getAttribute("placeholders"));null!=F&&mxEvent.isShiftDown(F)||k.setAttribute("label",p.convertValueToString(f));U.setValue(f,k)}F=null!=P?P:F;var U=-p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedValue){U.beginUpdate();try{var c=p.getEditableCells(p.getSelectionCells());if(0==c.length)Q(U.getRoot(),m.copiedValue);else for(P=0;P<c.length;P++)Q(c[P],m.copiedValue)}finally{U.endUpdate()}}},null,null,"Alt+Shift+E");this.addAction("delete",function(F,P){F=null!=P?P:F;null!=F&&mxEvent.isShiftDown(F)?e():b(null!=F&&(mxEvent.isControlDown(F)||mxEvent.isMetaDown(F)||mxEvent.isAltDown(F)))},null,null,"Delete");this.addAction("deleteAll",+mxUtils.bind(this,function(P){m.handleError(P)})):m.writeTextToClipboard(p.getLabel(F),mxUtils.bind(this,function(P){m.handleError(P)}))}catch(P){m.handleError(P)}});this.addAction("pasteData",function(F,P){function Q(f,k){var B=T.getValue(f);k=f.cloneValue(k);k.removeAttribute("placeholders");null==B||isNaN(B.nodeType)||k.setAttribute("placeholders",B.getAttribute("placeholders"));null!=F&&mxEvent.isShiftDown(F)||k.setAttribute("label",p.convertValueToString(f));T.setValue(f,k)}F=null!=P?P:F;var T=+p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedValue){T.beginUpdate();try{var c=p.getEditableCells(p.getSelectionCells());if(0==c.length)Q(T.getRoot(),m.copiedValue);else for(P=0;P<c.length;P++)Q(c[P],m.copiedValue)}finally{T.endUpdate()}}},null,null,"Alt+Shift+E");this.addAction("delete",function(F,P){F=null!=P?P:F;null!=F&&mxEvent.isShiftDown(F)?e():b(null!=F&&(mxEvent.isControlDown(F)||mxEvent.isMetaDown(F)||mxEvent.isAltDown(F)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){e()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{p.setSelectionCells(p.duplicateCells()),p.scrollCellToVisible(p.getSelectionCell())}catch(F){m.handleError(F)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action(mxResources.get("merge"),function(){var F=m.getSelectionState();if(null!=F.mergeCell){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",F.rowspan,[F.mergeCell]),p.setCellStyles("colspan",F.colspan,[F.mergeCell])}finally{p.getModel().endUpdate()}}}));this.put("unmergeCells",new Action(mxResources.get("unmerge"),function(){var F=m.getSelectionState();if(0<F.cells.length){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",null,F.cells),p.setCellStyles("colspan",null,F.cells)}finally{p.getModel().endUpdate()}}}));this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(F,P){F=null!=P?P:F;p.turnShapes(p.getResizableCells(p.getSelectionCells()),null!=F?mxEvent.isShiftDown(F):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R"));this.put("selectConnections",new Action(mxResources.get("selectEdges"),function(F){F=p.getSelectionCell();p.isEnabled()&&null!=F&&p.addSelectionCells(p.getEdges(F))}));this.addAction("selectVertices",function(){p.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){p.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){p.selectAll(null,@@ -2989,14 +2989,14 @@ null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){pfunction(F){p.orderCells(!1,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(F){p.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("group",function(){if(p.isEnabled()){var F=mxUtils.sortCells(p.getSelectionCells(),!0);1!=F.length||p.isTable(F[0])||p.isTableRow(F[0])?(F=p.getCellsForGroup(F),1<F.length&&p.setSelectionCell(p.groupCells(null,0,F))):p.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(p.isEnabled()){var F=p.getEditableCells(p.getSelectionCells());p.model.beginUpdate();try{var P=p.ungroupCells();if(null!=F)for(var Q=0;Q<F.length;Q++)p.model.contains(F[Q])&&(0==p.model.getChildCount(F[Q])&&p.model.isVertex(F[Q])&&p.setCellStyles("container","0",[F[Q]]),P.push(F[Q]))}finally{p.model.endUpdate()}0<P.length&&p.setSelectionCells(P)}},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){if(p.isEnabled()){var F=p.getSelectionCells();if(null!=F){for(var P=[],Q=0;Q<F.length;Q++)p.isTableRow(F[Q])||p.isTableCell(F[Q])||P.push(F[Q]);p.removeCellsFromParent(P);0<P.length&&p.scrollCellToVisible(P[0])}}});this.addAction("edit",function(){p.isEnabled()&&p.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var F=p.getSelectionCell()||p.getModel().getRoot();m.showDataDialog(F)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var P=-"";if(mxUtils.isNode(F.value)){var Q=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&F.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(Q=F.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==Q&&(Q=F.value.getAttribute("tooltip"));null!=Q&&(P=Q)}P=new TextareaDialog(m,mxResources.get("editTooltip")+":",P,function(U){p.setTooltipForCell(F,U)});m.showDialog(P.container,320,200,!0,!0);P.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var F=p.getLinkForCell(p.getSelectionCell());-null!=F&&p.openLink(F)});this.addAction("editLink...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var P=p.getLinkForCell(F,!0)||"";m.showLinkDialog(P,mxResources.get("ok"),function(Q,U,c){p.getModel().beginUpdate();try{p.setLinkForCell(F,0<Q.length?Q:null),p.setAttributeForCell(F,"linkTarget",c)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(F))}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){p.isEnabled()&&-!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),m.actions.get("image").funct())})).isEnabled=A;this.addAction("editImage...",function(){m.actions.get("image").funct()});this.put("insertLink",new Action(mxResources.get("link")+"...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&m.showLinkDialog("",mxResources.get("ok"),function(F,P,Q){F=mxUtils.trim(F);if(0<F.length){var U=null,c=p.getLinkTitle(F);null!=P&&0<P.length&&(U=P[0].iconUrl,c=P[0].name||P[0].type,c=c.charAt(0).toUpperCase()+-c.substring(1),30<c.length&&(c=c.substring(0,30)+"..."));P=new mxCell(c,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=U?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+U:"spacing=10;"));P.vertex=!0;U=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([P],!0));P.geometry.x=U.x;P.geometry.y=U.y;p.setAttributeForCell(P,"linkTarget",Q);p.setLinkForCell(P,F);p.cellSizeUpdated(P,!0);p.getModel().beginUpdate();try{P=p.addCell(P),-p.fireEvent(new mxEventObject("cellsInserted","cells",[P]))}finally{p.getModel().endUpdate()}p.setSelectionCell(P);p.scrollCellToVisible(p.getSelectionCell())}},!0)},null,null,"L")).isEnabled=A;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var F=p.getSelectedElement(),P=p.getParentByName(F,"A",p.cellEditor.textarea),Q="";if(null==P&&null!=F&&null!=F.getElementsByTagName)for(var U=F.getElementsByTagName("a"),c=0;c<U.length&&null==P;c++)U[c].textContent==-F.textContent&&(P=U[c]);null!=P&&"A"==P.nodeName&&(Q=P.getAttribute("href")||"",p.selectNode(P));var f=p.cellEditor.saveSelection();m.showLinkDialog(Q,mxResources.get("ok"),mxUtils.bind(this,function(k){p.cellEditor.restoreSelection(f);null!=k&&p.insertLink(k)}))}else p.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=A;this.addAction("autosize",function(){var F=p.getSelectionCells();if(null!=F){p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=+"";if(mxUtils.isNode(F.value)){var Q=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&F.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(Q=F.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==Q&&(Q=F.value.getAttribute("tooltip"));null!=Q&&(P=Q)}P=new TextareaDialog(m,mxResources.get("editTooltip")+":",P,function(T){p.setTooltipForCell(F,T)});m.showDialog(P.container,320,200,!0,!0);P.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var F=p.getLinkForCell(p.getSelectionCell());+null!=F&&p.openLink(F)});this.addAction("editLink...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var P=p.getLinkForCell(F,!0)||"";m.showLinkDialog(P,mxResources.get("ok"),function(Q,T,c){p.getModel().beginUpdate();try{p.setLinkForCell(F,0<Q.length?Q:null),p.setAttributeForCell(F,"linkTarget",c)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(F))}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){p.isEnabled()&&+!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),m.actions.get("image").funct())})).isEnabled=A;this.addAction("editImage...",function(){m.actions.get("image").funct()});this.put("insertLink",new Action(mxResources.get("link")+"...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&m.showLinkDialog("",mxResources.get("ok"),function(F,P,Q){F=mxUtils.trim(F);if(0<F.length){var T=null,c=p.getLinkTitle(F);null!=P&&0<P.length&&(T=P[0].iconUrl,c=P[0].name||P[0].type,c=c.charAt(0).toUpperCase()++c.substring(1),30<c.length&&(c=c.substring(0,30)+"..."));P=new mxCell(c,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=T?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+T:"spacing=10;"));P.vertex=!0;T=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([P],!0));P.geometry.x=T.x;P.geometry.y=T.y;p.setAttributeForCell(P,"linkTarget",Q);p.setLinkForCell(P,F);p.cellSizeUpdated(P,!0);p.getModel().beginUpdate();try{P=p.addCell(P),+p.fireEvent(new mxEventObject("cellsInserted","cells",[P]))}finally{p.getModel().endUpdate()}p.setSelectionCell(P);p.scrollCellToVisible(p.getSelectionCell())}},!0)},null,null,"L")).isEnabled=A;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var F=p.getSelectedElement(),P=p.getParentByName(F,"A",p.cellEditor.textarea),Q="";if(null==P&&null!=F&&null!=F.getElementsByTagName)for(var T=F.getElementsByTagName("a"),c=0;c<T.length&&null==P;c++)T[c].textContent==+F.textContent&&(P=T[c]);null!=P&&"A"==P.nodeName&&(Q=P.getAttribute("href")||"",p.selectNode(P));var f=p.cellEditor.saveSelection();m.showLinkDialog(Q,mxResources.get("ok"),mxUtils.bind(this,function(k){p.cellEditor.restoreSelection(f);null!=k&&p.insertLink(k)}))}else p.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=A;this.addAction("autosize",function(){var F=p.getSelectionCells();if(null!=F){p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=F[P];p.getModel().isVertex(Q)&&(0<p.getModel().getChildCount(Q)?p.updateGroupBounds([Q],0,!0):p.updateCellSize(Q))}}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("snapToGrid",function(){p.snapCellsToGrid(p.getSelectionCells(),p.gridSize)});this.addAction("formattedText",function(){p.stopEditing();var F=p.getCommonStyle(p.getSelectionCells());F="1"==mxUtils.getValue(F,"html","0")?null:"1";p.getModel().beginUpdate();try{for(var P=p.getEditableCells(p.getSelectionCells()),-Q=0;Q<P.length;Q++)if(state=p.getView().getState(P[Q]),null!=state){var U=mxUtils.getValue(state.style,"html","0");if("1"==U&&null==F)p.removeTextStyleForCell(state.cell),p.setCellStyles("html",F,[P[Q]]);else if("0"==U&&"1"==F){var c=mxUtils.htmlEntities(p.convertValueToString(state.cell),!1);"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>"));p.cellLabelChanged(state.cell,Graph.sanitizeHtml(c));p.setCellStyles("html",F,[P[Q]])}}m.fireEvent(new mxEventObject("styleChanged",+Q=0;Q<P.length;Q++)if(state=p.getView().getState(P[Q]),null!=state){var T=mxUtils.getValue(state.style,"html","0");if("1"==T&&null==F)p.removeTextStyleForCell(state.cell),p.setCellStyles("html",F,[P[Q]]);else if("0"==T&&"1"==F){var c=mxUtils.htmlEntities(p.convertValueToString(state.cell),!1);"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>"));p.cellLabelChanged(state.cell,Graph.sanitizeHtml(c));p.setCellStyles("html",F,[P[Q]])}}m.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=F?F:"0"],"cells",P))}finally{p.getModel().endUpdate()}});this.addAction("wordWrap",function(){var F=p.getView().getState(p.getSelectionCell()),P="wrap";p.stopEditing();null!=F&&"wrap"==F.style[mxConstants.STYLE_WHITE_SPACE]&&(P=null);p.setCellStyles(mxConstants.STYLE_WHITE_SPACE,P)});this.addAction("rotation",function(){var F="0",P=p.getView().getState(p.getSelectionCell());null!=P&&(F=P.style[mxConstants.STYLE_ROTATION]||F);F=new FilenameDialog(m,F,mxResources.get("apply"),function(Q){null!=Q&&0<Q.length&&p.setCellStyles(mxConstants.STYLE_ROTATION,Q)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");m.showDialog(F.container,375,80,!0,!0);F.init()});this.addAction("resetView",function(){p.zoomTo(1);m.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(F){p.isFastZoomEnabled()?p.lazyZoom(!0,!0,m.buttonZoomDelay):p.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(F){p.isFastZoomEnabled()?p.lazyZoom(!1,!0,m.buttonZoomDelay):p.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){p.pageVisible&&p.isSelectionEmpty()?p.fitPages():m.fitDiagramToWindow()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(2):this.get("pageView").funct()}),@@ -3007,9 +3007,9 @@ G.setEnabled(!1);G=this.addAction("animations",function(){Editor.enableAnimationG=this.addAction("collapseExpand",function(){var F=new ChangePageSetup(m);F.ignoreColor=!0;F.ignoreImage=!0;F.foldingEnabled=!p.foldingEnabled;p.model.execute(F)});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.foldingEnabled});G.isEnabled=A;G=this.addAction("pageView",mxUtils.bind(this,function(){m.setPageVisible(!p.pageVisible)}));G.setToggleAction(!0);G.setSelectedCallback(function(){return p.pageVisible});G=this.addAction("connectionArrows",function(){p.connectionArrowsEnabled=!p.connectionArrowsEnabled;m.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionArrowsEnabled});G=this.addAction("connectionPoints",function(){p.setConnectable(!p.connectionHandler.isEnabled());m.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+O");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionHandler.isEnabled()});G=this.addAction("copyConnect",function(){p.connectionHandler.setCreateTarget(!p.connectionHandler.isCreateTarget());m.fireEvent(new mxEventObject("copyConnectChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionHandler.isCreateTarget()});G.isEnabled=A;G=this.addAction("autosave",function(){m.editor.setAutosave(!m.editor.autosave)});G.setToggleAction(!0);G.setSelectedCallback(function(){return m.editor.autosave});G.isEnabled=A;G.visible=!1;this.addAction("help",function(){var F="";mxResources.isLanguageSupported(mxClient.language)&&-(F="_"+mxClient.language);p.openLink(RESOURCES_PATH+"/help"+F+".html")});var T=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){T||(m.showDialog((new AboutDialog(m)).container,320,280,!0,!0,function(){T=!1}),T=!0)}));G=mxUtils.bind(this,function(F,P,Q,U){return this.addAction(F,function(){if(null!=Q&&p.cellEditor.isContentEditing())Q();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var c=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,+(F="_"+mxClient.language);p.openLink(RESOURCES_PATH+"/help"+F+".html")});var S=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){S||(m.showDialog((new AboutDialog(m)).container,320,280,!0,!0,function(){S=!1}),S=!0)}));G=mxUtils.bind(this,function(F,P,Q,T){return this.addAction(F,function(){if(null!=Q&&p.cellEditor.isContentEditing())Q();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var c=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,P,c);(P&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?p.updateLabelElements(c,function(k){k.style.fontWeight=null;"B"==k.nodeName&&p.replaceElement(k)}):(P&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?p.updateLabelElements(c,function(k){k.style.fontStyle=null;"I"==k.nodeName&&p.replaceElement(k)}):(P&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&p.updateLabelElements(c,function(k){k.style.textDecoration=null;"U"==k.nodeName&&p.replaceElement(k)});for(var f=0;f<c.length;f++)0==p.model.getChildCount(c[f])&&-p.autoSizeCell(c[f],!1)}finally{p.getModel().endUpdate()}}},null,null,U)});G("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");G("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");G("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){m.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000",+p.autoSizeCell(c[f],!1)}finally{p.getModel().endUpdate()}}},null,null,T)});G("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");G("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");G("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){m.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",p.shapeForegroundColor)});this.addAction("strokeColor...",function(){m.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("fillColor...",function(){m.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",p.shapeBackgroundColor)});this.addAction("gradientColor...",function(){m.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("backgroundColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor",null,"default",p.shapeBackgroundColor)});this.addAction("borderColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("removeFormat",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&!p.isEditing()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),P=0;P<F.length;P++)p.removeTextStyleForCell(F[P],!0)}finally{p.getModel().endUpdate()}}});this.addAction("vertical",function(){m.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){m.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,null),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dashed",function(){p.getModel().beginUpdate();@@ -3019,16 +3019,16 @@ this.addAction("rounded",function(){p.getModel().beginUpdate();try{p.setCellStylQ="1"==mxUtils.getValue(P,mxConstants.STYLE_ROUNDED,"0")?"0":"1";p.setCellStyles(mxConstants.STYLE_ROUNDED,Q);p.setCellStyles(mxConstants.STYLE_CURVED,null);m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[Q,"0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}}});this.addAction("curved",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,"1"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("collapsible",function(){var F=p.view.getState(p.getSelectionCell()),P="1";null!=F&&null!=p.getFoldingImage(F)&&(P="0");p.setCellStyles("collapsible",P);m.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[P],"cells",p.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var F=p.getEditableCells(p.getSelectionCells());if(null!=F&&0<F.length){var P=p.getModel();P=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",P.getStyle(F[0])||"",function(Q){null!=Q&&p.setCellStyle(mxUtils.trim(Q),F)},null,null,400,220);this.editorUi.showDialog(P.container,420,300,!0,!0);P.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){p.isEnabled()&&!p.isSelectionEmpty()&&m.setDefaultStyle(p.getSelectionCell())},-null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&m.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var F=p.getSelectionCell();if(null!=F&&p.getModel().isEdge(F)){var P=v.graph.selectionCellsHandler.getHandler(F);if(P instanceof mxEdgeHandler){var Q=p.view.translate,U=p.view.scale,c=Q.x;Q=Q.y;F=p.getModel().getParent(F);for(var f=p.getCellGeometry(F);p.getModel().isVertex(F)&&null!=f;)c+=f.x,Q+=f.y,F=-p.getModel().getParent(F),f=p.getCellGeometry(F);c=Math.round(p.snap(p.popupMenuHandler.triggerX/U-c));U=Math.round(p.snap(p.popupMenuHandler.triggerY/U-Q));P.addPointAt(P.state,c,U)}}});this.addAction("removeWaypoint",function(){var F=m.actions.get("removeWaypoint");null!=F.handler&&F.handler.removePoint(F.handler.state,F.index)});this.addAction("clearAnchors",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=-F[P];p.getModel().isEdge(Q)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[Q]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[Q]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[Q]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[Q]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=F[P];if(p.getModel().isEdge(Q)){var U=p.getCellGeometry(Q);-null!=U&&(U=U.clone(),U.points=null,U.x=0,U.y=0,U.offset=null,p.getModel().setGeometry(Q,U))}}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+R");G=this.addAction("subscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");G=this.addAction("superscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");G=this.addAction("decreaseFontSize",+null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&m.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var F=p.getSelectionCell();if(null!=F&&p.getModel().isEdge(F)){var P=v.graph.selectionCellsHandler.getHandler(F);if(P instanceof mxEdgeHandler){var Q=p.view.translate,T=p.view.scale,c=Q.x;Q=Q.y;F=p.getModel().getParent(F);for(var f=p.getCellGeometry(F);p.getModel().isVertex(F)&&null!=f;)c+=f.x,Q+=f.y,F=+p.getModel().getParent(F),f=p.getCellGeometry(F);c=Math.round(p.snap(p.popupMenuHandler.triggerX/T-c));T=Math.round(p.snap(p.popupMenuHandler.triggerY/T-Q));P.addPointAt(P.state,c,T)}}});this.addAction("removeWaypoint",function(){var F=m.actions.get("removeWaypoint");null!=F.handler&&F.handler.removePoint(F.handler.state,F.index)});this.addAction("clearAnchors",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=+F[P];p.getModel().isEdge(Q)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[Q]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[Q]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[Q]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[Q]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=F[P];if(p.getModel().isEdge(Q)){var T=p.getCellGeometry(Q);+null!=T&&(T=T.clone(),T.points=null,T.x=0,T.y=0,T.offset=null,p.getModel().setGeometry(Q,T))}}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+R");G=this.addAction("subscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");G=this.addAction("superscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");G=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var F=p.getCurrentCellStyle(p.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,F-1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift + (Numpad)");G=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var F=p.getCurrentCellStyle(p.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,-mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,F+1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift - (Numpad)");this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=mxResources.get("image")+" ("+mxResources.get("url")+"):",P=p.getView().getState(p.getSelectionCell()),Q="",U=null;null!=P&&(Q=P.style[mxConstants.STYLE_IMAGE]||Q,U=P.style[mxConstants.STYLE_CLIP_PATH]||U);var c=p.cellEditor.saveSelection();-m.showImageDialog(F,Q,function(f,k,B,z,C,H){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(c),p.insertImage(f,k,B);else{var K=p.getSelectionCells();if(null!=f&&(0<f.length||0<K.length)){var M=null;p.getModel().beginUpdate();try{if(0==K.length){K=[p.insertVertex(p.getDefaultParent(),null,"",0,0,k,B,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var O=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(K,!0));K[0].geometry.x=O.x;K[0].geometry.y=-O.y;null!=z&&g(K[0],z,C,H,p);M=K;p.fireEvent(new mxEventObject("cellsInserted","cells",M))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<f.length?f:null,K);var ea=p.getCurrentCellStyle(K[0]);"image"!=ea[mxConstants.STYLE_SHAPE]&&"label"!=ea[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",K):0==f.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,K);null==z&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,K);if(null!=k&&null!=B)for(f=0;f<K.length;f++){var fa=K[f];if("0"!=p.getCurrentCellStyle(fa).expand){var S=-p.getModel().getGeometry(fa);null!=S&&(S=S.clone(),S.width=k,S.height=B,p.getModel().setGeometry(fa,S))}null!=z&&g(fa,z,C,H,p)}}finally{p.getModel().endUpdate()}null!=M&&(p.setSelectionCells(M),p.scrollCellToVisible(M[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,U)}}).isEnabled=A;this.addAction("crop...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F){var P=p.getCurrentCellStyle(F),Q=P[mxConstants.STYLE_IMAGE],-U=P[mxConstants.STYLE_SHAPE];Q&&"image"==U&&(P=new CropImageDialog(m,Q,P[mxConstants.STYLE_CLIP_PATH],function(c,f,k){g(F,c,f,k,p)}),m.showDialog(P.container,300,390,!0,!0))}}).isEnabled=A;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(m,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",+mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,F+1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift - (Numpad)");this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=mxResources.get("image")+" ("+mxResources.get("url")+"):",P=p.getView().getState(p.getSelectionCell()),Q="",T=null;null!=P&&(Q=P.style[mxConstants.STYLE_IMAGE]||Q,T=P.style[mxConstants.STYLE_CLIP_PATH]||T);var c=p.cellEditor.saveSelection();+m.showImageDialog(F,Q,function(f,k,B,z,C,I){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(c),p.insertImage(f,k,B);else{var L=p.getSelectionCells();if(null!=f&&(0<f.length||0<L.length)){var J=null;p.getModel().beginUpdate();try{if(0==L.length){L=[p.insertVertex(p.getDefaultParent(),null,"",0,0,k,B,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var O=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(L,!0));L[0].geometry.x=O.x;L[0].geometry.y=+O.y;null!=z&&g(L[0],z,C,I,p);J=L;p.fireEvent(new mxEventObject("cellsInserted","cells",J))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<f.length?f:null,L);var da=p.getCurrentCellStyle(L[0]);"image"!=da[mxConstants.STYLE_SHAPE]&&"label"!=da[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",L):0==f.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,L);null==z&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,L);if(null!=k&&null!=B)for(f=0;f<L.length;f++){var fa=L[f];if("0"!=p.getCurrentCellStyle(fa).expand){var V=+p.getModel().getGeometry(fa);null!=V&&(V=V.clone(),V.width=k,V.height=B,p.getModel().setGeometry(fa,V))}null!=z&&g(fa,z,C,I,p)}}finally{p.getModel().endUpdate()}null!=J&&(p.setSelectionCells(J),p.scrollCellToVisible(J[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,T)}}).isEnabled=A;this.addAction("crop...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F){var P=p.getCurrentCellStyle(F),Q=P[mxConstants.STYLE_IMAGE],+T=P[mxConstants.STYLE_SHAPE];Q&&"image"==T&&(P=new CropImageDialog(m,Q,P[mxConstants.STYLE_CLIP_PATH],function(c,f,k){g(F,c,f,k,p)}),m.showDialog(P.container,300,390,!0,!0))}}).isEnabled=A;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(m,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){m.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));G=this.addAction("format",mxUtils.bind(this,function(){m.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return m.isFormatPanelVisible()}));G=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(m,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){m.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editConnectionPoints...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F&&null!=F.geometry){var P=@@ -3042,25 +3042,25 @@ DrawioFile.prototype.synchronizeFile=function(b,e){if(this.savingFile)null!=e&&efunction(A){g&&(window.clearTimeout(m),this.sync.cleanup(b,e,A))}),v,p):this.updateFile(mxUtils.bind(this,function(){g&&(window.clearTimeout(m),null!=b&&b())}),v,p)}};DrawioFile.prototype.updateFile=function(b,e,g,m,v){null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():this.getLatestVersion(mxUtils.bind(this,function(p){try{null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[p]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():null!=p?this.mergeFile(p,b,e,m,v):this.reloadFile(b,e))}catch(A){null!=e&&e(A)}}),e))};-DrawioFile.prototype.mergeFile=function(b,e,g,m,v){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var A=this.getShadowPages(),G=[this.ui.diffPages(null!=m?m:A,p)],T=this.ignorePatches(G);if(T)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",T),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(A,-this.isRealtime()?this.ownPages:this.ui.pages):null,P=this.ui.patchPages(this.ui.clonePages(A),G[0]),Q=this.ui.getHashValueForPages(P,{}),U=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",A,"pages",p,"patched",P,"patches",G,"changes",F,"checksum",Q,"current",U,"valid",Q==U,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=Q&&Q!=U)this.checksumError(g,G,null,null,"mergeFile",-Q,U,b.getCurrentRevisionId());else{this.setShadowPages(p);if(null!=this.sync){var c=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?F:null,null,v);null==c||mxUtils.isEmptyObject(c)||G.push(c)}this.patch(G,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=e&&e()}}catch(B){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=g&&g(B);try{var f=this.getCurrentUser(),k=null!=f?+DrawioFile.prototype.mergeFile=function(b,e,g,m,v){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var A=this.getShadowPages(),G=[this.ui.diffPages(null!=m?m:A,p)],S=this.ignorePatches(G);if(S)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",S),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(A,+this.isRealtime()?this.ownPages:this.ui.pages):null,P=this.ui.patchPages(this.ui.clonePages(A),G[0]),Q=this.ui.getHashValueForPages(P,{}),T=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",A,"pages",p,"patched",P,"patches",G,"changes",F,"checksum",Q,"current",T,"valid",Q==T,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=Q&&Q!=T)this.checksumError(g,G,null,null,"mergeFile",+Q,T,b.getCurrentRevisionId());else{this.setShadowPages(p);if(null!=this.sync){var c=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?F:null,null,v);null==c||mxUtils.isEmptyObject(c)||G.push(c)}this.patch(G,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=e&&e()}}catch(B){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=g&&g(B);try{var f=this.getCurrentUser(),k=null!=f?f.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),k,B)}catch(z){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(B){null!=g&&g(B)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var e=new mxCodec(mxUtils.createXmlDocument()),g=e.document.createElement("mxfile");if(null!=b)for(var m=0;m<b.length;m++){var v=e.encode(new mxGraphModel(b[m].root));"1"!=urlParams.dev&&(v=this.ui.anonymizeNode(v,!0));v.setAttribute("id",b[m].getId());b[m].viewState&&this.ui.editor.graph.saveViewState(b[m].viewState,v,!0);g.appendChild(v)}return mxUtils.getPrettyXml(g)};DrawioFile.prototype.compressReportData=function(b,e,g){e=null!=e?e:1E4;null!=g&&null!=b&&b.length>g?b=b.substring(0,g)+"[...]":null!=b&&b.length>e&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,e,g,m,v,p,A,G){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var T=this.getCurrentUser(),F=null!=T?T.id:"unknown",P=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",Q=JSON.stringify(e).length,U=null;if(null!=e&&1E3>Q){for(b=0;b<e.length;b++)this.ui.anonymizePatch(e[b]);U=JSON.stringify(e);U=null!=U&&1E3>U.length?Graph.compress(U):-null}this.getLatestVersion(mxUtils.bind(this,function(c){try{var f=null!=U?"report":"error",k=this.ui.getHashValueForPages(c.getShadowPages()),B="unknown",z="unknown",C="unknown";try{var H=null!=c.initialData&&0<c.initialData.length?mxUtils.parseXml(c.initialData).documentElement:null;null!=H&&(null!=H.getAttribute("version")&&(B=H.getAttribute("version")),null!=H.getAttribute("agent")&&(z=H.getAttribute("agent")),null!=H.getAttribute("type")&&(C=H.getAttribute("type")))}catch(K){}EditorUi.logError("Checksum "+-f+" in "+v,null,this.getMode()+"."+P,"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+e.length+(null!=U?"-json_"+U:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=A?"-current_"+A:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=k?"-latest_"+k:"")+"-latestRev_"+this.ui.hashValue(c.getCurrentRevisionId())+("-latestVersion_"+B)+("-latestAgent_"+z)+("-latestType_"+C));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+P,action:v,label:"user_"+-F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+e.length+"-size_"+this.getSize()})}catch(K){}}),function(){})}catch(c){}};-DrawioFile.prototype.sendErrorReport=function(b,e,g,m){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),A=this.getCurrentUser(),G=null!=A?this.ui.hashValue(A.id):"unknown",T=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",F=this.getTitle(),P=F.lastIndexOf(".");A="xml";0<P&&(A=F.substring(P));var Q=null!=g?g.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+-":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+A+")\nUser="+G+T+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:-"")+(null!=g?"\n\nError: "+g.message:"")+"\n\nStack:\n"+Q+"\n\nShadow:\n"+v+"\n\nData:\n"+p,m)}catch(U){}};+DrawioFile.prototype.checksumError=function(b,e,g,m,v,p,A,G){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var S=this.getCurrentUser(),F=null!=S?S.id:"unknown",P=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",Q=JSON.stringify(e).length,T=null;if(null!=e&&1E3>Q){for(b=0;b<e.length;b++)this.ui.anonymizePatch(e[b]);T=JSON.stringify(e);T=null!=T&&1E3>T.length?Graph.compress(T):+null}this.getLatestVersion(mxUtils.bind(this,function(c){try{var f=null!=T?"report":"error",k=this.ui.getHashValueForPages(c.getShadowPages()),B="unknown",z="unknown",C="unknown";try{var I=null!=c.initialData&&0<c.initialData.length?mxUtils.parseXml(c.initialData).documentElement:null;null!=I&&(null!=I.getAttribute("version")&&(B=I.getAttribute("version")),null!=I.getAttribute("agent")&&(z=I.getAttribute("agent")),null!=I.getAttribute("type")&&(C=I.getAttribute("type")))}catch(L){}EditorUi.logError("Checksum "++f+" in "+v,null,this.getMode()+"."+P,"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+e.length+(null!=T?"-json_"+T:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=A?"-current_"+A:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=k?"-latest_"+k:"")+"-latestRev_"+this.ui.hashValue(c.getCurrentRevisionId())+("-latestVersion_"+B)+("-latestAgent_"+z)+("-latestType_"+C));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+P,action:v,label:"user_"++F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+e.length+"-size_"+this.getSize()})}catch(L){}}),function(){})}catch(c){}};+DrawioFile.prototype.sendErrorReport=function(b,e,g,m){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),A=this.getCurrentUser(),G=null!=A?this.ui.hashValue(A.id):"unknown",S=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",F=this.getTitle(),P=F.lastIndexOf(".");A="xml";0<P&&(A=F.substring(P));var Q=null!=g?g.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+A+")\nUser="+G+S+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:+"")+(null!=g?"\n\nError: "+g.message:"")+"\n\nStack:\n"+Q+"\n\nShadow:\n"+v+"\n\nData:\n"+p,m)}catch(T){}};DrawioFile.prototype.reloadFile=function(b,e){try{this.stats.fileReloaded++;var g=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),m=this.ui.editor.graph,v=m.getSelectionCells(),p=m.getViewState(),A=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(G){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[g],"viewState",[p],"latestFile",G);null!=G?(this.ui.replaceFileData(G.getData(),-[g]),this.ui.restoreViewState(A,p,v),this.setDescriptor(G.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var T=this.ui.getCurrentFile();null!=T&&(T.stats=this.stats,T.patch([g]),T.fileChanged());this.ui.restoreViewState(A,p,v);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(G){null!=e&&e(G)}};+[g]),this.ui.restoreViewState(A,p,v),this.setDescriptor(G.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var S=this.ui.getCurrentFile();null!=S&&(S.stats=this.stats,S.patch([g]),S.fileChanged());this.ui.restoreViewState(A,p,v);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(G){null!=e&&e(G)}};DrawioFile.prototype.copyFile=function(b,e){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var e=!0;if(null!=b)for(var g=0;g<b.length&&e;g++)e=e&&mxUtils.isEmptyObject(b[g]);return e};-DrawioFile.prototype.patch=function(b,e,g,m){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),A=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var T=this.changeListenerEnabled;this.changeListenerEnabled=g;var F=G.foldingEnabled,P=G.mathEnabled,Q=G.cellRenderer.redraw;G.cellRenderer.redraw=function(z){z.view.graph.isEditing(z.cell)&&(z.view.graph.scrollCellToVisible(z.cell),z.view.graph.cellEditor.resize());Q.apply(this,arguments)};G.model.beginUpdate();-try{if(g){for(var U=this.ui.pages.slice(),c=this.ui.currentPage,f=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified()),k=0;k<f.length;k++){var B=mxUtils.indexOf(this.ui.pages,f[k]);0>B?this.ui.insertPage(f[k],Math.min(k,this.ui.pages.length)):this.ui.movePage(B,k)}for(k=0;k<U.length;k++)0>mxUtils.indexOf(f,U[k])&&this.ui.removePage(U[k]);0<=mxUtils.indexOf(this.ui.pages,c)&&this.ui.selectPage(c,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified());0==this.ui.pages.length&&-this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);G.checkDefaultParent()}finally{G.container.style.visibility="";G.model.endUpdate();G.cellRenderer.redraw=Q;this.changeListenerEnabled=T;g||(v.history=p,v.indexOfNextAdd=A,v.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)P!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):(F!=G.foldingEnabled?+DrawioFile.prototype.patch=function(b,e,g,m){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),A=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var S=this.changeListenerEnabled;this.changeListenerEnabled=g;var F=G.foldingEnabled,P=G.mathEnabled,Q=G.cellRenderer.redraw;G.cellRenderer.redraw=function(z){z.view.graph.isEditing(z.cell)&&(z.view.graph.scrollCellToVisible(z.cell),z.view.graph.cellEditor.resize());Q.apply(this,arguments)};G.model.beginUpdate();+try{if(g){for(var T=this.ui.pages.slice(),c=this.ui.currentPage,f=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified()),k=0;k<f.length;k++){var B=mxUtils.indexOf(this.ui.pages,f[k]);0>B?this.ui.insertPage(f[k],Math.min(k,this.ui.pages.length)):this.ui.movePage(B,k)}for(k=0;k<T.length;k++)0>mxUtils.indexOf(f,T[k])&&this.ui.removePage(T[k]);0<=mxUtils.indexOf(this.ui.pages,c)&&this.ui.selectPage(c,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified());0==this.ui.pages.length&&+this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);G.checkDefaultParent()}finally{G.container.style.visibility="";G.model.endUpdate();G.cellRenderer.redraw=Q;this.changeListenerEnabled=S;g||(v.history=p,v.indexOfNextAdd=A,v.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)P!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):(F!=G.foldingEnabled?G.view.revalidate():G.view.validate(),G.sizeDidChange());null!=this.sync&&this.isRealtime()&&!m&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",e,"undoable",g)}return b};DrawioFile.prototype.save=function(b,e,g,m,v,p){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",m,"overwrite",v,"manual",p,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=g)g({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=e&&e();else if(null!=g)g({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(A){if(null!=g)g(A);else throw A;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var e=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=e&&(e.viewState=this.ui.editor.graph.getViewState(),e.needsUpdate=!0)}e=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return e};@@ -3111,7 +3111,7 @@ DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=newmxUtils.bind(this,function(e){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(e){this.handleFileError(e)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var e=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(e,mxUtils.bind(this,function(g){EditorUi.debug("DrawioFile.createSecret",[this],"secret",e,"token",g);b(e,g)}),mxUtils.bind(this,function(){b(e)})):b(e)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};DrawioFile.prototype.fileSaved=function(b,e,g,m,v,p,A){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;p=null!=p?p:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(p),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=g&&g()):this.sync.fileSaved(p,e,g,m,v,A)}catch(F){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=m&&m(F);try{var G=this.getCurrentUser(),T=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),T,F)}catch(P){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(F){this.descriptorChanged(),null!=m&&m(F)}};+this.inConflictState=!0;this.descriptorChanged();null!=m&&m(F);try{var G=this.getCurrentUser(),S=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),S,F)}catch(P){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(F){this.descriptorChanged(),null!=m&&m(F)}};DrawioFile.prototype.autosave=function(b,e,g,m){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<e?b:0;this.clearAutosave();var p=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==p&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var A=this.isAutosaveRevision();A&&(this.lastAutosaveRevision=(new Date).getTime());this.save(A,mxUtils.bind(this,function(G){this.autosaveCompleted();null!=g&&g(G)}),mxUtils.bind(this,function(G){null!=m&&m(G)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=g&&g(null)}catch(G){null!=m&&m(G)}}),v);this.autosaveThread=p;EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"delay",b,"maxDelay",e,"actualDelay",v,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};@@ -3120,10 +3120,10 @@ DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(thisDrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,e){b([])};DrawioFile.prototype.addComment=function(b,e,g){e(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,e){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,e)};LocalFile=function(b,e,g,m,v,p,A){DrawioFile.call(this,b,e);this.title=g;this.mode=m?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=p;this.editable=A};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,e,g,m,v){this.saveAs(this.title,e,g,m,v)};LocalFile.prototype.saveAs=function(b,e,g,m,v){this.saveFile(b,!1,e,g,null,m,v)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,e){null==this.fileHandle?null!=e&&e({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,e)};-LocalFile.prototype.saveFile=function(b,e,g,m,v,p,A){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var T=this.getData(),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=g&&g()}),P=mxUtils.bind(this,function(Q){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var U=mxUtils.bind(this,function(f){this.savingFile=!1;null!=m&&m({error:f})});this.saveDraft(T);this.fileHandle.createWritable().then(mxUtils.bind(this,function(f){this.fileHandle.getFile().then(mxUtils.bind(this,function(k){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[k],"conflict",this.desc.lastModified!=k.lastModified);A||this.desc.lastModified==k.lastModified?f.write(G?this.ui.base64ToBlob(Q,"image/png"):Q).then(mxUtils.bind(this,function(){f.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(B){try{var z=this.desc;this.savingFile=!1;this.desc=B;this.fileSaved(T,z,F,U);this.removeDraft()}catch(C){U(C)}}),U)}),U)}),U):(this.inConflictState=!0,U())}),mxUtils.bind(this,function(k){this.invalidFileHandle=!0;U(k)}))}),U)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(Q,b,G?"image/png":"text/xml",G);else if(Q.length<MAX_REQUEST_SIZE){var c=b.lastIndexOf(".");c=0<c?b.substring(c+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+c+"&xml="+encodeURIComponent(Q)+"&filename="+encodeURIComponent(b)+(G?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Q)}));F()}});G?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(Q){P(Q)}),m,this.ui.getCurrentFile()!=this?T:null,e.scale,e.border)):P(T)};+LocalFile.prototype.saveFile=function(b,e,g,m,v,p,A){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var S=this.getData(),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=g&&g()}),P=mxUtils.bind(this,function(Q){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var T=mxUtils.bind(this,function(f){this.savingFile=!1;null!=m&&m({error:f})});this.saveDraft(S);this.fileHandle.createWritable().then(mxUtils.bind(this,function(f){this.fileHandle.getFile().then(mxUtils.bind(this,function(k){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[k],"conflict",this.desc.lastModified!=k.lastModified);A||this.desc.lastModified==k.lastModified?f.write(G?this.ui.base64ToBlob(Q,"image/png"):Q).then(mxUtils.bind(this,function(){f.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(B){try{var z=this.desc;this.savingFile=!1;this.desc=B;this.fileSaved(S,z,F,T);this.removeDraft()}catch(C){T(C)}}),T)}),T)}),T):(this.inConflictState=!0,T())}),mxUtils.bind(this,function(k){this.invalidFileHandle=!0;T(k)}))}),T)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(Q,b,G?"image/png":"text/xml",G);else if(Q.length<MAX_REQUEST_SIZE){var c=b.lastIndexOf(".");c=0<c?b.substring(c+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+c+"&xml="+encodeURIComponent(Q)+"&filename="+encodeURIComponent(b)+(G?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Q)}));F()}});G?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(Q){P(Q)}),m,this.ui.getCurrentFile()!=this?S:null,e.scale,e.border)):P(S)};LocalFile.prototype.rename=function(b,e,g){this.title=b;this.descriptorChanged();null!=e&&e()};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinCommentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEyLjUgMjcuNWgyM3YtMi4yNWgtMjNabTAtNi4zNWgyM3YtMi4zaC0yM1ptMC02LjRoMjNWMTIuNWgtMjNaTTQzIDQyLjEgMzUuOSAzNWgtMjhxLTEuMTUgMC0yLjAyNS0uODc1VDUgMzIuMVY3LjlxMC0xLjE1Ljg3NS0yLjAyNVQ3LjkgNWgzMi4ycTEuMiAwIDIuMDUuODc1UTQzIDYuNzUgNDMgNy45Wk03LjI1IDcuOXYyNC44NUgzNi45bDMuODUgMy44NVY3LjlxMC0uMy0uMTc1LS40NzVUNDAuMSA3LjI1SDcuOXEtLjMgMC0uNDc1LjE3NVQ3LjI1IDcuOVptMCAwdjI4LjdWNy4yNSA3LjlaIi8+PC9zdmc+";Editor.thinDesignImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";@@ -3195,102 +3195,102 @@ type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"floatdispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(l,t){return t.editorUi.editor.graph.isCellConnectable(0<l.vertices.length&&0==l.edges.length?l.vertices[0]:null)},isVisible:function(l,t){return 0<l.vertices.length&&0==l.edges.length}},{name:"allowArrows",dispName:"Allow Arrows",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"perimeter",dispName:"Perimeter",defVal:"none",type:"enum",enumList:[{val:"none",dispName:"None"},{val:"rectanglePerimeter",dispName:"Rectangle"},{val:"ellipsePerimeter",dispName:"Ellipse"},{val:"rhombusPerimeter",dispName:"Rhombus"},{val:"trianglePerimeter",dispName:"Triangle"},{val:"hexagonPerimeter2",dispName:"Hexagon"},{val:"lifelinePerimeter",dispName:"Lifeline"},{val:"orthogonalPerimeter",dispName:"Orthogonal"},{val:"backbonePerimeter",dispName:"Backbone"},{val:"calloutPerimeter",dispName:"Callout"},{val:"parallelogramPerimeter",dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},{val:"stepPerimeter",dispName:"Step"},{val:"centerPerimeter",dispName:"Center"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",getDefaultValue:function(l,t){l=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;return null!=l&&t.isSwimlane(l)},isVisible:function(l,t){return 1==l.vertices.length&&-0==l.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(l,t){l=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;return null!=l&&(t.isSwimlane(l)||0<t.model.getChildCount(l))},isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(l,t){var I=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;-return null!=I&&(t.isContainer(I)&&"0"!=l.style.collapsible||!t.isContainer(I)&&"1"==l.style.collapsible)},isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length&&!t.editorUi.editor.graph.isSwimlane(l.vertices[0])&&null==mxUtils.getValue(l.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",+0==l.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(l,t){l=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;return null!=l&&(t.isSwimlane(l)||0<t.model.getChildCount(l))},isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(l,t){var H=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;+return null!=H&&(t.isContainer(H)&&"0"!=l.style.collapsible||!t.isContainer(H)&&"1"==l.style.collapsible)},isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length&&!t.editorUi.editor.graph.isSwimlane(l.vertices[0])&&null==mxUtils.getValue(l.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(l,t){t=t.editorUi.editor.graph.model;return 0<l.vertices.length?t.isVertex(t.getParent(l.vertices[0])):!1}},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"movableLabel",dispName:"Movable Label",type:"bool",defVal:!1,isVisible:function(l,t){l=0<l.vertices.length?t.editorUi.editor.graph.getCellGeometry(l.vertices[0]):null;return null!=l&&!l.relative}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"autosizeGrid",dispName:"Autosize Grid",type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"1",dispName:"Enabled"},{val:"0",dispName:"Disabled"}],isVisible:function(l,t){return 0<l.vertices.length&&t.editorUi.editor.graph.isAutoSizeCell(l.vertices[0])}},{name:"fixedWidth",dispName:"Fixed Width",type:"bool",defVal:!1},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",-type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(l,t){var I=mxUtils.getValue(l.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||t.editorUi.editor.graph.isSwimlane(l.vertices[0])||null==I||I==mxConstants.NONE||0==mxUtils.getValue(l.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(l.style,mxConstants.STYLE_OPACITY,100)||null!=l.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",+type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(l,t){var H=mxUtils.getValue(l.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||t.editorUi.editor.graph.isSwimlane(l.vertices[0])||null==H||H==mxConstants.NONE||0==mxUtils.getValue(l.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(l.style,mxConstants.STYLE_OPACITY,100)||null!=l.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",type:"bool",defVal:!1,isVisible:function(l,t){return 0<l.vertices.length&&t.editorUi.editor.graph.isContainer(l.vertices[0])}}].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart or a JSON string as used in\n## Layout, Apply. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.createRoughCanvas=function(l){var t=rough.canvas({getContext:function(){return l}});t.draw=function(I){var V=I.sets||[];I=I.options||this.getDefaultOptions();for(var J=0;J<V.length;J++){var W=V[J];switch(W.type){case "path":null!=I.stroke&&this._drawToContext(l,W,I);break;case "fillPath":this._drawToContext(l,W,I);break;case "fillSketch":this.fillSketch(l,W,I)}}};t.fillSketch=function(I,V,J){var W=l.state.strokeColor,Y=l.state.strokeWidth,ba=l.state.strokeAlpha,ja=l.state.dashed,oa=J.fillWeight;-0>oa&&(oa=J.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(J.fill||"");l.setStrokeWidth(oa);l.setDashed(!1);this._drawToContext(I,V,J);l.setDashed(ja);l.setStrokeWidth(Y);l.setStrokeColor(W);l.setStrokeAlpha(ba)};t._drawToContext=function(I,V,J){I.begin();for(var W=0;W<V.ops.length;W++){var Y=V.ops[W],ba=Y.data;switch(Y.op){case "move":I.moveTo(ba[0],ba[1]);break;case "bcurveTo":I.curveTo(ba[0],ba[1],ba[2],ba[3],ba[4],ba[5]);break;case "lineTo":I.lineTo(ba[0],ba[1])}}I.end();-"fillPath"===V.type&&J.filled?I.fill():I.stroke()};return t};(function(){function l(W,Y,ba){this.canvas=W;this.rc=Y;this.shape=ba;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,l.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,l.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,l.prototype.rect);this.originalRoundrect=this.canvas.roundrect;+Editor.createRoughCanvas=function(l){var t=rough.canvas({getContext:function(){return l}});t.draw=function(H){var U=H.sets||[];H=H.options||this.getDefaultOptions();for(var K=0;K<U.length;K++){var W=U[K];switch(W.type){case "path":null!=H.stroke&&this._drawToContext(l,W,H);break;case "fillPath":this._drawToContext(l,W,H);break;case "fillSketch":this.fillSketch(l,W,H)}}};t.fillSketch=function(H,U,K){var W=l.state.strokeColor,Y=l.state.strokeWidth,ca=l.state.strokeAlpha,ja=l.state.dashed,oa=K.fillWeight;+0>oa&&(oa=K.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(K.fill||"");l.setStrokeWidth(oa);l.setDashed(!1);this._drawToContext(H,U,K);l.setDashed(ja);l.setStrokeWidth(Y);l.setStrokeColor(W);l.setStrokeAlpha(ca)};t._drawToContext=function(H,U,K){H.begin();for(var W=0;W<U.ops.length;W++){var Y=U.ops[W],ca=Y.data;switch(Y.op){case "move":H.moveTo(ca[0],ca[1]);break;case "bcurveTo":H.curveTo(ca[0],ca[1],ca[2],ca[3],ca[4],ca[5]);break;case "lineTo":H.lineTo(ca[0],ca[1])}}H.end();+"fillPath"===U.type&&K.filled?H.fill():H.stroke()};return t};(function(){function l(W,Y,ca){this.canvas=W;this.rc=Y;this.shape=ca;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,l.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,l.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,l.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,l.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,l.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,l.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,l.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,-l.prototype.fillAndStroke);this.path=[];this.passThrough=!1}l.prototype.moveOp="M";l.prototype.lineOp="L";l.prototype.quadOp="Q";l.prototype.curveOp="C";l.prototype.closeOp="Z";l.prototype.getStyle=function(W,Y){var ba=1;if(null!=this.shape.state){var ja=this.shape.state.cell.id;if(null!=ja)for(var oa=0;oa<ja.length;oa++)ba=(ba<<5)-ba+ja.charCodeAt(oa)<<0}ba={strokeWidth:this.canvas.state.strokeWidth,seed:ba,preserveVertices:!0};ja=this.rc.getDefaultOptions();ba.stroke=W?this.canvas.state.strokeColor===-mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;W=null;(ba.filled=Y)?(ba.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,W=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):ba.fill="";ba.bowing=mxUtils.getValue(this.shape.style,"bowing",ja.bowing);ba.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ja.hachureAngle);ba.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ja.curveFitting);-ba.roughness=mxUtils.getValue(this.shape.style,"jiggle",ja.roughness);ba.simplification=mxUtils.getValue(this.shape.style,"simplification",ja.simplification);ba.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ja.disableMultiStroke);ba.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ja.disableMultiStrokeFill);Y=mxUtils.getValue(this.shape.style,"hachureGap",-1);ba.hachureGap="auto"==Y?-1:Y;ba.dashGap=mxUtils.getValue(this.shape.style,"dashGap",-Y);ba.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",Y);ba.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",Y);Y=mxUtils.getValue(this.shape.style,"fillWeight",-1);ba.fillWeight="auto"==Y?-1:Y;Y=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==Y&&(Y="auto");"auto"==Y&&(Y=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&Y.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&Y.push(mxUtils.hex2rgb(Editor.darkColor)),Y=-null!=ba.fill&&(null!=W||0<=mxUtils.indexOf(Y,mxUtils.hex2rgb(ba.fill)))?"solid":ja.fillStyle);ba.fillStyle=Y;return ba};l.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};l.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};l.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var W=2;W<arguments.length;W+=2)this.lastX=arguments[W-1],this.lastY=arguments[W],+l.prototype.fillAndStroke);this.path=[];this.passThrough=!1}l.prototype.moveOp="M";l.prototype.lineOp="L";l.prototype.quadOp="Q";l.prototype.curveOp="C";l.prototype.closeOp="Z";l.prototype.getStyle=function(W,Y){var ca=1;if(null!=this.shape.state){var ja=this.shape.state.cell.id;if(null!=ja)for(var oa=0;oa<ja.length;oa++)ca=(ca<<5)-ca+ja.charCodeAt(oa)<<0}ca={strokeWidth:this.canvas.state.strokeWidth,seed:ca,preserveVertices:!0};ja=this.rc.getDefaultOptions();ca.stroke=W?this.canvas.state.strokeColor===+mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;W=null;(ca.filled=Y)?(ca.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,W=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):ca.fill="";ca.bowing=mxUtils.getValue(this.shape.style,"bowing",ja.bowing);ca.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ja.hachureAngle);ca.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ja.curveFitting);+ca.roughness=mxUtils.getValue(this.shape.style,"jiggle",ja.roughness);ca.simplification=mxUtils.getValue(this.shape.style,"simplification",ja.simplification);ca.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ja.disableMultiStroke);ca.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ja.disableMultiStrokeFill);Y=mxUtils.getValue(this.shape.style,"hachureGap",-1);ca.hachureGap="auto"==Y?-1:Y;ca.dashGap=mxUtils.getValue(this.shape.style,"dashGap",+Y);ca.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",Y);ca.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",Y);Y=mxUtils.getValue(this.shape.style,"fillWeight",-1);ca.fillWeight="auto"==Y?-1:Y;Y=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==Y&&(Y="auto");"auto"==Y&&(Y=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&Y.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&Y.push(mxUtils.hex2rgb(Editor.darkColor)),Y=+null!=ca.fill&&(null!=W||0<=mxUtils.indexOf(Y,mxUtils.hex2rgb(ca.fill)))?"solid":ja.fillStyle);ca.fillStyle=Y;return ca};l.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};l.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};l.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var W=2;W<arguments.length;W+=2)this.lastX=arguments[W-1],this.lastY=arguments[W],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};l.prototype.lineTo=function(W,Y){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,W,Y),this.lastX=W,this.lastY=Y)};l.prototype.moveTo=function(W,Y){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,W,Y),this.lastX=W,this.lastY=Y,this.firstX=W,this.firstY=Y)};l.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,-arguments):this.addOp(this.closeOp)};l.prototype.quadTo=function(W,Y,ba,ja){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,W,Y,ba,ja),this.lastX=ba,this.lastY=ja)};l.prototype.curveTo=function(W,Y,ba,ja,oa,qa){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,W,Y,ba,ja,oa,qa),this.lastX=oa,this.lastY=qa)};l.prototype.arcTo=function(W,Y,ba,ja,oa,qa,ra){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);-else{var xa=mxUtils.arcToCurves(this.lastX,this.lastY,W,Y,ba,ja,oa,qa,ra);if(null!=xa)for(var Ba=0;Ba<xa.length;Ba+=6)this.curveTo(xa[Ba],xa[Ba+1],xa[Ba+2],xa[Ba+3],xa[Ba+4],xa[Ba+5]);this.lastX=qa;this.lastY=ra}};l.prototype.rect=function(W,Y,ba,ja){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(W,Y,ba,ja,this.getStyle(!0,!0)))};l.prototype.ellipse=function(W,Y,ba,ja){this.passThrough?this.originalEllipse.apply(this.canvas,-arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(W+ba/2,Y+ja/2,ba,ja,this.getStyle(!0,!0)))};l.prototype.roundrect=function(W,Y,ba,ja,oa,qa){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(W+oa,Y),this.lineTo(W+ba-oa,Y),this.quadTo(W+ba,Y,W+ba,Y+qa),this.lineTo(W+ba,Y+ja-qa),this.quadTo(W+ba,Y+ja,W+ba-oa,Y+ja),this.lineTo(W+oa,Y+ja),this.quadTo(W,Y+ja,W,Y+ja-qa),this.lineTo(W,Y+qa),this.quadTo(W,Y,W+oa,Y))};l.prototype.drawPath=function(W){if(0<-this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),W)}catch(ba){}this.passThrough=!1}else if(null!=this.nextShape){for(var Y in W)this.nextShape.options[Y]=W[Y];W.stroke!=mxConstants.NONE&&null!=W.stroke||delete this.nextShape.options.stroke;W.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};l.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,+arguments):this.addOp(this.closeOp)};l.prototype.quadTo=function(W,Y,ca,ja){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,W,Y,ca,ja),this.lastX=ca,this.lastY=ja)};l.prototype.curveTo=function(W,Y,ca,ja,oa,qa){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,W,Y,ca,ja,oa,qa),this.lastX=oa,this.lastY=qa)};l.prototype.arcTo=function(W,Y,ca,ja,oa,qa,ra){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);+else{var xa=mxUtils.arcToCurves(this.lastX,this.lastY,W,Y,ca,ja,oa,qa,ra);if(null!=xa)for(var Ba=0;Ba<xa.length;Ba+=6)this.curveTo(xa[Ba],xa[Ba+1],xa[Ba+2],xa[Ba+3],xa[Ba+4],xa[Ba+5]);this.lastX=qa;this.lastY=ra}};l.prototype.rect=function(W,Y,ca,ja){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(W,Y,ca,ja,this.getStyle(!0,!0)))};l.prototype.ellipse=function(W,Y,ca,ja){this.passThrough?this.originalEllipse.apply(this.canvas,+arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(W+ca/2,Y+ja/2,ca,ja,this.getStyle(!0,!0)))};l.prototype.roundrect=function(W,Y,ca,ja,oa,qa){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(W+oa,Y),this.lineTo(W+ca-oa,Y),this.quadTo(W+ca,Y,W+ca,Y+qa),this.lineTo(W+ca,Y+ja-qa),this.quadTo(W+ca,Y+ja,W+ca-oa,Y+ja),this.lineTo(W+oa,Y+ja),this.quadTo(W,Y+ja,W,Y+ja-qa),this.lineTo(W,Y+qa),this.quadTo(W,Y,W+oa,Y))};l.prototype.drawPath=function(W){if(0<+this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),W)}catch(ca){}this.passThrough=!1}else if(null!=this.nextShape){for(var Y in W)this.nextShape.options[Y]=W[Y];W.stroke!=mxConstants.NONE&&null!=W.stroke||delete this.nextShape.options.stroke;W.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};l.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};l.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};l.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(W){return new l(W,Editor.createRoughCanvas(W),this)};var t=mxShape.prototype.createHandJiggle;-mxShape.prototype.createHandJiggle=function(W){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?t.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(W):this.createRoughCanvas(W)};var I=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(W,Y,ba,ja,oa){null!=W.handJiggle&&W.handJiggle.passThrough||I.apply(this,arguments)};var V=mxShape.prototype.paint;mxShape.prototype.paint=-function(W){var Y=W.addTolerance,ba=!0;null!=this.style&&(ba="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=W.handJiggle&&W.handJiggle.constructor==l&&!this.outline){W.save();var ja=this.fill,oa=this.stroke;this.stroke=this.fill=null;var qa=this.configurePointerEvents,ra=W.setStrokeColor;W.setStrokeColor=function(){};var xa=W.setFillColor;W.setFillColor=function(){};ba||null==ja||(this.configurePointerEvents=function(){});W.handJiggle.passThrough=!0;V.apply(this,-arguments);W.handJiggle.passThrough=!1;W.setFillColor=xa;W.setStrokeColor=ra;this.configurePointerEvents=qa;this.stroke=oa;this.fill=ja;W.restore();ba&&null!=ja&&(W.addTolerance=function(){})}V.apply(this,arguments);W.addTolerance=Y};var J=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(W,Y,ba,ja,oa,qa){null!=W.handJiggle&&W.handJiggle.constructor==l?(W.handJiggle.passThrough=!0,J.apply(this,arguments),W.handJiggle.passThrough=!1):J.apply(this,arguments)}})();Editor.fastCompress=-function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:pako.inflateRaw(Graph.stringToArrayBuffer(atob(l)),{to:"string"})};Editor.extractGraphModel=function(l,t,I){if(null!=l&&"undefined"!==typeof pako){var V=l.ownerDocument.getElementsByTagName("div"),J=[];if(null!=V&&0<V.length)for(var W=0;W<V.length;W++)if("mxgraph"==V[W].getAttribute("class")){J.push(V[W]);-break}0<J.length&&(V=J[0].getAttribute("data-mxgraph"),null!=V?(J=JSON.parse(V),null!=J&&null!=J.xml&&(l=mxUtils.parseXml(J.xml),l=l.documentElement)):(J=J[0].getElementsByTagName("div"),0<J.length&&(V=mxUtils.getTextContent(J[0]),V=Graph.decompress(V,null,I),0<V.length&&(l=mxUtils.parseXml(V),l=l.documentElement))))}if(null!=l&&"svg"==l.nodeName)if(V=l.getAttribute("content"),null!=V&&"<"!=V.charAt(0)&&"%"!=V.charAt(0)&&(V=unescape(window.atob?atob(V):Base64.decode(cont,V))),null!=V&&"%"==V.charAt(0)&&-(V=decodeURIComponent(V)),null!=V&&0<V.length)l=mxUtils.parseXml(V).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==l||t||(J=null,"diagram"==l.nodeName?J=l:"mxfile"==l.nodeName&&(V=l.getElementsByTagName("diagram"),0<V.length&&(J=V[Math.max(0,Math.min(V.length-1,urlParams.page||0))])),null!=J&&(l=Editor.parseDiagramNode(J,I)));null==l||"mxGraphModel"==l.nodeName||t&&"mxfile"==l.nodeName||(l=null);return l};Editor.parseDiagramNode=function(l,t,I){Editor.validateDiagramNode(l);-var V=mxUtils.trim(mxUtils.getTextContent(l)),J=null;0<V.length?(t=Graph.decompress(V,null,t),null!=t&&0<t.length&&(J=mxUtils.parseXml(t).documentElement)):(l=mxUtils.getChildNodes(l),0<l.length&&(J=l[0],I&&(J=Editor.parseDiagramNode(J,t,!1)),t=mxUtils.createXmlDocument(),t.appendChild(t.importNode(J,!0)),J=t.documentElement));return J};Editor.getDiagramNodeXml=function(l){Editor.validateDiagramNode(l);var t=mxUtils.getNodeValue(l),I=null;0<t.length?I=Graph.decompress(t):(l=l.getElementsByTagName("mxGraphModel"),-null!=l&&0<l.length&&(I=mxUtils.getXml(l[0])));return I};Editor.validateDiagramNode=function(l){if(0==mxUtils.trim(mxUtils.getTextContent(l)).length&&0==mxUtils.getChildNodes(l).length){var t=new mxCodec,I=new mxGraphModel;l.appendChild(t.encode(I))}return l};Editor.extractGraphModelFromPdf=function(l){var t=null;l=l.substring(l.indexOf(",")+1);l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0);if("%PDF-1.7"==l.substring(0,8)){var I=l.indexOf("EmbeddedFile");if(-1<I){var V=l.indexOf("stream",-I)+9;if(0<l.substring(I,V).indexOf("application#2Fvnd.jgraph.mxfile")){var J=l.indexOf("endstream",V-1);return pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(V,J)),{to:"string"})}}for(I=l.indexOf("/ObjStm");0<I;){V=l.indexOf("stream",I)+9;J=l.indexOf("endstream",V-1);V=pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(V,J)),{to:"string"});J=V.indexOf("/Subject <");if(0<J){I=V.substring(J+14,V.indexOf(">",J));if(null!=I){t=I;I=[];for(V=0;V<t.length;V+=2)J=t.substr(V,2),"00"!=J&&I.push(String.fromCharCode(parseInt(J,-16)));t=I.join("")}break}I=l.indexOf("/ObjStm",I+1)}}if(null==t&&"%PDF-1.4"==l.substring(0,8)){I="";J=V=0;for(var W=[],Y=null;J<l.length;){var ba=l.charCodeAt(J);J+=1;10!=ba&&(I+=String.fromCharCode(ba));ba=="/Subject (%3Cmxfile".charCodeAt(V)?V++:V=0;if(19==V){var ja=l.indexOf("%3C%2Fmxfile%3E",J)+15;J-=9;if(ja>J){t=l.substring(J,ja);break}}10==ba&&("endobj"==I?Y=null:"obj"==I.substring(I.length-3,I.length)||"xref"==I||"trailer"==I?(Y=[],W[I.split(" ")[0]]=Y):null!=Y&&Y.push(I),I="")}}null==t&&null!=-W&&(t=Editor.extractGraphModelFromXref(W));null!=t&&(t=decodeURIComponent(t.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return t};Editor.extractGraphModelFromXref=function(l){var t=l.trailer,I=null;null!=t&&(t=/.* \/Info (\d+) (\d+) R/g.exec(t.join("\n")),null!=t&&0<t.length&&(t=l[t[1]],null!=t&&(t=/.* \/Subject (\d+) (\d+) R/g.exec(t.join("\n")),null!=t&&0<t.length&&(l=l[t[1]],null!=l&&(l=l.join("\n"),I=l.substring(1,l.length-1))))));return I};Editor.extractParserError=function(l,t){var I=null;l=-null!=l?l.getElementsByTagName("parsererror"):null;null!=l&&0<l.length&&(I=t||mxResources.get("invalidChars"),t=l[0].getElementsByTagName("div"),0<t.length&&(I=mxUtils.getTextContent(t[0])));return null!=I?mxUtils.trim(I):I};Editor.addRetryToError=function(l,t){null!=l&&(l=null!=l.error?l.error:l,null==l.retry&&(l.retry=t))};Editor.mermaidToDrawio=function(l,t,I){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(l,t,I)};Editor.configure=function(l){if(null!=l){Editor.config=l;Editor.configVersion=+mxShape.prototype.createHandJiggle=function(W){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?t.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(W):this.createRoughCanvas(W)};var H=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(W,Y,ca,ja,oa){null!=W.handJiggle&&W.handJiggle.passThrough||H.apply(this,arguments)};var U=mxShape.prototype.paint;mxShape.prototype.paint=+function(W){var Y=W.addTolerance,ca=!0;null!=this.style&&(ca="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=W.handJiggle&&W.handJiggle.constructor==l&&!this.outline){W.save();var ja=this.fill,oa=this.stroke;this.stroke=this.fill=null;var qa=this.configurePointerEvents,ra=W.setStrokeColor;W.setStrokeColor=function(){};var xa=W.setFillColor;W.setFillColor=function(){};ca||null==ja||(this.configurePointerEvents=function(){});W.handJiggle.passThrough=!0;U.apply(this,+arguments);W.handJiggle.passThrough=!1;W.setFillColor=xa;W.setStrokeColor=ra;this.configurePointerEvents=qa;this.stroke=oa;this.fill=ja;W.restore();ca&&null!=ja&&(W.addTolerance=function(){})}U.apply(this,arguments);W.addTolerance=Y};var K=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(W,Y,ca,ja,oa,qa){null!=W.handJiggle&&W.handJiggle.constructor==l?(W.handJiggle.passThrough=!0,K.apply(this,arguments),W.handJiggle.passThrough=!1):K.apply(this,arguments)}})();Editor.fastCompress=+function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:pako.inflateRaw(Graph.stringToArrayBuffer(atob(l)),{to:"string"})};Editor.extractGraphModel=function(l,t,H){if(null!=l&&"undefined"!==typeof pako){var U=l.ownerDocument.getElementsByTagName("div"),K=[];if(null!=U&&0<U.length)for(var W=0;W<U.length;W++)if("mxgraph"==U[W].getAttribute("class")){K.push(U[W]);+break}0<K.length&&(U=K[0].getAttribute("data-mxgraph"),null!=U?(K=JSON.parse(U),null!=K&&null!=K.xml&&(l=mxUtils.parseXml(K.xml),l=l.documentElement)):(K=K[0].getElementsByTagName("div"),0<K.length&&(U=mxUtils.getTextContent(K[0]),U=Graph.decompress(U,null,H),0<U.length&&(l=mxUtils.parseXml(U),l=l.documentElement))))}if(null!=l&&"svg"==l.nodeName)if(U=l.getAttribute("content"),null!=U&&"<"!=U.charAt(0)&&"%"!=U.charAt(0)&&(U=unescape(window.atob?atob(U):Base64.decode(cont,U))),null!=U&&"%"==U.charAt(0)&&+(U=decodeURIComponent(U)),null!=U&&0<U.length)l=mxUtils.parseXml(U).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==l||t||(K=null,"diagram"==l.nodeName?K=l:"mxfile"==l.nodeName&&(U=l.getElementsByTagName("diagram"),0<U.length&&(K=U[Math.max(0,Math.min(U.length-1,urlParams.page||0))])),null!=K&&(l=Editor.parseDiagramNode(K,H)));null==l||"mxGraphModel"==l.nodeName||t&&"mxfile"==l.nodeName||(l=null);return l};Editor.parseDiagramNode=function(l,t,H){Editor.validateDiagramNode(l);+var U=mxUtils.trim(mxUtils.getTextContent(l)),K=null;0<U.length?(t=Graph.decompress(U,null,t),null!=t&&0<t.length&&(K=mxUtils.parseXml(t).documentElement)):(l=mxUtils.getChildNodes(l),0<l.length&&(K=l[0],H&&(K=Editor.parseDiagramNode(K,t,!1)),t=mxUtils.createXmlDocument(),t.appendChild(t.importNode(K,!0)),K=t.documentElement));return K};Editor.getDiagramNodeXml=function(l){Editor.validateDiagramNode(l);var t=mxUtils.getNodeValue(l),H=null;0<t.length?H=Graph.decompress(t):(l=l.getElementsByTagName("mxGraphModel"),+null!=l&&0<l.length&&(H=mxUtils.getXml(l[0])));return H};Editor.validateDiagramNode=function(l){if(0==mxUtils.trim(mxUtils.getTextContent(l)).length&&0==mxUtils.getChildNodes(l).length){var t=new mxCodec,H=new mxGraphModel;l.appendChild(t.encode(H))}return l};Editor.extractGraphModelFromPdf=function(l){var t=null;l=l.substring(l.indexOf(",")+1);l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0);if("%PDF-1.7"==l.substring(0,8)){var H=l.indexOf("EmbeddedFile");if(-1<H){var U=l.indexOf("stream",+H)+9;if(0<l.substring(H,U).indexOf("application#2Fvnd.jgraph.mxfile")){var K=l.indexOf("endstream",U-1);return pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(U,K)),{to:"string"})}}for(H=l.indexOf("/ObjStm");0<H;){U=l.indexOf("stream",H)+9;K=l.indexOf("endstream",U-1);U=pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(U,K)),{to:"string"});K=U.indexOf("/Subject <");if(0<K){H=U.substring(K+14,U.indexOf(">",K));if(null!=H){t=H;H=[];for(U=0;U<t.length;U+=2)K=t.substr(U,2),"00"!=K&&H.push(String.fromCharCode(parseInt(K,+16)));t=H.join("")}break}H=l.indexOf("/ObjStm",H+1)}}if(null==t&&"%PDF-1.4"==l.substring(0,8)){H="";K=U=0;for(var W=[],Y=null;K<l.length;){var ca=l.charCodeAt(K);K+=1;10!=ca&&(H+=String.fromCharCode(ca));ca=="/Subject (%3Cmxfile".charCodeAt(U)?U++:U=0;if(19==U){var ja=l.indexOf("%3C%2Fmxfile%3E",K)+15;K-=9;if(ja>K){t=l.substring(K,ja);break}}10==ca&&("endobj"==H?Y=null:"obj"==H.substring(H.length-3,H.length)||"xref"==H||"trailer"==H?(Y=[],W[H.split(" ")[0]]=Y):null!=Y&&Y.push(H),H="")}}null==t&&null!=+W&&(t=Editor.extractGraphModelFromXref(W));null!=t&&(t=decodeURIComponent(t.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return t};Editor.extractGraphModelFromXref=function(l){var t=l.trailer,H=null;null!=t&&(t=/.* \/Info (\d+) (\d+) R/g.exec(t.join("\n")),null!=t&&0<t.length&&(t=l[t[1]],null!=t&&(t=/.* \/Subject (\d+) (\d+) R/g.exec(t.join("\n")),null!=t&&0<t.length&&(l=l[t[1]],null!=l&&(l=l.join("\n"),H=l.substring(1,l.length-1))))));return H};Editor.extractParserError=function(l,t){var H=null;l=+null!=l?l.getElementsByTagName("parsererror"):null;null!=l&&0<l.length&&(H=t||mxResources.get("invalidChars"),t=l[0].getElementsByTagName("div"),0<t.length&&(H=mxUtils.getTextContent(t[0])));return null!=H?mxUtils.trim(H):H};Editor.addRetryToError=function(l,t){null!=l&&(l=null!=l.error?l.error:l,null==l.retry&&(l.retry=t))};Editor.mermaidToDrawio=function(l,t,H){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(l,t,H)};Editor.configure=function(l){if(null!=l){Editor.config=l;Editor.configVersion=l.version;l.debug&&(urlParams.test="1");null!=l.defaultFonts&&(Menus.prototype.defaultFonts=l.defaultFonts);null!=l.presetColors&&(ColorDialog.prototype.presetColors=l.presetColors);null!=l.defaultColors&&(ColorDialog.prototype.defaultColors=l.defaultColors);null!=l.colorNames&&(ColorDialog.prototype.colorNames=l.colorNames);null!=l.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=l.defaultColorSchemes);null!=l.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=l.defaultEdgeLength);null!=l.selectParentLayer&&(Graph.selectParentLayer=l.selectParentLayer);null!=l.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=l.autosaveDelay);null!=l.templateFile&&(EditorUi.templateFile=l.templateFile);null!=l.styles&&(Array.isArray(l.styles)?Editor.styles=l.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=l.globalVars&&(Editor.globalVars=l.globalVars);null!=l.compressXml&&(Editor.defaultCompressed=l.compressXml,Editor.compressXml=l.compressXml);null!=l.includeDiagram&&(Editor.defaultIncludeDiagram=l.includeDiagram);null!=l.simpleLabels&&(Editor.simpleLabels=l.simpleLabels);null!=l.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=l.oneDriveInlinePicker);null!=l.defaultAdaptiveColors?Graph.defaultAdaptiveColors=l.defaultAdaptiveColors:0==l.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=l.darkColor&&(Editor.darkColor=l.darkColor);null!=l.darkColorVar&&(Editor.darkColorVar=l.darkColorVar);Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":"light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.defaultPageBorderColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=l.settingsName&&(Editor.configurationKey="."+l.settingsName+"-configuration",Editor.settingsKey="."+l.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=l.customFonts&&(Menus.prototype.defaultFonts=l.customFonts.concat(Menus.prototype.defaultFonts));-null!=l.customPresetColors&&(ColorDialog.prototype.presetColors=l.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=l.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=l.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=l.css){var t=document.createElement("style");t.setAttribute("type","text/css");t.appendChild(document.createTextNode(l.css));var I=document.getElementsByTagName("script")[0];I.parentNode.insertBefore(t,I)}null!=+null!=l.customPresetColors&&(ColorDialog.prototype.presetColors=l.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=l.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=l.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=l.css){var t=document.createElement("style");t.setAttribute("type","text/css");t.appendChild(document.createTextNode(l.css));var H=document.getElementsByTagName("script")[0];H.parentNode.insertBefore(t,H)}null!=l.expandLibraries&&(Sidebar.prototype.expandLibraries=l.expandLibraries);null!=l.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=l.appendCustomLibraries);null!=l.libraries&&(Sidebar.prototype.customEntries=l.libraries);null!=l.enabledLibraries&&(Array.isArray(l.enabledLibraries)?Sidebar.prototype.enabledLibraries=l.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=l.defaultLibraries&&(Sidebar.prototype.defaultEntries=l.defaultLibraries);null!=l.defaultCustomLibraries&&(Editor.defaultCustomLibraries=l.defaultCustomLibraries);null!=l.enableCustomLibraries&&(Editor.enableCustomLibraries=l.enableCustomLibraries);null!=l.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=l.defaultVertexStyle);null!=l.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=l.defaultEdgeStyle);null!=l.defaultPageVisible&&(Graph.prototype.defaultPageVisible=l.defaultPageVisible);null!=l.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=l.defaultGridEnabled);null!=l.zoomWheel&&(Graph.zoomWheel=l.zoomWheel);null!=l.zoomFactor&&(t=parseFloat(l.zoomFactor),!isNaN(t)&&1<t?Graph.prototype.zoomFactor=t:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=l.defaultGridSize&&(t=parseInt(l.defaultGridSize),!isNaN(t)&&0<t?mxGraph.prototype.gridSize=t:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=l.gridSteps&&(t=parseInt(l.gridSteps),!isNaN(t)&&0<t?mxGraphView.prototype.gridSteps=t:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));-null!=l.pageFormat&&(t=parseInt(l.pageFormat.width),I=parseInt(l.pageFormat.height),!isNaN(t)&&0<t&&!isNaN(I)&&0<I?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,t,I),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=l.thumbWidth&&(Sidebar.prototype.thumbWidth=l.thumbWidth);null!=l.thumbHeight&&(Sidebar.prototype.thumbHeight=l.thumbHeight);null!=l.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=+null!=l.pageFormat&&(t=parseInt(l.pageFormat.width),H=parseInt(l.pageFormat.height),!isNaN(t)&&0<t&&!isNaN(H)&&0<H?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,t,H),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=l.thumbWidth&&(Sidebar.prototype.thumbWidth=l.thumbWidth);null!=l.thumbHeight&&(Sidebar.prototype.thumbHeight=l.thumbHeight);null!=l.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=l.emptyLibraryXml);null!=l.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=l.emptyDiagramXml);null!=l.sidebarWidth&&(EditorUi.prototype.hsplitPosition=l.sidebarWidth);null!=l.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=l.updateDefaultStyle);null!=l.sidebarTitles&&(Sidebar.prototype.sidebarTitles=l.sidebarTitles);null!=l.sidebarTitleSize&&(t=parseInt(l.sidebarTitleSize),!isNaN(t)&&0<t?Sidebar.prototype.sidebarTitleSize=t:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=l.fontCss&&("string"===typeof l.fontCss?Editor.configureFontCss(l.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=l.autosaveDelay&&(t=parseInt(l.autosaveDelay),!isNaN(t)&&0<t?DrawioFile.prototype.autosaveDelay=t:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=l.maxImageBytes&&(EditorUi.prototype.maxImageBytes=l.maxImageBytes);null!=l.maxImageSize&&(EditorUi.prototype.maxImageSize=l.maxImageSize);null!=l.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=l.shareCursorPosition);null!=l.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=l.showRemoteCursors);null!=l.restrictExport&&(DrawioFile.RESTRICT_EXPORT=l.restrictExport);null!=l.replaceSvgDataUris&&(Editor.replaceSvgDataUris=l.replaceSvgDataUris);null!=l.foreignObjectImages&&(Editor.foreignObjectImages=l.foreignObjectImages);null!=l.shadowColor&&(mxConstants.SHADOW_COLOR=l.shadowColor);null!=l.shadowOpacity&&(mxConstants.SHADOW_OPACITY=l.shadowOpacity);null!=l.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=l.shadowOffsetX);null!=l.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=l.shadowOffsetY);null!=l.shadowBlur&&(mxConstants.SHADOW_BLUR=l.shadowBlur);null!=l.enableAnimations&&(Editor.enableAnimations=l.enableAnimations);null!=l.enableChatGpt&&(Editor.enableChatGpt=l.enableChatGpt);null!=l.gptApiKey&&(Editor.gptApiKey=l.gptApiKey);null!=l.gptModel&&(Editor.gptModel=l.gptModel);null!=l.gptUrl&&(Editor.gptUrl=l.gptUrl)}};Editor.isSettingsEnabled=function(){return"undefined"!==-typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(l){if(null!=l){Editor.prototype.fontCss=l;var t=document.getElementsByTagName("script")[0];if(null!=t&&null!=t.parentNode){var I=document.createElement("style");I.setAttribute("type","text/css");I.appendChild(document.createTextNode(l));t.parentNode.insertBefore(I,t);l=l.split("url(");for(I=1;I<l.length;I++){var V=l[I].indexOf(")");V=Editor.trimCssUrl(l[I].substring(0,V));var J=document.createElement("link");-J.setAttribute("rel","preload");J.setAttribute("href",V);J.setAttribute("as","font");J.setAttribute("crossorigin","");t.parentNode.insertBefore(J,t)}}}};Editor.trimCssUrl=function(l){return l.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=-20;Editor.guid=function(l){l=null!=l?l:Editor.GUID_LENGTH;for(var t=[],I=0;I<l;I++)t.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return t.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},+typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(l){if(null!=l){Editor.prototype.fontCss=l;var t=document.getElementsByTagName("script")[0];if(null!=t&&null!=t.parentNode){var H=document.createElement("style");H.setAttribute("type","text/css");H.appendChild(document.createTextNode(l));t.parentNode.insertBefore(H,t);l=l.split("url(");for(H=1;H<l.length;H++){var U=l[H].indexOf(")");U=Editor.trimCssUrl(l[H].substring(0,U));var K=document.createElement("link");+K.setAttribute("rel","preload");K.setAttribute("href",U);K.setAttribute("as","font");K.setAttribute("crossorigin","");t.parentNode.insertBefore(K,t)}}}};Editor.trimCssUrl=function(l){return l.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=+20;Editor.guid=function(l){l=null!=l?l:Editor.GUID_LENGTH;for(var t=[],H=0;H<l;H++)t.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return t.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!mxClient.IS_IE;var b=Editor.prototype.setGraphXml;-Editor.prototype.setGraphXml=function(l){l=null!=l&&"mxlibrary"!=l.nodeName?this.extractGraphModel(l):null;if(null!=l){var t=Editor.extractParserError(l,mxResources.get("invalidOrMissingFile"));if(t)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[l],"cause",[t]),Error(mxResources.get("notADiagramFile")+" ("+t+")");if("mxGraphModel"==l.nodeName){t=l.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=t&&""!=t)t!=this.graph.currentStyle&&(I=null!=this.graph.themes?-this.graph.themes[t]:mxUtils.load(STYLE_PATH+"/"+t+".xml").getDocumentElement(),null!=I&&(V=new mxCodec(I.ownerDocument),V.decode(I,this.graph.getStylesheet())));else{var I=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=I){var V=new mxCodec(I.ownerDocument);V.decode(I,this.graph.getStylesheet())}}this.graph.currentStyle=t;this.graph.mathEnabled="1"==urlParams.math||"1"==l.getAttribute("math");this.graph.setAdaptiveColors(l.getAttribute("adaptiveColors"));-t=l.getAttribute("backgroundImage");null!=t?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(t)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==l.getAttribute("shadow"),!1);if(t=l.getAttribute("extFonts"))try{for(t=t.split("|").map(function(J){J=J.split("^");return{name:J[0],url:J[1]}}),I=0;I<t.length;I++)this.graph.addExtFont(t[I].name,-t[I].url)}catch(J){console.log("ExtFonts format error: "+J.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var e=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(l,t){l=null!=l?l:!0;var I=e.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&I.setAttribute("style",-this.graph.currentStyle);var V=this.graph.getBackgroundImageObject(this.graph.backgroundImage,t);null!=V&&I.setAttribute("backgroundImage",JSON.stringify(V));I.setAttribute("math",this.graph.mathEnabled?"1":"0");I.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?I.setAttribute("adaptiveColors",this.graph.adaptiveColors):I.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(V=this.graph.extFonts.map(function(J){return J.name+-"^"+J.url}),I.setAttribute("extFonts",V.join("|")));return I};Editor.prototype.isDataSvg=function(l){try{var t=mxUtils.parseXml(l).documentElement.getAttribute("content");if(null!=t&&(null!=t&&"<"!=t.charAt(0)&&"%"!=t.charAt(0)&&(t=unescape(window.atob?atob(t):Base64.decode(cont,t))),null!=t&&"%"==t.charAt(0)&&(t=decodeURIComponent(t)),null!=t&&0<t.length)){var I=mxUtils.parseXml(t).documentElement;return"mxfile"==I.nodeName||"mxGraphModel"==I.nodeName}}catch(V){}return!1};Editor.prototype.extractGraphModel=-function(l,t,I){return Editor.extractGraphModel.apply(this,arguments)};var g=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();g.apply(this,arguments)};var m=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=-function(){m.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(l,t){if("undefined"===typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var I=function(){V=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};l=null!=l?l:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var V=null;Editor.doMathJaxRender=-function(Y){try{null==V?(MathJax.typesetClear([Y]),MathJax.typeset([Y]),I()):V!=Y&&Editor.mathJaxQueue.push(Y)}catch(ba){MathJax.typesetClear([Y]),null!=ba.retry?(V=Y,ba.retry.then(function(){MathJax.typesetPromise([Y]).then(I)["catch"](function(ja){console.log("Error in MathJax.typesetPromise: "+ja.toString());I()})})["catch"](function(ja){console.log("Error in MathJax.retry: "+ja.toString());I()})):null!=window.console&&console.log("Error in MathJax.typeset: "+ba.toString())}};window.MathJax=null!=+Editor.prototype.setGraphXml=function(l){l=null!=l&&"mxlibrary"!=l.nodeName?this.extractGraphModel(l):null;if(null!=l){var t=Editor.extractParserError(l,mxResources.get("invalidOrMissingFile"));if(t)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[l],"cause",[t]),Error(mxResources.get("notADiagramFile")+" ("+t+")");if("mxGraphModel"==l.nodeName){t=l.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=t&&""!=t)t!=this.graph.currentStyle&&(H=null!=this.graph.themes?+this.graph.themes[t]:mxUtils.load(STYLE_PATH+"/"+t+".xml").getDocumentElement(),null!=H&&(U=new mxCodec(H.ownerDocument),U.decode(H,this.graph.getStylesheet())));else{var H=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=H){var U=new mxCodec(H.ownerDocument);U.decode(H,this.graph.getStylesheet())}}this.graph.currentStyle=t;this.graph.mathEnabled="1"==urlParams.math||"1"==l.getAttribute("math");this.graph.setAdaptiveColors(l.getAttribute("adaptiveColors"));+t=l.getAttribute("backgroundImage");null!=t?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(t)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==l.getAttribute("shadow"),!1);if(t=l.getAttribute("extFonts"))try{for(t=t.split("|").map(function(K){K=K.split("^");return{name:K[0],url:K[1]}}),H=0;H<t.length;H++)this.graph.addExtFont(t[H].name,+t[H].url)}catch(K){console.log("ExtFonts format error: "+K.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var e=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(l,t){l=null!=l?l:!0;var H=e.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&H.setAttribute("style",+this.graph.currentStyle);var U=this.graph.getBackgroundImageObject(this.graph.backgroundImage,t);null!=U&&H.setAttribute("backgroundImage",JSON.stringify(U));H.setAttribute("math",this.graph.mathEnabled?"1":"0");H.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?H.setAttribute("adaptiveColors",this.graph.adaptiveColors):H.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(U=this.graph.extFonts.map(function(K){return K.name++"^"+K.url}),H.setAttribute("extFonts",U.join("|")));return H};Editor.prototype.isDataSvg=function(l){try{var t=mxUtils.parseXml(l).documentElement.getAttribute("content");if(null!=t&&(null!=t&&"<"!=t.charAt(0)&&"%"!=t.charAt(0)&&(t=unescape(window.atob?atob(t):Base64.decode(cont,t))),null!=t&&"%"==t.charAt(0)&&(t=decodeURIComponent(t)),null!=t&&0<t.length)){var H=mxUtils.parseXml(t).documentElement;return"mxfile"==H.nodeName||"mxGraphModel"==H.nodeName}}catch(U){}return!1};Editor.prototype.extractGraphModel=+function(l,t,H){return Editor.extractGraphModel.apply(this,arguments)};var g=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();g.apply(this,arguments)};var m=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=+function(){m.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(l,t){if("undefined"===typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var H=function(){U=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};l=null!=l?l:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var U=null;Editor.doMathJaxRender=+function(Y){try{null==U?(MathJax.typesetClear([Y]),MathJax.typeset([Y]),H()):U!=Y&&Editor.mathJaxQueue.push(Y)}catch(ca){MathJax.typesetClear([Y]),null!=ca.retry?(U=Y,ca.retry.then(function(){MathJax.typesetPromise([Y]).then(H)["catch"](function(ja){console.log("Error in MathJax.typesetPromise: "+ja.toString());H()})})["catch"](function(ja){console.log("Error in MathJax.retry: "+ja.toString());H()})):null!=window.console&&console.log("Error in MathJax.typeset: "+ca.toString())}};window.MathJax=null!=t?t:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"]},startup:{pageReady:function(){for(var Y=0;Y<Editor.mathJaxQueue.length;Y++)Editor.doMathJaxRender(Editor.mathJaxQueue[Y])}}};Editor.MathJaxRender=function(Y){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(Y):Editor.mathJaxQueue.push(Y)};Editor.onMathJaxDone=function(){};-var J=Editor.prototype.init;Editor.prototype.init=function(){J.apply(this,arguments);var Y=mxUtils.bind(this,function(ba,ja){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,Y);this.graph.addListener(mxEvent.REFRESH,Y)};t=document.getElementsByTagName("script");if(null!=t&&0<t.length){var W=document.createElement("script");W.setAttribute("type","text/javascript");W.setAttribute("src",l);t[0].parentNode.appendChild(W)}}};-Editor.prototype.csvToArray=function(l){if(0<l.length){var t="",I=[""],V=0,J=!0,W;l=$jscomp.makeIterator(l);for(W=l.next();!W.done;W=l.next())W=W.value,'"'===W?(J&&W===t&&(I[V]+=W),J=!J):","===W&&J?W=I[++V]="":I[V]+=W,t=W;return I}return[]};Editor.prototype.getProxiedUrl=function(l){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(l)){var t=EditorUi.isVisioFilename(l);t=/\.png$/i.test(l)||/\.pdf$/i.test(l)||t;var I=-"t="+(new Date).getTime();l=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+I+(t?"&base64=1":"")}return l};Editor.prototype.isCorsEnabledForUrl=function(l){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||l.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(l)||"https://raw.githubusercontent.com/"===l.substring(0,34)||-"https://fonts.googleapis.com/"===l.substring(0,29)||"https://fonts.gstatic.com/"===l.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var l=new mxUrlConverter;l.updateBaseUrl();var t=l.convert,I=this;l.convert=function(V){null!=V&&navigator.onLine&&("http://"!=V.substring(0,7)&&"https://"!=V.substring(0,8)||V.substring(0,l.baseUrl.length)==l.baseUrl||I.crossOriginImages&&I.isCorsEnabledForUrl(V)?"chrome-extension://"!=V.substring(0,19)&&(V=t.apply(this,arguments)):V=PROXY_URL+-"?url="+encodeURIComponent(V));return V};return l};Editor.createSvgDataUri=function(l){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(l)))};Editor.prototype.convertImageToDataUri=function(l,t,I,V,J){try{var W=!0,Y=window.setTimeout(mxUtils.bind(this,function(){W=!1;t(l)}),this.timeout),ba=mxUtils.bind(this,function(){null!=V?this.convertImageToDataUri(l,t,I,V,!0):t(l)});if(/(\.svg)$/i.test(l)&&!J)mxUtils.get(l,mxUtils.bind(this,function(oa){window.clearTimeout(Y);W&&(200>oa.getStatus()||-299<oa.getStatus()?ba():t(Editor.createSvgDataUri(oa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Y);W&&ba()}));else{var ja=new Image;this.crossOriginImages&&(ja.crossOrigin="anonymous");ja.onload=function(){window.clearTimeout(Y);if(W)try{V=null!=V&&J?V:1;var oa=document.createElement("canvas"),qa=oa.getContext("2d");qa.scale(V,V);oa.height=ja.height*V;oa.width=ja.width*V;qa.drawImage(ja,0,0);t(oa.toDataURL())}catch(ra){t(l)}};ja.onerror=function(){window.clearTimeout(Y);W&&(null!=-I?I():t(l))};ja.src=l}}catch(oa){null!=I?I():t(l)}};Editor.prototype.convertImages=function(l,t,I,V){function J(){0<W.length?W.shift()():t(l)}null==V&&(V=this.createImageUrlConverter());var W=[],Y=I||{};I=mxUtils.bind(this,function(ba,ja){ba=l.getElementsByTagName(ba);for(var oa=0;oa<ba.length;oa++)mxUtils.bind(this,function(qa){W.push(mxUtils.bind(this,function(){try{if(null!=qa){var ra=V.convert(qa.getAttribute(ja));if(null!=ra&&"data:"!=ra.substring(0,5)){var xa=Y[ra];null==xa?this.convertImageToDataUri(ra,-function(Ba){null!=Ba&&(Y[ra]=Ba,qa.setAttribute(ja,Ba));J()},null,Editor.svgRasterScale):(qa.setAttribute(ja,xa),J())}else null!=ra&&qa.setAttribute(ja,ra),J()}}catch(Ba){J()}}))})(ba[oa])});I("image","xlink:href");I("img","src");J()};Editor.base64Encode=function(l){for(var t="",I=0,V=l.length,J,W,Y;I<V;){J=l.charCodeAt(I++)&255;if(I==V){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(J>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((J&-3)<<4);t+="==";break}W=l.charCodeAt(I++);if(I==V){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(J>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((J&3)<<4|(W&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2);t+="=";break}Y=l.charCodeAt(I++);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(J>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((J&-3)<<4|(W&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2|(Y&192)>>6);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y&63)}return t};Editor.prototype.loadUrl=function(l,t,I,V,J,W,Y,ba){try{var ja=!Y&&(V||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));J=null!=J?J:!0;var oa=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(qa){if(200<=qa.getStatus()&&-299>=qa.getStatus()){if(null!=t){var ra=qa.getText();if(ja){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){qa=mxUtilsBinaryToArray(qa.request.responseBody).toArray();ra=Array(qa.length);for(var xa=0;xa<qa.length;xa++)ra[xa]=String.fromCharCode(qa[xa]);ra=ra.join("")}W=null!=W?W:"data:image/png;base64,";ra=W+Editor.base64Encode(ra)}t(ra)}}else null!=I&&(0==qa.getStatus()?I({message:mxResources.get("accessDenied")},qa):404==qa.getStatus()?-I({message:mxResources.get("fileNotFound"),code:qa.getStatus()},qa):I({message:this.getErrorMessage(qa)},qa))}),function(qa){null!=I&&I({message:mxResources.get("error")+" "+qa.getStatus()})},ja,this.timeout,function(){J&&null!=I&&I({code:App.ERROR_TIMEOUT,retry:oa})},ba)});oa()}catch(qa){null!=I&&I(qa)}};Editor.prototype.getErrorMessage=function(l){var t=mxResources.get("error")+" "+l.getStatus();try{var I=l.getText(),V=JSON.parse(I);null!=V&&null!=V.error&&null!=V.error.message&&(t=V.error.message+-" ("+t+")")}catch(J){}return t};Editor.prototype.absoluteCssFonts=function(l){var t=null;if(null!=l){var I=l.split("url(");if(0<I.length){t=[I[0]];l=window.location.pathname;var V=null!=l?l.lastIndexOf("/"):-1;0<=V&&(l=l.substring(0,V+1));V=document.getElementsByTagName("base");var J=null;null!=V&&0<V.length&&(J=V[0].getAttribute("href"));for(var W=1;W<I.length;W++)if(V=I[W].indexOf(")"),0<V){var Y=Editor.trimCssUrl(I[W].substring(0,V));this.graph.isRelativeUrl(Y)&&(Y=null!=J?J+Y:window.location.protocol+-"//"+window.location.hostname+("/"==Y.charAt(0)?"":l)+Y);t.push('url("'+Y+'"'+I[W].substring(V))}else t.push(I[W])}else t=[l]}return null!=t?t.join(""):null};Editor.prototype.mapFontUrl=function(l,t,I){/^https?:\/\//.test(t)&&!this.isCorsEnabledForUrl(t)&&(t=PROXY_URL+"?url="+encodeURIComponent(t));I(l,t)};Editor.prototype.embedCssFonts=function(l,t){var I=l.split("url("),V=0;null==this.cachedFonts&&(this.cachedFonts={});var J=mxUtils.bind(this,function(){if(0==V){for(var ja=[I[0]],oa=1;oa<I.length;oa++){var qa=-I[oa].indexOf(")");ja.push('url("');ja.push(this.cachedFonts[Editor.trimCssUrl(I[oa].substring(0,qa))]);ja.push('"'+I[oa].substring(qa))}t(ja.join(""))}});if(0<I.length){for(l=1;l<I.length;l++){var W=I[l].indexOf(")"),Y=null,ba=I[l].indexOf("format(",W);0<ba&&(Y=Editor.trimCssUrl(I[l].substring(ba+7,I[l].indexOf(")",ba))));mxUtils.bind(this,function(ja){if(null==this.cachedFonts[ja]){this.cachedFonts[ja]=ja;V++;var oa="application/x-font-ttf";if("svg"==Y||/(\.svg)($|\?)/i.test(ja))oa="image/svg+xml";+var K=Editor.prototype.init;Editor.prototype.init=function(){K.apply(this,arguments);var Y=mxUtils.bind(this,function(ca,ja){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,Y);this.graph.addListener(mxEvent.REFRESH,Y)};t=document.getElementsByTagName("script");if(null!=t&&0<t.length){var W=document.createElement("script");W.setAttribute("type","text/javascript");W.setAttribute("src",l);t[0].parentNode.appendChild(W)}}};+Editor.prototype.csvToArray=function(l){if(0<l.length){var t="",H=[""],U=0,K=!0,W;l=$jscomp.makeIterator(l);for(W=l.next();!W.done;W=l.next())W=W.value,'"'===W?(K&&W===t&&(H[U]+=W),K=!K):","===W&&K?W=H[++U]="":H[U]+=W,t=W;return H}return[]};Editor.prototype.getProxiedUrl=function(l){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(l)){var t=EditorUi.isVisioFilename(l);t=/\.png$/i.test(l)||/\.pdf$/i.test(l)||t;var H=+"t="+(new Date).getTime();l=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+H+(t?"&base64=1":"")}return l};Editor.prototype.isCorsEnabledForUrl=function(l){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||l.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(l)||"https://raw.githubusercontent.com/"===l.substring(0,34)||+"https://fonts.googleapis.com/"===l.substring(0,29)||"https://fonts.gstatic.com/"===l.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var l=new mxUrlConverter;l.updateBaseUrl();var t=l.convert,H=this;l.convert=function(U){null!=U&&navigator.onLine&&("http://"!=U.substring(0,7)&&"https://"!=U.substring(0,8)||U.substring(0,l.baseUrl.length)==l.baseUrl||H.crossOriginImages&&H.isCorsEnabledForUrl(U)?"chrome-extension://"!=U.substring(0,19)&&(U=t.apply(this,arguments)):U=PROXY_URL++"?url="+encodeURIComponent(U));return U};return l};Editor.createSvgDataUri=function(l){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(l)))};Editor.prototype.convertImageToDataUri=function(l,t,H,U,K){try{var W=!0,Y=window.setTimeout(mxUtils.bind(this,function(){W=!1;t(l)}),this.timeout),ca=mxUtils.bind(this,function(){null!=U?this.convertImageToDataUri(l,t,H,U,!0):t(l)});if(/(\.svg)$/i.test(l)&&!K)mxUtils.get(l,mxUtils.bind(this,function(oa){window.clearTimeout(Y);W&&(200>oa.getStatus()||+299<oa.getStatus()?ca():t(Editor.createSvgDataUri(oa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Y);W&&ca()}));else{var ja=new Image;this.crossOriginImages&&(ja.crossOrigin="anonymous");ja.onload=function(){window.clearTimeout(Y);if(W)try{U=null!=U&&K?U:1;var oa=document.createElement("canvas"),qa=oa.getContext("2d");qa.scale(U,U);oa.height=ja.height*U;oa.width=ja.width*U;qa.drawImage(ja,0,0);t(oa.toDataURL())}catch(ra){t(l)}};ja.onerror=function(){window.clearTimeout(Y);W&&(null!=+H?H():t(l))};ja.src=l}}catch(oa){null!=H?H():t(l)}};Editor.prototype.convertImages=function(l,t,H,U){function K(){0<W.length?W.shift()():t(l)}null==U&&(U=this.createImageUrlConverter());var W=[],Y=H||{};H=mxUtils.bind(this,function(ca,ja){ca=l.getElementsByTagName(ca);for(var oa=0;oa<ca.length;oa++)mxUtils.bind(this,function(qa){W.push(mxUtils.bind(this,function(){try{if(null!=qa){var ra=U.convert(qa.getAttribute(ja));if(null!=ra&&"data:"!=ra.substring(0,5)){var xa=Y[ra];null==xa?this.convertImageToDataUri(ra,+function(Ba){null!=Ba&&(Y[ra]=Ba,qa.setAttribute(ja,Ba));K()},null,Editor.svgRasterScale):(qa.setAttribute(ja,xa),K())}else null!=ra&&qa.setAttribute(ja,ra),K()}}catch(Ba){K()}}))})(ca[oa])});H("image","xlink:href");H("img","src");K()};Editor.base64Encode=function(l){for(var t="",H=0,U=l.length,K,W,Y;H<U;){K=l.charCodeAt(H++)&255;if(H==U){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(K>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((K&+3)<<4);t+="==";break}W=l.charCodeAt(H++);if(H==U){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(K>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((K&3)<<4|(W&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2);t+="=";break}Y=l.charCodeAt(H++);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(K>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((K&+3)<<4|(W&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2|(Y&192)>>6);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y&63)}return t};Editor.prototype.loadUrl=function(l,t,H,U,K,W,Y,ca){try{var ja=!Y&&(U||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));K=null!=K?K:!0;var oa=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(qa){if(200<=qa.getStatus()&&+299>=qa.getStatus()){if(null!=t){var ra=qa.getText();if(ja){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){qa=mxUtilsBinaryToArray(qa.request.responseBody).toArray();ra=Array(qa.length);for(var xa=0;xa<qa.length;xa++)ra[xa]=String.fromCharCode(qa[xa]);ra=ra.join("")}W=null!=W?W:"data:image/png;base64,";ra=W+Editor.base64Encode(ra)}t(ra)}}else null!=H&&(0==qa.getStatus()?H({message:mxResources.get("accessDenied")},qa):404==qa.getStatus()?+H({message:mxResources.get("fileNotFound"),code:qa.getStatus()},qa):H({message:this.getErrorMessage(qa)},qa))}),function(qa){null!=H&&H({message:mxResources.get("error")+" "+qa.getStatus()})},ja,this.timeout,function(){K&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:oa})},ca)});oa()}catch(qa){null!=H&&H(qa)}};Editor.prototype.getErrorMessage=function(l){var t=mxResources.get("error")+" "+l.getStatus();try{var H=l.getText(),U=JSON.parse(H);null!=U&&null!=U.error&&null!=U.error.message&&(t=U.error.message++" ("+t+")")}catch(K){}return t};Editor.prototype.absoluteCssFonts=function(l){var t=null;if(null!=l){var H=l.split("url(");if(0<H.length){t=[H[0]];l=window.location.pathname;var U=null!=l?l.lastIndexOf("/"):-1;0<=U&&(l=l.substring(0,U+1));U=document.getElementsByTagName("base");var K=null;null!=U&&0<U.length&&(K=U[0].getAttribute("href"));for(var W=1;W<H.length;W++)if(U=H[W].indexOf(")"),0<U){var Y=Editor.trimCssUrl(H[W].substring(0,U));this.graph.isRelativeUrl(Y)&&(Y=null!=K?K+Y:window.location.protocol++"//"+window.location.hostname+("/"==Y.charAt(0)?"":l)+Y);t.push('url("'+Y+'"'+H[W].substring(U))}else t.push(H[W])}else t=[l]}return null!=t?t.join(""):null};Editor.prototype.mapFontUrl=function(l,t,H){/^https?:\/\//.test(t)&&!this.isCorsEnabledForUrl(t)&&(t=PROXY_URL+"?url="+encodeURIComponent(t));H(l,t)};Editor.prototype.embedCssFonts=function(l,t){var H=l.split("url("),U=0;null==this.cachedFonts&&(this.cachedFonts={});var K=mxUtils.bind(this,function(){if(0==U){for(var ja=[H[0]],oa=1;oa<H.length;oa++){var qa=+H[oa].indexOf(")");ja.push('url("');ja.push(this.cachedFonts[Editor.trimCssUrl(H[oa].substring(0,qa))]);ja.push('"'+H[oa].substring(qa))}t(ja.join(""))}});if(0<H.length){for(l=1;l<H.length;l++){var W=H[l].indexOf(")"),Y=null,ca=H[l].indexOf("format(",W);0<ca&&(Y=Editor.trimCssUrl(H[l].substring(ca+7,H[l].indexOf(")",ca))));mxUtils.bind(this,function(ja){if(null==this.cachedFonts[ja]){this.cachedFonts[ja]=ja;U++;var oa="application/x-font-ttf";if("svg"==Y||/(\.svg)($|\?)/i.test(ja))oa="image/svg+xml";else if("otf"==Y||"embedded-opentype"==Y||/(\.otf)($|\?)/i.test(ja))oa="application/x-font-opentype";else if("woff"==Y||/(\.woff)($|\?)/i.test(ja))oa="application/font-woff";else if("woff2"==Y||/(\.woff2)($|\?)/i.test(ja))oa="application/font-woff2";else if("eot"==Y||/(\.eot)($|\?)/i.test(ja))oa="application/vnd.ms-fontobject";else if("sfnt"==Y||/(\.sfnt)($|\?)/i.test(ja))oa="application/font-sfnt";this.mapFontUrl(oa,ja,mxUtils.bind(this,function(qa,ra){this.loadUrl(ra,mxUtils.bind(this,function(xa){this.cachedFonts[ja]=-xa;V--;J()}),mxUtils.bind(this,function(xa){V--;J()}),!0,null,"data:"+qa+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(I[l].substring(0,W)),Y)}J()}else t(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(t){this.resolvedFontCss=t;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=function(){var l={},t;for(t in Graph.fontMapping)Graph.isCssFontUrl(t)&&(l[t]=Graph.fontMapping[t]);-return l};Editor.prototype.embedExtFonts=function(l){var t=this.graph.getCustomFonts();if(0<t.length){var I=[],V=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var J=mxUtils.bind(this,function(){0==V&&this.embedCssFonts(I.join(""),l)}),W=0;W<t.length;W++)mxUtils.bind(this,function(Y,ba){Graph.isCssFontUrl(ba)?null==this.cachedGoogleFonts[ba]?(V++,this.loadUrl(Graph.rewriteGoogleFontUrl(ba),mxUtils.bind(this,function(ja){this.cachedGoogleFonts[ba]=ja;I.push(ja+-"\n");V--;J()}),mxUtils.bind(this,function(ja){V--;I.push("@import url("+ba+");\n");J()}))):I.push(this.cachedGoogleFonts[ba]+"\n"):I.push('@font-face {font-family: "'+Y+'";src: url("'+ba+'")}\n')})(t[W].name,t[W].url);J()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&0<l.length)for(var t=document.getElementsByTagName("style"),I=0;I<t.length;I++){var V=mxUtils.getTextContent(t[I]);0>V.indexOf("mxPageSelector")&&0<V.indexOf("MathJax")&&l[0].appendChild(t[I].cloneNode(!0))}};-Editor.prototype.addFontCss=function(l,t){t=null!=t?t:this.absoluteCssFonts(this.fontCss);if(null!=t){var I=mxUtils.getSvgDefs(l),V=t.split("\n");t=[];for(var J=[],W=0;W<V.length;W++)"@import"==V[W].substring(0,7)?t.push(V[W]):J.push(V[W]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"style"):l.createElement("style");l.setAttribute("type","text/css");0<t.length&&(mxUtils.setTextContent(l,t.join("\n")),I.appendChild(l));0<J.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,-J.join("\n")),I.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(l,t,I){var V=mxClient.IS_FF?8192:16384;return Math.min(I,Math.min(V/l,V/t))};Editor.prototype.exportToCanvas=function(l,t,I,V,J,W,Y,ba,ja,oa,qa,ra,xa,Ba,ya,Da,La,sa){try{W=null!=W?W:!0;Y=null!=Y?Y:!0;ra=null!=ra?ra:this.graph;xa=null!=xa?xa:0;var Aa=ja?null:ra.background;Aa==mxConstants.NONE&&(Aa=null);null==Aa&&(Aa=V);null==-Aa&&0==ja&&(Aa="dark"==Da?Editor.darkColor:"#ffffff");this.convertImages(ra.getSvg(null,null,xa,Ba,null,Y,null,null,null,oa,null,Da,La,sa),mxUtils.bind(this,function(Ea){try{var Ka=new Image;Ka.onload=mxUtils.bind(this,function(){try{var za=function(){mxClient.IS_SF?window.setTimeout(function(){Pa.drawImage(Ka,0,0);l(Wa,Ea)},0):(Pa.drawImage(Ka,0,0),l(Wa,Ea))},Wa=document.createElement("canvas"),Ia=parseInt(Ea.getAttribute("width")),Xa=parseInt(Ea.getAttribute("height"));ba=null!=ba?ba:1;null!=t&&-(ba=W?Math.min(1,Math.min(3*t/(4*Xa),t/Ia)):t/Ia);ba=this.getMaxCanvasScale(Ia,Xa,ba);Ia=Math.ceil(ba*Ia);Xa=Math.ceil(ba*Xa);Wa.setAttribute("width",Ia);Wa.setAttribute("height",Xa);var Pa=Wa.getContext("2d");null!=Aa&&(Pa.beginPath(),Pa.rect(0,0,Ia,Xa),Pa.fillStyle=Aa,Pa.fill());1!=ba&&Pa.scale(ba,ba);if(ya){var u=ra.view,N=u.scale;u.scale=1;var R=btoa(unescape(encodeURIComponent(u.createSvgGrid(u.gridColor))));u.scale=N;R="data:image/svg+xml;base64,"+R;var X=ra.gridSize*u.gridSteps*ba,ia=ra.getGraphBounds(),-ka=u.translate.x*N,pa=u.translate.y*N,wa=ka+(ia.x-ka)/N-xa,ta=pa+(ia.y-pa)/N-xa,ua=new Image;ua.onload=function(){try{for(var Ca=-Math.round(X-mxUtils.mod((ka-wa)*ba,X)),Na=-Math.round(X-mxUtils.mod((pa-ta)*ba,X));Ca<Ia;Ca+=X)for(var Ya=Na;Ya<Xa;Ya+=X)Pa.drawImage(ua,Ca/ba,Ya/ba);za()}catch(Za){null!=J&&J(Za)}};ua.onerror=function(Ca){null!=J&&J(Ca)};ua.src=R}else za()}catch(Ca){null!=J&&J(Ca)}});Ka.onerror=function(za){null!=J&&J(za)};oa&&this.graph.addSvgShadow(Ea);this.graph.mathEnabled&&this.addMathCss(Ea);-var Ma=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ea,this.resolvedFontCss),Ka.src=Editor.createSvgDataUri(mxUtils.getXml(Ea))}catch(za){null!=J&&J(za)}});this.embedExtFonts(mxUtils.bind(this,function(za){try{null!=za&&this.addFontCss(Ea,za),this.loadFonts(Ma)}catch(Wa){null!=J&&J(Wa)}}))}catch(za){null!=J&&J(za)}}),I,qa)}catch(Ea){null!=J&&J(Ea)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,A=0;8>A;A++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=-p;Editor.updateCRC=function(l,t,I,V){for(var J=0;J<V;J++)l=Editor.crcTable[(l^t.charCodeAt(I+J))&255]^l>>>8;return l};Editor.crc32=function(l){for(var t=-1,I=0;I<l.length;I++)t=t>>>8^Editor.crcTable[(t^l.charCodeAt(I))&255];return(t^-1)>>>0};Editor.writeGraphModelToPng=function(l,t,I,V,J){function W(qa,ra){var xa=ja;ja+=ra;return qa.substring(xa,ja)}function Y(qa){qa=W(qa,4);return qa.charCodeAt(3)+(qa.charCodeAt(2)<<8)+(qa.charCodeAt(1)<<16)+(qa.charCodeAt(0)<<24)}function ba(qa){return String.fromCharCode(qa>>-24&255,qa>>16&255,qa>>8&255,qa&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?atob(l):Base64.decode(l,!0);var ja=0;if(W(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=J&&J();else if(W(l,4),"IHDR"!=W(l,4))null!=J&&J();else{W(l,17);J=l.substring(0,ja);do{var oa=Y(l);if("IDAT"==W(l,4)){J=l.substring(0,ja-8);"pHYs"==t&&"dpi"==I?(I=Math.round(V/.0254),I=ba(I)+ba(I)+String.fromCharCode(1)):I=I+String.fromCharCode(0)+("zTXt"==t?String.fromCharCode(0):"")+V;V=4294967295;V=-Editor.updateCRC(V,t,0,4);V=Editor.updateCRC(V,I,0,I.length);J+=ba(I.length)+t+I+ba(V^4294967295);J+=l.substring(ja-8,l.length);break}J+=l.substring(ja-8,ja-4+oa);W(l,oa);W(l,4)}while(oa);return"data:image/png;base64,"+(window.btoa?btoa(J):Base64.encode(J,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,t){G.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);-mxSettings.save()};var T=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){T.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,t){var I=null;null!=l.editor.graph.getModel().getParent(t)?I=t.getId():null!=l.currentPage&&(I=l.currentPage.getId());return I});if(null!=window.StyleFormatPanel){var F=Format.prototype.init;Format.prototype.init=function(){F.apply(this,+xa;U--;K()}),mxUtils.bind(this,function(xa){U--;K()}),!0,null,"data:"+qa+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(H[l].substring(0,W)),Y)}K()}else t(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(t){this.resolvedFontCss=t;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=function(){var l={},t;for(t in Graph.fontMapping)Graph.isCssFontUrl(t)&&(l[t]=Graph.fontMapping[t]);+return l};Editor.prototype.embedExtFonts=function(l){var t=this.graph.getCustomFonts();if(0<t.length){var H=[],U=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var K=mxUtils.bind(this,function(){0==U&&this.embedCssFonts(H.join(""),l)}),W=0;W<t.length;W++)mxUtils.bind(this,function(Y,ca){Graph.isCssFontUrl(ca)?null==this.cachedGoogleFonts[ca]?(U++,this.loadUrl(Graph.rewriteGoogleFontUrl(ca),mxUtils.bind(this,function(ja){this.cachedGoogleFonts[ca]=ja;H.push(ja++"\n");U--;K()}),mxUtils.bind(this,function(ja){U--;H.push("@import url("+ca+");\n");K()}))):H.push(this.cachedGoogleFonts[ca]+"\n"):H.push('@font-face {font-family: "'+Y+'";src: url("'+ca+'")}\n')})(t[W].name,t[W].url);K()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&0<l.length)for(var t=document.getElementsByTagName("style"),H=0;H<t.length;H++){var U=mxUtils.getTextContent(t[H]);0>U.indexOf("mxPageSelector")&&0<U.indexOf("MathJax")&&l[0].appendChild(t[H].cloneNode(!0))}};+Editor.prototype.addFontCss=function(l,t){t=null!=t?t:this.absoluteCssFonts(this.fontCss);if(null!=t){var H=mxUtils.getSvgDefs(l),U=t.split("\n");t=[];for(var K=[],W=0;W<U.length;W++)"@import"==U[W].substring(0,7)?t.push(U[W]):K.push(U[W]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"style"):l.createElement("style");l.setAttribute("type","text/css");0<t.length&&(mxUtils.setTextContent(l,t.join("\n")),H.appendChild(l));0<K.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,+K.join("\n")),H.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(l,t,H){var U=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(U/l,U/t))};Editor.prototype.exportToCanvas=function(l,t,H,U,K,W,Y,ca,ja,oa,qa,ra,xa,Ba,ya,Da,La,sa){try{W=null!=W?W:!0;Y=null!=Y?Y:!0;ra=null!=ra?ra:this.graph;xa=null!=xa?xa:0;var Aa=ja?null:ra.background;Aa==mxConstants.NONE&&(Aa=null);null==Aa&&(Aa=U);null==+Aa&&0==ja&&(Aa="dark"==Da?Editor.darkColor:"#ffffff");this.convertImages(ra.getSvg(null,null,xa,Ba,null,Y,null,null,null,oa,null,Da,La,sa),mxUtils.bind(this,function(Ea){try{var Ka=new Image;Ka.onload=mxUtils.bind(this,function(){try{var za=function(){mxClient.IS_SF?window.setTimeout(function(){Pa.drawImage(Ka,0,0);l(Wa,Ea)},0):(Pa.drawImage(Ka,0,0),l(Wa,Ea))},Wa=document.createElement("canvas"),Ia=parseInt(Ea.getAttribute("width")),Xa=parseInt(Ea.getAttribute("height"));ca=null!=ca?ca:1;null!=t&&+(ca=W?Math.min(1,Math.min(3*t/(4*Xa),t/Ia)):t/Ia);ca=this.getMaxCanvasScale(Ia,Xa,ca);Ia=Math.ceil(ca*Ia);Xa=Math.ceil(ca*Xa);Wa.setAttribute("width",Ia);Wa.setAttribute("height",Xa);var Pa=Wa.getContext("2d");null!=Aa&&(Pa.beginPath(),Pa.rect(0,0,Ia,Xa),Pa.fillStyle=Aa,Pa.fill());1!=ca&&Pa.scale(ca,ca);if(ya){var u=ra.view,N=u.scale;u.scale=1;var R=btoa(unescape(encodeURIComponent(u.createSvgGrid(u.gridColor))));u.scale=N;R="data:image/svg+xml;base64,"+R;var X=ra.gridSize*u.gridSteps*ca,ia=ra.getGraphBounds(),+ka=u.translate.x*N,pa=u.translate.y*N,wa=ka+(ia.x-ka)/N-xa,ta=pa+(ia.y-pa)/N-xa,ua=new Image;ua.onload=function(){try{for(var Ca=-Math.round(X-mxUtils.mod((ka-wa)*ca,X)),Na=-Math.round(X-mxUtils.mod((pa-ta)*ca,X));Ca<Ia;Ca+=X)for(var Ya=Na;Ya<Xa;Ya+=X)Pa.drawImage(ua,Ca/ca,Ya/ca);za()}catch(Za){null!=K&&K(Za)}};ua.onerror=function(Ca){null!=K&&K(Ca)};ua.src=R}else za()}catch(Ca){null!=K&&K(Ca)}});Ka.onerror=function(za){null!=K&&K(za)};oa&&this.graph.addSvgShadow(Ea);this.graph.mathEnabled&&this.addMathCss(Ea);+var Ma=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ea,this.resolvedFontCss),Ka.src=Editor.createSvgDataUri(mxUtils.getXml(Ea))}catch(za){null!=K&&K(za)}});this.embedExtFonts(mxUtils.bind(this,function(za){try{null!=za&&this.addFontCss(Ea,za),this.loadFonts(Ma)}catch(Wa){null!=K&&K(Wa)}}))}catch(za){null!=K&&K(za)}}),H,qa)}catch(Ea){null!=K&&K(Ea)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,A=0;8>A;A++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=+p;Editor.updateCRC=function(l,t,H,U){for(var K=0;K<U;K++)l=Editor.crcTable[(l^t.charCodeAt(H+K))&255]^l>>>8;return l};Editor.crc32=function(l){for(var t=-1,H=0;H<l.length;H++)t=t>>>8^Editor.crcTable[(t^l.charCodeAt(H))&255];return(t^-1)>>>0};Editor.writeGraphModelToPng=function(l,t,H,U,K){function W(qa,ra){var xa=ja;ja+=ra;return qa.substring(xa,ja)}function Y(qa){qa=W(qa,4);return qa.charCodeAt(3)+(qa.charCodeAt(2)<<8)+(qa.charCodeAt(1)<<16)+(qa.charCodeAt(0)<<24)}function ca(qa){return String.fromCharCode(qa>>+24&255,qa>>16&255,qa>>8&255,qa&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?atob(l):Base64.decode(l,!0);var ja=0;if(W(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=K&&K();else if(W(l,4),"IHDR"!=W(l,4))null!=K&&K();else{W(l,17);K=l.substring(0,ja);do{var oa=Y(l);if("IDAT"==W(l,4)){K=l.substring(0,ja-8);"pHYs"==t&&"dpi"==H?(H=Math.round(U/.0254),H=ca(H)+ca(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==t?String.fromCharCode(0):"")+U;U=4294967295;U=+Editor.updateCRC(U,t,0,4);U=Editor.updateCRC(U,H,0,H.length);K+=ca(H.length)+t+H+ca(U^4294967295);K+=l.substring(ja-8,l.length);break}K+=l.substring(ja-8,ja-4+oa);W(l,oa);W(l,4)}while(oa);return"data:image/png;base64,"+(window.btoa?btoa(K):Base64.encode(K,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,t){G.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);+mxSettings.save()};var S=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){S.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,t){var H=null;null!=l.editor.graph.getModel().getParent(t)?H=t.getId():null!=l.currentPage&&(H=l.currentPage.getId());return H});if(null!=window.StyleFormatPanel){var F=Format.prototype.init;Format.prototype.init=function(){F.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var P=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?P.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(l){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var Q=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=-function(l){l=Q.apply(this,arguments);var t=this.editorUi,I=t.editor.graph;if(I.isEnabled()){var V=t.getCurrentFile();null!=V&&V.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),function(){return t.editor.autosave},function(Y){t.editor.setAutosave(Y);t.editor.autosave&&V.isModified()&&V.fileChanged()},{install:function(Y){this.listener=function(){Y(t.editor.autosave)};t.editor.addListener("autosaveChanged",this.listener)},destroy:function(){t.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&-I.isEnabled()&&"undefined"!==typeof MathJax){var J=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return I.mathEnabled},function(Y){t.actions.get("mathematicalTypesetting").funct()},{install:function(Y){this.listener=function(){Y(I.mathEnabled)};t.addListener("mathEnabledChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}});l.appendChild(J);if(!t.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var W=t.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting");-W.style.position="absolute";W.style.left="85%";J.appendChild(W)}}return l};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",+function(l){l=Q.apply(this,arguments);var t=this.editorUi,H=t.editor.graph;if(H.isEnabled()){var U=t.getCurrentFile();null!=U&&U.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),function(){return t.editor.autosave},function(Y){t.editor.setAutosave(Y);t.editor.autosave&&U.isModified()&&U.fileChanged()},{install:function(Y){this.listener=function(){Y(t.editor.autosave)};t.editor.addListener("autosaveChanged",this.listener)},destroy:function(){t.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&+H.isEnabled()&&"undefined"!==typeof MathJax){var K=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(Y){t.actions.get("mathematicalTypesetting").funct()},{install:function(Y){this.listener=function(){Y(H.mathEnabled)};t.addListener("mathEnabledChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}});l.appendChild(K);if(!t.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var W=t.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting");+W.style.position="absolute";W.style.left="85%";K.appendChild(W)}}return l};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.25,@@ -3313,95 +3313,95 @@ min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},-{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(l,t,I,V){if(null!=t){var J=mxUtils.bind(this,function(Y){if(null!=Y)if(I)for(var ba=0;ba<Y.length;ba++){if("function"!==typeof Y[ba].isVisible||Y[ba].isVisible(V,this))t[Y[ba].name]=Y[ba]}else for(var ja in t){var oa=!1;for(ba=-0;ba<Y.length;ba++)if(Y[ba].name==ja&&Y[ba].type==t[ja].type){oa=!0;break}oa||delete t[ja]}}),W=this.editorUi.editor.graph.view.getState(l);null!=W&&null!=W.shape&&(W.shape.commonCustomPropAdded||(W.shape.commonCustomPropAdded=!0,W.shape.customProperties=W.shape.customProperties||[],W.cell.vertex?Array.prototype.push.apply(W.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(W.shape.customProperties,Editor.commonEdgeProperties)),J(W.shape.customProperties));l=l.getAttribute("customProperties");-if(null!=l)try{J(JSON.parse(l))}catch(Y){}}};var U=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=l.style.shape&&!l.containsLabel&&0<l.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));U.apply(this,arguments);if(Editor.enableCustomProperties){for(var t={},I=l.vertices,V=l.edges,J=0;J<I.length;J++)this.findCommonProperties(I[J],t,-0==J,l);for(J=0;J<V.length;J++)this.findCommonProperties(V[J],t,0==I.length&&0==J,l);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(t).length&&this.container.appendChild(this.addProperties(this.createPanel(),t,l))}};var c=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var t=this.editorUi.getSelectionState();1==t.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=t.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);c.apply(this,-arguments);return l};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,t,I,V){function J(Pa,u,N,R,X){if(null!=N.valueChanged)N.valueChanged(u,X);else{xa.getModel().beginUpdate();try{X=[];var ia=[];if(null!=N.index){for(var ka=[],pa=N.parentRow.nextSibling;pa&&pa.getAttribute("data-pName")==Pa;)ka.push(pa.getAttribute("data-pValue")),pa=pa.nextSibling;N.index<ka.length?null!=R?ka.splice(R,1):ka[N.index]=u:ka.push(u);null!=N.size&&ka.length>N.size&&(ka=ka.slice(0,+{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(l,t,H,U){if(null!=t){var K=mxUtils.bind(this,function(Y){if(null!=Y)if(H)for(var ca=0;ca<Y.length;ca++){if("function"!==typeof Y[ca].isVisible||Y[ca].isVisible(U,this))t[Y[ca].name]=Y[ca]}else for(var ja in t){var oa=!1;for(ca=+0;ca<Y.length;ca++)if(Y[ca].name==ja&&Y[ca].type==t[ja].type){oa=!0;break}oa||delete t[ja]}}),W=this.editorUi.editor.graph.view.getState(l);null!=W&&null!=W.shape&&(W.shape.commonCustomPropAdded||(W.shape.commonCustomPropAdded=!0,W.shape.customProperties=W.shape.customProperties||[],W.cell.vertex?Array.prototype.push.apply(W.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(W.shape.customProperties,Editor.commonEdgeProperties)),K(W.shape.customProperties));l=l.getAttribute("customProperties");+if(null!=l)try{K(JSON.parse(l))}catch(Y){}}};var T=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=l.style.shape&&!l.containsLabel&&0<l.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));T.apply(this,arguments);if(Editor.enableCustomProperties){for(var t={},H=l.vertices,U=l.edges,K=0;K<H.length;K++)this.findCommonProperties(H[K],t,+0==K,l);for(K=0;K<U.length;K++)this.findCommonProperties(U[K],t,0==H.length&&0==K,l);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(t).length&&this.container.appendChild(this.addProperties(this.createPanel(),t,l))}};var c=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var t=this.editorUi.getSelectionState();1==t.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=t.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);c.apply(this,+arguments);return l};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,t,H,U){function K(Pa,u,N,R,X){if(null!=N.valueChanged)N.valueChanged(u,X);else{xa.getModel().beginUpdate();try{X=[];var ia=[];if(null!=N.index){for(var ka=[],pa=N.parentRow.nextSibling;pa&&pa.getAttribute("data-pName")==Pa;)ka.push(pa.getAttribute("data-pValue")),pa=pa.nextSibling;N.index<ka.length?null!=R?ka.splice(R,1):ka[N.index]=u:ka.push(u);null!=N.size&&ka.length>N.size&&(ka=ka.slice(0,N.size));u=ka.join(",");null!=N.countProperty&&(xa.setCellStyles(N.countProperty,ka.length,xa.getSelectionCells()),X.push(N.countProperty),ia.push(ka.length))}xa.setCellStyles(Pa,u,xa.getSelectionCells());X.push(Pa);ia.push(u);if(null!=N.dependentProps)for(Pa=0;Pa<N.dependentProps.length;Pa++){var wa=N.dependentPropsDefVal[Pa],ta=N.dependentPropsVals[Pa];if(ta.length>u)ta=ta.slice(0,u);else for(var ua=ta.length;ua<u;ua++)ta.push(wa);ta=ta.join(",");xa.setCellStyles(N.dependentProps[Pa],ta,xa.getSelectionCells());X.push(N.dependentProps[Pa]);ia.push(ta)}if("function"==typeof N.onChange)N.onChange(xa,u);ra.editorUi.fireEvent(new mxEventObject("styleChanged","keys",X,"values",ia,"cells",xa.getSelectionCells()))}finally{xa.getModel().endUpdate()}}}function W(Pa,u,N){var R=mxUtils.getOffset(l,!0),X=mxUtils.getOffset(Pa,!0);u.style.position="absolute";u.style.left=X.x-R.x+"px";u.style.top=X.y-R.y+"px";u.style.width=Pa.offsetWidth+"px";u.style.height=Pa.offsetHeight-(N?4:0)+"px";u.style.zIndex=5}function Y(Pa,u,N){function R(ia){if(null==ia||ia==mxConstants.NONE)X.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==ia)X.style.background="";else{var ka=mxUtils.getLightDarkColor(ia);mxUtils.isLightDarkColor(ia)&&ka.light!=ka.dark?X.style.background="linear-gradient(to right bottom, "+ka.cssText+" 50%, "+mxUtils.invertLightDarkColor(ka).cssText+" 50.3%)":X.style.background=ia}}var X=document.createElement("div");X.style.width="32px";X.style.height="8px";X.style.margin="2px";X.style.borderStyle=-"solid";X.style.borderWidth="1px";R(u);btn=mxUtils.button("",mxUtils.bind(ra,function(ia){this.editorUi.pickColor(u,function(ka){J(Pa,ka,N);R(ka)});mxEvent.consume(ia)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(X);return btn}function ba(Pa,u,N,R,X,ia,ka){null!=u&&(u=u.split(","),Ba.push({name:Pa,values:u,type:N,defVal:R,countProperty:X,parentRow:ia,isDeletable:!0,flipBkg:ka}));btn=mxUtils.button("+",-mxUtils.bind(ra,function(pa){for(var wa=ia,ta=0;null!=wa.nextSibling;)if(wa.nextSibling.getAttribute("data-pName")==Pa)wa=wa.nextSibling,ta++;else break;var ua={type:N,parentRow:ia,index:ta,isDeletable:!0,defVal:R,countProperty:X};ta=qa(Pa,"",ua,0==ta%2,ka);J(Pa,R,ua);wa.parentNode.insertBefore(ta,wa.nextSibling);mxEvent.consume(pa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ja(Pa,u,N,R,X,ia,ka){if(0<X){var pa=Array(X);u=null!=u?u.split(","):[];-for(var wa=0;wa<X;wa++)pa[wa]=null!=u[wa]?u[wa]:null!=R?R:"";Ba.push({name:Pa,values:pa,type:N,defVal:R,parentRow:ia,flipBkg:ka,size:X})}return document.createElement("div")}function oa(Pa,u,N){var R=document.createElement("input");R.type="checkbox";R.checked="1"==u;mxEvent.addListener(R,"change",function(){J(Pa,R.checked?"1":"0",N)});return R}function qa(Pa,u,N,R,X){var ia=N.dispName,ka=N.type,pa=document.createElement("tr");pa.className="gePropRow"+(X?"Dark":"")+(R?"Alt":"")+" gePropNonHeaderRow";+"solid";X.style.borderWidth="1px";R(u);btn=mxUtils.button("",mxUtils.bind(ra,function(ia){this.editorUi.pickColor(u,function(ka){K(Pa,ka,N);R(ka)});mxEvent.consume(ia)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(X);return btn}function ca(Pa,u,N,R,X,ia,ka){null!=u&&(u=u.split(","),Ba.push({name:Pa,values:u,type:N,defVal:R,countProperty:X,parentRow:ia,isDeletable:!0,flipBkg:ka}));btn=mxUtils.button("+",+mxUtils.bind(ra,function(pa){for(var wa=ia,ta=0;null!=wa.nextSibling;)if(wa.nextSibling.getAttribute("data-pName")==Pa)wa=wa.nextSibling,ta++;else break;var ua={type:N,parentRow:ia,index:ta,isDeletable:!0,defVal:R,countProperty:X};ta=qa(Pa,"",ua,0==ta%2,ka);K(Pa,R,ua);wa.parentNode.insertBefore(ta,wa.nextSibling);mxEvent.consume(pa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ja(Pa,u,N,R,X,ia,ka){if(0<X){var pa=Array(X);u=null!=u?u.split(","):[];+for(var wa=0;wa<X;wa++)pa[wa]=null!=u[wa]?u[wa]:null!=R?R:"";Ba.push({name:Pa,values:pa,type:N,defVal:R,parentRow:ia,flipBkg:ka,size:X})}return document.createElement("div")}function oa(Pa,u,N){var R=document.createElement("input");R.type="checkbox";R.checked="1"==u;mxEvent.addListener(R,"change",function(){K(Pa,R.checked?"1":"0",N)});return R}function qa(Pa,u,N,R,X){var ia=N.dispName,ka=N.type,pa=document.createElement("tr");pa.className="gePropRow"+(X?"Dark":"")+(R?"Alt":"")+" gePropNonHeaderRow";pa.setAttribute("data-pName",Pa);pa.setAttribute("data-pValue",u);R=!1;null!=N.index&&(pa.setAttribute("data-index",N.index),ia=(null!=ia?ia:"")+"["+N.index+"]",R=!0);var wa=document.createElement("td");wa.className="gePropRowCell";ia=mxResources.get(ia,null,ia);mxUtils.write(wa,ia);wa.setAttribute("title",ia);R&&(wa.style.textAlign="right");pa.appendChild(wa);wa=document.createElement("td");wa.className="gePropRowCell";wa.setAttribute("title",null!=u?u:mxResources.get("none"));if("color"==ka)wa.appendChild(Y(Pa,u,N));else if("bool"==ka||"boolean"==ka)wa.appendChild(oa(Pa,u,N));else if("enum"==ka){var ta=N.enumList;for(X=0;X<ta.length;X++)if(ia=ta[X],ia.val==u){mxUtils.write(wa,mxResources.get(ia.dispName,null,ia.dispName));break}mxEvent.addListener(wa,"click",mxUtils.bind(ra,function(){var ua=document.createElement("select"),Ca=null;W(wa,ua);for(var Na=0;Na<ta.length;Na++){var Ya=ta[Na],Za=document.createElement("option");Za.value=mxUtils.htmlEntities(Ya.val);mxUtils.write(Za,mxResources.get(Ya.dispName,-null,Ya.dispName));ua.appendChild(Za);null==Ya.val&&(Za.value="null",Ca=Za)}ua.value=null==u&&null!=Ca?"null":u;l.appendChild(ua);mxEvent.addListener(ua,"change",function(){var ab=mxUtils.htmlEntities(ua.value);if(ua[ua.selectedIndex]==Ca||"null"==ab.value)ab=null;J(Pa,ab,N)});ua.focus();mxEvent.addListener(ua,"blur",function(){l.removeChild(ua)})}))}else"dynamicArr"==ka?wa.appendChild(ba(Pa,u,N.subType,N.subDefVal,N.countProperty,pa,X)):"staticArr"==ka?wa.appendChild(ja(Pa,u,N.subType,N.subDefVal,+null,Ya.dispName));ua.appendChild(Za);null==Ya.val&&(Za.value="null",Ca=Za)}ua.value=null==u&&null!=Ca?"null":u;l.appendChild(ua);mxEvent.addListener(ua,"change",function(){var ab=mxUtils.htmlEntities(ua.value);if(ua[ua.selectedIndex]==Ca||"null"==ab.value)ab=null;K(Pa,ab,N)});ua.focus();mxEvent.addListener(ua,"blur",function(){l.removeChild(ua)})}))}else"dynamicArr"==ka?wa.appendChild(ca(Pa,u,N.subType,N.subDefVal,N.countProperty,pa,X)):"staticArr"==ka?wa.appendChild(ja(Pa,u,N.subType,N.subDefVal,N.size,pa,X)):"readOnly"==ka?(X=document.createElement("input"),X.setAttribute("readonly",""),X.value=u,X.style.borderWidth="0px","id"==Pa?(X.style.width="190px",X.style.position="relative",X.style.right="6px",X.style.float="right",X.style.background="none",X.style.textAlign="right",pa.firstChild.setAttribute("colspan","2"),X.setAttribute("title",u),pa.firstChild.appendChild(X)):(X.style.width="96px",wa.appendChild(X))):(wa.innerHTML=mxUtils.htmlEntities(decodeURIComponent(u)),mxEvent.addListener(wa,-"click",mxUtils.bind(ra,function(){function ua(){var Na=Ca.value;Na=0==Na.length&&"string"!=ka&&"numbers"!=ka?0:Na;N.allowAuto&&(null!=Na.trim&&"auto"==Na.trim().toLowerCase()?(Na="auto",ka="string"):(Na=parseFloat(Na),Na=isNaN(Na)?0:Na));null!=N.min&&Na<N.min?Na=N.min:null!=N.max&&Na>N.max&&(Na=N.max);var Ya=null;try{Ya="numbers"==ka?Na.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==ka?parseInt(Na):Na)+"")}catch(Za){}J(Pa,Ya,N,null,Ca)}var Ca=document.createElement("input");W(wa,-Ca,!0);Ca.value=decodeURIComponent(u);Ca.className="gePropEditor";"int"!=ka&&"float"!=ka||N.allowAuto||(Ca.type="number",Ca.step="int"==ka?"1":"any",null!=N.min&&(Ca.min=parseFloat(N.min)),null!=N.max&&(Ca.max=parseFloat(N.max)));l.appendChild(Ca);mxEvent.addListener(Ca,"keypress",function(Na){13==Na.keyCode&&ua()});Ca.focus();mxEvent.addListener(Ca,"blur",function(){ua()})})));N.isDeletable&&(X=mxUtils.button("-",mxUtils.bind(ra,function(ua){J(Pa,"",N,N.index);mxEvent.consume(ua)})),X.style.height=+"click",mxUtils.bind(ra,function(){function ua(){var Na=Ca.value;Na=0==Na.length&&"string"!=ka&&"numbers"!=ka?0:Na;N.allowAuto&&(null!=Na.trim&&"auto"==Na.trim().toLowerCase()?(Na="auto",ka="string"):(Na=parseFloat(Na),Na=isNaN(Na)?0:Na));null!=N.min&&Na<N.min?Na=N.min:null!=N.max&&Na>N.max&&(Na=N.max);var Ya=null;try{Ya="numbers"==ka?Na.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==ka?parseInt(Na):Na)+"")}catch(Za){}K(Pa,Ya,N,null,Ca)}var Ca=document.createElement("input");W(wa,+Ca,!0);Ca.value=decodeURIComponent(u);Ca.className="gePropEditor";"int"!=ka&&"float"!=ka||N.allowAuto||(Ca.type="number",Ca.step="int"==ka?"1":"any",null!=N.min&&(Ca.min=parseFloat(N.min)),null!=N.max&&(Ca.max=parseFloat(N.max)));l.appendChild(Ca);mxEvent.addListener(Ca,"keypress",function(Na){13==Na.keyCode&&ua()});Ca.focus();mxEvent.addListener(Ca,"blur",function(){ua()})})));N.isDeletable&&(X=mxUtils.button("-",mxUtils.bind(ra,function(ua){K(Pa,"",N,N.index);mxEvent.consume(ua)})),X.style.height="16px",X.style.width="25px",X.style.float="right",X.className="geColorBtn",wa.appendChild(X));pa.appendChild(wa);return pa}var ra=this,xa=this.editorUi.editor.graph,Ba=[];l.style.position="relative";l.style.padding="0";var ya=document.createElement("table");ya.className="geProperties";ya.style.whiteSpace="nowrap";ya.style.width="100%";var Da=document.createElement("tr");Da.className="gePropHeader";var La=document.createElement("th");La.className="gePropHeaderCell";La.style.paddingLeft="16px";La.style.backgroundRepeat="no-repeat";La.style.backgroundPosition="-2px 50%";La.style.backgroundSize="20px";mxUtils.write(La,mxResources.get("property"));Da.style.cursor="pointer";var sa=function(){var Pa=ya.querySelectorAll(".gePropNonHeaderRow");if(ra.editorUi.propertiesCollapsed){La.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var u="none";for(var N=l.childNodes.length-1;0<=N;N--)try{var R=l.childNodes[N],X=R.nodeName.toUpperCase();"INPUT"!=X&&"SELECT"!=X||l.removeChild(R)}catch(ia){}}else La.style.backgroundImage=-"url('"+Editor.arrowDownImage+"')",u="";for(N=0;N<Pa.length;N++)Pa[N].style.display=u};mxEvent.addListener(Da,"click",function(){ra.editorUi.propertiesCollapsed=!ra.editorUi.propertiesCollapsed;sa()});Da.appendChild(La);var Aa=document.createElement("th");Aa.className="gePropHeaderCell";Aa.style.paddingLeft="4px";mxUtils.write(Aa,mxResources.get("value"));Da.appendChild(Aa);ya.appendChild(Da);var Ea=Aa=!1;Da=null;1==I.vertices.length&&0==I.edges.length?Da=I.vertices[0].id:0==I.vertices.length&&1==-I.edges.length&&(Da=I.edges[0].id);null==Da||V||ya.appendChild(qa("id",mxUtils.htmlEntities(Da),{dispName:"id",type:"readOnly"},!0,!1));for(var Ka in t)if(V=t[Ka],"function"!=typeof V.isVisible||V.isVisible(I,this)){var Ma=null!=V.getValue?V.getValue():null!=I.style[Ka]?mxUtils.htmlEntities(I.style[Ka]+""):null!=V.getDefaultValue?V.getDefaultValue(I,this):V.defVal;if("separator"==V.type)Ea=!Ea;else{if("staticArr"==V.type)V.size=parseInt(I.style[V.sizeProperty]||t[V.sizeProperty].defVal)||0;else if(null!=-V.dependentProps){var za=V.dependentProps,Wa=[],Ia=[];for(Da=0;Da<za.length;Da++){var Xa=I.style[za[Da]];Ia.push(t[za[Da]].subDefVal);Wa.push(null!=Xa?Xa.split(","):[])}V.dependentPropsDefVal=Ia;V.dependentPropsVals=Wa}ya.appendChild(qa(Ka,Ma,V,Aa,Ea));Aa=!Aa}}for(Da=0;Da<Ba.length;Da++)for(V=Ba[Da],t=V.parentRow,I=0;I<V.values.length;I++)Ka=qa(V.name,V.values[I],{type:V.type,parentRow:V.parentRow,isDeletable:V.isDeletable,index:I,defVal:V.defVal,countProperty:V.countProperty,size:V.size},0==I%2,-V.flipBkg),t.parentNode.insertBefore(Ka,t.nextSibling),t=Ka;l.appendChild(ya);sa();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var t=function(Ba){mxEvent.addListener(Ba,"mouseenter",function(){Ba.style.opacity="1"});mxEvent.addListener(Ba,"mouseleave",function(){Ba.style.opacity="0.5"})},I=this.editorUi,V=I.editor.graph,J=document.createElement("div");J.style.whiteSpace="nowrap";J.style.paddingLeft="24px";J.style.paddingRight="20px";l.style.paddingLeft=-"16px";l.style.paddingBottom="6px";l.style.position="relative";l.appendChild(J);var W=document.createElement("div");W.style.whiteSpace="nowrap";W.style.position="relative";W.style.textAlign="center";W.style.width="210px";for(var Y=[],ba=0;ba<this.defaultColorSchemes.length;ba++){var ja=document.createElement("div");ja.style.display="inline-block";ja.style.width="6px";ja.style.height="6px";ja.style.marginLeft="4px";ja.style.marginRight="3px";ja.style.borderRadius="3px";ja.style.cursor="pointer";ja.style.background=-"transparent";ja.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(Ba){mxEvent.addListener(ja,"click",mxUtils.bind(this,function(){oa(Ba)}))})(ba);Y.push(ja);W.appendChild(ja)}var oa=mxUtils.bind(this,function(Ba){null!=Y[Ba]&&(null!=this.format.currentScheme&&null!=Y[this.format.currentScheme]&&(Y[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Ba,qa(this.defaultColorSchemes[this.format.currentScheme]),Y[this.format.currentScheme].style.background="#84d7ff")}),-qa=mxUtils.bind(this,function(Ba){var ya=mxUtils.clone(V.defaultVertexStyle);ya[mxConstants.STYLE_STROKECOLOR]=null!=ya[mxConstants.STYLE_STROKECOLOR]?ya[mxConstants.STYLE_STROKECOLOR]:"default";ya[mxConstants.STYLE_FILLCOLOR]=null!=ya[mxConstants.STYLE_FILLCOLOR]?ya[mxConstants.STYLE_FILLCOLOR]:"default";ya[mxConstants.STYLE_FONTCOLOR]=null!=ya[mxConstants.STYLE_FONTCOLOR]?ya[mxConstants.STYLE_FONTCOLOR]:"default";V.replaceDefaultColors(new mxCell,ya);var Da=mxUtils.bind(this,function(sa){var Aa=-mxUtils.button("",mxUtils.bind(this,function(Ma){V.getModel().beginUpdate();try{for(var za=I.getSelectionState().cells,Wa=0;Wa<za.length;Wa++){var Ia=V.getModel().getStyle(za[Wa]);null!=sa?(mxEvent.isShiftDown(Ma)||(Ia=""==sa.fill||null==sa.fill?mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,sa.fill),Ia=""==sa.gradient||null==sa.gradient?mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,-sa.gradient),mxEvent.isControlDown(Ma)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ma)||!V.getModel().isVertex(za[Wa])||(Ia=""==sa.font||null==sa.font?mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,sa.font))),mxEvent.isAltDown(Ma)||(Ia=""==sa.stroke||null==sa.fill?mxUtils.setStyle(Ia,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_STROKECOLOR,sa.stroke))):(Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,null),Ia=mxUtils.setStyle(Ia,-mxConstants.STYLE_STROKECOLOR,null),Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,null),V.getModel().isVertex(za[Wa])&&(Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,null)));V.getModel().setStyle(za[Wa],Ia)}}finally{V.getModel().endUpdate()}}));Aa.className="geStyleButton";Aa.style.width="36px";Aa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";Aa.style.margin="0px 6px 6px 0px";if(null!=sa){var Ea="1px solid";null!=sa.border&&(Ea=sa.border);if(null!=sa.gradient)Aa.style.backgroundImage=+"url('"+Editor.arrowDownImage+"')",u="";for(N=0;N<Pa.length;N++)Pa[N].style.display=u};mxEvent.addListener(Da,"click",function(){ra.editorUi.propertiesCollapsed=!ra.editorUi.propertiesCollapsed;sa()});Da.appendChild(La);var Aa=document.createElement("th");Aa.className="gePropHeaderCell";Aa.style.paddingLeft="4px";mxUtils.write(Aa,mxResources.get("value"));Da.appendChild(Aa);ya.appendChild(Da);var Ea=Aa=!1;Da=null;1==H.vertices.length&&0==H.edges.length?Da=H.vertices[0].id:0==H.vertices.length&&1==+H.edges.length&&(Da=H.edges[0].id);null==Da||U||ya.appendChild(qa("id",mxUtils.htmlEntities(Da),{dispName:"id",type:"readOnly"},!0,!1));for(var Ka in t)if(U=t[Ka],"function"!=typeof U.isVisible||U.isVisible(H,this)){var Ma=null!=U.getValue?U.getValue():null!=H.style[Ka]?mxUtils.htmlEntities(H.style[Ka]+""):null!=U.getDefaultValue?U.getDefaultValue(H,this):U.defVal;if("separator"==U.type)Ea=!Ea;else{if("staticArr"==U.type)U.size=parseInt(H.style[U.sizeProperty]||t[U.sizeProperty].defVal)||0;else if(null!=+U.dependentProps){var za=U.dependentProps,Wa=[],Ia=[];for(Da=0;Da<za.length;Da++){var Xa=H.style[za[Da]];Ia.push(t[za[Da]].subDefVal);Wa.push(null!=Xa?Xa.split(","):[])}U.dependentPropsDefVal=Ia;U.dependentPropsVals=Wa}ya.appendChild(qa(Ka,Ma,U,Aa,Ea));Aa=!Aa}}for(Da=0;Da<Ba.length;Da++)for(U=Ba[Da],t=U.parentRow,H=0;H<U.values.length;H++)Ka=qa(U.name,U.values[H],{type:U.type,parentRow:U.parentRow,isDeletable:U.isDeletable,index:H,defVal:U.defVal,countProperty:U.countProperty,size:U.size},0==H%2,+U.flipBkg),t.parentNode.insertBefore(Ka,t.nextSibling),t=Ka;l.appendChild(ya);sa();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var t=function(Ba){mxEvent.addListener(Ba,"mouseenter",function(){Ba.style.opacity="1"});mxEvent.addListener(Ba,"mouseleave",function(){Ba.style.opacity="0.5"})},H=this.editorUi,U=H.editor.graph,K=document.createElement("div");K.style.whiteSpace="nowrap";K.style.paddingLeft="24px";K.style.paddingRight="20px";l.style.paddingLeft=+"16px";l.style.paddingBottom="6px";l.style.position="relative";l.appendChild(K);var W=document.createElement("div");W.style.whiteSpace="nowrap";W.style.position="relative";W.style.textAlign="center";W.style.width="210px";for(var Y=[],ca=0;ca<this.defaultColorSchemes.length;ca++){var ja=document.createElement("div");ja.style.display="inline-block";ja.style.width="6px";ja.style.height="6px";ja.style.marginLeft="4px";ja.style.marginRight="3px";ja.style.borderRadius="3px";ja.style.cursor="pointer";ja.style.background=+"transparent";ja.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(Ba){mxEvent.addListener(ja,"click",mxUtils.bind(this,function(){oa(Ba)}))})(ca);Y.push(ja);W.appendChild(ja)}var oa=mxUtils.bind(this,function(Ba){null!=Y[Ba]&&(null!=this.format.currentScheme&&null!=Y[this.format.currentScheme]&&(Y[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Ba,qa(this.defaultColorSchemes[this.format.currentScheme]),Y[this.format.currentScheme].style.background="#84d7ff")}),+qa=mxUtils.bind(this,function(Ba){var ya=mxUtils.clone(U.defaultVertexStyle);ya[mxConstants.STYLE_STROKECOLOR]=null!=ya[mxConstants.STYLE_STROKECOLOR]?ya[mxConstants.STYLE_STROKECOLOR]:"default";ya[mxConstants.STYLE_FILLCOLOR]=null!=ya[mxConstants.STYLE_FILLCOLOR]?ya[mxConstants.STYLE_FILLCOLOR]:"default";ya[mxConstants.STYLE_FONTCOLOR]=null!=ya[mxConstants.STYLE_FONTCOLOR]?ya[mxConstants.STYLE_FONTCOLOR]:"default";U.replaceDefaultColors(new mxCell,ya);var Da=mxUtils.bind(this,function(sa){var Aa=+mxUtils.button("",mxUtils.bind(this,function(Ma){U.getModel().beginUpdate();try{for(var za=H.getSelectionState().cells,Wa=0;Wa<za.length;Wa++){var Ia=U.getModel().getStyle(za[Wa]);null!=sa?(mxEvent.isShiftDown(Ma)||(Ia=""==sa.fill||null==sa.fill?mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,sa.fill),Ia=""==sa.gradient||null==sa.gradient?mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,+sa.gradient),mxEvent.isControlDown(Ma)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ma)||!U.getModel().isVertex(za[Wa])||(Ia=""==sa.font||null==sa.font?mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,sa.font))),mxEvent.isAltDown(Ma)||(Ia=""==sa.stroke||null==sa.fill?mxUtils.setStyle(Ia,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_STROKECOLOR,sa.stroke))):(Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,null),Ia=mxUtils.setStyle(Ia,+mxConstants.STYLE_STROKECOLOR,null),Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,null),U.getModel().isVertex(za[Wa])&&(Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,null)));U.getModel().setStyle(za[Wa],Ia)}}finally{U.getModel().endUpdate()}}));Aa.className="geStyleButton";Aa.style.width="36px";Aa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";Aa.style.margin="0px 6px 6px 0px";if(null!=sa){var Ea="1px solid";null!=sa.border&&(Ea=sa.border);if(null!=sa.gradient)Aa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(sa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(sa.gradient).cssText+" 100%)";else if(sa.fill==mxConstants.NONE)Aa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==sa.fill||""==sa.fill)Aa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Ka=mxUtils.getLightDarkColor(sa.fill);Aa.style.backgroundImage="linear-gradient(to right bottom, "+Ka.cssText+" 50%, "+Ka.light+" 50.3%)"}null==sa.stroke||sa.stroke==mxConstants.NONE?Aa.style.border=Ea+" transparent":""==sa.stroke?Aa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Ka=mxUtils.getLightDarkColor(sa.stroke),Aa.style.border=Ea+" "+Ka.cssText,Aa.style.borderRightColor=Ka.light,Aa.style.borderBottomColor=Aa.style.borderRightColor);null!=sa.title&&Aa.setAttribute("title",sa.title)}else Ea=mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,-"#ffffff"),Ka=mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000"),Aa.style.backgroundColor=Ea,Aa.style.border="1px solid "+Ka;Aa.style.borderRadius="0";J.appendChild(Aa);null!=sa&&null!=sa.gradient&&(Ea=Aa.cloneNode(!1),Ea.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(sa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(sa.gradient).light+") 100%)",Ea.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ea.style.backgroundColor=-"transparent",J.appendChild(Ea),Ea.style.marginLeft="-42px",mxEvent.addListener(Ea,"click",function(){Aa.click()}))});J.innerText="";if(null!=Ba)for(var La=0;La<Ba.length;La++)0<La&&0==mxUtils.mod(La,4)&&mxUtils.br(J),Da(Ba[La])});null==this.format.currentScheme?oa(Math.min(Y.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):oa(this.format.currentScheme);ba=10>=this.defaultColorSchemes.length?28:8;var ra=document.createElement("div");ra.style.cssText="position:absolute;left:10px;top:8px;bottom:"+-ba+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";mxEvent.addListener(ra,"click",mxUtils.bind(this,function(){oa(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));-var xa=document.createElement("div");xa.style.cssText="position:absolute;left:202px;top:8px;bottom:"+ba+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";1<this.defaultColorSchemes.length&&+"#ffffff"),Ka=mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000"),Aa.style.backgroundColor=Ea,Aa.style.border="1px solid "+Ka;Aa.style.borderRadius="0";K.appendChild(Aa);null!=sa&&null!=sa.gradient&&(Ea=Aa.cloneNode(!1),Ea.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(sa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(sa.gradient).light+") 100%)",Ea.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ea.style.backgroundColor=+"transparent",K.appendChild(Ea),Ea.style.marginLeft="-42px",mxEvent.addListener(Ea,"click",function(){Aa.click()}))});K.innerText="";if(null!=Ba)for(var La=0;La<Ba.length;La++)0<La&&0==mxUtils.mod(La,4)&&mxUtils.br(K),Da(Ba[La])});null==this.format.currentScheme?oa(Math.min(Y.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):oa(this.format.currentScheme);ca=10>=this.defaultColorSchemes.length?28:8;var ra=document.createElement("div");ra.style.cssText="position:absolute;left:10px;top:8px;bottom:"++ca+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";mxEvent.addListener(ra,"click",mxUtils.bind(this,function(){oa(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));+var xa=document.createElement("div");xa.style.cssText="position:absolute;left:202px;top:8px;bottom:"+ca+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";1<this.defaultColorSchemes.length&&(l.appendChild(ra),l.appendChild(xa));mxEvent.addListener(xa,"click",mxUtils.bind(this,function(){oa(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));t(ra);t(xa);qa(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&l.appendChild(W)}return l}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(l){return l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||l.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(l){return Graph.isGoogleFontUrl(l)};Graph.rewriteGoogleFontUrl=function(l){null!=l&&l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(l=Editor.GOOGLE_FONTS_CSS2+l.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return l};Graph.createFontElement=-function(l,t){var I=Graph.fontMapping[t];null==I&&Graph.isCssFontUrl(t)?(l=document.createElement("link"),l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(t))):(null==I&&(I='@font-face {\nfont-family: "'+l+'";\nsrc: url("'+t+'");\n}'),l=document.createElement("style"),mxUtils.write(l,I));return l};Graph.addRecentCustomFont=function(l,t){};Graph.addFont=function(l,t,I){if(null!=l&&0<l.length&&null!=-t&&0<t.length){var V=l.toLowerCase();if("helvetica"!=V&&"arial"!=l&&"sans-serif"!=V){var J=Graph.customFontElements[V];null!=J&&J.url!=t&&(J.elt.parentNode.removeChild(J.elt),J=null);null==J?(J=t,"http:"==t.substring(0,5)&&(J=PROXY_URL+"?url="+encodeURIComponent(t)),J={name:l,url:t,elt:Graph.createFontElement(l,J)},Graph.customFontElements[V]=J,t=document.getElementsByTagName("head")[0],null!=I&&("link"==J.elt.nodeName.toLowerCase()?(J.elt.onload=I,J.elt.onerror=I):I()),null!=t&&t.appendChild(J.elt)):-null!=I&&I()}else null!=I&&I()}else null!=I&&I();return l};Graph.getFontUrl=function(l,t){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(t=l.url);return t};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var t=0;t<l.length;t++){var I=l[t].getAttribute("data-font-src");if(null!=I){var V="FONT"==l[t].nodeName?l[t].getAttribute("face"):l[t].style.fontFamily;null!=V&&Graph.addFont(V,I)}}};Graph.processFontStyle=function(l){if(null!=l){var t=mxUtils.getValue(l,"fontSource",-null);if(null!=t){var I=mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=I)try{Graph.addFont(I,decodeURIComponent(t))}catch(V){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur=-"1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var f=Graph.prototype.init;Graph.prototype.init=function(){function l(J){t=J}f.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var t=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",l);mxEvent.addListener(this.container,"mouseleave",function(J){t=null});this.isMouseInsertPoint=function(){return null!=-t};var I=this.getInsertPoint;this.getInsertPoint=function(){return null!=t?this.getPointForEvent(t):I.apply(this,arguments)};var V=this.layoutManager.getLayout;this.layoutManager.getLayout=function(J){var W=this.graph.getCellStyle(J);if(null!=W&&"rack"==W.childLayout){var Y=new mxStackLayout(this.graph,!1);Y.gridSize=null!=W.rackUnitSize?parseFloat(W.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;Y.marginLeft=W.marginLeft||0;Y.marginRight=W.marginRight||0;Y.marginTop=-W.marginTop||0;Y.marginBottom=W.marginBottom||0;Y.allowGaps=W.allowGaps||0;Y.horizontal="1"==mxUtils.getValue(W,"horizontalRack","0");Y.resizeParent=!1;Y.fill=!0;return Y}return V.apply(this,arguments)};this.updateGlobalUrlVariables()};var k=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,t){return Graph.processFontStyle(k.apply(this,arguments))};var B=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(l,t,I,V,J,W,Y,ba,ja,-oa,qa,ra){B.apply(this,arguments);Graph.processFontAttributes(ra)};var z=mxText.prototype.redraw;mxText.prototype.redraw=function(){z.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,t,I,V){function J(){for(var Da=ba.getSelectionCells(),La=[],sa=0;sa<Da.length;sa++)ba.isCellVisible(Da[sa])&&La.push(Da[sa]);ba.setSelectionCells(La)}function W(Da){ba.setHiddenTags(Da?[]:ja.slice());J();ba.refresh()}-function Y(Da,La){qa.innerText="";if(0<Da.length){var sa=document.createElement("table");sa.setAttribute("cellpadding","2");sa.style.boxSizing="border-box";sa.style.tableLayout="fixed";sa.style.width="100%";var Aa=document.createElement("tbody");if(null!=Da&&0<Da.length)for(var Ea=0;Ea<Da.length;Ea++)(function(Ka){function Ma(){var u=ba.getCellsForTags([Ka],null,null,!0);ba.isEnabled()?ba.setSelectionCells(u):ba.highlightCells(u,null,null,70)}var za=0>mxUtils.indexOf(ba.hiddenTags,Ka),Wa=document.createElement("tr"),+function(l,t){var H=Graph.fontMapping[t];null==H&&Graph.isCssFontUrl(t)?(l=document.createElement("link"),l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(t))):(null==H&&(H='@font-face {\nfont-family: "'+l+'";\nsrc: url("'+t+'");\n}'),l=document.createElement("style"),mxUtils.write(l,H));return l};Graph.addRecentCustomFont=function(l,t){};Graph.addFont=function(l,t,H){if(null!=l&&0<l.length&&null!=+t&&0<t.length){var U=l.toLowerCase();if("helvetica"!=U&&"arial"!=l&&"sans-serif"!=U){var K=Graph.customFontElements[U];null!=K&&K.url!=t&&(K.elt.parentNode.removeChild(K.elt),K=null);null==K?(K=t,"http:"==t.substring(0,5)&&(K=PROXY_URL+"?url="+encodeURIComponent(t)),K={name:l,url:t,elt:Graph.createFontElement(l,K)},Graph.customFontElements[U]=K,t=document.getElementsByTagName("head")[0],null!=H&&("link"==K.elt.nodeName.toLowerCase()?(K.elt.onload=H,K.elt.onerror=H):H()),null!=t&&t.appendChild(K.elt)):+null!=H&&H()}else null!=H&&H()}else null!=H&&H();return l};Graph.getFontUrl=function(l,t){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(t=l.url);return t};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var t=0;t<l.length;t++){var H=l[t].getAttribute("data-font-src");if(null!=H){var U="FONT"==l[t].nodeName?l[t].getAttribute("face"):l[t].style.fontFamily;null!=U&&Graph.addFont(U,H)}}};Graph.processFontStyle=function(l){if(null!=l){var t=mxUtils.getValue(l,"fontSource",+null);if(null!=t){var H=mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=H)try{Graph.addFont(H,decodeURIComponent(t))}catch(U){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur=+"1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var f=Graph.prototype.init;Graph.prototype.init=function(){function l(K){t=K}f.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var t=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",l);mxEvent.addListener(this.container,"mouseleave",function(K){t=null});this.isMouseInsertPoint=function(){return null!=+t};var H=this.getInsertPoint;this.getInsertPoint=function(){return null!=t?this.getPointForEvent(t):H.apply(this,arguments)};var U=this.layoutManager.getLayout;this.layoutManager.getLayout=function(K){var W=this.graph.getCellStyle(K);if(null!=W&&"rack"==W.childLayout){var Y=new mxStackLayout(this.graph,!1);Y.gridSize=null!=W.rackUnitSize?parseFloat(W.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;Y.marginLeft=W.marginLeft||0;Y.marginRight=W.marginRight||0;Y.marginTop=+W.marginTop||0;Y.marginBottom=W.marginBottom||0;Y.allowGaps=W.allowGaps||0;Y.horizontal="1"==mxUtils.getValue(W,"horizontalRack","0");Y.resizeParent=!1;Y.fill=!0;return Y}return U.apply(this,arguments)};this.updateGlobalUrlVariables()};var k=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,t){return Graph.processFontStyle(k.apply(this,arguments))};var B=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(l,t,H,U,K,W,Y,ca,ja,+oa,qa,ra){B.apply(this,arguments);Graph.processFontAttributes(ra)};var z=mxText.prototype.redraw;mxText.prototype.redraw=function(){z.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,t,H,U){function K(){for(var Da=ca.getSelectionCells(),La=[],sa=0;sa<Da.length;sa++)ca.isCellVisible(Da[sa])&&La.push(Da[sa]);ca.setSelectionCells(La)}function W(Da){ca.setHiddenTags(Da?[]:ja.slice());K();ca.refresh()}+function Y(Da,La){qa.innerText="";if(0<Da.length){var sa=document.createElement("table");sa.setAttribute("cellpadding","2");sa.style.boxSizing="border-box";sa.style.tableLayout="fixed";sa.style.width="100%";var Aa=document.createElement("tbody");if(null!=Da&&0<Da.length)for(var Ea=0;Ea<Da.length;Ea++)(function(Ka){function Ma(){var u=ca.getCellsForTags([Ka],null,null,!0);ca.isEnabled()?ca.setSelectionCells(u):ca.highlightCells(u,null,null,70)}var za=0>mxUtils.indexOf(ca.hiddenTags,Ka),Wa=document.createElement("tr"),Ia=document.createElement("td");Ia.style.align="center";Ia.style.width="16px";var Xa=document.createElement("img");Xa.setAttribute("src",za?Editor.visibleImage:Editor.hiddenImage);Xa.setAttribute("title",mxResources.get(za?"hideIt":"show",[Ka]));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter="invert(100%)";Ia.appendChild(Xa);mxEvent.addListener(Xa,"click",function(u){mxEvent.isShiftDown(u)?-W(0<=mxUtils.indexOf(ba.hiddenTags,Ka)):(ba.toggleHiddenTag(Ka),J(),ba.refresh());mxEvent.consume(u)});Wa.appendChild(Ia);Ia=document.createElement("td");Ia.style.align="center";Ia.style.width="16px";Xa=document.createElement("img");Xa.setAttribute("src",Editor.selectImage);Xa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter=+W(0<=mxUtils.indexOf(ca.hiddenTags,Ka)):(ca.toggleHiddenTag(Ka),K(),ca.refresh());mxEvent.consume(u)});Wa.appendChild(Ia);Ia=document.createElement("td");Ia.style.align="center";Ia.style.width="16px";Xa=document.createElement("img");Xa.setAttribute("src",Editor.selectImage);Xa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter="invert(100%)";mxEvent.addListener(Xa,"click",function(u){W(!0);Ma();mxEvent.consume(u)});Ia.appendChild(Xa);Wa.appendChild(Ia);Ia=document.createElement("td");Ia.style.overflow="hidden";Ia.style.whiteSpace="nowrap";Ia.style.textOverflow="ellipsis";Ia.style.verticalAlign="middle";Ia.style.cursor="pointer";Ia.setAttribute("title",Ka);a=document.createElement("a");mxUtils.write(a,Ka);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,za?100:40);Ia.appendChild(a);mxEvent.addListener(Ia,-"click",function(u){if(mxEvent.isShiftDown(u))W(!0),Ma();else if(za&&0<ba.hiddenTags.length)W(!0);else{var N=ja.slice(),R=mxUtils.indexOf(N,Ka);N.splice(R,1);ba.setHiddenTags(N);J();ba.refresh()}mxEvent.consume(u)});Wa.appendChild(Ia);if(ba.isEnabled()){Ia=document.createElement("td");Ia.style.verticalAlign="middle";Ia.style.textAlign="center";Ia.style.width="18px";if(null==La){Ia.style.align="center";Ia.style.width="16px";Xa=document.createElement("img");Xa.setAttribute("src",Editor.trashImage);-Xa.setAttribute("title",mxResources.get("removeIt",[Ka]));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter="invert(100%)";mxEvent.addListener(Xa,"click",function(u){var N=mxUtils.indexOf(ja,Ka);0<=N&&ja.splice(N,1);ba.removeTagsForCells(ba.model.getDescendants(ba.model.getRoot()),[Ka]);ba.refresh();mxEvent.consume(u)});Ia.appendChild(Xa)}else{var Pa=document.createElement("input");-Pa.setAttribute("type","checkbox");Pa.style.margin="0px";Pa.defaultChecked=null!=La&&0<=mxUtils.indexOf(La,Ka);Pa.checked=Pa.defaultChecked;Pa.style.background="transparent";Pa.setAttribute("title",mxResources.get(Pa.defaultChecked?"removeIt":"add",[Ka]));mxEvent.addListener(Pa,"change",function(u){Pa.checked?ba.addTagsForCells(ba.getSelectionCells(),[Ka]):ba.removeTagsForCells(ba.getSelectionCells(),[Ka]);mxEvent.consume(u)});Ia.appendChild(Pa)}Wa.appendChild(Ia)}Aa.appendChild(Wa)})(Da[Ea]);sa.appendChild(Aa);-qa.appendChild(sa)}}var ba=this,ja=ba.hiddenTags.slice(),oa=document.createElement("div");oa.style.userSelect="none";oa.style.overflow="hidden";oa.style.padding="10px";oa.style.height="100%";var qa=document.createElement("div");qa.style.boxSizing="border-box";qa.style.borderRadius="4px";qa.style.userSelect="none";qa.style.overflow="auto";qa.style.position="absolute";qa.style.left="10px";qa.style.right="10px";qa.style.top="10px";qa.style.border=ba.isEnabled()?"1px solid #808080":"none";qa.style.bottom=-ba.isEnabled()?"48px":"10px";oa.appendChild(qa);var ra=mxUtils.button(mxResources.get("reset"),function(Da){ba.setHiddenTags([]);mxEvent.isShiftDown(Da)||(ja=ba.hiddenTags.slice());J();ba.refresh()});ra.setAttribute("title",mxResources.get("reset"));ra.className="geBtn";ra.style.margin="0 4px 0 0";var xa=mxUtils.button(mxResources.get("add"),function(){null!=I&&I(ja,function(Da){ja=Da;Ba()})});xa.setAttribute("title",mxResources.get("add"));xa.className="geBtn";xa.style.margin="0";ba.addListener(mxEvent.ROOT,-function(){ja=ba.hiddenTags.slice()});var Ba=mxUtils.bind(this,function(Da,La){if(l()){Da=ba.getAllTags();for(La=0;La<Da.length;La++)0>mxUtils.indexOf(ja,Da[La])&&ja.push(Da[La]);ja.sort();ba.isSelectionEmpty()?Y(ja):Y(ja,ba.getCommonTagsForCells(ba.getSelectionCells()))}});ba.selectionModel.addListener(mxEvent.CHANGE,Ba);ba.model.addListener(mxEvent.CHANGE,Ba);ba.addListener(mxEvent.REFRESH,Ba);var ya=document.createElement("div");ya.style.display="flex";ya.style.alignItems="center";ya.style.boxSizing=-"border-box";ya.style.whiteSpace="nowrap";ya.style.position="absolute";ya.style.overflow="hidden";ya.style.bottom="6px";ya.style.height="42px";ya.style.right="10px";ya.style.left="10px";ba.isEnabled()&&(ya.appendChild(ra),ya.appendChild(xa),oa.appendChild(ya));null!=V&&ya.appendChild(V);return{div:oa,refresh:Ba}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var t in Graph.customFontElements){var I=Graph.customFontElements[t];l.push({name:I.name,url:I.url})}return l};-Graph.prototype.setFont=function(l,t){Graph.addFont(l,t);var I=Editor.guid();document.execCommand("fontname",!1,I);for(var V=this.cellEditor.textarea.getElementsByTagName("font"),J=!1,W=0;W<V.length;W++)V[W].getAttribute("face")==I&&(J=!0,V[W].setAttribute("face",l),null!=t?V[W].setAttribute("data-font-src",t):V[W].removeAttribute("data-font-src"));J||document.execCommand("fontname",!1,l)};var C=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return C.apply(this,arguments)&&-(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var l=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=l)for(var t in l)this.globalVars[t]=l[t]}catch(I){null!=window.console&&console.log("Error in vars URL parameter: "+I)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):-{}};var H=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(l){var t=H.apply(this,arguments);null==t&&null!=this.globalVars&&(t=this.globalVars[l]);return t};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var K=Graph.prototype.getSvg;Graph.prototype.getSvg=-function(l,t,I,V,J,W,Y,ba,ja,oa,qa,ra,xa,Ba,ya,Da){var La=K.apply(this,arguments);if(null!=ra){var sa=La.getAttribute("style");null==sa&&(sa="");ra="auto"==ra?"none"==this.getAdaptiveColors()?"light":"light dark":ra;La.setAttribute("style",sa+(" color-scheme: "+ra+";"))}var Aa=this.getCustomFonts();if(qa&&0<Aa.length){var Ea=La.ownerDocument;sa=null!=Ea.createElementNS?Ea.createElementNS(mxConstants.NS_SVG,"style"):Ea.createElement("style");null!=Ea.setAttributeNS?sa.setAttributeNS("type","text/css"):+"click",function(u){if(mxEvent.isShiftDown(u))W(!0),Ma();else if(za&&0<ca.hiddenTags.length)W(!0);else{var N=ja.slice(),R=mxUtils.indexOf(N,Ka);N.splice(R,1);ca.setHiddenTags(N);K();ca.refresh()}mxEvent.consume(u)});Wa.appendChild(Ia);if(ca.isEnabled()){Ia=document.createElement("td");Ia.style.verticalAlign="middle";Ia.style.textAlign="center";Ia.style.width="18px";if(null==La){Ia.style.align="center";Ia.style.width="16px";Xa=document.createElement("img");Xa.setAttribute("src",Editor.trashImage);+Xa.setAttribute("title",mxResources.get("removeIt",[Ka]));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter="invert(100%)";mxEvent.addListener(Xa,"click",function(u){var N=mxUtils.indexOf(ja,Ka);0<=N&&ja.splice(N,1);ca.removeTagsForCells(ca.model.getDescendants(ca.model.getRoot()),[Ka]);ca.refresh();mxEvent.consume(u)});Ia.appendChild(Xa)}else{var Pa=document.createElement("input");+Pa.setAttribute("type","checkbox");Pa.style.margin="0px";Pa.defaultChecked=null!=La&&0<=mxUtils.indexOf(La,Ka);Pa.checked=Pa.defaultChecked;Pa.style.background="transparent";Pa.setAttribute("title",mxResources.get(Pa.defaultChecked?"removeIt":"add",[Ka]));mxEvent.addListener(Pa,"change",function(u){Pa.checked?ca.addTagsForCells(ca.getSelectionCells(),[Ka]):ca.removeTagsForCells(ca.getSelectionCells(),[Ka]);mxEvent.consume(u)});Ia.appendChild(Pa)}Wa.appendChild(Ia)}Aa.appendChild(Wa)})(Da[Ea]);sa.appendChild(Aa);+qa.appendChild(sa)}}var ca=this,ja=ca.hiddenTags.slice(),oa=document.createElement("div");oa.style.userSelect="none";oa.style.overflow="hidden";oa.style.padding="10px";oa.style.height="100%";var qa=document.createElement("div");qa.style.boxSizing="border-box";qa.style.borderRadius="4px";qa.style.userSelect="none";qa.style.overflow="auto";qa.style.position="absolute";qa.style.left="10px";qa.style.right="10px";qa.style.top="10px";qa.style.border=ca.isEnabled()?"1px solid #808080":"none";qa.style.bottom=+ca.isEnabled()?"48px":"10px";oa.appendChild(qa);var ra=mxUtils.button(mxResources.get("reset"),function(Da){ca.setHiddenTags([]);mxEvent.isShiftDown(Da)||(ja=ca.hiddenTags.slice());K();ca.refresh()});ra.setAttribute("title",mxResources.get("reset"));ra.className="geBtn";ra.style.margin="0 4px 0 0";var xa=mxUtils.button(mxResources.get("add"),function(){null!=H&&H(ja,function(Da){ja=Da;Ba()})});xa.setAttribute("title",mxResources.get("add"));xa.className="geBtn";xa.style.margin="0";ca.addListener(mxEvent.ROOT,+function(){ja=ca.hiddenTags.slice()});var Ba=mxUtils.bind(this,function(Da,La){if(l()){Da=ca.getAllTags();for(La=0;La<Da.length;La++)0>mxUtils.indexOf(ja,Da[La])&&ja.push(Da[La]);ja.sort();ca.isSelectionEmpty()?Y(ja):Y(ja,ca.getCommonTagsForCells(ca.getSelectionCells()))}});ca.selectionModel.addListener(mxEvent.CHANGE,Ba);ca.model.addListener(mxEvent.CHANGE,Ba);ca.addListener(mxEvent.REFRESH,Ba);var ya=document.createElement("div");ya.style.display="flex";ya.style.alignItems="center";ya.style.boxSizing=+"border-box";ya.style.whiteSpace="nowrap";ya.style.position="absolute";ya.style.overflow="hidden";ya.style.bottom="6px";ya.style.height="42px";ya.style.right="10px";ya.style.left="10px";ca.isEnabled()&&(ya.appendChild(ra),ya.appendChild(xa),oa.appendChild(ya));null!=U&&ya.appendChild(U);return{div:oa,refresh:Ba}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var t in Graph.customFontElements){var H=Graph.customFontElements[t];l.push({name:H.name,url:H.url})}return l};+Graph.prototype.setFont=function(l,t){Graph.addFont(l,t);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var U=this.cellEditor.textarea.getElementsByTagName("font"),K=!1,W=0;W<U.length;W++)U[W].getAttribute("face")==H&&(K=!0,U[W].setAttribute("face",l),null!=t?U[W].setAttribute("data-font-src",t):U[W].removeAttribute("data-font-src"));K||document.execCommand("fontname",!1,l)};var C=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return C.apply(this,arguments)&&+(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var l=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=l)for(var t in l)this.globalVars[t]=l[t]}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+H)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):+{}};var I=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(l){var t=I.apply(this,arguments);null==t&&null!=this.globalVars&&(t=this.globalVars[l]);return t};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var L=Graph.prototype.getSvg;Graph.prototype.getSvg=+function(l,t,H,U,K,W,Y,ca,ja,oa,qa,ra,xa,Ba,ya,Da){var La=L.apply(this,arguments);if(null!=ra){var sa=La.getAttribute("style");null==sa&&(sa="");ra="auto"==ra?"none"==this.getAdaptiveColors()?"light":"light dark":ra;La.setAttribute("style",sa+(" color-scheme: "+ra+";"))}var Aa=this.getCustomFonts();if(qa&&0<Aa.length){var Ea=La.ownerDocument;sa=null!=Ea.createElementNS?Ea.createElementNS(mxConstants.NS_SVG,"style"):Ea.createElement("style");null!=Ea.setAttributeNS?sa.setAttributeNS("type","text/css"):sa.setAttribute("type","text/css");for(var Ka="",Ma="",za=0;za<Aa.length;za++){var Wa=Aa[za].name,Ia=Aa[za].url;Graph.isCssFontUrl(Ia)?Ka+="@import url("+Graph.rewriteGoogleFontUrl(Ia)+");\n":Ma+='@font-face {\nfont-family: "'+Wa+'";\nsrc: url("'+Ia+'");\n}\n'}sa.appendChild(Ea.createTextNode(Ka+Ma));La.getElementsByTagName("defs")[0].appendChild(sa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(La);this.mathEnabled&&(document.body.appendChild(La),-Editor.MathJaxRender(La),La.parentNode.removeChild(La),sa=La.ownerDocument.getElementById("MJX-SVG-styles"),null!=sa&&La.getElementsByTagName("defs")[0].appendChild(sa.cloneNode(!0)));return La};var M=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(l){M.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var O=mxGraphView.prototype.resetValidationState;-mxGraphView.prototype.resetValidationState=function(){O.apply(this,arguments);this.enumerationState=0};var ea=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(l){null!=l.shape&&this.redrawEnumerationState(l);return ea.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(l){l=decodeURIComponent(mxUtils.getValue(l.style,"enumerateValue",""));""==l&&(l=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'++Editor.MathJaxRender(La),La.parentNode.removeChild(La),sa=La.ownerDocument.getElementById("MJX-SVG-styles"),null!=sa&&La.getElementsByTagName("defs")[0].appendChild(sa.cloneNode(!0)));return La};var J=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(l){J.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var O=mxGraphView.prototype.resetValidationState;+mxGraphView.prototype.resetValidationState=function(){O.apply(this,arguments);this.enumerationState=0};var da=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(l){null!=l.shape&&this.redrawEnumerationState(l);return da.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(l){l=decodeURIComponent(mxUtils.getValue(l.style,"enumerateValue",""));""==l&&(l=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(l)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(l){var t="1"==mxUtils.getValue(l.style,"enumerate",0);t&&null==l.secondLabel?(l.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),l.secondLabel.size=12,l.secondLabel.state=l,l.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(l,l.secondLabel)):t||null==l.secondLabel||(l.secondLabel.destroy(),l.secondLabel=null);t=l.secondLabel;if(null!=-t){var I=l.view.scale,V=this.createEnumerationValue(l);l=this.graph.model.isVertex(l.cell)?new mxRectangle(l.x+l.width-4*I,l.y+4*I,0,0):mxRectangle.fromPoint(l.view.getPoint(l));t.bounds.equals(l)&&t.value==V&&t.scale==I||(t.bounds=l,t.value=V,t.scale=I,t.redraw())}};var fa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();fa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&-(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var S=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){S.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(l,t){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(l.actions,null,t))};Graph.prototype.executeCustomActions=function(l,t,I){if(this.executingCustomActions)this.stoppingCustomActions=-!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var V=!1,J=0,W=0,Y=mxUtils.bind(this,function(){V||(V=!0,this.model.beginUpdate())}),ba=mxUtils.bind(this,function(){V&&(V=!1,this.model.endUpdate())}),ja=mxUtils.bind(this,function(){0<J&&J--;0==J&&oa()}),oa=mxUtils.bind(this,function(){if(W<l.length){var qa=-this.stoppingCustomActions,ra=l[W++],xa=[];if(null!=ra.open)if(ba(),this.isCustomLink(ra.open)){if(!this.customLinkClicked(ra.open,I))return}else this.openLink(ra.open);null==ra.wait||qa||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ja()}),J++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=ra.wait?parseInt(ra.wait):1E3),ba());null!=ra.opacity&&null!=ra.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(ra.opacity,-!0)),ra.opacity.value);null!=ra.fadeIn&&(J++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(ra.fadeIn,!0)),0,1,ja,qa?0:ra.fadeIn.delay));null!=ra.fadeOut&&(J++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(ra.fadeOut,!0)),1,0,ja,qa?0:ra.fadeOut.delay));null!=ra.wipeIn&&(xa=xa.concat(this.createWipeAnimations(this.getCellsForAction(ra.wipeIn,!0),!0)));null!=ra.wipeOut&&(xa=xa.concat(this.createWipeAnimations(this.getCellsForAction(ra.wipeOut,!0),!1)));null!=ra.toggle&&+t){var H=l.view.scale,U=this.createEnumerationValue(l);l=this.graph.model.isVertex(l.cell)?new mxRectangle(l.x+l.width-4*H,l.y+4*H,0,0):mxRectangle.fromPoint(l.view.getPoint(l));t.bounds.equals(l)&&t.value==U&&t.scale==H||(t.bounds=l,t.value=U,t.scale=H,t.redraw())}};var fa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();fa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&+(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var V=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){V.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(l,t){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(l.actions,null,t))};Graph.prototype.executeCustomActions=function(l,t,H){if(this.executingCustomActions)this.stoppingCustomActions=+!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var U=!1,K=0,W=0,Y=mxUtils.bind(this,function(){U||(U=!0,this.model.beginUpdate())}),ca=mxUtils.bind(this,function(){U&&(U=!1,this.model.endUpdate())}),ja=mxUtils.bind(this,function(){0<K&&K--;0==K&&oa()}),oa=mxUtils.bind(this,function(){if(W<l.length){var qa=+this.stoppingCustomActions,ra=l[W++],xa=[];if(null!=ra.open)if(ca(),this.isCustomLink(ra.open)){if(!this.customLinkClicked(ra.open,H))return}else this.openLink(ra.open);null==ra.wait||qa||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ja()}),K++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=ra.wait?parseInt(ra.wait):1E3),ca());null!=ra.opacity&&null!=ra.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(ra.opacity,+!0)),ra.opacity.value);null!=ra.fadeIn&&(K++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(ra.fadeIn,!0)),0,1,ja,qa?0:ra.fadeIn.delay));null!=ra.fadeOut&&(K++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(ra.fadeOut,!0)),1,0,ja,qa?0:ra.fadeOut.delay));null!=ra.wipeIn&&(xa=xa.concat(this.createWipeAnimations(this.getCellsForAction(ra.wipeIn,!0),!0)));null!=ra.wipeOut&&(xa=xa.concat(this.createWipeAnimations(this.getCellsForAction(ra.wipeOut,!0),!1)));null!=ra.toggle&&(Y(),this.toggleCells(this.getCellsForAction(ra.toggle,!0)));if(null!=ra.show){Y();var Ba=this.getCellsForAction(ra.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(Ba),1);this.setCellsVisible(Ba,!0)}null!=ra.hide&&(Y(),Ba=this.getCellsForAction(ra.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(Ba),0),this.setCellsVisible(Ba,!1));null!=ra.toggleStyle&&null!=ra.toggleStyle.key&&(Y(),this.toggleCellStyles(ra.toggleStyle.key,null!=ra.toggleStyle.defaultValue?ra.toggleStyle.defaultValue:"0",this.getCellsForAction(ra.toggleStyle,!0)));null!=ra.style&&null!=ra.style.key&&(Y(),this.setCellStyles(ra.style.key,ra.style.value,this.getCellsForAction(ra.style,!0)));Ba=[];null!=ra.select&&this.isEnabled()&&(Ba=this.getCellsForAction(ra.select),this.setSelectionCells(Ba));null!=ra.highlight&&(Ba=this.getCellsForAction(ra.highlight),this.highlightCells(Ba,ra.highlight.color,ra.highlight.duration,ra.highlight.opacity));null!=ra.scroll&&(Ba=this.getCellsForAction(ra.scroll));null!=ra.viewbox&&-this.fitWindow(ra.viewbox,ra.viewbox.border);0<Ba.length&&this.scrollCellToVisible(Ba[0]);null!=I&&null!=ra.explore&&Graph.exploreFromCell(this,I,ra.explore);if(null!=ra.tags){if(null!=ra.tags.toggle){var ya=ra.tags.toggle;0==ya.length&&(ya=this.getAllTags());for(Ba=0;Ba<ya.length;Ba++)this.toggleHiddenTag(ya[Ba])}ya=null;null!=ra.tags.hidden&&(null==ya&&(ya=[]),ya=ya.concat(ra.tags.hidden));if(null!=ra.tags.visible){null==ya&&(ya=[]);var Da=this.getAllTags();for(Ba=0;Ba<Da.length;Ba++)0>mxUtils.indexOf(ra.tags.visible,-Da[Ba])&&0>mxUtils.indexOf(ya,Da[Ba])&&ya.push(Da[Ba])}null!=ya&&this.setHiddenTags(ya);this.refresh()}0<xa.length&&(J++,this.executeAnimations(xa,ja,qa?1:ra.steps,qa?0:ra.delay));0==J?oa():ba()}else this.stoppingCustomActions=this.executingCustomActions=!1,ba(),null!=t&&t()});oa()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,t){var I=this.getLinkForCell(t);null!=I&&"data:action/json,"==I.substring(0,17)&&this.setLinkForCell(t,this.updateCustomLink(l,I));if(this.isHtmlLabel(t)){var V=document.createElement("div");-V.innerHTML=Graph.sanitizeHtml(this.getLabel(t));for(var J=V.getElementsByTagName("a"),W=!1,Y=0;Y<J.length;Y++)I=J[Y].getAttribute("href"),null!=I&&"data:action/json,"==I.substring(0,17)&&(J[Y].setAttribute("href",this.updateCustomLink(l,I)),W=!0);W&&this.labelChanged(t,V.innerHTML)}};Graph.prototype.updateCustomLink=function(l,t){if("data:action/json,"==t.substring(0,17))try{var I=JSON.parse(t.substring(17));null!=I.actions&&(this.updateCustomLinkActions(l,I.actions),t="data:action/json,"+JSON.stringify(I))}catch(V){}return t};-Graph.prototype.updateCustomLinkActions=function(l,t){for(var I=0;I<t.length;I++){var V=t[I],J;for(J in V)this.updateCustomLinkAction(l,V[J],"cells"),this.updateCustomLinkAction(l,V[J],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(l,t,I){if(null!=t&&null!=t[I]){for(var V=[],J=0;J<t[I].length;J++)if("*"==t[I][J])V.push(t[I][J]);else{var W=l[t[I][J]];null!=W?""!=W&&V.push(W):V.push(t[I][J])}t[I]=V}};Graph.prototype.getCellsForAction=function(l,t){t=this.getCellsById(l.cells).concat(this.getCellsForTags(l.tags,-null,t));if(null!=l.excludeCells){for(var I=[],V=0;V<t.length;V++)0>l.excludeCells.indexOf(t[V].id)&&I.push(t[V]);t=I}return t};Graph.prototype.getCellsById=function(l){var t=[];if(null!=l)for(var I=0;I<l.length;I++)if("*"==l[I]){var V=this.model.getRoot();t=t.concat(this.model.filterDescendants(function(W){return W!=V},V))}else{var J=this.model.getCell(l[I]);null!=J&&t.push(J)}return t};var ca=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(l){return ca.apply(this,arguments)&&+this.fitWindow(ra.viewbox,ra.viewbox.border);0<Ba.length&&this.scrollCellToVisible(Ba[0]);null!=H&&null!=ra.explore&&Graph.exploreFromCell(this,H,ra.explore);if(null!=ra.tags){if(null!=ra.tags.toggle){var ya=ra.tags.toggle;0==ya.length&&(ya=this.getAllTags());for(Ba=0;Ba<ya.length;Ba++)this.toggleHiddenTag(ya[Ba])}ya=null;null!=ra.tags.hidden&&(null==ya&&(ya=[]),ya=ya.concat(ra.tags.hidden));if(null!=ra.tags.visible){null==ya&&(ya=[]);var Da=this.getAllTags();for(Ba=0;Ba<Da.length;Ba++)0>mxUtils.indexOf(ra.tags.visible,+Da[Ba])&&0>mxUtils.indexOf(ya,Da[Ba])&&ya.push(Da[Ba])}null!=ya&&this.setHiddenTags(ya);this.refresh()}0<xa.length&&(K++,this.executeAnimations(xa,ja,qa?1:ra.steps,qa?0:ra.delay));0==K?oa():ca()}else this.stoppingCustomActions=this.executingCustomActions=!1,ca(),null!=t&&t()});oa()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,t){var H=this.getLinkForCell(t);null!=H&&"data:action/json,"==H.substring(0,17)&&this.setLinkForCell(t,this.updateCustomLink(l,H));if(this.isHtmlLabel(t)){var U=document.createElement("div");+U.innerHTML=Graph.sanitizeHtml(this.getLabel(t));for(var K=U.getElementsByTagName("a"),W=!1,Y=0;Y<K.length;Y++)H=K[Y].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(K[Y].setAttribute("href",this.updateCustomLink(l,H)),W=!0);W&&this.labelChanged(t,U.innerHTML)}};Graph.prototype.updateCustomLink=function(l,t){if("data:action/json,"==t.substring(0,17))try{var H=JSON.parse(t.substring(17));null!=H.actions&&(this.updateCustomLinkActions(l,H.actions),t="data:action/json,"+JSON.stringify(H))}catch(U){}return t};+Graph.prototype.updateCustomLinkActions=function(l,t){for(var H=0;H<t.length;H++){var U=t[H],K;for(K in U)this.updateCustomLinkAction(l,U[K],"cells"),this.updateCustomLinkAction(l,U[K],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(l,t,H){if(null!=t&&null!=t[H]){for(var U=[],K=0;K<t[H].length;K++)if("*"==t[H][K])U.push(t[H][K]);else{var W=l[t[H][K]];null!=W?""!=W&&U.push(W):U.push(t[H][K])}t[H]=U}};Graph.prototype.getCellsForAction=function(l,t){t=this.getCellsById(l.cells).concat(this.getCellsForTags(l.tags,+null,t));if(null!=l.excludeCells){for(var H=[],U=0;U<t.length;U++)0>l.excludeCells.indexOf(t[U].id)&&H.push(t[U]);t=H}return t};Graph.prototype.getCellsById=function(l){var t=[];if(null!=l)for(var H=0;H<l.length;H++)if("*"==l[H]){var U=this.model.getRoot();t=t.concat(this.model.filterDescendants(function(W){return W!=U},U))}else{var K=this.model.getCell(l[H]);null!=K&&t.push(K)}return t};var ba=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(l){return ba.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(l))};Graph.prototype.setHiddenTags=function(l){this.hiddenTags=l;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(l){var t=mxUtils.indexOf(this.hiddenTags,l);0>t?this.hiddenTags.push(l):0<=t&&this.hiddenTags.splice(t,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(l){if(null==l||0==l.length||0==this.hiddenTags.length)return!1;l=l.split(" ");if(l.length>this.hiddenTags.length)return!1;-for(var t=0;t<l.length;t++)if(0>mxUtils.indexOf(this.hiddenTags,l[t]))return!1;return!0};Graph.prototype.getCellsForTags=function(l,t,I,V){var J=[];if(null!=l){t=null!=t?t:this.model.getDescendants(this.model.getRoot());for(var W=0,Y={},ba=0;ba<l.length;ba++)0<l[ba].length&&(Y[l[ba]]=!0,W++);for(ba=0;ba<t.length;ba++)if(I&&this.model.getParent(t[ba])==this.model.root||this.model.isVertex(t[ba])||this.model.isEdge(t[ba])){var ja=this.getTagsForCell(t[ba]),oa=!1;if(0<ja.length&&(ja=ja.split(" "),ja.length>=-l.length)){for(var qa=oa=0;qa<ja.length&&oa<W;qa++)null!=Y[ja[qa]]&&oa++;oa=oa==W}oa&&(1!=V||this.isCellVisible(t[ba]))&&J.push(t[ba])}}return J};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var t=null,I=[],V=0;V<l.length;V++){var J=this.getTagsForCell(l[V]);I=[];if(0<J.length){J=J.split(" ");for(var W={},Y=0;Y<J.length;Y++)if(null==t||null!=t[J[Y]])W[J[Y]]=!0,I.push(J[Y]);-t=W}else return[]}return I};Graph.prototype.getTagsForCells=function(l){for(var t=[],I={},V=0;V<l.length;V++){var J=this.getTagsForCell(l[V]);if(0<J.length){J=J.split(" ");for(var W=0;W<J.length;W++)null==I[J[W]]&&(I[J[W]]=!0,t.push(J[W]))}}return t};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var I=0;I<l.length;I++){for(var V=this.getTagsForCell(l[I]),-J=V.split(" "),W=!1,Y=0;Y<t.length;Y++){var ba=mxUtils.trim(t[Y]);""!=ba&&0>mxUtils.indexOf(J,ba)&&(V=0<V.length?V+" "+ba:ba,W=!0)}W&&this.setAttributeForCell(l[I],"tags",V)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var I=0;I<l.length;I++){var V=this.getTagsForCell(l[I]);if(0<V.length){for(var J=V.split(" "),W=!1,Y=0;Y<t.length;Y++){var ba=mxUtils.indexOf(J,t[Y]);0<=ba&&(J.splice(ba,1),W=!0)}W&&this.setAttributeForCell(l[I],-"tags",J.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)this.model.setVisible(l[t],!this.model.isVisible(l[t]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(l,t){this.model.beginUpdate();try{for(var I=0;I<l.length;I++)this.model.setVisible(l[I],t)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(l,t,I,V){for(var J=0;J<l.length;J++)this.highlightCell(l[J],-t,I,V)};Graph.prototype.highlightCell=function(l,t,I,V,J){t=null!=t?t:mxConstants.DEFAULT_VALID_COLOR;I=null!=I?I:1E3;l=this.view.getState(l);var W=null;null!=l&&(J=null!=J?J:4,J=Math.max(J+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)+J),W=new mxCellHighlight(this,t,J,!1),null!=V&&(W.opacity=V),W.highlight(l),window.setTimeout(function(){null!=W.shape&&(mxUtils.setPrefixedStyle(W.shape.node.style,"transition","all 1200ms ease-in-out"),W.shape.node.style.opacity=0);window.setTimeout(function(){W.destroy()},-1200)},I));return W};Graph.prototype.addSvgShadow=function(l,t,I,V){I=null!=I?I:!1;V=null!=V?V:!0;var J=l.ownerDocument,W=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"filter"):J.createElement("filter");W.setAttribute("id",this.shadowId);var Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):J.createElement("feGaussianBlur");Y.setAttribute("in","SourceAlpha");Y.setAttribute("stdDeviation",this.svgShadowBlur);Y.setAttribute("result","blur");W.appendChild(Y);-Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feOffset"):J.createElement("feOffset");Y.setAttribute("in","blur");Y.setAttribute("dx",this.svgShadowSize);Y.setAttribute("dy",this.svgShadowSize);Y.setAttribute("result","offsetBlur");W.appendChild(Y);Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feFlood"):J.createElement("feFlood");Y.setAttribute("flood-color",this.svgShadowColor);Y.setAttribute("flood-opacity",this.svgShadowOpacity);Y.setAttribute("result","offsetColor");-W.appendChild(Y);Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feComposite"):J.createElement("feComposite");Y.setAttribute("in","offsetColor");Y.setAttribute("in2","offsetBlur");Y.setAttribute("operator","in");Y.setAttribute("result","offsetBlur");W.appendChild(Y);Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feBlend"):J.createElement("feBlend");Y.setAttribute("in","SourceGraphic");Y.setAttribute("in2","offsetBlur");W.appendChild(Y);Y=l.getElementsByTagName("defs");-0==Y.length?(J=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"defs"):J.createElement("defs"),null!=l.firstChild?l.insertBefore(J,l.firstChild):l.appendChild(J)):J=Y[0];J.appendChild(W);I||(t=null!=t?t:l.getElementsByTagName("g")[0],null!=t&&(t.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(l.getAttribute("width")))&&V&&(l.setAttribute("width",parseInt(l.getAttribute("width"))+6),l.setAttribute("height",parseInt(l.getAttribute("height"))+6),t=l.getAttribute("viewBox"),+for(var t=0;t<l.length;t++)if(0>mxUtils.indexOf(this.hiddenTags,l[t]))return!1;return!0};Graph.prototype.getCellsForTags=function(l,t,H,U){var K=[];if(null!=l){t=null!=t?t:this.model.getDescendants(this.model.getRoot());for(var W=0,Y={},ca=0;ca<l.length;ca++)0<l[ca].length&&(Y[l[ca]]=!0,W++);for(ca=0;ca<t.length;ca++)if(H&&this.model.getParent(t[ca])==this.model.root||this.model.isVertex(t[ca])||this.model.isEdge(t[ca])){var ja=this.getTagsForCell(t[ca]),oa=!1;if(0<ja.length&&(ja=ja.split(" "),ja.length>=+l.length)){for(var qa=oa=0;qa<ja.length&&oa<W;qa++)null!=Y[ja[qa]]&&oa++;oa=oa==W}oa&&(1!=U||this.isCellVisible(t[ca]))&&K.push(t[ca])}}return K};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var t=null,H=[],U=0;U<l.length;U++){var K=this.getTagsForCell(l[U]);H=[];if(0<K.length){K=K.split(" ");for(var W={},Y=0;Y<K.length;Y++)if(null==t||null!=t[K[Y]])W[K[Y]]=!0,H.push(K[Y]);+t=W}else return[]}return H};Graph.prototype.getTagsForCells=function(l){for(var t=[],H={},U=0;U<l.length;U++){var K=this.getTagsForCell(l[U]);if(0<K.length){K=K.split(" ");for(var W=0;W<K.length;W++)null==H[K[W]]&&(H[K[W]]=!0,t.push(K[W]))}}return t};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){for(var U=this.getTagsForCell(l[H]),+K=U.split(" "),W=!1,Y=0;Y<t.length;Y++){var ca=mxUtils.trim(t[Y]);""!=ca&&0>mxUtils.indexOf(K,ca)&&(U=0<U.length?U+" "+ca:ca,W=!0)}W&&this.setAttributeForCell(l[H],"tags",U)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){var U=this.getTagsForCell(l[H]);if(0<U.length){for(var K=U.split(" "),W=!1,Y=0;Y<t.length;Y++){var ca=mxUtils.indexOf(K,t[Y]);0<=ca&&(K.splice(ca,1),W=!0)}W&&this.setAttributeForCell(l[H],+"tags",K.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)this.model.setVisible(l[t],!this.model.isVisible(l[t]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(l,t){this.model.beginUpdate();try{for(var H=0;H<l.length;H++)this.model.setVisible(l[H],t)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(l,t,H,U){for(var K=0;K<l.length;K++)this.highlightCell(l[K],+t,H,U)};Graph.prototype.highlightCell=function(l,t,H,U,K){t=null!=t?t:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;l=this.view.getState(l);var W=null;null!=l&&(K=null!=K?K:4,K=Math.max(K+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)+K),W=new mxCellHighlight(this,t,K,!1),null!=U&&(W.opacity=U),W.highlight(l),window.setTimeout(function(){null!=W.shape&&(mxUtils.setPrefixedStyle(W.shape.node.style,"transition","all 1200ms ease-in-out"),W.shape.node.style.opacity=0);window.setTimeout(function(){W.destroy()},+1200)},H));return W};Graph.prototype.addSvgShadow=function(l,t,H,U){H=null!=H?H:!1;U=null!=U?U:!0;var K=l.ownerDocument,W=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"filter"):K.createElement("filter");W.setAttribute("id",this.shadowId);var Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):K.createElement("feGaussianBlur");Y.setAttribute("in","SourceAlpha");Y.setAttribute("stdDeviation",this.svgShadowBlur);Y.setAttribute("result","blur");W.appendChild(Y);+Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feOffset"):K.createElement("feOffset");Y.setAttribute("in","blur");Y.setAttribute("dx",this.svgShadowSize);Y.setAttribute("dy",this.svgShadowSize);Y.setAttribute("result","offsetBlur");W.appendChild(Y);Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feFlood"):K.createElement("feFlood");Y.setAttribute("flood-color",this.svgShadowColor);Y.setAttribute("flood-opacity",this.svgShadowOpacity);Y.setAttribute("result","offsetColor");+W.appendChild(Y);Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feComposite"):K.createElement("feComposite");Y.setAttribute("in","offsetColor");Y.setAttribute("in2","offsetBlur");Y.setAttribute("operator","in");Y.setAttribute("result","offsetBlur");W.appendChild(Y);Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feBlend"):K.createElement("feBlend");Y.setAttribute("in","SourceGraphic");Y.setAttribute("in2","offsetBlur");W.appendChild(Y);Y=l.getElementsByTagName("defs");+0==Y.length?(K=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"defs"):K.createElement("defs"),null!=l.firstChild?l.insertBefore(K,l.firstChild):l.appendChild(K)):K=Y[0];K.appendChild(W);H||(t=null!=t?t:l.getElementsByTagName("g")[0],null!=t&&(t.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(l.getAttribute("width")))&&U&&(l.setAttribute("width",parseInt(l.getAttribute("width"))+6),l.setAttribute("height",parseInt(l.getAttribute("height"))+6),t=l.getAttribute("viewBox"),null!=t&&0<t.length&&(t=t.split(" "),3<t.length&&(w=parseFloat(t[2])+6,h=parseFloat(t[3])+6,l.setAttribute("viewBox",t[0]+" "+t[1]+" "+w+" "+h))))));return W};Graph.prototype.setShadowVisible=function(l,t){mxClient.IS_SVG&&!mxClient.IS_SF&&(t=null!=t?t:!0,(this.shadowVisible=l)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),t&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.checkDefaultParent=function(){null==-this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var l=this.model.getChildCount(this.model.root),t=0;do var I=this.model.getChildAt(this.model.root,t);while(t++<l&&"1"==mxUtils.getValue(this.getCellStyle(I),"locked","0"));null!=I&&this.setDefaultParent(I)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=+this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var l=this.model.getChildCount(this.model.root),t=0;do var H=this.model.getChildAt(this.model.root,t);while(t++<l&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=@@ -3413,43 +3413,43 @@ this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultPar"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=-[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(l){var t=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?t="mxgraph.er":"sysML"==l.substring(0,5)&&(t="mxgraph.sysml"));return t};var ma=mxMarker.createMarker;mxMarker.createMarker=function(l,t,I,V,J,W,Y,ba,ja,oa){if(null!=I&&null==mxMarker.markers[I]){var qa=this.getPackageForType(I);-null!=qa&&mxStencilRegistry.getStencil(qa)}return ma.apply(this,arguments)};var la=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,t,I,V,J,W){"1"==mxUtils.getValue(t.style,"lineShape",null)&&l.setFillColor(mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return la.apply(this,arguments)};PrintDialog.prototype.create=function(l,t,I){function V(){Ba.value=Math.max(1,Math.min(oa,Math.max(parseInt(Ba.value),parseInt(xa.value))));xa.value=Math.max(1,Math.min(oa,-Math.min(parseInt(Ba.value),parseInt(xa.value))))}function J(ua){l.lastPrintPagesRadioChecked=ra.checked;l.lastPrintSelectionOnlyChecked=Da.checked;l.lastPrintCropRadioChecked=sa.checked;l.lastPrintFitRadioChecked=Aa.checked;ra.checked&&xa.value<Ba.value?(l.lastPrintPagesFromInput=xa.value,l.lastPrintPagesToInput=Ba.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);X.value=Math.max(1,Math.min(1600,parseInt(X.value)))+"%";l.lastPrintZoom=X.value;l.lastPrintBorder=R.value;l.lastPrintGrid=+[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(l){var t=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?t="mxgraph.er":"sysML"==l.substring(0,5)&&(t="mxgraph.sysml"));return t};var ma=mxMarker.createMarker;mxMarker.createMarker=function(l,t,H,U,K,W,Y,ca,ja,oa){if(null!=H&&null==mxMarker.markers[H]){var qa=this.getPackageForType(H);+null!=qa&&mxStencilRegistry.getStencil(qa)}return ma.apply(this,arguments)};var la=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,t,H,U,K,W){"1"==mxUtils.getValue(t.style,"lineShape",null)&&l.setFillColor(mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return la.apply(this,arguments)};PrintDialog.prototype.create=function(l,t,H){function U(){Ba.value=Math.max(1,Math.min(oa,Math.max(parseInt(Ba.value),parseInt(xa.value))));xa.value=Math.max(1,Math.min(oa,+Math.min(parseInt(Ba.value),parseInt(xa.value))))}function K(ua){l.lastPrintPagesRadioChecked=ra.checked;l.lastPrintSelectionOnlyChecked=Da.checked;l.lastPrintCropRadioChecked=sa.checked;l.lastPrintFitRadioChecked=Aa.checked;ra.checked&&xa.value<Ba.value?(l.lastPrintPagesFromInput=xa.value,l.lastPrintPagesToInput=Ba.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);X.value=Math.max(1,Math.min(1600,parseInt(X.value)))+"%";l.lastPrintZoom=X.value;l.lastPrintBorder=R.value;l.lastPrintGrid=ia.checked;l.lastPrintTransparent=ka.checked;l.lastPrintInclude=pa.checked;l.lastPrintSheetsAcross=u.value;l.lastPrintSheetsDown=N.value;var Ca={};Ca.border=parseInt(R.value);Ca.scale=parseInt(X.value)/100;Ca.grid=ia.checked;Ca.transparent=ka.checked;Ca.includeCopy=pa.checked;Ca.sheetsAcross=parseInt(u.value);Ca.sheetsDown=parseInt(N.value);Ca.pagesFrom=parseInt(xa.value);Ca.pagesTo=parseInt(Ba.value);Ca.allPages=qa.checked;Ca.selection=Da.checked;Ca.pageView=La.checked;Ca.crop=sa.checked;Ca.fit=-Aa.checked;return null!=I?I(!ua,Ca):l.print(!ua,Ca)}var W=l.editor.graph,Y=document.createElement("div"),ba=document.createElement("h3");ba.style.width="100%";ba.style.textAlign="center";ba.style.marginTop="0px";mxUtils.write(ba,t||mxResources.get("print"));Y.appendChild(ba);var ja=1,oa=1;ba=document.createElement("div");ba.style.whiteSpace="nowrap";var qa=document.createElement("input");qa.style.marginRight="8px";qa.style.marginBottom="8px";qa.setAttribute("type","radio");qa.setAttribute("name",-"pages-printdialog");ba.appendChild(qa);t=document.createElement("span");mxUtils.write(t,mxResources.get("allPages"));mxEvent.addListener(t,"click",function(){qa.checked=!0});ba.appendChild(t);mxUtils.br(ba);var ra=qa.cloneNode(!0);ba.appendChild(ra);t=document.createElement("span");mxUtils.write(t,mxResources.get("pages")+":");ba.appendChild(t);mxEvent.addListener(t,"click",function(){ra.checked=!0});var xa=document.createElement("input");xa.style.margin="0 4px";xa.setAttribute("value","1");xa.setAttribute("type",-"number");xa.setAttribute("min","1");xa.style.width="40px";ba.appendChild(xa);t=document.createElement("span");mxUtils.write(t,mxResources.get("to"));ba.appendChild(t);var Ba=xa.cloneNode(!0);ba.appendChild(Ba);mxEvent.addListener(xa,"focus",function(){ra.checked=!0});mxEvent.addListener(Ba,"focus",function(){ra.checked=!0});mxEvent.addListener(xa,"change",V);mxEvent.addListener(Ba,"change",V);if(null!=l.pages&&(oa=l.pages.length,null!=l.currentPage))for(var ya=0;ya<oa;ya++)if(l.currentPage==l.pages[ya]){ja=+Aa.checked;return null!=H?H(!ua,Ca):l.print(!ua,Ca)}var W=l.editor.graph,Y=document.createElement("div"),ca=document.createElement("h3");ca.style.width="100%";ca.style.textAlign="center";ca.style.marginTop="0px";mxUtils.write(ca,t||mxResources.get("print"));Y.appendChild(ca);var ja=1,oa=1;ca=document.createElement("div");ca.style.whiteSpace="nowrap";var qa=document.createElement("input");qa.style.marginRight="8px";qa.style.marginBottom="8px";qa.setAttribute("type","radio");qa.setAttribute("name",+"pages-printdialog");ca.appendChild(qa);t=document.createElement("span");mxUtils.write(t,mxResources.get("allPages"));mxEvent.addListener(t,"click",function(){qa.checked=!0});ca.appendChild(t);mxUtils.br(ca);var ra=qa.cloneNode(!0);ca.appendChild(ra);t=document.createElement("span");mxUtils.write(t,mxResources.get("pages")+":");ca.appendChild(t);mxEvent.addListener(t,"click",function(){ra.checked=!0});var xa=document.createElement("input");xa.style.margin="0 4px";xa.setAttribute("value","1");xa.setAttribute("type",+"number");xa.setAttribute("min","1");xa.style.width="40px";ca.appendChild(xa);t=document.createElement("span");mxUtils.write(t,mxResources.get("to"));ca.appendChild(t);var Ba=xa.cloneNode(!0);ca.appendChild(Ba);mxEvent.addListener(xa,"focus",function(){ra.checked=!0});mxEvent.addListener(Ba,"focus",function(){ra.checked=!0});mxEvent.addListener(xa,"change",U);mxEvent.addListener(Ba,"change",U);if(null!=l.pages&&(oa=l.pages.length,null!=l.currentPage))for(var ya=0;ya<oa;ya++)if(l.currentPage==l.pages[ya]){ja=ya+1;break}null!=l.lastPrintPagesFromInput&&null!=l.lastPrintPagesToInput?(xa.value=Math.min(oa,Math.max(1,l.lastPrintPagesFromInput)),Ba.value=Math.min(oa,Math.max(1,l.lastPrintPagesToInput))):(xa.value=ja,Ba.value=ja);xa.setAttribute("max",oa);Ba.setAttribute("max",oa);ya=mxUtils.button(mxResources.get("currentPage"),function(ua){xa.value=ja;Ba.value=ja;ra.checked=!0});ya.setAttribute("title",mxResources.get("currentPage"));ya.style.marginLeft="4px";ya.style.maxWidth="100px";ya.style.overflow="hidden";-ya.style.textOverflow="ellipsis";ya.style.whiteSpace="nowrap";ba.appendChild(ya);1<oa&&Y.appendChild(ba);ba=document.createElement("div");ba.style.borderBottom="1px solid lightGray";ba.style.paddingBottom="12px";ba.style.marginBottom="12px";ba.style.whiteSpace="nowrap";var Da=document.createElement("input");Da.setAttribute("name","pages-printdialog");Da.setAttribute("type",1==oa?"checkbox":"radio");Da.style.marginRight="8px";W.isSelectionEmpty()&&Da.setAttribute("disabled","disabled");W.isEnabled()&&-(ba.appendChild(Da),t=document.createElement("span"),mxUtils.write(t,mxResources.get("selectionOnly")),ba.appendChild(t));(W.isEnabled()||1<oa)&&Y.appendChild(ba);!l.isPagesEnabled()||l.lastPrintPagesRadioChecked?ra.checked=!0:!W.isSelectionEmpty()&&l.lastPrintSelectionOnlyChecked?Da.checked=!0:qa.checked=!0;W.isSelectionEmpty()||mxEvent.addListener(t,"click",function(){Da.checked=!Da.checked});W=document.createElement("div");W.style.whiteSpace="nowrap";var La=document.createElement("input");La.style.marginBottom=+ya.style.textOverflow="ellipsis";ya.style.whiteSpace="nowrap";ca.appendChild(ya);1<oa&&Y.appendChild(ca);ca=document.createElement("div");ca.style.borderBottom="1px solid lightGray";ca.style.paddingBottom="12px";ca.style.marginBottom="12px";ca.style.whiteSpace="nowrap";var Da=document.createElement("input");Da.setAttribute("name","pages-printdialog");Da.setAttribute("type",1==oa?"checkbox":"radio");Da.style.marginRight="8px";W.isSelectionEmpty()&&Da.setAttribute("disabled","disabled");W.isEnabled()&&+(ca.appendChild(Da),t=document.createElement("span"),mxUtils.write(t,mxResources.get("selectionOnly")),ca.appendChild(t));(W.isEnabled()||1<oa)&&Y.appendChild(ca);!l.isPagesEnabled()||l.lastPrintPagesRadioChecked?ra.checked=!0:!W.isSelectionEmpty()&&l.lastPrintSelectionOnlyChecked?Da.checked=!0:qa.checked=!0;W.isSelectionEmpty()||mxEvent.addListener(t,"click",function(){Da.checked=!Da.checked});W=document.createElement("div");W.style.whiteSpace="nowrap";var La=document.createElement("input");La.style.marginBottom="8px";La.style.marginRight="8px";La.setAttribute("type","radio");La.setAttribute("name","printSize");W.appendChild(La);t=document.createElement("span");mxUtils.write(t,mxResources.get("pageView"));W.appendChild(t);mxEvent.addListener(W,"click",function(){La.checked=!0});Y.appendChild(W);W=document.createElement("div");W.style.whiteSpace="nowrap";var sa=document.createElement("input");sa.style.marginBottom="8px";sa.style.marginRight="8px";sa.setAttribute("type","radio");sa.setAttribute("name","printSize");W.appendChild(sa);t=document.createElement("span");mxUtils.write(t,mxResources.get("crop"));W.appendChild(t);mxEvent.addListener(W,"click",function(){sa.checked=!0});Y.appendChild(W);W=document.createElement("div");W.style.whiteSpace="nowrap";var Aa=document.createElement("input");Aa.style.marginBottom="8px";Aa.style.marginRight="8px";Aa.setAttribute("type","radio");Aa.setAttribute("name","printSize");t=document.createElement("div");t.style.display="inline-block";t.style.verticalAlign="top";t.style.paddingTop=-"2px";t.appendChild(Aa);W.appendChild(t);ba=document.createElement("table");ba.style.display="inline-block";ba.style.borderSpacing="0";ya=document.createElement("tbody");var Ea=document.createElement("tr"),Ka=Ea.cloneNode(!0),Ma=document.createElement("td"),za=Ma.cloneNode(!0),Wa=Ma.cloneNode(!0),Ia=Ma.cloneNode(!0),Xa=Ma.cloneNode(!0),Pa=Ma.cloneNode(!0);Ma.style.textAlign="right";Ia.style.textAlign="right";mxUtils.write(Ma,mxResources.get("fitTo"));mxEvent.addListener(W,"click",function(ua){mxEvent.getSource(ua)!=+"2px";t.appendChild(Aa);W.appendChild(t);ca=document.createElement("table");ca.style.display="inline-block";ca.style.borderSpacing="0";ya=document.createElement("tbody");var Ea=document.createElement("tr"),Ka=Ea.cloneNode(!0),Ma=document.createElement("td"),za=Ma.cloneNode(!0),Wa=Ma.cloneNode(!0),Ia=Ma.cloneNode(!0),Xa=Ma.cloneNode(!0),Pa=Ma.cloneNode(!0);Ma.style.textAlign="right";Ia.style.textAlign="right";mxUtils.write(Ma,mxResources.get("fitTo"));mxEvent.addListener(W,"click",function(ua){mxEvent.getSource(ua)!=Aa&&(Aa.checked=!Aa.checked)});var u=document.createElement("input");u.style.margin="0 2px";u.style.boxSizing="border-box";u.setAttribute("value",l.lastPrintSheetsAcross||"1");u.setAttribute("min","1");u.setAttribute("type","number");u.style.width="40px";za.appendChild(u);t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsAcross"));Wa.appendChild(t);mxUtils.write(Ia,mxResources.get("fitToBy"));var N=u.cloneNode(!0);N.setAttribute("value",l.lastPrintSheetsDown||"1");Xa.appendChild(N);mxEvent.addListener(u,"click",function(ua){Aa.checked=!0;mxEvent.consume(ua)});mxEvent.addListener(N,"click",function(ua){Aa.checked=!0;mxEvent.consume(ua)});l.lastPrintCropRadioChecked?sa.checked=!0:l.lastPrintFitRadioChecked?Aa.checked=!0:La.checked=!0;t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsDown"));Pa.appendChild(t);Ea.appendChild(Ma);Ea.appendChild(za);Ea.appendChild(Wa);Ka.appendChild(Ia);Ka.appendChild(Xa);Ka.appendChild(Pa);ya.appendChild(Ea);ya.appendChild(Ka);-ba.appendChild(ya);W.appendChild(ba);Y.appendChild(W);W=document.createElement("div");W.style.borderTop="1px solid lightGray";W.style.whiteSpace="nowrap";W.style.paddingTop="12px";W.style.marginTop="12px";W.style.paddingLeft="8px";mxUtils.write(W,mxResources.get("borderWidth")+":");var R=document.createElement("input");R.setAttribute("type","number");R.setAttribute("min","0");R.style.width="40px";R.style.marginLeft="4px";R.value=null!=l.lastPrintBorder?l.lastPrintBorder:mxPrintPreview.prototype.pageMargin;+ca.appendChild(ya);W.appendChild(ca);Y.appendChild(W);W=document.createElement("div");W.style.borderTop="1px solid lightGray";W.style.whiteSpace="nowrap";W.style.paddingTop="12px";W.style.marginTop="12px";W.style.paddingLeft="8px";mxUtils.write(W,mxResources.get("borderWidth")+":");var R=document.createElement("input");R.setAttribute("type","number");R.setAttribute("min","0");R.style.width="40px";R.style.marginLeft="4px";R.value=null!=l.lastPrintBorder?l.lastPrintBorder:mxPrintPreview.prototype.pageMargin;W.appendChild(R);t=document.createElement("span");t.style.marginLeft="8px";mxUtils.write(t,mxResources.get("zoom")+":");W.appendChild(t);var X=document.createElement("input");X.style.width="60px";X.style.marginLeft="4px";X.value=null!=l.lastPrintZoom?l.lastPrintZoom:"100%";W.appendChild(X);mxUtils.br(W);var ia=document.createElement("input");ia.setAttribute("type","checkbox");ia.style.marginTop="12px";ia.checked=null!=l.lastPrintGrid?l.lastPrintGrid:!1;W.appendChild(ia);t=document.createElement("span");-t.style.marginLeft="4px";t.style.marginRight="8px";mxUtils.write(t,mxResources.get("grid"));W.appendChild(t);mxEvent.addListener(t,"click",function(ua){ia.checked=!0;mxEvent.consume(ua)});var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.style.marginTop="10px";ka.checked=null!=l.lastPrintTransparent?l.lastPrintTransparent:!1;null!=I&&(W.appendChild(ka),t=document.createElement("span"),t.style.marginLeft="4px",mxUtils.write(t,mxResources.get("transparentBackground")),W.appendChild(t),-mxEvent.addListener(t,"click",function(ua){ka.checked=!0;mxEvent.consume(ua)}));var pa=document.createElement("input");pa.setAttribute("type","checkbox");pa.style.marginTop="10px";pa.checked=null!=l.lastPrintInclude?l.lastPrintInclude:Editor.defaultIncludeDiagram;null==I||mxClient.IS_CHROMEAPP||"draw.io"!=l.getServiceName()||(mxUtils.br(W),W.appendChild(pa),t=document.createElement("span"),t.style.marginLeft="4px",mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram")),W.appendChild(t),mxEvent.addListener(t,-"click",function(ua){pa.checked=!0;mxEvent.consume(ua)}));Y.appendChild(W);t=document.createElement("div");t.style.marginTop="40px";t.style.textAlign="right";t.style.whiteSpace="nowrap";l.isOffline()||null!=I||t.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));W=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});W.className="geBtn";l.editor.cancelFirst&&t.appendChild(W);PrintDialog.previewEnabled&&null==I&&(ba=mxUtils.button(mxResources.get("preview"),-function(){try{l.hideDialog(),J(!1)}catch(ua){l.handleError(ua)}}),ba.className="geBtn",t.appendChild(ba));ba=mxUtils.button(mxResources.get(null!=I?"export":PrintDialog.previewEnabled?"print":"ok"),function(){try{l.hideDialog(),J(!0)}catch(ua){l.handleError(ua)}});ba.className="geBtn gePrimaryBtn";t.appendChild(ba);l.editor.cancelFirst||t.appendChild(W);Y.appendChild(t);if(l.editor.isChromelessView()){var wa=function(){Editor.isDarkMode()?(Y.classList.add("geDarkMode"),Y.style.colorScheme="dark"):+t.style.marginLeft="4px";t.style.marginRight="8px";mxUtils.write(t,mxResources.get("grid"));W.appendChild(t);mxEvent.addListener(t,"click",function(ua){ia.checked=!0;mxEvent.consume(ua)});var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.style.marginTop="10px";ka.checked=null!=l.lastPrintTransparent?l.lastPrintTransparent:!1;null!=H&&(W.appendChild(ka),t=document.createElement("span"),t.style.marginLeft="4px",mxUtils.write(t,mxResources.get("transparentBackground")),W.appendChild(t),+mxEvent.addListener(t,"click",function(ua){ka.checked=!0;mxEvent.consume(ua)}));var pa=document.createElement("input");pa.setAttribute("type","checkbox");pa.style.marginTop="10px";pa.checked=null!=l.lastPrintInclude?l.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=l.getServiceName()||(mxUtils.br(W),W.appendChild(pa),t=document.createElement("span"),t.style.marginLeft="4px",mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram")),W.appendChild(t),mxEvent.addListener(t,+"click",function(ua){pa.checked=!0;mxEvent.consume(ua)}));Y.appendChild(W);t=document.createElement("div");t.style.marginTop="40px";t.style.textAlign="right";t.style.whiteSpace="nowrap";l.isOffline()||null!=H||t.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));W=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});W.className="geBtn";l.editor.cancelFirst&&t.appendChild(W);PrintDialog.previewEnabled&&null==H&&(ca=mxUtils.button(mxResources.get("preview"),+function(){try{l.hideDialog(),K(!1)}catch(ua){l.handleError(ua)}}),ca.className="geBtn",t.appendChild(ca));ca=mxUtils.button(mxResources.get(null!=H?"export":PrintDialog.previewEnabled?"print":"ok"),function(){try{l.hideDialog(),K(!0)}catch(ua){l.handleError(ua)}});ca.className="geBtn gePrimaryBtn";t.appendChild(ca);l.editor.cancelFirst||t.appendChild(W);Y.appendChild(t);if(l.editor.isChromelessView()){var wa=function(){Editor.isDarkMode()?(Y.classList.add("geDarkMode"),Y.style.colorScheme="dark"):(Y.classList.remove("geDarkMode"),Y.style.colorScheme="light")};l.addListener("darkModeChanged",wa);wa();var ta=function(ua,Ca){ua=Ca.getProperty("dialog");Y.parentNode==ua.container&&(l.editor.removeListener(ta),l.removeListener(wa))};l.editor.addListener("hideDialog",ta)}this.container=Y};var Z=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var l=this.image;null!=l&&null!=l.src&&Graph.isPageLink(l.src)&&(l={originalSrc:l.src});this.page.viewState.backgroundImage=l}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else Z.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(l=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=l?l:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var da=document.createElement("canvas"),aa=new Image;aa.onload=function(){try{da.getContext("2d").drawImage(aa,0,0);var l=da.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=l&&6<l.length}catch(t){}};aa.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(l){}Editor.prototype.useCanvasForExport=+this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var ea=document.createElement("canvas"),aa=new Image;aa.onload=function(){try{ea.getContext("2d").drawImage(aa,0,0);var l=ea.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=l&&6<l.length}catch(t){}};aa.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(l){}Editor.prototype.useCanvasForExport=!1})();(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){m.previousColor=m.color;m.previousImage=m.image;m.previousFormat=m.format;m.previousAdaptiveColors=m.adaptiveColors;null!=m.foldingEnabled&&(m.foldingEnabled=!m.foldingEnabled);null!=m.mathEnabled&&(m.mathEnabled=!m.mathEnabled);null!=m.shadowVisible&&(m.shadowVisible=!m.shadowVisible);return m};mxCodecRegistry.register(b)})();-(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.0.3";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&+(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.0.4";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};-EditorUi.logError=function(c,f,k,B,z,C,H){if(null!=c){z=null!=z?z:Error(c);z.stack=null!=z.stack?z.stack:"";C=null!=C?C:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>z.stack.indexOf("extension:")&&0>z.stack.indexOf("<anonymous>:")&&-0>z.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+C+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=B?":colno:"+encodeURIComponent(B):"")+(""!=z.stack?"&stack="+encodeURIComponent(z.stack):""))}catch(K){}try{H||null==window.console||console.error(C,c,f,k,B,z)}catch(K){}}};EditorUi.logEvent=+EditorUi.logError=function(c,f,k,B,z,C,I){if(null!=c){z=null!=z?z:Error(c);z.stack=null!=z.stack?z.stack:"";C=null!=C?C:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>z.stack.indexOf("extension:")&&0>z.stack.indexOf("<anonymous>:")&&+0>z.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+C+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=B?":colno:"+encodeURIComponent(B):"")+(""!=z.stack?"&stack="+encodeURIComponent(z.stack):""))}catch(L){}try{I||null==window.console||console.error(C,c,f,k,B,z)}catch(L){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{f=null!=f?f:5E4,c.length>f&&(c=c.substring(0,f)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(k){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],f=0;f<arguments.length;f++)c.push(arguments[f]);console.log.apply(console,c)}}catch(k){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var f=[],k=0;k<c.length;k++)f.push(c[k]);for(k=0;k<f.length;k++)EditorUi.replaceSvgImage(f[k])};EditorUi.replaceSvgImage=function(c){try{var f=null;f=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var k=EditorUi.getSvgSubtree(f);if(null!=k&&"svg"==k.nodeName){k.setAttribute("x",c.getAttribute("x"));k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";var B=mxUtils.createElementNs(k.ownerDocument,mxConstants.NS_SVG,"g");B.appendChild(k);c.hasAttribute("transform")&&B.setAttribute("transform",c.getAttribute("transform"));c.parentNode.replaceChild(B,c)}}catch(z){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var k="svg-image-"+Editor.guid();c.setAttribute("id",k);for(var B=document.implementation.createHTMLDocument(""),-z=document.createElement("style"),C=0;C<f.length;C++){z.textContent=f[C].textContent;B.body.appendChild(z);for(var H="",K=0;K<z.sheet.cssRules.length;K++){var M=z.sheet.cssRules[K];if(null!=M.selectorText){for(var O=M.selectorText.split(","),ea=0;ea<O.length;ea++)O[ea]="#"+k+" "+O[ea];M.selectorText=O.join(",")}H+=M.cssText+"\n"}f[C].textContent=H}}f=c.getElementsByTagName("*");for(k=0;k<f.length;k++)f[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+z=document.createElement("style"),C=0;C<f.length;C++){z.textContent=f[C].textContent;B.body.appendChild(z);for(var I="",L=0;L<z.sheet.cssRules.length;L++){var J=z.sheet.cssRules[L];if(null!=J.selectorText){for(var O=J.selectorText.split(","),da=0;da<O.length;da++)O[da]="#"+k+" "+O[da];J.selectorText=O.join(",")}I+=J.cssText+"\n"}f[C].textContent=I}}f=c.getElementsByTagName("*");for(k=0;k<f.length;k++)f[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;EditorUi.prototype.webpSupported=!1;try{var c=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!c.getContext||!c.getContext("2d"))}catch(z){}try{var f=document.createElement("canvas"),@@ -3459,121 +3459,121 @@ f,k)};EditorUi.prototype.showSplash=function(c){};EditorUi.prototype.getLocalDatEditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,k){var B=null==c||null==f;k=null!=k?k:24;var z=new Spinner({lines:12,length:k,width:Math.round(k/3),radius:Math.round(k/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),C=this.timeout,H=z.spin,K=null,M=null,O=mxUtils.bind(this,function(fa){null!=fa&&fa()});z.spin=function(fa,S,ca,ma){ma=null!=ma?ma:C;var la=!1;if(!this.active){var Z=Date.now();null!=ca&&(K=window.setTimeout(function(){z.stop();K=null;ca({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:M})},ma));H.call(this,fa);this.active=!0;null!=S&&(B&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/+speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),C=this.timeout,I=z.spin,L=null,J=null,O=mxUtils.bind(this,function(fa){null!=fa&&fa()});z.spin=function(fa,V,ba,ma){ma=null!=ma?ma:C;var la=!1;if(!this.active){var Z=Date.now();null!=ba&&(L=window.setTimeout(function(){z.stop();L=null;ba({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:J})},ma));I.call(this,fa);this.active=!0;null!=V&&(B&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2),la=document.createElement("div"),la.className="geSpinnerStatus",la.style.position="absolute",la.style.whiteSpace="nowrap",la.style.background="#4B4243",la.style.color="white",la.style.fontFamily=Editor.defaultHtmlFont,la.style.fontSize="9pt",la.style.padding="6px",la.style.paddingLeft="10px",la.style.paddingRight="10px",la.style.zIndex=2E9,la.style.left=Math.max(0,c)+"px",la.style.top=Math.max(0,f+70)+"px",mxUtils.setPrefixedStyle(la.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(la.style,-"transform","translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(la.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=S.substring(S.length-3,S.length)&&"!"!=S.charAt(S.length-1)&&(S+="..."),la.innerHTML=mxUtils.htmlEntities(S),fa.appendChild(la),z.status=la);this.pause=mxUtils.bind(this,function(){var da=O;this.active&&(ma=Math.max(0,ma-(Date.now()-Z)),da=mxUtils.bind(this,function(aa){this.spin(fa,S,ca,ma);if(null!=aa)try{aa(),M=mxUtils.bind(this,function(){this.spin(fa,S,ca,ma);-try{aa()}catch(l){null!=ca&&ca(l)}})}catch(l){null!=ca&&ca(l)}}));this.stop();return da});la=!0}return la};var ea=z.stop;z.stop=function(){ea.call(this);this.active&&(this.active=!1,null!=K&&(window.clearTimeout(K),K=null),null!=z.status&&null!=z.status.parentNode&&z.status.parentNode.removeChild(z.status),z.status=null)};z.pause=function(){return O};return z};EditorUi.prototype.isCompatibleString=function(c){try{var f=mxUtils.parseXml(c),k=this.editor.extractGraphModel(f.documentElement,!0);return null!=+"transform","translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(la.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=V.substring(V.length-3,V.length)&&"!"!=V.charAt(V.length-1)&&(V+="..."),la.innerHTML=mxUtils.htmlEntities(V),fa.appendChild(la),z.status=la);this.pause=mxUtils.bind(this,function(){var ea=O;this.active&&(ma=Math.max(0,ma-(Date.now()-Z)),ea=mxUtils.bind(this,function(aa){this.spin(fa,V,ba,ma);if(null!=aa)try{aa(),J=mxUtils.bind(this,function(){this.spin(fa,V,ba,ma);+try{aa()}catch(l){null!=ba&&ba(l)}})}catch(l){null!=ba&&ba(l)}}));this.stop();return ea});la=!0}return la};var da=z.stop;z.stop=function(){da.call(this);this.active&&(this.active=!1,null!=L&&(window.clearTimeout(L),L=null),null!=z.status&&null!=z.status.parentNode&&z.status.parentNode.removeChild(z.status),z.status=null)};z.pause=function(){return O};return z};EditorUi.prototype.isCompatibleString=function(c){try{var f=mxUtils.parseXml(c),k=this.editor.extractGraphModel(f.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}catch(B){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=-function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=f.getFunction,B=this.editor.graph,z=this;f.getFunction=function(C){if(B.isSelectionEmpty()&&null!=z.pages&&0<z.pages.length){var H=z.getSelectedPageIndex();if(mxEvent.isShiftDown(C)){if(37==C.keyCode)return function(){0<H&&z.movePage(H,H-1)};if(38==C.keyCode)return function(){0<H&&z.movePage(H,0)};if(39==C.keyCode)return function(){H<z.pages.length-1&&z.movePage(H,H+1)};if(40==C.keyCode)return function(){H<-z.pages.length-1&&z.movePage(H,z.pages.length-1)}}else if(mxEvent.isControlDown(C)||mxClient.IS_MAC&&mxEvent.isMetaDown(C)){if(37==C.keyCode)return function(){0<H&&z.selectNextPage(!1)};if(38==C.keyCode)return function(){0<H&&z.selectPage(z.pages[0])};if(39==C.keyCode)return function(){H<z.pages.length-1&&z.selectNextPage(!0)};if(40==C.keyCode)return function(){H<z.pages.length-1&&z.selectPage(z.pages[z.pages.length-1])}}}return!(65<=C.keyCode&&90>=C.keyCode)||B.isSelectionEmpty()||mxEvent.isAltDown(C)||+function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=f.getFunction,B=this.editor.graph,z=this;f.getFunction=function(C){if(B.isSelectionEmpty()&&null!=z.pages&&0<z.pages.length){var I=z.getSelectedPageIndex();if(mxEvent.isShiftDown(C)){if(37==C.keyCode)return function(){0<I&&z.movePage(I,I-1)};if(38==C.keyCode)return function(){0<I&&z.movePage(I,0)};if(39==C.keyCode)return function(){I<z.pages.length-1&&z.movePage(I,I+1)};if(40==C.keyCode)return function(){I<+z.pages.length-1&&z.movePage(I,z.pages.length-1)}}else if(mxEvent.isControlDown(C)||mxClient.IS_MAC&&mxEvent.isMetaDown(C)){if(37==C.keyCode)return function(){0<I&&z.selectNextPage(!1)};if(38==C.keyCode)return function(){0<I&&z.selectPage(z.pages[0])};if(39==C.keyCode)return function(){I<z.pages.length-1&&z.selectNextPage(!0)};if(40==C.keyCode)return function(){I<z.pages.length-1&&z.selectPage(z.pages[z.pages.length-1])}}}return!(65<=C.keyCode&&90>=C.keyCode)||B.isSelectionEmpty()||mxEvent.isAltDown(C)||mxEvent.isShiftDown(C)||mxEvent.isControlDown(C)||mxClient.IS_MAC&&mxEvent.isMetaDown(C)?k.apply(this,arguments):null}}return f};var e=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=e.apply(this,arguments);if(null==f)try{var k=c.indexOf("<mxfile ");if(0<=k){var B=c.lastIndexOf("</mxfile>");B>k&&(f=c.substring(k,B+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var z=mxUtils.parseXml(c),-C=this.editor.extractGraphModel(z.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=C?mxUtils.getXml(C):""}}catch(H){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",-f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=null!=c?this.editor.extractGraphModel(c,!0):null;null!=k&&(c=k);if(null!=c){k=this.editor.graph;k.model.beginUpdate();try{var B=null!=this.pages?this.pages.slice():null,z=c.getElementsByTagName("diagram");if(1<z.length||1==z.length&&z[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var C=z.length-1;0<=C;C--){var H=this.updatePageRoot(new DiagramPage(z[C]));null==-H.getName()&&H.setName(mxResources.get("pageWithNumber",[C+1]));k.model.execute(new ChangePage(this,H,0==C?H:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,-k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=B)for(C=0;C<B.length;C++)k.model.execute(new ChangePage(this,B[C],null));var K=this.getCurrentFile();null!=K&&K.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){f=null!=f?f:this.editor.graph;z=null!=z?z:!1;M=null!=M?M:!0;ea=null!=ea?ea:!Editor.defaultCompressed;var ca=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var ma=-"_blank";else ca=ma=B;if(null==c)return"";var la=c;if("mxfile"!=la.nodeName.toLowerCase()){if(ea){var Z=c.ownerDocument.createElement("diagram");Z.setAttribute("name",mxResources.get("pageWithNumber",[1]));Z.setAttribute("id",Editor.guid());Z.appendChild(c)}else{Z=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(Z);if(Graph.decompress(la)!=Z)return Z;Z=c.ownerDocument.createElement("diagram");Z.setAttribute("name",mxResources.get("pageWithNumber",[1]));Z.setAttribute("id",Editor.guid());mxUtils.setTextContent(Z,+C=this.editor.extractGraphModel(z.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=C?mxUtils.getXml(C):""}}catch(I){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",+f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=null!=c?this.editor.extractGraphModel(c,!0):null;null!=k&&(c=k);if(null!=c){k=this.editor.graph;k.model.beginUpdate();try{var B=null!=this.pages?this.pages.slice():null,z=c.getElementsByTagName("diagram");if(1<z.length||1==z.length&&z[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var C=z.length-1;0<=C;C--){var I=this.updatePageRoot(new DiagramPage(z[C]));null==+I.getName()&&I.setName(mxResources.get("pageWithNumber",[C+1]));k.model.execute(new ChangePage(this,I,0==C?I:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,+k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=B)for(C=0;C<B.length;C++)k.model.execute(new ChangePage(this,B[C],null));var L=this.getCurrentFile();null!=L&&L.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){f=null!=f?f:this.editor.graph;z=null!=z?z:!1;J=null!=J?J:!0;da=null!=da?da:!Editor.defaultCompressed;var ba=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var ma=+"_blank";else ba=ma=B;if(null==c)return"";var la=c;if("mxfile"!=la.nodeName.toLowerCase()){if(da){var Z=c.ownerDocument.createElement("diagram");Z.setAttribute("name",mxResources.get("pageWithNumber",[1]));Z.setAttribute("id",Editor.guid());Z.appendChild(c)}else{Z=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(Z);if(Graph.decompress(la)!=Z)return Z;Z=c.ownerDocument.createElement("diagram");Z.setAttribute("name",mxResources.get("pageWithNumber",[1]));Z.setAttribute("id",Editor.guid());mxUtils.setTextContent(Z,la)}la=c.ownerDocument.createElement("mxfile");la.appendChild(Z)}O?(la=la.cloneNode(!0),la.removeAttribute("modified"),la.removeAttribute("host"),la.removeAttribute("agent"),la.removeAttribute("etag"),la.removeAttribute("userAgent"),la.removeAttribute("version"),la.removeAttribute("editor"),la.removeAttribute("type")):(la.removeAttribute("userAgent"),la.removeAttribute("modified"),la.removeAttribute("version"),la.removeAttribute("editor"),la.removeAttribute("pages"),la.removeAttribute("type"),la.removeAttribute("etag"),-mxClient.IS_CHROMEAPP?la.setAttribute("host","Chrome"):EditorUi.isElectronApp?la.setAttribute("host","Electron"):la.setAttribute("host",window.location.hostname),la.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),la.setAttribute("version",EditorUi.VERSION),1<la.getElementsByTagName("diagram").length&&null!=this.pages&&la.setAttribute("pages",this.pages.length));null!=fa&&(la=la.cloneNode(!0),la.setAttribute("scale",fa));null!=S&&(la=la.cloneNode(!0),la.setAttribute("border",-S));c=ea?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!C&&!z&&(H||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(la),f,null!=k?k.getTitle():null,ma,ca);else if(C||!z&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(B=null),k=this.getSvgFileProperties(la),c=this.getEmbeddedSvg(c,f,B,null,K,M,ca,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,B){c=-null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var z=this.editor.getGraphXml(c,B);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(M){var O=M.getElementsByTagName("mxGraphModel"),ea=0<O.length?O[0]:null;O=M;null==ea&&k?(ea=mxUtils.getNodeValue(M),0<ea.length&&(ea=Graph.decompress(ea),null!=ea&&0<ea.length&&(O=M.cloneNode(!1),O.appendChild(mxUtils.parseXml(ea).documentElement)))):null==ea||k?O=M.cloneNode(!0):(O=M.cloneNode(!1),mxUtils.setTextContent(O,Graph.compressNode(ea)));-z.appendChild(O)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(z),z=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var C=this.pages[f],H=C.node;if(C!=this.currentPage)if(C.needsUpdate){var K=new mxCodec(mxUtils.createXmlDocument());K=K.encode(new mxGraphModel(C.root));this.editor.graph.saveViewState(C.viewState,K,null,B);EditorUi.removeChildNodes(H);H.appendChild(K);delete C.needsUpdate}else B&&(this.updatePageRoot(C),-null!=C.viewState.backgroundImage&&(null!=C.viewState.backgroundImage.originalSrc?C.viewState.backgroundImage=this.createImageForPageLink(C.viewState.backgroundImage.originalSrc,C):Graph.isPageLink(C.viewState.backgroundImage.src)&&(C.viewState.backgroundImage=this.createImageForPageLink(C.viewState.backgroundImage.src,C))),null!=C.viewState.backgroundImage&&null!=C.viewState.backgroundImage.originalSrc&&(K=new mxCodec(mxUtils.createXmlDocument()),K=K.encode(new mxGraphModel(C.root)),this.editor.graph.saveViewState(C.viewState,-K,null,B),H=H.cloneNode(!1),H.appendChild(K)));c(H)}return z};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],B=0;B<c.length;B++){var z=c.charAt(B);0<=EditorUi.ignoredAnonymizedChars.indexOf(z)?k.push(z):isNaN(parseInt(z))?z.toLowerCase()!=z?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):z.toUpperCase()!=z?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(z)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizePatch=+mxClient.IS_CHROMEAPP?la.setAttribute("host","Chrome"):EditorUi.isElectronApp?la.setAttribute("host","Electron"):la.setAttribute("host",window.location.hostname),la.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),la.setAttribute("version",EditorUi.VERSION),1<la.getElementsByTagName("diagram").length&&null!=this.pages&&la.setAttribute("pages",this.pages.length));null!=fa&&(la=la.cloneNode(!0),la.setAttribute("scale",fa));null!=V&&(la=la.cloneNode(!0),la.setAttribute("border",+V));c=da?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!C&&!z&&(I||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(la),f,null!=k?k.getTitle():null,ma,ba);else if(C||!z&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(B=null),k=this.getSvgFileProperties(la),c=this.getEmbeddedSvg(c,f,B,null,L,J,ba,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,B){c=+null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var z=this.editor.getGraphXml(c,B);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(J){var O=J.getElementsByTagName("mxGraphModel"),da=0<O.length?O[0]:null;O=J;null==da&&k?(da=mxUtils.getNodeValue(J),0<da.length&&(da=Graph.decompress(da),null!=da&&0<da.length&&(O=J.cloneNode(!1),O.appendChild(mxUtils.parseXml(da).documentElement)))):null==da||k?O=J.cloneNode(!0):(O=J.cloneNode(!1),mxUtils.setTextContent(O,Graph.compressNode(da)));+z.appendChild(O)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(z),z=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var C=this.pages[f],I=C.node;if(C!=this.currentPage)if(C.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(C.root));this.editor.graph.saveViewState(C.viewState,L,null,B);EditorUi.removeChildNodes(I);I.appendChild(L);delete C.needsUpdate}else B&&(this.updatePageRoot(C),+null!=C.viewState.backgroundImage&&(null!=C.viewState.backgroundImage.originalSrc?C.viewState.backgroundImage=this.createImageForPageLink(C.viewState.backgroundImage.originalSrc,C):Graph.isPageLink(C.viewState.backgroundImage.src)&&(C.viewState.backgroundImage=this.createImageForPageLink(C.viewState.backgroundImage.src,C))),null!=C.viewState.backgroundImage&&null!=C.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(C.root)),this.editor.graph.saveViewState(C.viewState,+L,null,B),I=I.cloneNode(!1),I.appendChild(L)));c(I)}return z};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],B=0;B<c.length;B++){var z=c.charAt(B);0<=EditorUi.ignoredAnonymizedChars.indexOf(z)?k.push(z):isNaN(parseInt(z))?z.toLowerCase()!=z?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):z.toUpperCase()!=z?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(z)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizePatch=function(c){if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(k)}catch(C){c[EditorUi.DIFF_INSERT][f].data=C.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var B in c[EditorUi.DIFF_UPDATE]){var z=c[EditorUi.DIFF_UPDATE][B];null!=z.name&&-(z.name=this.anonymizeString(z.name));null!=z.cells&&(f=mxUtils.bind(this,function(C){var H=z.cells[C];if(null!=H){for(var K in H)null!=H[K].value&&(H[K].value="["+H[K].value.length+"]"),null!=H[K].xmlValue&&(H[K].xmlValue="["+H[K].xmlValue.length+"]"),null!=H[K].style&&(H[K].style="["+H[K].style.length+"]"),mxUtils.isEmptyObject(H[K])&&delete H[K];mxUtils.isEmptyObject(H)&&delete z.cells[C]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(z.cells)&&delete z.cells);mxUtils.isEmptyObject(z)&&+(z.name=this.anonymizeString(z.name));null!=z.cells&&(f=mxUtils.bind(this,function(C){var I=z.cells[C];if(null!=I){for(var L in I)null!=I[L].value&&(I[L].value="["+I[L].value.length+"]"),null!=I[L].xmlValue&&(I[L].xmlValue="["+I[L].xmlValue.length+"]"),null!=I[L].style&&(I[L].style="["+I[L].style.length+"]"),mxUtils.isEmptyObject(I[L])&&delete I[L];mxUtils.isEmptyObject(I)&&delete z.cells[C]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(z.cells)&&delete z.cells);mxUtils.isEmptyObject(z)&&delete c[EditorUi.DIFF_UPDATE][B]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var k=0;k<c.attributes.length;k++)"as"!=c.attributes[k].name&&c.setAttribute(c.attributes[k].name,this.anonymizeString(c.attributes[k].value,f));if(null!=c.childNodes)for(k=0;k<c.childNodes.length;k++)this.anonymizeAttributes(c.childNodes[k],f)};EditorUi.prototype.anonymizeNode=function(c,f){f=c.getElementsByTagName("mxCell");for(var k=0;k<f.length;k++)null!=f[k].getAttribute("value")&&f[k].setAttribute("value","["+f[k].getAttribute("value").length+"]"),null!=f[k].getAttribute("xmlValue")&&f[k].setAttribute("xmlValue","["+f[k].getAttribute("xmlValue").length+"]"),null!=f[k].getAttribute("style")&&f[k].setAttribute("style","["+f[k].getAttribute("style").length+"]"),null!=f[k].parentNode&&"root"!=f[k].parentNode.nodeName&&null!=f[k].parentNode.parentNode&&(f[k].setAttribute("id",f[k].parentNode.getAttribute("id")),f[k].parentNode.parentNode.replaceChild(f[k],f[k].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(f.clearAutosave(),this.editor.setStatus(""),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();-f.handleFileError(k,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){z=null!=z?z:!0;C=null!=C?C:!1;O=null!=O?O:!Editor.defaultCompressed;var ca=this.editor.graph;if((f||!c&&null!=M&&/(\.svg)$/i.test(M.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ma=ca.getGlobalVariable;ca=this.createTemporaryGraph(ca.getStylesheet());-ca.setBackgroundImage=this.editor.graph.setBackgroundImage;ca.background=this.editor.graph.background;var la=null!=this.pages?this.pages[0]:null;null==la||this.currentPage==la?ca.setBackgroundImage(this.editor.graph.backgroundImage):null!=la.viewState&&null!=la.viewState&&ca.setBackgroundImage(la.viewState.backgroundImage);ca.getGlobalVariable=function(Z){return"page"==Z&&null!=la?la.getName():"pagenumber"==Z?1:ma.apply(this,arguments)};document.body.appendChild(ca.container);null!=la&&ca.model.setRoot(la.root)}H=-null!=H?H:this.getXmlFileData(z,C,O,ea);M=null!=M?M:this.getCurrentFile();c=this.createFileData(H,ca,M,window.location.href,c,f,k,B,z,K,O,fa,S);ca!=this.editor.graph&&ca.container.parentNode.removeChild(ca.container);return c};EditorUi.prototype.getHtml=function(c,f,k,B,z,C){C=null!=C?C:!0;var H=null,K=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){H=C?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var M=f.view.scale;C=Math.floor(H.x/M-f.view.translate.x);M=Math.floor(H.y/M-f.view.translate.y);-H=f.background;null==z&&(f=this.getBasenames().join(";"),0<f.length&&(K=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",C);c.setAttribute("y0",M)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=B&&c.setAttribute("edit",B));null!=z&&(z=z.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";B=Graph.compress(c);Graph.decompress(B)!=c&&(B=encodeURIComponent(c));-return(null==z?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=z?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==z?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=z?'<meta http-equiv="refresh" content="0;URL=\''+z+"'\"/>\n":"")+"</head>\n<body"+(null==z&&null!=H&&H!=mxConstants.NONE?' style="background-color:'+H+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+-B+"</div>\n</div>\n"+(null==z?'<script type="text/javascript" src="'+K+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+z+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,B,z){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=z&&(z=z.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,+f.handleFileError(k,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){z=null!=z?z:!0;C=null!=C?C:!1;O=null!=O?O:!Editor.defaultCompressed;var ba=this.editor.graph;if((f||!c&&null!=J&&/(\.svg)$/i.test(J.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ma=ba.getGlobalVariable;ba=this.createTemporaryGraph(ba.getStylesheet());+ba.setBackgroundImage=this.editor.graph.setBackgroundImage;ba.background=this.editor.graph.background;var la=null!=this.pages?this.pages[0]:null;null==la||this.currentPage==la?ba.setBackgroundImage(this.editor.graph.backgroundImage):null!=la.viewState&&null!=la.viewState&&ba.setBackgroundImage(la.viewState.backgroundImage);ba.getGlobalVariable=function(Z){return"page"==Z&&null!=la?la.getName():"pagenumber"==Z?1:ma.apply(this,arguments)};document.body.appendChild(ba.container);null!=la&&ba.model.setRoot(la.root)}I=+null!=I?I:this.getXmlFileData(z,C,O,da);J=null!=J?J:this.getCurrentFile();c=this.createFileData(I,ba,J,window.location.href,c,f,k,B,z,L,O,fa,V);ba!=this.editor.graph&&ba.container.parentNode.removeChild(ba.container);return c};EditorUi.prototype.getHtml=function(c,f,k,B,z,C){C=null!=C?C:!0;var I=null,L=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){I=C?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var J=f.view.scale;C=Math.floor(I.x/J-f.view.translate.x);J=Math.floor(I.y/J-f.view.translate.y);+I=f.background;null==z&&(f=this.getBasenames().join(";"),0<f.length&&(L=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",C);c.setAttribute("y0",J)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=B&&c.setAttribute("edit",B));null!=z&&(z=z.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";B=Graph.compress(c);Graph.decompress(B)!=c&&(B=encodeURIComponent(c));+return(null==z?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=z?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==z?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=z?'<meta http-equiv="refresh" content="0;URL=\''+z+"'\"/>\n":"")+"</head>\n<body"+(null==z&&null!=I&&I!=mxConstants.NONE?' style="background-color:'+I+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'++B+"</div>\n</div>\n"+(null==z?'<script type="text/javascript" src="'+L+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+z+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,B,z){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=z&&(z=z.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==z?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=z?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==z?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=z?'<meta http-equiv="refresh" content="0;URL=\''+z+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>\n'+(null==z?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+z+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,k=Editor.extractParserError(f,mxResources.get("invalidOrMissingFile"));if(k)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[f],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),k={},0<c.length)){var B=this.getHashObject(),z=null;this.fileNode=f;this.pages=[];for(var C=0;C<c.length;C++){null==c[C].getAttribute("id")&&c[C].setAttribute("id",C);f=new DiagramPage(c[C]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[C+1]));this.pages.push(f);if(null==B.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=B.pageId&&f.getId()==B.pageId)z=f;if(null==k[f.getId()])k[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=z?z:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),-this.scrollToPage());if(null!=urlParams["layer-ids"])try{var H=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(C=0;C<H.length;C++)f[H[C]]=!0;var K=this.editor.graph.getModel(),M=K.getChildren(K.root);for(C=0;C<M.length;C++){var O=M[C];K.setVisible(O,f[O.id]||!1)}}catch(ea){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=-f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la){try{B=null!=B?B:this.editor.graph.isSelectionEmpty();var Z=this.getBaseFilename(!z),da=Z+("xml"==c||"pdf"==c&&ea?".drawio":"")+-"."+c;if("xml"==c){var aa=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,B,z,null,null,null,f);this.saveData(da,c,aa,"text/xml")}else if("html"==c)aa=this.getHtml2(this.getFileData(!0),this.editor.graph,Z),this.saveData(da,c,aa,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?da=Z+".png":"jpeg"==c&&(da=Z+".jpg"),this.saveRequest(da,c,mxUtils.bind(this,function(J,W){try{return this.createDownloadRequest(J,c,B,W,H,z,K,-M,O,ea,fa,void 0,void 0,!C,S,ca,ma,la)}catch(Y){this.handleError(Y)}}));else{var l=null,t=mxUtils.bind(this,function(J){J.length<=MAX_REQUEST_SIZE?this.saveData(da,"svg",J,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(l)}))});if("svg"==c){var I=this.editor.graph.background;if(H||I==mxConstants.NONE)I=null;var V=this.editor.graph.getSvg(I,null,null,null,null,B);k&&this.editor.graph.addSvgShadow(V);-this.editor.convertImages(V,mxUtils.bind(this,mxUtils.bind(this,function(J){this.spinner.stop();t(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(J))})))}else da=Z+".svg",l=this.getFileData(!1,!0,null,mxUtils.bind(this,function(J){this.spinner.stop();t(J)}),B)}}catch(J){this.handleError(J)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la,Z,da){c=this.downloadRequestBuilder(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la,Z,da);f="";for(var aa in c)k=c[aa],-null!=k&&(f+=aa+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la,Z,da){var aa=this.editor.graph,l=aa.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==C?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var t=null,I=null,V=null;if(!EditorUi.isElectronApp&&(l.width*l.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};O=O?"1":-"0";"pdf"==f&&(null!=ea?(t=ea.from,I=ea.to):0==C&&(V="1"));"xmlpng"==f&&(O="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(C=0;C<this.pages.length;C++)if(this.pages[C]==this.currentPage){t=C;break}C=aa.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!z?z||null!=C&&C!=mxConstants.NONE||(C="#ffffff"):C=mxConstants.NONE;z={globalVars:aa.getExportVariables()};M&&(z.grid={size:aa.gridSize,steps:aa.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:-aa.view.gridColor});Graph.translateDiagram&&(z.diagramLanguage=Graph.diagramLanguage);return{format:f,from:t,to:I,allPages:V,bg:null!=C?C:mxConstants.NONE,base64:B,embedXml:O,xml:k,filename:null!=c?c:"",extras:JSON.stringify(z),scale:H,border:K,pageMargin:ma,w:fa&&isFinite(fa)?fa:null,h:S&&isFinite(S)?S:null,crop:null!=ca&&ca?"1":"0",fit:null!=la&&la?"1":"0",sheetsAcross:Z,sheetsDown:da}};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;+this.scrollToPage());if(null!=urlParams["layer-ids"])try{var I=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(C=0;C<I.length;C++)f[I[C]]=!0;var L=this.editor.graph.getModel(),J=L.getChildren(L.root);for(C=0;C<J.length;C++){var O=J[C];L.setVisible(O,f[O.id]||!1)}}catch(da){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=+f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la){try{B=null!=B?B:this.editor.graph.isSelectionEmpty();var Z=this.getBaseFilename(!z),ea=Z+("xml"==c||"pdf"==c&&da?".drawio":"")++"."+c;if("xml"==c){var aa=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,B,z,null,null,null,f);this.saveData(ea,c,aa,"text/xml")}else if("html"==c)aa=this.getHtml2(this.getFileData(!0),this.editor.graph,Z),this.saveData(ea,c,aa,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?ea=Z+".png":"jpeg"==c&&(ea=Z+".jpg"),this.saveRequest(ea,c,mxUtils.bind(this,function(K,W){try{return this.createDownloadRequest(K,c,B,W,I,z,L,+J,O,da,fa,void 0,void 0,!C,V,ba,ma,la)}catch(Y){this.handleError(Y)}}));else{var l=null,t=mxUtils.bind(this,function(K){K.length<=MAX_REQUEST_SIZE?this.saveData(ea,"svg",K,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(l)}))});if("svg"==c){var H=this.editor.graph.background;if(I||H==mxConstants.NONE)H=null;var U=this.editor.graph.getSvg(H,null,null,null,null,B);k&&this.editor.graph.addSvgShadow(U);+this.editor.convertImages(U,mxUtils.bind(this,mxUtils.bind(this,function(K){this.spinner.stop();t(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(K))})))}else ea=Z+".svg",l=this.getFileData(!1,!0,null,mxUtils.bind(this,function(K){this.spinner.stop();t(K)}),B)}}catch(K){this.handleError(K)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la,Z,ea){c=this.downloadRequestBuilder(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la,Z,ea);f="";for(var aa in c)k=c[aa],+null!=k&&(f+=aa+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la,Z,ea){var aa=this.editor.graph,l=aa.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==C?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var t=null,H=null,U=null;if(!EditorUi.isElectronApp&&(l.width*l.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};O=O?"1":+"0";"pdf"==f&&(null!=da?(t=da.from,H=da.to):0==C&&(U="1"));"xmlpng"==f&&(O="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(C=0;C<this.pages.length;C++)if(this.pages[C]==this.currentPage){t=C;break}C=aa.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!z?z||null!=C&&C!=mxConstants.NONE||(C="#ffffff"):C=mxConstants.NONE;z={globalVars:aa.getExportVariables()};J&&(z.grid={size:aa.gridSize,steps:aa.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:+aa.view.gridColor});Graph.translateDiagram&&(z.diagramLanguage=Graph.diagramLanguage);return{format:f,from:t,to:H,allPages:U,bg:null!=C?C:mxConstants.NONE,base64:B,embedXml:O,xml:k,filename:null!=c?c:"",extras:JSON.stringify(z),scale:I,border:L,pageMargin:ma,w:fa&&isFinite(fa)?fa:null,h:V&&isFinite(V)?V:null,crop:null!=ba&&ba?"1":"0",fit:null!=la&&la?"1":"0",sheetsAcross:Z,sheetsDown:ea}};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var k=c.lastIndexOf("#");if(0<k){c=decodeURIComponent(c.substring(k+1));try{f=JSON.parse(c)}catch(B){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var k=f.lastIndexOf("#");0<k&&(f=f.substring(0,k));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(B){}0<k&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,k){var B=window.location.hash,-z=mxUtils.bind(this,function(H){var K=null!=c.data?c.data:"";null!=H&&0<H.length&&(0<K.length&&(K+="\n"),K+=H);H=new LocalFile(this,"csv"!=c.format&&0<K.length?K:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);H.getHash=function(){return B};this.fileLoaded(H);"csv"==c.format&&this.importCsv(K,mxUtils.bind(this,function(S){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var M=null!=c.interval?-parseInt(c.interval):6E4,O=null,ea=mxUtils.bind(this,function(){var S=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(ca){S===this.currentPage&&(200<=ca.getStatus()&&300>=ca.getStatus()?(this.updateDiagram(ca.getText()),fa()):this.handleError({message:mxResources.get("error")+" "+ca.getStatus()}))}),mxUtils.bind(this,function(ca){this.handleError(ca)}))}),fa=mxUtils.bind(this,function(){window.clearTimeout(O);O=-window.setTimeout(ea,M)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){fa();ea()}));fa();ea()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var C=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(C,mxUtils.bind(this,function(H){z(H)}),mxUtils.bind(this,function(H){null!=k&&k(H)}))}else z("")};EditorUi.prototype.updateDiagram=function(c){function f(l){var t=new mxCellOverlay(l.image||z.warningImage,l.tooltip,l.align,l.valign,l.offset);t.addListener(mxEvent.CLICK,function(I,-V){B.alert(l.tooltip)});return t}var k=null,B=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var z=this.editor.graph,C=z.getModel();C.beginUpdate();var H=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var K=C.getCell(c.getAttribute("id"));if(null!=K){try{var M=c.getAttribute("value");if(null!=M){var O=mxUtils.parseXml(M).documentElement;if(null!=O)if("1"==O.getAttribute("replace-value"))C.setValue(K,O);else for(var ea=-O.attributes,fa=0;fa<ea.length;fa++)z.setAttributeForCell(K,ea[fa].nodeName,0<ea[fa].nodeValue.length?ea[fa].nodeValue:null)}}catch(l){null!=window.console&&console.log("Error in value for "+K.id+": "+l)}try{var S=c.getAttribute("style");null!=S&&z.model.setStyle(K,S)}catch(l){null!=window.console&&console.log("Error in style for "+K.id+": "+l)}try{var ca=c.getAttribute("icon");if(null!=ca){var ma=0<ca.length?JSON.parse(ca):null;null!=ma&&ma.append||z.removeCellOverlays(K);null!=ma&&z.addCellOverlay(K,-f(ma))}}catch(l){null!=window.console&&console.log("Error in icon for "+K.id+": "+l)}try{var la=c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var Z=z.getCellGeometry(K);if(null!=Z){Z=Z.clone();for(key in la){var da=parseFloat(la[key]);"dx"==key?Z.x+=da:"dy"==key?Z.y+=da:"dw"==key?Z.width+=da:"dh"==key?Z.height+=da:Z[key]=parseFloat(la[key])}z.model.setGeometry(K,Z)}}}catch(l){null!=window.console&&console.log("Error in icon for "+K.id+": "+l)}}}else if("model"==c.nodeName){for(var aa=-c.firstChild;null!=aa&&aa.nodeType!=mxConstants.NODETYPE_ELEMENT;)aa=aa.nextSibling;null!=aa&&(new mxCodec(c.firstChild)).decode(aa,C)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(z.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))z.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(H=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{C.endUpdate()}null!=-H&&this.chromelessResize&&this.chromelessResize(!0,H)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var B=k.lastIndexOf(".");0<=B&&(c=k.substring(B),k=k.substring(0,B));if(f){f=k;var z=new Date;k=z.getFullYear();B=z.getMonth()+1;var C=z.getDate(),H=z.getHours(),K=z.getMinutes();z=z.getSeconds();k=f+(" "+(k+"-"+B+"-"+C+"-"+H+"-"+K+"-"+z))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=+z=mxUtils.bind(this,function(I){var L=null!=c.data?c.data:"";null!=I&&0<I.length&&(0<L.length&&(L+="\n"),L+=I);I=new LocalFile(this,"csv"!=c.format&&0<L.length?L:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);I.getHash=function(){return B};this.fileLoaded(I);"csv"==c.format&&this.importCsv(L,mxUtils.bind(this,function(V){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var J=null!=c.interval?+parseInt(c.interval):6E4,O=null,da=mxUtils.bind(this,function(){var V=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(ba){V===this.currentPage&&(200<=ba.getStatus()&&300>=ba.getStatus()?(this.updateDiagram(ba.getText()),fa()):this.handleError({message:mxResources.get("error")+" "+ba.getStatus()}))}),mxUtils.bind(this,function(ba){this.handleError(ba)}))}),fa=mxUtils.bind(this,function(){window.clearTimeout(O);O=+window.setTimeout(da,J)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){fa();da()}));fa();da()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var C=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(C,mxUtils.bind(this,function(I){z(I)}),mxUtils.bind(this,function(I){null!=k&&k(I)}))}else z("")};EditorUi.prototype.updateDiagram=function(c){function f(l){var t=new mxCellOverlay(l.image||z.warningImage,l.tooltip,l.align,l.valign,l.offset);t.addListener(mxEvent.CLICK,function(H,+U){B.alert(l.tooltip)});return t}var k=null,B=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var z=this.editor.graph,C=z.getModel();C.beginUpdate();var I=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var L=C.getCell(c.getAttribute("id"));if(null!=L){try{var J=c.getAttribute("value");if(null!=J){var O=mxUtils.parseXml(J).documentElement;if(null!=O)if("1"==O.getAttribute("replace-value"))C.setValue(L,O);else for(var da=+O.attributes,fa=0;fa<da.length;fa++)z.setAttributeForCell(L,da[fa].nodeName,0<da[fa].nodeValue.length?da[fa].nodeValue:null)}}catch(l){null!=window.console&&console.log("Error in value for "+L.id+": "+l)}try{var V=c.getAttribute("style");null!=V&&z.model.setStyle(L,V)}catch(l){null!=window.console&&console.log("Error in style for "+L.id+": "+l)}try{var ba=c.getAttribute("icon");if(null!=ba){var ma=0<ba.length?JSON.parse(ba):null;null!=ma&&ma.append||z.removeCellOverlays(L);null!=ma&&z.addCellOverlay(L,+f(ma))}}catch(l){null!=window.console&&console.log("Error in icon for "+L.id+": "+l)}try{var la=c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var Z=z.getCellGeometry(L);if(null!=Z){Z=Z.clone();for(key in la){var ea=parseFloat(la[key]);"dx"==key?Z.x+=ea:"dy"==key?Z.y+=ea:"dw"==key?Z.width+=ea:"dh"==key?Z.height+=ea:Z[key]=parseFloat(la[key])}z.model.setGeometry(L,Z)}}}catch(l){null!=window.console&&console.log("Error in icon for "+L.id+": "+l)}}}else if("model"==c.nodeName){for(var aa=+c.firstChild;null!=aa&&aa.nodeType!=mxConstants.NODETYPE_ELEMENT;)aa=aa.nextSibling;null!=aa&&(new mxCodec(c.firstChild)).decode(aa,C)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(z.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))z.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(I=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{C.endUpdate()}null!=+I&&this.chromelessResize&&this.chromelessResize(!0,I)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var B=k.lastIndexOf(".");0<=B&&(c=k.substring(B),k=k.substring(0,B));if(f){f=k;var z=new Date;k=z.getFullYear();B=z.getMonth()+1;var C=z.getDate(),I=z.getHours(),L=z.getMinutes();z=z.getSeconds();k=f+(" "+(k+"-"+B+"-"+C+"-"+I+"-"+L+"-"+z))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,f,k){var B=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var z=!1;this.hideDialog();null!=B&&(B.removeListener(this.descriptorChangedListener),this.logIfModified(B,!0),B.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var C=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);!f&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerText="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();f||this.showSplash()});if(null!=c)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?c.addUnsavedStatus():this.editor.setStatus(""):this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</div>");!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();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));z=!0;if(!this.isOffline()&&null!=-c.getMode()){var H="1"==urlParams.sketch?"sketch":uiTheme;if(null==H)H="default";else if("sketch"==H||"min"==H)H+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(K){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+-1),mxSettings.save()}catch(K){}}catch(K){this.fileLoadedError=K;if(null!=c)try{c.close()}catch(M){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=B?this.fileLoaded(B)||C():C()});f?c():(null!=K.fallbackFileData&&(K.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var M=new LocalFile(this,K.fallbackFileData,this.defaultFilename,-!0);this.fileLoaded(M)})}),this.handleError(K,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else C();return z};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,B=new mxGraphModel,z=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var C=0;C<c.length;C++){this.updatePageRoot(c[C]);var H=c[C].node.cloneNode(!1);H.removeAttribute("name");B.root=c[C].root;var K=z.encode(B);this.editor.graph.saveViewState(c[C].viewState,K,!0);K.removeAttribute("pageWidth");-K.removeAttribute("pageHeight");H.appendChild(K);null!=f&&(f.eltCount+=H.getElementsByTagName("*").length,f.nodeCount+=H.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(H,function(M,O,ea,fa){return!fa||"mxGeometry"!=M.nodeName&&"mxPoint"!=M.nodeName||"x"!=O&&"y"!=O&&"width"!=O&&"height"!=O?fa&&"mxCell"==M.nodeName&&"previous"==O?null:ea:Math.round(ea)},f)<<0}return k};EditorUi.prototype.hashValue=function(c,f,k){var B=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&-"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(B^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var z=0;z<c.attributes.length;z++){var C=c.attributes[z].name,H=null!=f?f(c,C,c.attributes[z].value,!0):c.attributes[z].value;null!=H&&(B^=this.hashValue(C,f,k)+this.hashValue(H,f,k))}}if(null!=c.childNodes)for(z=0;z<c.childNodes.length;z++)B=(B<<5)-B+this.hashValue(c.childNodes[z],f,k)<<0}else if(null!=c&&"function"!==-typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(z=0;z<c.length;z++)f=(f<<5)-f+c.charCodeAt(z)<<0;B^=f}return B};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,B,z,C,H){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,+c.getMode()){var I="1"==urlParams.sketch?"sketch":uiTheme;if(null==I)I="default";else if("sketch"==I||"min"==I)I+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(L){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()++1),mxSettings.save()}catch(L){}}catch(L){this.fileLoadedError=L;if(null!=c)try{c.close()}catch(J){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=B?this.fileLoaded(B)||C():C()});f?c():(null!=L.fallbackFileData&&(L.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var J=new LocalFile(this,L.fallbackFileData,this.defaultFilename,+!0);this.fileLoaded(J)})}),this.handleError(L,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else C();return z};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,B=new mxGraphModel,z=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var C=0;C<c.length;C++){this.updatePageRoot(c[C]);var I=c[C].node.cloneNode(!1);I.removeAttribute("name");B.root=c[C].root;var L=z.encode(B);this.editor.graph.saveViewState(c[C].viewState,L,!0);L.removeAttribute("pageWidth");+L.removeAttribute("pageHeight");I.appendChild(L);null!=f&&(f.eltCount+=I.getElementsByTagName("*").length,f.nodeCount+=I.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(I,function(J,O,da,fa){return!fa||"mxGeometry"!=J.nodeName&&"mxPoint"!=J.nodeName||"x"!=O&&"y"!=O&&"width"!=O&&"height"!=O?fa&&"mxCell"==J.nodeName&&"previous"==O?null:da:Math.round(da)},f)<<0}return k};EditorUi.prototype.hashValue=function(c,f,k){var B=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&+"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(B^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var z=0;z<c.attributes.length;z++){var C=c.attributes[z].name,I=null!=f?f(c,C,c.attributes[z].value,!0):c.attributes[z].value;null!=I&&(B^=this.hashValue(C,f,k)+this.hashValue(I,f,k))}}if(null!=c.childNodes)for(z=0;z<c.childNodes.length;z++)B=(B<<5)-B+this.hashValue(c.childNodes[z],f,k)<<0}else if(null!=c&&"function"!==+typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(z=0;z<c.length;z++)f=(f<<5)-f+c.charCodeAt(z)<<0;B^=f}return B};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,B,z,C,I){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){null==c&&(c=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var k=f.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(c,null,2));f.appendChild(k);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var k=0;k<f.length;k++)f[k].parentNode.removeChild(f[k]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,f){var k=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:k.firstChild.nextSibling.nextSibling;f=k.lastChild;var B=f.previousSibling;k.insertBefore(f,c);k.insertBefore(B,f)}};EditorUi.prototype.loadLibrary=function(c,f){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==k.documentElement.nodeName){var B=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,B,k.documentElement.getAttribute("title"),f)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.libraryLoaded=function(c,f,k,B){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var z=null;if(c.constructor!=StorageLibrary||-".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var C=0;C<this.openLibraries.length;C++)if(this.openLibraries[C].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[C],this.openLibraries);break}z={file:c,images:f,title:k,expand:B};this.openLibraries.push(z)}else this.scratchpad=c;C=this.sidebar.palettes[c.getHash()];C=null!=C?C[C.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var H=null,K=mxUtils.bind(this,function(da,aa){0==da.length&&c.isEditable()?-(null==H&&(H=document.createElement("div"),H.className="geDropTarget",mxUtils.write(H,mxResources.get("dragElementsHere"))),aa.appendChild(H)):this.addLibraryEntries(da,aa)});null!=this.sidebar&&null!=f&&this.sidebar.addEntries(f);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var M=this.sidebar.addPalette(c.getHash(),k,null!=B?B:!0,mxUtils.bind(this,function(da){K(f,da)}));null!=z&&(z.div=M);this.repositionLibrary(C,"L.scratchpad"!=c.getHash());B=M.parentNode.previousSibling;-k=B.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&B.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var O=document.createElement("div");O.style.backgroundColor="inherit";B.style.position="relative";var ea=document.createElement("img");ea.className="geAdaptiveAsset";ea.setAttribute("src",Editor.crossImage);ea.setAttribute("title",mxResources.get("close"));ea.setAttribute("valign","absmiddle");ea.setAttribute("border","0");ea.style.position="relative";ea.style.top="2px";-ea.style.width="14px";ea.style.cursor="pointer";ea.style.margin="0 3px";var fa=null;if(".scratchpad"!=c.title||this.closableScratchpad)O.appendChild(ea),mxEvent.addListener(ea,"click",mxUtils.bind(this,function(da){if(!mxEvent.isConsumed(da)){var aa=mxUtils.bind(this,function(){null!=z&&mxUtils.remove(z,this.openLibraries);this.closeLibrary(c)});null!=fa?this.confirm(mxResources.get("allChangesLost"),null,aa,mxResources.get("cancel"),mxResources.get("discardChanges")):aa();mxEvent.consume(da)}}));-if(c.isEditable()){var S=this.editor.graph,ca=null;k=mxUtils.bind(this,function(da){this.showLibraryDialog(c.getTitle(),M,f,c,c.getMode());mxEvent.consume(da)});var ma=mxUtils.bind(this,function(da){c.setModified(!0);c.isAutosave()?(null!=ca&&null!=ca.parentNode&&ca.parentNode.removeChild(ca),ca=ea.cloneNode(!1),ca.setAttribute("src",Editor.spinImage),ca.setAttribute("title",mxResources.get("saving")),ca.style.cursor="default",ca.style.marginRight="2px",ca.style.marginTop="-2px",O.insertBefore(ca,-O.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=ca&&null!=ca.parentNode&&ca.parentNode.removeChild(ca)})):null==fa&&(fa=ea.cloneNode(!1),fa.setAttribute("src",Editor.saveImage),fa.setAttribute("title",mxResources.get("save")),O.insertBefore(fa,O.firstChild),mxEvent.addListener(fa,"click",mxUtils.bind(this,function(aa){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==fa||c.isModified()||(fa.parentNode.removeChild(fa),fa=-null)});mxEvent.consume(aa)})))}),la=mxUtils.bind(this,function(da,aa,l,t){da=S.cloneCells(mxUtils.sortCells(S.model.getTopmostCells(da)));for(var I=0;I<da.length;I++){var V=S.getCellGeometry(da[I]);null!=V&&V.translate(-aa.x,-aa.y)}M.appendChild(this.sidebar.createVertexTemplateFromCells(da,aa.width,aa.height,t||"",!0,null,!1));da=mxUtils.getXml(this.editor.graph.encodeCells(da));Editor.defaultCompressed&&(da=Graph.compress(da));aa={xml:da,w:aa.width,h:aa.height};null!=t&&(aa.title=t);f.push(aa);-ma(l);null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null)}),Z=mxUtils.bind(this,function(da){if(S.isSelectionEmpty())S.getRubberband().isActive()?(S.getRubberband().execute(da),S.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var aa=S.getSelectionCells(),l=S.view.getBounds(aa);if(null!=l&&0<l.width&&0<l.height){var t=S.view.scale;l.x/=t;l.y/=t;l.width/=t;l.height/=t;l.x-=S.view.translate.x;-l.y-=S.view.translate.y;la(aa,l)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(da)});mxEvent.addGestureListeners(M,function(){},mxUtils.bind(this,function(da){S.isMouseDown&&null!=S.panningManager&&null!=S.graphHandler.first&&(S.graphHandler.suspend(),null!=S.graphHandler.hint&&(S.graphHandler.hint.style.visibility="hidden"),M.style.backgroundColor="light-dark(#fefefe, #000000)",M.style.cursor="copy",S.panningManager.stop(),S.autoScroll=-!1,mxEvent.consume(da))}),mxUtils.bind(this,function(da){S.isMouseDown&&null!=S.panningManager&&null!=S.graphHandler&&(M.style.backgroundColor="",M.style.cursor="default",this.sidebar.showTooltips=!0,S.panningManager.stop(),S.graphHandler.reset(),S.isMouseDown=!1,S.autoScroll=!0,Z(da),mxEvent.consume(da))}));mxEvent.addListener(M,"mouseleave",mxUtils.bind(this,function(da){S.isMouseDown&&null!=S.graphHandler.first&&(S.graphHandler.resume(),null!=S.graphHandler.hint&&(S.graphHandler.hint.style.visibility=-"visible"),M.style.backgroundColor="",M.style.cursor="",S.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(M,"dragover",mxUtils.bind(this,function(da){M.style.backgroundColor="light-dark(#fefefe, #000000)";da.dataTransfer.dropEffect="copy";M.style.cursor="copy";this.sidebar.hideTooltip();da.stopPropagation();da.preventDefault()})),mxEvent.addListener(M,"drop",mxUtils.bind(this,function(da){M.style.cursor="";M.style.backgroundColor="";0<da.dataTransfer.files.length&&this.importFiles(da.dataTransfer.files,-0,0,this.maxImageSize,mxUtils.bind(this,function(aa,l,t,I,V,J,W,Y,ba){if(null!=aa&&"image/"==l.substring(0,6))aa="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(aa),aa=[new mxCell("",new mxGeometry(0,0,V,J),aa)],aa[0].vertex=!0,la(aa,new mxRectangle(0,0,V,J),da,mxEvent.isAltDown(da)?null:W.substring(0,W.lastIndexOf(".")).replace(/_/g," ")),null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null);else{var ja=!1,-oa=mxUtils.bind(this,function(qa,ra){null!=qa&&"application/pdf"==ra&&(ra=Editor.extractGraphModelFromPdf(qa),null!=ra&&0<ra.length&&(qa=ra));if(null!=qa)if(qa=mxUtils.parseXml(qa),"mxlibrary"==qa.documentElement.nodeName)try{var xa=JSON.parse(mxUtils.getTextContent(qa.documentElement));K(xa,M);f=f.concat(xa);ma(da);this.spinner.stop();ja=!0}catch(La){}else if("mxfile"==qa.documentElement.nodeName)try{var Ba=qa.documentElement.getElementsByTagName("diagram");for(xa=0;xa<Ba.length;xa++){var ya=this.stringToCells(Editor.getDiagramNodeXml(Ba[xa])),-Da=this.editor.graph.getBoundingBoxFromGeometry(ya);null!=Da&&la(ya,new mxRectangle(0,0,Da.width,Da.height),da)}ja=!0}catch(La){null!=window.console&&console.log("error in drop handler:",La)}ja||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null)});null!=ba&&null!=W&&EditorUi.isVisioFilename(W)?this.importVisio(ba,function(qa){oa(qa,"text/xml")},null,W):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(aa,-W)&&null!=ba?this.isExternalDataComms()?this.parseFile(ba,mxUtils.bind(this,function(qa){4==qa.readyState&&(this.spinner.stop(),200<=qa.status&&299>=qa.status?oa(qa.responseText,"text/xml"):this.handleError({message:mxResources.get(413==qa.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):oa(aa,l)}}));da.stopPropagation();da.preventDefault()})),mxEvent.addListener(M,-"dragleave",function(da){M.style.cursor="";M.style.backgroundColor="";da.stopPropagation();da.preventDefault()}));ea=ea.cloneNode(!1);ea.setAttribute("src",Editor.editImage);ea.setAttribute("title",mxResources.get("edit"));O.insertBefore(ea,O.firstChild);mxEvent.addListener(ea,"click",k);k=ea.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));O.insertBefore(k,O.firstChild);mxEvent.addListener(k,"click",Z);".scratchpad"==c.title&&(this.addSelectionToScratchpad=+".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var C=0;C<this.openLibraries.length;C++)if(this.openLibraries[C].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[C],this.openLibraries);break}z={file:c,images:f,title:k,expand:B};this.openLibraries.push(z)}else this.scratchpad=c;C=this.sidebar.palettes[c.getHash()];C=null!=C?C[C.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var I=null,L=mxUtils.bind(this,function(ea,aa){0==ea.length&&c.isEditable()?+(null==I&&(I=document.createElement("div"),I.className="geDropTarget",mxUtils.write(I,mxResources.get("dragElementsHere"))),aa.appendChild(I)):this.addLibraryEntries(ea,aa)});null!=this.sidebar&&null!=f&&this.sidebar.addEntries(f);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var J=this.sidebar.addPalette(c.getHash(),k,null!=B?B:!0,mxUtils.bind(this,function(ea){L(f,ea)}));null!=z&&(z.div=J);this.repositionLibrary(C,"L.scratchpad"!=c.getHash());B=J.parentNode.previousSibling;+k=B.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&B.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var O=document.createElement("div");O.style.backgroundColor="inherit";B.style.position="relative";var da=document.createElement("img");da.className="geAdaptiveAsset";da.setAttribute("src",Editor.crossImage);da.setAttribute("title",mxResources.get("close"));da.setAttribute("valign","absmiddle");da.setAttribute("border","0");da.style.position="relative";da.style.top="2px";+da.style.width="14px";da.style.cursor="pointer";da.style.margin="0 3px";var fa=null;if(".scratchpad"!=c.title||this.closableScratchpad)O.appendChild(da),mxEvent.addListener(da,"click",mxUtils.bind(this,function(ea){if(!mxEvent.isConsumed(ea)){var aa=mxUtils.bind(this,function(){null!=z&&mxUtils.remove(z,this.openLibraries);this.closeLibrary(c)});null!=fa?this.confirm(mxResources.get("allChangesLost"),null,aa,mxResources.get("cancel"),mxResources.get("discardChanges")):aa();mxEvent.consume(ea)}}));+if(c.isEditable()){var V=this.editor.graph,ba=null;k=mxUtils.bind(this,function(ea){this.showLibraryDialog(c.getTitle(),J,f,c,c.getMode());mxEvent.consume(ea)});var ma=mxUtils.bind(this,function(ea){c.setModified(!0);c.isAutosave()?(null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba),ba=da.cloneNode(!1),ba.setAttribute("src",Editor.spinImage),ba.setAttribute("title",mxResources.get("saving")),ba.style.cursor="default",ba.style.marginRight="2px",ba.style.marginTop="-2px",O.insertBefore(ba,+O.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba)})):null==fa&&(fa=da.cloneNode(!1),fa.setAttribute("src",Editor.saveImage),fa.setAttribute("title",mxResources.get("save")),O.insertBefore(fa,O.firstChild),mxEvent.addListener(fa,"click",mxUtils.bind(this,function(aa){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==fa||c.isModified()||(fa.parentNode.removeChild(fa),fa=+null)});mxEvent.consume(aa)})))}),la=mxUtils.bind(this,function(ea,aa,l,t){ea=V.cloneCells(mxUtils.sortCells(V.model.getTopmostCells(ea)));for(var H=0;H<ea.length;H++){var U=V.getCellGeometry(ea[H]);null!=U&&U.translate(-aa.x,-aa.y)}J.appendChild(this.sidebar.createVertexTemplateFromCells(ea,aa.width,aa.height,t||"",!0,null,!1));ea=mxUtils.getXml(this.editor.graph.encodeCells(ea));Editor.defaultCompressed&&(ea=Graph.compress(ea));aa={xml:ea,w:aa.width,h:aa.height};null!=t&&(aa.title=t);f.push(aa);+ma(l);null!=I&&null!=I.parentNode&&0<f.length&&(I.parentNode.removeChild(I),I=null)}),Z=mxUtils.bind(this,function(ea){if(V.isSelectionEmpty())V.getRubberband().isActive()?(V.getRubberband().execute(ea),V.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var aa=V.getSelectionCells(),l=V.view.getBounds(aa);if(null!=l&&0<l.width&&0<l.height){var t=V.view.scale;l.x/=t;l.y/=t;l.width/=t;l.height/=t;l.x-=V.view.translate.x;+l.y-=V.view.translate.y;la(aa,l)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(ea)});mxEvent.addGestureListeners(J,function(){},mxUtils.bind(this,function(ea){V.isMouseDown&&null!=V.panningManager&&null!=V.graphHandler.first&&(V.graphHandler.suspend(),null!=V.graphHandler.hint&&(V.graphHandler.hint.style.visibility="hidden"),J.style.backgroundColor="light-dark(#fefefe, #000000)",J.style.cursor="copy",V.panningManager.stop(),V.autoScroll=+!1,mxEvent.consume(ea))}),mxUtils.bind(this,function(ea){V.isMouseDown&&null!=V.panningManager&&null!=V.graphHandler&&(J.style.backgroundColor="",J.style.cursor="default",this.sidebar.showTooltips=!0,V.panningManager.stop(),V.graphHandler.reset(),V.isMouseDown=!1,V.autoScroll=!0,Z(ea),mxEvent.consume(ea))}));mxEvent.addListener(J,"mouseleave",mxUtils.bind(this,function(ea){V.isMouseDown&&null!=V.graphHandler.first&&(V.graphHandler.resume(),null!=V.graphHandler.hint&&(V.graphHandler.hint.style.visibility=+"visible"),J.style.backgroundColor="",J.style.cursor="",V.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(J,"dragover",mxUtils.bind(this,function(ea){J.style.backgroundColor="light-dark(#fefefe, #000000)";ea.dataTransfer.dropEffect="copy";J.style.cursor="copy";this.sidebar.hideTooltip();ea.stopPropagation();ea.preventDefault()})),mxEvent.addListener(J,"drop",mxUtils.bind(this,function(ea){J.style.cursor="";J.style.backgroundColor="";0<ea.dataTransfer.files.length&&this.importFiles(ea.dataTransfer.files,+0,0,this.maxImageSize,mxUtils.bind(this,function(aa,l,t,H,U,K,W,Y,ca){if(null!=aa&&"image/"==l.substring(0,6))aa="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(aa),aa=[new mxCell("",new mxGeometry(0,0,U,K),aa)],aa[0].vertex=!0,la(aa,new mxRectangle(0,0,U,K),ea,mxEvent.isAltDown(ea)?null:W.substring(0,W.lastIndexOf(".")).replace(/_/g," ")),null!=I&&null!=I.parentNode&&0<f.length&&(I.parentNode.removeChild(I),I=null);else{var ja=!1,+oa=mxUtils.bind(this,function(qa,ra){null!=qa&&"application/pdf"==ra&&(ra=Editor.extractGraphModelFromPdf(qa),null!=ra&&0<ra.length&&(qa=ra));if(null!=qa)if(qa=mxUtils.parseXml(qa),"mxlibrary"==qa.documentElement.nodeName)try{var xa=JSON.parse(mxUtils.getTextContent(qa.documentElement));L(xa,J);f=f.concat(xa);ma(ea);this.spinner.stop();ja=!0}catch(La){}else if("mxfile"==qa.documentElement.nodeName)try{var Ba=qa.documentElement.getElementsByTagName("diagram");for(xa=0;xa<Ba.length;xa++){var ya=this.stringToCells(Editor.getDiagramNodeXml(Ba[xa])),+Da=this.editor.graph.getBoundingBoxFromGeometry(ya);null!=Da&&la(ya,new mxRectangle(0,0,Da.width,Da.height),ea)}ja=!0}catch(La){null!=window.console&&console.log("error in drop handler:",La)}ja||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=I&&null!=I.parentNode&&0<f.length&&(I.parentNode.removeChild(I),I=null)});null!=ca&&null!=W&&EditorUi.isVisioFilename(W)?this.importVisio(ca,function(qa){oa(qa,"text/xml")},null,W):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(aa,+W)&&null!=ca?this.isExternalDataComms()?this.parseFile(ca,mxUtils.bind(this,function(qa){4==qa.readyState&&(this.spinner.stop(),200<=qa.status&&299>=qa.status?oa(qa.responseText,"text/xml"):this.handleError({message:mxResources.get(413==qa.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):oa(aa,l)}}));ea.stopPropagation();ea.preventDefault()})),mxEvent.addListener(J,+"dragleave",function(ea){J.style.cursor="";J.style.backgroundColor="";ea.stopPropagation();ea.preventDefault()}));da=da.cloneNode(!1);da.setAttribute("src",Editor.editImage);da.setAttribute("title",mxResources.get("edit"));O.insertBefore(da,O.firstChild);mxEvent.addListener(da,"click",k);k=da.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));O.insertBefore(k,O.firstChild);mxEvent.addListener(k,"click",Z);".scratchpad"==c.title&&(this.addSelectionToScratchpad=Z);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink),C=k.getElementsByTagName("img")[0],k.style.marginRight="1px",C.style.marginTop="-2px",C.style.opacity="",O.insertBefore(k,O.firstChild))}B.appendChild(O);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var k=0;k<c.length;k++)try{var B=c[k],z=B.data;if(null!=z){z="data:"==z.substring(0,5)?this.convertDataUri(z):-z;var C="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==B.aspect&&(C+="aspect=fixed;");C=C+"image="+z+";";null!=B.style&&(C+=B.style);f.appendChild(this.sidebar.createVertexTemplate(C,B.w,B.h,"",B.title||"",!1,null,!0))}else if(null!=B.xml){var H=this.stringToCells("<"==B.xml.charAt(0)?B.xml:Graph.decompress(B.xml)),K=0==H.length?mxResources.get("drawingEmpty"):null!=B.title?B.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(H,B.w,B.h,K,!0,null,-!0))}}catch(M){K=null!=M.message?mxResources.get("error")+": "+M.message:String(M),C=this.sidebar.createVertexTemplateFromCells(null,B.w,B.h,K,!0,null,!0),f.appendChild(C)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(mxClient.link("stylesheet",+z;var C="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==B.aspect&&(C+="aspect=fixed;");C=C+"image="+z+";";null!=B.style&&(C+=B.style);f.appendChild(this.sidebar.createVertexTemplate(C,B.w,B.h,"",B.title||"",!1,null,!0))}else if(null!=B.xml){var I=this.stringToCells("<"==B.xml.charAt(0)?B.xml:Graph.decompress(B.xml)),L=0==I.length?mxResources.get("drawingEmpty"):null!=B.title?B.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(I,B.w,B.h,L,!0,null,+!0))}}catch(J){L=null!=J.message?mxResources.get("error")+": "+J.message:String(J),C=this.sidebar.createVertexTemplateFromCells(null,B.w,B.h,L,!0,null,!0),f.appendChild(C)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground="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);"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=-function(c,f,k,B,z,C,H){c=new ImageDialog(this,c,f,k,B,z,C,H);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,B,z,C){var H=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=H?JSON.stringify(JSON.parse(H),null,2):"",mxUtils.bind(this,function(K){if(null!=K)try{if(null!=C&&C(K),K==H)this.hideDialog();else{if(0<K.length){var M=JSON.parse(K);localStorage.setItem(f,JSON.stringify(M))}else localStorage.removeItem(f);-this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(O){this.handleError(O)}}),null,mxResources.get("close"),null,null,null,!0,null,null,z,k,B);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,B){c=null!=c?c:mxUtils.bind(this,function(z,C,H,K){C||(z=new ChangePageSetup(this,B?H:null,z),z.ignoreColor=!B,null!=K&&B&&(z.shadowVisible=K),this.editor.graph.model.execute(z))});c=new BackgroundImageDialog(this,c,+function(c,f,k,B,z,C,I){c=new ImageDialog(this,c,f,k,B,z,C,I);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,B,z,C){var I=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=I?JSON.stringify(JSON.parse(I),null,2):"",mxUtils.bind(this,function(L){if(null!=L)try{if(null!=C&&C(L),L==I)this.hideDialog();else{if(0<L.length){var J=JSON.parse(L);localStorage.setItem(f,JSON.stringify(J))}else localStorage.removeItem(f);+this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(O){this.handleError(O)}}),null,mxResources.get("close"),null,null,null,!0,null,null,z,k,B);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,B){c=null!=c?c:mxUtils.bind(this,function(z,C,I,L){C||(z=new ChangePageSetup(this,B?I:null,z),z.ignoreColor=!B,null!=L&&B&&(z.shadowVisible=L),this.editor.graph.model.execute(z))});c=new BackgroundImageDialog(this,c,f,k,B);this.showDialog(c.container,400,B?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,k,B,z){c=new LibraryDialog(this,c,f,k,B,z);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(C){C&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var g=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=g.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&-f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,B,z,C,H){var K=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},M=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{H||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!H||null==window.console||console.error("EditorUi.handleError:",c)}catch(S){}if(null!=-M||null!=f){H=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var O=mxResources.get("ok"),ea=null;f=null!=f?f:mxResources.get("error");if(null!=M){null!=M.retry&&(O=mxResources.get("cancel"),ea=function(){K();M.retry()});if(404==M.code||404==M.status||403==M.code){H=403==M.code?null!=M.message?mxUtils.htmlEntities(M.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=z?z:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?-" ("+this.drive.user.email+")":""),!1);var fa=null!=z?null:null!=C?C:window.location.hash;if(null!=fa&&("#G"==fa.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==fa.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==M.code||404==M.status)){fa="#U"==fa.substring(0,2)?fa.substring(45,fa.lastIndexOf("%26ex")):fa.substring(2);-this.showError(f,H,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+fa);null!=B&&B()}),ea,mxResources.get("changeUser"),mxUtils.bind(this,function(){function S(){Z.innerText="";for(var da=0;da<ca.length;da++){var aa=document.createElement("option");mxUtils.write(aa,ca[da].displayName);aa.value=da;Z.appendChild(aa);aa=document.createElement("option");aa.innerHTML=" ";mxUtils.write(aa,"<"+ca[da].email+-">");aa.setAttribute("disabled","disabled");Z.appendChild(aa)}aa=document.createElement("option");mxUtils.write(aa,mxResources.get("addAccount"));aa.value=ca.length;Z.appendChild(aa)}var ca=this.drive.getUsersList(),ma=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");ma.appendChild(la);var Z=document.createElement("select");Z.style.width="100%";S();mxEvent.addListener(Z,"change",mxUtils.bind(this,function(){var da=-Z.value,aa=ca.length!=da;aa&&this.drive.setUser(ca[da]);this.drive.authorize(aa,mxUtils.bind(this,function(){aa||(ca=this.drive.getUsersList(),S())}),mxUtils.bind(this,function(l){this.handleError(l)}),!0)}));ma.appendChild(Z);ma=new CustomDialog(this,ma,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ma.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=M.message?-H=""==M.message&&null!=M.name?mxUtils.htmlEntities(M.name,!1):mxUtils.htmlEntities(M.message,!1):null!=M.response&&null!=M.response.error?H=mxUtils.htmlEntities(M.response.error,!1):"undefined"!==typeof window.App&&(M.code==App.ERROR_TIMEOUT?H=mxUtils.htmlEntities(mxResources.get("timeout"),!1):M.code==App.ERROR_BUSY?H=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof M&&0<M.length&&(H=mxUtils.htmlEntities(M,!1)))}z=c=null;null!=M&&null!=M.helpLink?(c=mxResources.get("help"),z=mxUtils.bind(this,-function(){return this.editor.graph.openLink(M.helpLink)})):null!=M&&null!=M.ownerEmail?(c=mxResources.get("contactOwner"),H+=mxUtils.htmlEntities(" ("+c+": "+M.ownerEmail+")",!1),z=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(M.ownerEmail))})):null!=M&&null!=M.alternateAction&&(c=M.alternateAction.label,z=M.alternateAction.funct);this.showError(f,H,O,k,ea,null,null,c,z,null,null,null,B?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,-null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,B,z,C){c=null!=c?c:"";var H=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},K=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){H();null!=f&&f()},function(){H();null!=k&&k()},B,z,null,null,null,null,K);this.showDialog(c.container,340,46+K,!0,C);c.init()};EditorUi.prototype.showBanner=function(c,f,k,-B,z,C,H,K,M){var O=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){C=null!=C?C:"bottom:10px;left:50%;";H=null!=H?H:"translate(-50%,120%)";K=null!=K?K:"translate(-50%,0%)";var ea=z?500:1E3;O=z?"padding:4px;border-radius:6px;font-size:11px;height:12px;font-weight:normal;":"font-size:16px;padding:18px 34px 12px 20px;font-weight:bold;";var fa=document.createElement("div");fa.style.cssText="position:absolute;"+C+";max-width:90%;white-space:nowrap;cursor:pointer;z-index:"+-mxPopupMenu.prototype.zIndex+";"+O;mxUtils.setPrefixedStyle(fa.style,"transform",H);mxUtils.setPrefixedStyle(fa.style,"transition","all "+ea+"ms ease");fa.className="geBtn gePrimaryBtn"+(z?" geSmallBanner":"");Editor.isDarkMode()||mxUtils.setPrefixedStyle(fa.style,"box-shadow","1px 1px 2px 0px #ddd");null!=M&&mxUtils.setPrefixedStyle(fa.style,"transform-origin",M);if(!z){var S=document.createElement("img");S.setAttribute("src",IMAGE_PATH+"/logo.png");S.setAttribute("border","0");S.setAttribute("align",-"absmiddle");S.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";fa.appendChild(S);S=document.createElement("img");S.setAttribute("src",Dialog.prototype.closeImage);S.setAttribute("title",mxResources.get(B?"doNotShowAgain":"close"));S.setAttribute("border","0");S.style.cssText=(z?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";fa.appendChild(S)}mxUtils.write(fa,f);document.body.appendChild(fa);-this.bannerShowing=!0;f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var ca=document.createElement("input");ca.setAttribute("type","checkbox");ca.setAttribute("id","geDoNotShowAgainCheckbox");ca.style.marginRight="6px";if(!B){f.appendChild(ca);var ma=document.createElement("label");ma.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(ma,mxResources.get("doNotShowAgain"));-f.appendChild(ma);fa.style.paddingBottom=z?"16px":"30px";fa.appendChild(f)}var la=mxUtils.bind(this,function(){null!=fa.parentNode&&(fa.parentNode.removeChild(fa),this.bannerShowing=!1,ca.checked||B)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=S&&mxEvent.addListener(S,"click",mxUtils.bind(this,function(da){mxEvent.consume(da);la()}));var Z=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(fa.style,-"transform",H);window.setTimeout(mxUtils.bind(this,function(){la()}),ea)});mxEvent.addListener(fa,"click",mxUtils.bind(this,function(da){var aa=mxEvent.getSource(da);aa!=ca&&aa!=ma?(null!=k&&k(),la(),mxEvent.consume(da)):Z()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(fa.style,"transform",K)}),ea/2);window.setTimeout(Z,z?4E3:3E4);O=!0}return O};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=+f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,B,z,C,I){var L=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},J=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{I||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!I||null==window.console||console.error("EditorUi.handleError:",c)}catch(V){}if(null!=+J||null!=f){I=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var O=mxResources.get("ok"),da=null;f=null!=f?f:mxResources.get("error");if(null!=J){null!=J.retry&&(O=mxResources.get("cancel"),da=function(){L();J.retry()});if(404==J.code||404==J.status||403==J.code){I=403==J.code?null!=J.message?mxUtils.htmlEntities(J.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=z?z:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?+" ("+this.drive.user.email+")":""),!1);var fa=null!=z?null:null!=C?C:window.location.hash;if(null!=fa&&("#G"==fa.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==fa.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==J.code||404==J.status)){fa="#U"==fa.substring(0,2)?fa.substring(45,fa.lastIndexOf("%26ex")):fa.substring(2);+this.showError(f,I,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+fa);null!=B&&B()}),da,mxResources.get("changeUser"),mxUtils.bind(this,function(){function V(){Z.innerText="";for(var ea=0;ea<ba.length;ea++){var aa=document.createElement("option");mxUtils.write(aa,ba[ea].displayName);aa.value=ea;Z.appendChild(aa);aa=document.createElement("option");aa.innerHTML=" ";mxUtils.write(aa,"<"+ba[ea].email++">");aa.setAttribute("disabled","disabled");Z.appendChild(aa)}aa=document.createElement("option");mxUtils.write(aa,mxResources.get("addAccount"));aa.value=ba.length;Z.appendChild(aa)}var ba=this.drive.getUsersList(),ma=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");ma.appendChild(la);var Z=document.createElement("select");Z.style.width="100%";V();mxEvent.addListener(Z,"change",mxUtils.bind(this,function(){var ea=+Z.value,aa=ba.length!=ea;aa&&this.drive.setUser(ba[ea]);this.drive.authorize(aa,mxUtils.bind(this,function(){aa||(ba=this.drive.getUsersList(),V())}),mxUtils.bind(this,function(l){this.handleError(l)}),!0)}));ma.appendChild(Z);ma=new CustomDialog(this,ma,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ma.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=J.message?+I=""==J.message&&null!=J.name?mxUtils.htmlEntities(J.name,!1):mxUtils.htmlEntities(J.message,!1):null!=J.response&&null!=J.response.error?I=mxUtils.htmlEntities(J.response.error,!1):"undefined"!==typeof window.App&&(J.code==App.ERROR_TIMEOUT?I=mxUtils.htmlEntities(mxResources.get("timeout"),!1):J.code==App.ERROR_BUSY?I=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof J&&0<J.length&&(I=mxUtils.htmlEntities(J,!1)))}z=c=null;null!=J&&null!=J.helpLink?(c=mxResources.get("help"),z=mxUtils.bind(this,+function(){return this.editor.graph.openLink(J.helpLink)})):null!=J&&null!=J.ownerEmail?(c=mxResources.get("contactOwner"),I+=mxUtils.htmlEntities(" ("+c+": "+J.ownerEmail+")",!1),z=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(J.ownerEmail))})):null!=J&&null!=J.alternateAction&&(c=J.alternateAction.label,z=J.alternateAction.funct);this.showError(f,I,O,k,da,null,null,c,z,null,null,null,B?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,+null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,B,z,C){c=null!=c?c:"";var I=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){I();null!=f&&f()},function(){I();null!=k&&k()},B,z,null,null,null,null,L);this.showDialog(c.container,340,46+L,!0,C);c.init()};EditorUi.prototype.showBanner=function(c,f,k,+B,z,C,I,L,J){var O=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){C=null!=C?C:"bottom:10px;left:50%;";I=null!=I?I:"translate(-50%,120%)";L=null!=L?L:"translate(-50%,0%)";var da=z?500:1E3;O=z?"padding:4px;border-radius:6px;font-size:11px;height:12px;font-weight:normal;":"font-size:16px;padding:18px 34px 12px 20px;font-weight:bold;";var fa=document.createElement("div");fa.style.cssText="position:absolute;"+C+";max-width:90%;white-space:nowrap;cursor:pointer;z-index:"++mxPopupMenu.prototype.zIndex+";"+O;mxUtils.setPrefixedStyle(fa.style,"transform",I);mxUtils.setPrefixedStyle(fa.style,"transition","all "+da+"ms ease");fa.className="geBtn gePrimaryBtn"+(z?" geSmallBanner":"");Editor.isDarkMode()||mxUtils.setPrefixedStyle(fa.style,"box-shadow","1px 1px 2px 0px #ddd");null!=J&&mxUtils.setPrefixedStyle(fa.style,"transform-origin",J);if(!z){var V=document.createElement("img");V.setAttribute("src",IMAGE_PATH+"/logo.png");V.setAttribute("border","0");V.setAttribute("align",+"absmiddle");V.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";fa.appendChild(V);V=document.createElement("img");V.setAttribute("src",Dialog.prototype.closeImage);V.setAttribute("title",mxResources.get(B?"doNotShowAgain":"close"));V.setAttribute("border","0");V.style.cssText=(z?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";fa.appendChild(V)}mxUtils.write(fa,f);document.body.appendChild(fa);+this.bannerShowing=!0;f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var ba=document.createElement("input");ba.setAttribute("type","checkbox");ba.setAttribute("id","geDoNotShowAgainCheckbox");ba.style.marginRight="6px";if(!B){f.appendChild(ba);var ma=document.createElement("label");ma.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(ma,mxResources.get("doNotShowAgain"));+f.appendChild(ma);fa.style.paddingBottom=z?"16px":"30px";fa.appendChild(f)}var la=mxUtils.bind(this,function(){null!=fa.parentNode&&(fa.parentNode.removeChild(fa),this.bannerShowing=!1,ba.checked||B)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=V&&mxEvent.addListener(V,"click",mxUtils.bind(this,function(ea){mxEvent.consume(ea);la()}));var Z=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(fa.style,+"transform",I);window.setTimeout(mxUtils.bind(this,function(){la()}),da)});mxEvent.addListener(fa,"click",mxUtils.bind(this,function(ea){var aa=mxEvent.getSource(ea);aa!=ba&&aa!=ma?(null!=k&&k(),la(),mxEvent.consume(ea)):Z()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(fa.style,"transform",L)}),da/2);window.setTimeout(Z,z?4E3:3E4);O=!0}return O};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return this.editor.isExportToCanvas()};EditorUi.prototype.createImageDataUri=function(c,f,k,B){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<B&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",B));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,B,z){var C="jpeg"==k?"jpg":k;B=this.getBaseFilename(B)+(null!=f?".drawio":"")+"."+C;c=this.createImageDataUri(c,f,k,z);this.saveData(B,C,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,B,z,C){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=C?C:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=B?this.base64ToBlob(c,k):new Blob([c],{type:k}),navigator.msSaveOrOpenBlob(c,f);else if(mxClient.IS_IE)k=window.open("about:blank",-"_blank"),null==k?mxUtils.popup(c,!0):(k.document.write(c),k.document.close(),k.document.execCommand("SaveAs",!0,f),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,B);else{var H=document.createElement("a");C=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof H.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var K=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);-C=65==(K?parseInt(K[2],10):!1)?!1:C}if(C||this.isOffline()){H.href=URL.createObjectURL(B?this.base64ToBlob(c,k):new Blob([c],{type:k}));C?H.download=f:H.setAttribute("target","_blank");document.body.appendChild(H);try{window.setTimeout(function(){URL.revokeObjectURL(H.href)},2E4),H.click(),H.parentNode.removeChild(H)}catch(M){}}else this.createEchoRequest(c,f,k,B,z).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,B,z,C){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,-c+(null!=k?"&mime="+k:"")+(null!=z?"&format="+z:"")+(null!=C?"&base64="+C:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(B?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,B,z,C,H,K){C=null!=C?C:!1;H=null!=H?H:"vsdx"!=z&&(!mxClient.IS_IOS||!navigator.standalone);var M=mxUtils.bind(this,function(ea,fa,S,ca){try{if("_blank"==fa)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,B);else if(null!=k&&"text/html"==k.substring(0,9)){var ma=new EmbedDialog(this,c);this.showDialog(ma.container,-450,240,!0,!0);ma.init()}else{var la=window.open("about:blank");null==la?mxUtils.popup(c,!0):(la.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),la.document.close())}else if(fa==App.MODE_DEVICE||"download"==fa)this.doSaveLocalFile(c,ea,k,B,null,K);else if(null!=ea&&0<ea.length){var Z=mxUtils.bind(this,function(da){try{this.exportFile(c,ea,k,B,fa,da)}catch(aa){this.handleError(aa)}});null!=ca?Z(ca):this.pickFolder(fa,Z)}}catch(da){this.handleError(da)}});z=[];C||z.push(App.MODE_BROWSER);-H||z.push("_blank");var O=new SaveDialog(this,f,mxUtils.bind(this,function(ea,fa,S){M(ea.value,fa,ea,S);this.hideDialog(null,null,O.container)}),z,c,k,B);this.showDialog(O.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));O.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){var B=window.open("about:blank");if(null==B||null==B.document)mxUtils.popup(c,!0);else{var z="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==f){var C=mxUtils.parseXml(c).documentElement.style.backgroundColor;+"_blank"),null==k?mxUtils.popup(c,!0):(k.document.write(c),k.document.close(),k.document.execCommand("SaveAs",!0,f),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,B);else{var I=document.createElement("a");C=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof I.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);+C=65==(L?parseInt(L[2],10):!1)?!1:C}if(C||this.isOffline()){I.href=URL.createObjectURL(B?this.base64ToBlob(c,k):new Blob([c],{type:k}));C?I.download=f:I.setAttribute("target","_blank");document.body.appendChild(I);try{window.setTimeout(function(){URL.revokeObjectURL(I.href)},2E4),I.click(),I.parentNode.removeChild(I)}catch(J){}}else this.createEchoRequest(c,f,k,B,z).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,B,z,C){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,+c+(null!=k?"&mime="+k:"")+(null!=z?"&format="+z:"")+(null!=C?"&base64="+C:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(B?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,B,z,C,I,L){C=null!=C?C:!1;I=null!=I?I:"vsdx"!=z&&(!mxClient.IS_IOS||!navigator.standalone);var J=mxUtils.bind(this,function(da,fa,V,ba){try{if("_blank"==fa)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,B);else if(null!=k&&"text/html"==k.substring(0,9)){var ma=new EmbedDialog(this,c);this.showDialog(ma.container,+450,240,!0,!0);ma.init()}else{var la=window.open("about:blank");null==la?mxUtils.popup(c,!0):(la.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),la.document.close())}else if(fa==App.MODE_DEVICE||"download"==fa)this.doSaveLocalFile(c,da,k,B,null,L);else if(null!=da&&0<da.length){var Z=mxUtils.bind(this,function(ea){try{this.exportFile(c,da,k,B,fa,ea)}catch(aa){this.handleError(aa)}});null!=ba?Z(ba):this.pickFolder(fa,Z)}}catch(ea){this.handleError(ea)}});z=[];C||z.push(App.MODE_BROWSER);+I||z.push("_blank");var O=new SaveDialog(this,f,mxUtils.bind(this,function(da,fa,V){J(da.value,fa,da,V);this.hideDialog(null,null,O.container)}),z,c,k,B);this.showDialog(O.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));O.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){var B=window.open("about:blank");if(null==B||null==B.document)mxUtils.popup(c,!0);else{var z="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==f){var C=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=C&&(z="background: "+C+";")}z='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+z+'">';"image/svg+xml"!=f||mxClient.IS_SVG?"image/svg+xml"!=f||k?(C=k?c:btoa(unescape(encodeURIComponent(c))),B.document.write(z+'<img style="max-width:100%;" src="data:'+f+";base64,"+C+'"/></body></html>')):B.document.write(z+c+"</body></html>"):B.document.write(z+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");B.document.close()}};var m=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var f=c(mxUtils.bind(this,function(B){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.className="geScrollable",this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=@@ -3583,190 +3583,192 @@ this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialognull)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.isExportToCanvas()&&this.isChromelessImageExportEnabled()){this.exportDialog=null;var k=c(mxUtils.bind(this,function(B){var z=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",z);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)z.apply(this);else{this.exportDialog=document.createElement("div");var C=k.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width=-"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=C.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";C=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=C.zIndex;var H=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});H.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",z);this.editor.exportToCanvas(mxUtils.bind(this,function(K){H.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var M=this.createImageDataUri(K,null,"png");K=document.createElement("img");K.style.maxWidth="140px";K.style.maxHeight="140px";-K.style.cursor="pointer";K.style.backgroundColor="white";K.setAttribute("title",mxResources.get("openInNewWindow"));K.setAttribute("border","0");K.setAttribute("src",M);this.exportDialog.appendChild(K);mxEvent.addListener(K,"click",mxUtils.bind(this,function(){this.openInNewWindow(M.substring(M.indexOf(",")+1),"image/png",!0);z.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(K){H.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),-this.exportDialog=null);this.handleError(K)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(B)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,B,z){this.isLocalFileSave()?this.saveLocalFile(k,c,B,z,f):this.saveRequest(c,f,mxUtils.bind(this,function(C,H){return this.createEchoRequest(k,C,B,z,f,H)}),k,z,B)};EditorUi.prototype.saveRequest=function(c,f,k,B,z,C,H){H=null!=H?H:!mxClient.IS_IOS||!navigator.standalone;var K=mxUtils.bind(this,-function(O,ea,fa,S){if("_blank"==ea||null!=O&&0<O.length){var ca=k("_blank"==ea?null:O,ea==App.MODE_DEVICE||"download"==ea||null==ea||"_blank"==ea?"0":"1");null!=ca&&(ea==App.MODE_DEVICE||"download"==ea||"_blank"==ea?ca.simulate(document,"_blank"):(fa=mxUtils.bind(this,function(ma){C=null!=C?C:"pdf"==f?"application/pdf":"image/"+f;if(null!=B)try{this.exportFile(B,O,C,!0,ea,ma)}catch(la){this.handleError(la)}else this.spinner.spin(document.body,mxResources.get("saving"))&&ca.send(mxUtils.bind(this,-function(){this.spinner.stop();if(200<=ca.getStatus()&&299>=ca.getStatus())try{this.exportFile(ca.getText(),O,C,!0,ea,ma)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=S?fa(S):this.pickFolder(ea,fa)))}});z=[App.MODE_BROWSER];H||z.push("_blank");var M=new SaveDialog(this,c,mxUtils.bind(this,function(O,ea,fa){K(O.value,ea,O,fa);this.hideDialog(null,null,M.container)}),-z,null,"application/pdf");this.showDialog(M.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));M.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,k,B,z,C){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,k){f(null)};-EditorUi.prototype.exportSvg=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(J){Editor.addRetryToError(J,mxUtils.bind(this,function(){this.exportSvg(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca)}));this.handleError(J)})))try{var ma=this.editor.graph.isSelectionEmpty();k=null!=k?k:ma;var la=f?null:this.editor.graph.background;la==mxConstants.NONE&&(la=null);null==la&&0==f&&(la=this.editor.graph.shapeBackgroundColor);var Z=this.editor.graph.addForeignObjectWarning;-Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var da=this.editor.graph.createSvgImageExport(z),aa=this.editor.graph.getSvg(la,c,H,K,null,k,null,da,"blank"==O?"_blank":"self"==O?"_top":null,null,!S,ea,fa);this.editor.graph.addForeignObjectWarning=Z;B&&this.editor.graph.addSvgShadow(aa);var l=this.getBaseFilename()+(z?".drawio":"")+".svg";ca=null!=ca?ca:mxUtils.bind(this,function(J){this.isLocalFileSave()||J.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",J,"image/svg+xml"):-this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(J)}))});var t=mxUtils.bind(this,function(J){this.spinner.stop();z&&J.setAttribute("content",this.getFileData(!0,null,null,null,k,M,null,null,null,null,null,c,H));ca(Graph.xmlDeclaration+"\n"+(z?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(J))});this.editor.graph.mathEnabled&&this.editor.addMathCss(aa);var I=mxUtils.bind(this,function(J){Editor.replaceSvgDataUris&&-C&&EditorUi.embedSvgImages(J);Editor.foreignObjectImages&&S?this.replaceAlternateContent(J,ea,t):t(J)}),V=mxUtils.bind(this,function(J){C&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(J,I,this.thumbImageCache)):I(J)});S?this.embedFonts(aa,V):(this.editor.addFontCss(aa),V(aa))}catch(J){this.handleError(J)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function B(fa,S,ca,ma,la){var Z=mxUtils.createElementNs(c.ownerDocument,-mxConstants.NS_SVG,"image");Z.setAttribute("x",S);Z.setAttribute("y",ca+.5);Z.setAttribute("width",ma.width);Z.setAttribute("height",ma.height);null==Z.setAttributeNS?Z.setAttribute("xlink:href",la):Z.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);fa.replaceChild(Z,fa.lastChild);K()}function z(){if(H<ea.length)ea[H++](z)}var C="";f=c.getElementsByTagName("style");for(var H=0;H<f.length;H++)C+=f[H].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var K=mxUtils.bind(this,function(){counter--;-0==counter&&k(c)}),M={},O={},ea=[];for(H=0;H<f.length;H++)mxUtils.bind(this,function(fa){var S=fa.getElementsByTagName("div");if(0<S.length)try{var ca=S[0].cloneNode(!0),ma=parseInt(ca.style.marginLeft),la=parseInt(ca.style.paddingTop),Z=ca.getElementsByTagName("div")[1],da=S=!1,aa=ca.style.alignItems,l=ca.style.justifyContent;if(null!=ca.style.writingMode){var t=ca.style.writingMode;da="vertical-"==t.substring(0,9);S="-rl"==t.substring(t.length-3)}var I=!da&&"1px"==ca.style.width||da&&"1px"==ca.style.height;-if(!da&&"1px"==ca.style.height||da&&"1px"==ca.style.width)ca.style.alignItems=da&&S?"unsafe flex-end":"unsafe flex-start";I&&(ca.style.justifyContent="unsafe flex-start");ca.style.paddingTop="";ca.style.marginLeft="";var V=ca.outerHTML,J=M[V];null==J&&(ca.style.position="absolute",ca.style.visibility="hidden",document.body.appendChild(ca),t=1,t="1px"==ca.style.width?Z.offsetWidth:parseInt(ca.style.width),I=1,I="1px"==ca.style.height?Z.offsetHeight:parseInt(ca.style.height),document.body.removeChild(ca),-J=new mxRectangle(ma,la,t,I),M[V]=J);"1px"==ca.style.height&&("unsafe center"==aa?la-=J.height/2:"unsafe flex-end"==aa&&(la-=J.height));if("1px"==ca.style.width)if(!da&&"unsafe center"==l||da&&"unsafe center"==aa)ma-=J.width/2;else if(!da&&"unsafe flex-end"==l||da&&(!S&&"unsafe flex-end"==aa||S&&"unsafe flex-start"==aa))ma-=J.width;J=new mxRectangle(ma,la,J.width,J.height+parseInt(Z.style.fontSize)/4);ea.push(mxUtils.bind(this,function(W){var Y=O[V];null==Y?Graph.htmlToPng(V,J.width,J.height,mxUtils.bind(this,-function(ba){B(fa,ma,la,J,ba);O[V]=ba;W()}),C):(B(fa,ma,la,J,Y),W())}))}catch(W){K()}else K()})(f[H]);0==counter&&k(c);H=0;z()};EditorUi.prototype.addRadiobox=function(c,f,k,B,z,C,H){return this.addCheckbox(c,k,B,z,C,H,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,B,z,C,H,K){C=null!=C?C:!0;var M=document.createElement("input");M.style.marginRight="8px";M.style.marginTop="16px";M.setAttribute("type",H?"radio":"checkbox");H="geCheckbox-"+Editor.guid();M.id=H;null!=K&&M.setAttribute("name",K);-k&&(M.setAttribute("checked","checked"),M.defaultChecked=!0);B&&M.setAttribute("disabled","disabled");C&&(c.appendChild(M),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",H),c.appendChild(k),z||mxUtils.br(c));return M};EditorUi.prototype.addEditButton=function(c,f){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var B=this.getCurrentFile(),z="";null!=B&&B.getMode()!=App.MODE_DEVICE&&B.getMode()!=App.MODE_BROWSER&&(z=window.location.href);-var C=document.createElement("select");C.style.maxWidth="200px";C.style.width="auto";C.style.marginLeft="8px";C.style.marginRight="10px";C.className="geBtn";B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("makeCopy"));C.appendChild(B);var H=document.createElement("option");H.setAttribute("value","custom");mxUtils.write(H,mxResources.get("custom")+"...");C.appendChild(H);c.appendChild(C);mxEvent.addListener(C,"change",mxUtils.bind(this,function(){if("custom"==-C.value){var K=new FilenameDialog(this,z,mxResources.get("ok"),function(M){null!=M?(z=M,H.setAttribute("title",M)):(C.value="blank",H.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){C.value="blank"});this.showDialog(K.container,300,80,!0,!1);K.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==f||f.checked)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return k.checked?-"blank"===C.value?"_blank":z:null},getEditInput:function(){return k},getEditSelect:function(){return C}}};EditorUi.prototype.addLinkSection=function(c,f){function k(){var K=document.createElement("div");K.style.width="100%";K.style.height="100%";K.style.boxSizing="border-box";null!=C&&C!=mxConstants.NONE?(K.style.border="1px solid black",K.style.backgroundColor=C):(K.style.backgroundPosition="center center",K.style.backgroundRepeat="no-repeat",K.style.backgroundImage="url('"+Dialog.prototype.closeImage+-"')");H.innerText="";H.appendChild(K)}mxUtils.write(c,mxResources.get("links")+":");var B=document.createElement("select");B.style.width="100px";B.style.padding="0px";B.style.marginLeft="8px";B.style.marginRight="10px";B.className="geBtn";var z=document.createElement("option");z.setAttribute("value","auto");mxUtils.write(z,mxResources.get("automatic"));B.appendChild(z);z=document.createElement("option");z.setAttribute("value","blank");mxUtils.write(z,mxResources.get("openInNewWindow"));B.appendChild(z);-z=document.createElement("option");z.setAttribute("value","self");mxUtils.write(z,mxResources.get("openInThisWindow"));B.appendChild(z);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),B.appendChild(f));c.appendChild(B);mxUtils.write(c,mxResources.get("borderColor")+":");var C="#0000ff",H=null;H=mxUtils.button("",mxUtils.bind(this,function(K){this.pickColor(C||"none",function(M){C=M;k()});-mxEvent.consume(K)}));k();H.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";H.style.marginLeft="4px";H.style.height="22px";H.style.width="22px";H.style.position="relative";H.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";H.className="geColorBtn";c.appendChild(H);mxUtils.br(c);return{getColor:function(){return C},getTarget:function(){return B.value},focus:function(){B.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,B,z,C){C=null!=C?C:[];k&&(C.push("lightbox=1"),-"auto"!=c&&C.push("target="+c),null!=f&&f!=mxConstants.NONE&&C.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=B&&0<B.length&&C.push("edit="+encodeURIComponent(B)),z&&C.push("layers=1"),this.editor.graph.foldingEnabled&&C.push("nav=1"));return C};EditorUi.prototype.createLink=function(c,f,k,B,z,C,H,K,M,O,ea){var fa=this.getCurrentFile();M=this.createUrlParameters(c,f,B,z,C,M);c=!0;null!=H?k="#U"+encodeURIComponent(H):K||null==fa||""==fa.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,-null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+fa.getHash(),c=!1);c&&null!=fa&&null!=fa.getTitle()&&fa.getTitle()!=this.defaultFilename&&M.push("title="+encodeURIComponent(fa.getTitle()));O&&1<k.length&&(M.push("open="+k.substring(1)),k="");ea&&null!=this.currentPage&&M.push("page-id="+this.currentPage.getId());return(B&&(null!=H||null!=fa&&fa.getMode()!=App.MODE_GITHUB&&fa.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||-EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<M.length?"?"+M.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,B,z,C,H,K,M,O,ea,fa){this.getBasenames();var S={};""!=z&&z!=mxConstants.NONE&&(S.highlight=z);"auto"!==B&&(S.target=B);O||(S.lightbox=!1);S.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(S.zoom=k/100);k=[];H&&(k.push("pages"),S.resize=!0,null!=this.pages&&null!=this.currentPage&&-(S.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),S.resize=!0);K&&k.push("layers");M&&k.push("tags");0<k.length&&(O&&k.push("lightbox"),S.toolbar=k.join(" "));null!=ea&&0<ea.length&&(S.edit=ea);null!=c?S.url=c:S.xml=this.getFileData(!0,null,null,null,null,!H);f='<div class="mxgraph" style="'+(C?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(S))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";fa(f,-'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,f,k,B){var z=document.createElement("div");z.style.whiteSpace="nowrap";var C=document.createElement("h3");mxUtils.write(C,-mxResources.get("html"));C.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";z.appendChild(C);var H=document.createElement("div");H.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var K=document.createElement("input");K.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";K.setAttribute("value","url");K.setAttribute("type","radio");K.setAttribute("name","type-embedhtmldialog");C=K.cloneNode(!0);C.setAttribute("value",-"copy");H.appendChild(C);var M=document.createElement("span");mxUtils.write(M,mxResources.get("includeCopyOfMyDiagram"));H.appendChild(M);mxUtils.br(H);H.appendChild(K);M=document.createElement("span");mxUtils.write(M,mxResources.get("publicDiagramUrl"));H.appendChild(M);var O=this.getCurrentFile();null==k&&null!=O&&O.constructor==window.DriveFile&&(M=document.createElement("a"),M.style.paddingLeft="12px",M.style.color="gray",M.style.cursor="pointer",mxUtils.write(M,mxResources.get("share")),H.appendChild(M),-mxEvent.addListener(M,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(O.getId(),O)})));C.setAttribute("checked","checked");null==k&&K.setAttribute("disabled","disabled");z.appendChild(H);var ea=this.addLinkSection(z),fa=this.addCheckbox(z,mxResources.get("zoom"),!0,null,!0);mxUtils.write(z,":");var S=document.createElement("input");S.setAttribute("type","text");S.style.marginRight="16px";S.style.width="60px";S.style.marginLeft="4px";S.style.marginRight="12px";S.value=-"100%";z.appendChild(S);var ca=this.addCheckbox(z,mxResources.get("fit"),!0);H=null!=this.pages&&1<this.pages.length;var ma=ma=this.addCheckbox(z,mxResources.get("allPages"),H,!H),la=this.addCheckbox(z,mxResources.get("layers"),!0),Z=this.addCheckbox(z,mxResources.get("tags"),!0),da=this.addCheckbox(z,mxResources.get("lightbox"),!0),aa=null;H=380;if(EditorUi.enableHtmlEditOption){aa=this.addEditButton(z,da);var l=aa.getEditInput();l.style.marginBottom="16px";H+=50;mxEvent.addListener(da,"change",-function(){da.checked?l.removeAttribute("disabled"):l.setAttribute("disabled","disabled");l.checked&&da.checked?aa.getEditSelect().removeAttribute("disabled"):aa.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,z,mxUtils.bind(this,function(){B(K.checked?k:null,fa.checked,S.value,ea.getTarget(),ea.getColor(),ca.checked,ma.checked,la.checked,Z.checked,da.checked,null!=aa?aa.getLink():null)}),null,c,f);this.showDialog(c.container,340,H,!0,!0);C.focus()};EditorUi.prototype.showPublishLinkDialog=-function(c,f,k,B,z,C,H,K,M){var O=document.createElement("div");O.style.whiteSpace="nowrap";var ea=document.createElement("h3");mxUtils.write(ea,c||mxResources.get("publish"));ea.style.width="100%";ea.style.textAlign="center";ea.style.marginTop="2px";ea.style.marginBottom="20px";O.appendChild(ea);var fa=document.createElement("select");c=30;fa.className="geBtn";fa.style.marginBottom="8px";fa.style.marginLeft="0px";fa.style.width="100%";fa.style.boxSizing="border-box";if(null==K||""==K.getHash())z=-null!=z?z:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ea=document.createElement("option"),mxUtils.write(ea,mxResources.get("makeCopy")),ea.setAttribute("value","copy"),fa.appendChild(ea);ea=document.createElement("option");mxUtils.write(ea,mxResources.get("authorizationRequired"));ea.setAttribute("value","auth");fa.appendChild(ea);null!=K&&""!=K.getHash()||ea.setAttribute("disabled","disabled");K=document.createElement("option");K.setAttribute("value","public");fa.appendChild(K);null!=-H?(mxUtils.write(K,mxResources.get("publicDiagramUrl")),K.setAttribute("title",H),fa.value="public"):(mxUtils.write(K,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),K.setAttribute("disabled","disabled"));O.appendChild(fa);mxUtils.br(O);fa.focus();var S=null,ca=null;if(null!=f||null!=k)c+=30,mxUtils.write(O,mxResources.get("width")+":"),S=document.createElement("input"),S.setAttribute("type","text"),S.style.marginRight="16px",S.style.width="50px",S.style.marginLeft=-"6px",S.style.marginRight="16px",S.style.marginBottom="10px",S.value="100%",O.appendChild(S),mxUtils.write(O,mxResources.get("height")+":"),ca=document.createElement("input"),ca.setAttribute("type","text"),ca.style.width="50px",ca.style.marginLeft="6px",ca.style.marginBottom="10px",ca.value=k+"px",O.appendChild(ca),mxUtils.br(O);var ma=this.addLinkSection(O,B),la=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,f=null!=this.currentPage?this.currentPage.getName():-"",16<f.length&&(f=f.substring(0,16)+"..."),la=this.addCheckbox(O,mxResources.get("selectedPage")+": "+f));var Z=this.addCheckbox(O,mxResources.get("lightbox"),!0,null,null,!B),da=this.addEditButton(O,Z),aa=da.getEditInput();B&&(aa.style.marginLeft=Z.style.marginLeft,Z.style.display="none",c-=20);var l=this.addCheckbox(O,mxResources.get("layers"),!0);l.style.marginLeft=aa.style.marginLeft;l.style.marginTop="8px";var t=this.addCheckbox(O,mxResources.get("tags"),!0);t.style.marginLeft=aa.style.marginLeft;-t.style.marginBottom="16px";t.style.marginTop="16px";mxEvent.addListener(Z,"change",function(){Z.checked?(l.removeAttribute("disabled"),aa.removeAttribute("disabled"),t.removeAttribute("disabled")):(l.setAttribute("disabled","disabled"),aa.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));aa.checked&&Z.checked?da.getEditSelect().removeAttribute("disabled"):da.getEditSelect().setAttribute("disabled","disabled")});B=new CustomDialog(this,O,mxUtils.bind(this,function(){M(ma.getTarget(),-ma.getColor(),null==la?!1:la.checked,Z.checked,da.getLink(),l.checked,null!=S?S.value:null,null!=ca?ca.value:null,t.checked,fa.value)}),null,mxResources.get("create"),z,C);this.showDialog(B.container,340,296+c,!0,!0);null!=S?(S.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?S.select():document.execCommand("selectAll",!1,null)):null==fa.parentNode;ma.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,B,z){var C=document.createElement("div");C.style.whiteSpace="nowrap";-var H=document.createElement("h3");mxUtils.write(H,mxResources.get("image"));H.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(z?"10":"4")+"px";C.appendChild(H);if(z){mxUtils.write(C,mxResources.get("zoom")+":");var K=document.createElement("input");K.setAttribute("type","text");K.style.marginRight="16px";K.style.width="60px";K.style.marginLeft="4px";K.style.marginRight="12px";K.value=this.lastExportZoom||"100%";C.appendChild(K);mxUtils.write(C,mxResources.get("borderWidth")+-":");var M=document.createElement("input");M.setAttribute("type","text");M.style.marginRight="16px";M.style.width="60px";M.style.marginLeft="4px";M.value=this.lastExportBorder||"0";C.appendChild(M);mxUtils.br(C)}var O=this.addCheckbox(C,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),ea=B?null:this.addCheckbox(C,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);H=this.editor.graph;var fa=B?null:this.addCheckbox(C,mxResources.get("transparentBackground"),-H.background==mxConstants.NONE||null==H.background);null!=fa&&(fa.style.marginBottom="16px");c=new CustomDialog(this,C,mxUtils.bind(this,function(){var S=parseInt(K.value)/100||1,ca=parseInt(M.value)||0;k(!O.checked,null!=ea?ea.checked:!1,null!=fa?fa.checked:!1,S,ca)}),null,c,f);this.showDialog(c.container,300,(z?25:0)+(B?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,k,B,z,C,H,K,M){H=null!=H?H:Editor.defaultIncludeDiagram;var O=document.createElement("div");O.style.whiteSpace=-"nowrap";var ea=this.editor.graph,fa="jpeg"==K||"webp"==K?220:320,S=document.createElement("h3");mxUtils.write(S,c);S.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";O.appendChild(S);mxUtils.write(O,mxResources.get("zoom")+":");var ca=document.createElement("input");ca.setAttribute("type","text");ca.style.marginRight="16px";ca.style.width="60px";ca.style.marginLeft="4px";ca.style.marginRight="12px";ca.value=this.lastExportZoom||"100%";O.appendChild(ca);mxUtils.write(O,-mxResources.get("borderWidth")+":");var ma=document.createElement("input");ma.setAttribute("type","text");ma.style.marginRight="16px";ma.style.width="60px";ma.style.marginLeft="4px";ma.value=this.lastExportBorder||"0";O.appendChild(ma);mxUtils.br(O);var la=this.addCheckbox(O,mxResources.get("selectionOnly"),!1,ea.isSelectionEmpty()),Z=document.createElement("input");Z.style.marginTop="16px";Z.style.marginRight="8px";Z.style.marginLeft="24px";Z.setAttribute("disabled","disabled");Z.setAttribute("type",-"checkbox");var da=document.createElement("select");da.style.marginTop="16px";da.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(S=0;S<c.length;S++)if(!ea.isSelectionEmpty()||"selectionOnly"!=c[S]){var aa=document.createElement("option");mxUtils.write(aa,mxResources.get(c[S]));aa.setAttribute("value",c[S]);da.appendChild(aa)}M?(mxUtils.write(O,mxResources.get("size")+":"),O.appendChild(da),mxUtils.br(O),fa+=26,mxEvent.addListener(da,"change",function(){"selectionOnly"==da.value&&(la.checked=-!0)})):C&&(O.appendChild(Z),mxUtils.write(O,mxResources.get("crop")),mxUtils.br(O),fa+=30,mxEvent.addListener(la,"change",function(){la.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")}));ea.isSelectionEmpty()?M&&(la.style.display="none",la.nextSibling.style.display="none",la.nextSibling.nextSibling.style.display="none",fa-=30):(da.value="diagram",Z.setAttribute("checked","checked"),Z.defaultChecked=!0,mxEvent.addListener(la,"change",function(){da.value=la.checked?"selectionOnly":-"diagram"}));var l=this.addCheckbox(O,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=K&&"webp"!=K),t=document.createElement("select");t.style.maxWidth="260px";t.style.marginLeft="8px";t.style.marginTop="16px";C=document.createElement("option");C.setAttribute("value","light");mxUtils.write(C,mxResources.get("light"));t.appendChild(C);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));t.appendChild(M);"svg"==K?(C=document.createElement("option"),-C.setAttribute("value","auto"),mxUtils.write(C,mxResources.get("automatic")),C.setAttribute("selected","selected"),t.appendChild(C)):Editor.isDarkMode()?M.setAttribute("selected","selected"):C.setAttribute("selected","selected");mxUtils.write(O,mxResources.get("appearance")+":");O.appendChild(t);mxUtils.br(O);fa+=26;var I=this.addCheckbox(O,mxResources.get("shadow"),ea.shadowVisible),V=null;if("png"==K||"jpeg"==K||"webp"==K)V=this.addCheckbox(O,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,-!1,!0),fa+=30;var J=this.addCheckbox(O,mxResources.get("includeCopyOfMyDiagram")+":",H,null,null,"jpeg"!=K&&"webp"!=K),W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="28px";"png"==K||"svg"==K?(H=function(){J.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},ea=document.createElement("option"),ea.setAttribute("value","allPages"),mxUtils.write(ea,mxResources.get("allPages")),W.appendChild(ea),ea=document.createElement("option"),ea.setAttribute("value",-"currentPage"),mxUtils.write(ea,mxResources.get("currentPage")),W.appendChild(ea),J.style.marginBottom="12px",W.style.marginBottom="16px",O.appendChild(W),mxUtils.br(O),fa+=20,null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(J,"change",H),H()):J.style.marginBottom="16px";var Y=document.createElement("input");Y.style.marginBottom="16px";Y.style.marginRight="8px";Y.setAttribute("type","checkbox");var ba=document.createElement("input");ba.style.marginBottom="16px";ba.style.marginRight=-"8px";ba.setAttribute("type","checkbox");f&&(Y.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,O.appendChild(Y),mxUtils.write(O,mxResources.get("embedImages")),mxUtils.br(O),ba.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,O.appendChild(ba),mxUtils.write(O,mxResources.get("embedFonts")),mxUtils.br(O),fa+=50);var ja=document.createElement("select");ja.style.maxWidth="260px";ja.style.marginLeft="8px";C=document.createElement("option");C.setAttribute("value","auto");mxUtils.write(C,-mxResources.get("automatic"));ja.appendChild(C);H=document.createElement("option");H.setAttribute("value","blank");mxUtils.write(H,mxResources.get("openInNewWindow"));ja.appendChild(H);H=document.createElement("option");H.setAttribute("value","self");mxUtils.write(H,mxResources.get("openInThisWindow"));ja.appendChild(H);H=document.createElement("div");mxUtils.write(H,mxResources.get("LinksLost"));H.style.margin="7px";H.style.display="none";"svg"==K&&(mxUtils.write(O,mxResources.get("links")+":"),-O.appendChild(ja),O.appendChild(H),mxUtils.br(O),mxUtils.br(O),fa+=50);k=new CustomDialog(this,O,mxUtils.bind(this,function(){this.lastExportBorder=ma.value;this.lastExportZoom=ca.value;this.lastEmbedImages=Y.checked;this.lastEmbedFonts=ba.checked;this.lastEmbedInclude=W.value;z(ca.value,l.checked,!la.checked,I.checked,J.checked,Y.checked&&f,ma.value,Z.checked,("png"==K||"svg"==K)&&"currentPage"==W.value,ja.value,null!=V?V.checked:null,null!=t?t.value:null,da.value,ba.checked)}),null,k,B);this.showDialog(k.container,-340,fa,!0,!0,null,null,null,null,!0);ca.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ca.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,k,B,z){var C=document.createElement("div");C.style.whiteSpace="nowrap";var H=this.editor.graph;if(null!=f){var K=document.createElement("h3");mxUtils.write(K,f);K.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";C.appendChild(K)}var M=this.addCheckbox(C,mxResources.get("fit"),-!0),O=this.addCheckbox(C,mxResources.get("shadow"),H.shadowVisible&&B,!B),ea=this.addCheckbox(C,k),fa=this.addCheckbox(C,mxResources.get("lightbox"),!0),S=this.addEditButton(C,fa),ca=S.getEditInput(),ma=1<H.model.getChildCount(H.model.getRoot()),la=this.addCheckbox(C,mxResources.get("layers"),ma,!ma);la.style.marginLeft=ca.style.marginLeft;la.style.marginBottom="12px";la.style.marginTop="8px";mxEvent.addListener(fa,"change",function(){fa.checked?(ma&&la.removeAttribute("disabled"),ca.removeAttribute("disabled")):-(la.setAttribute("disabled","disabled"),ca.setAttribute("disabled","disabled"));ca.checked&&fa.checked?S.getEditSelect().removeAttribute("disabled"):S.getEditSelect().setAttribute("disabled","disabled")});f=new CustomDialog(this,C,mxUtils.bind(this,function(){c(M.checked,O.checked,ea.checked,fa.checked,S.getLink(),la.checked)}),null,mxResources.get("embed"),z);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,B,z,C,H,K){function M(ca){var ma=" ",la="";-B&&(ma=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(null!=ea?"&page="+ea:"")+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}})(this);\"",la+="cursor:pointer;");c&&(la+="max-width:100%;");var Z=-"";k&&(Z=' width="'+Math.round(O.width)+'" height="'+Math.round(O.height)+'"');H('<img src="'+ca+'"'+Z+(""!=la?' style="'+la+'"':"")+ma+"/>")}var O=this.editor.graph.getGraphBounds(),ea=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ca){var ma=B?this.getFileData(!0):null;ca=this.createImageDataUri(ca,ma,"png");M(ca)}),null,null,null,mxUtils.bind(this,function(ca){K({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,-null,Editor.defaultBorder);else if(f=this.getFileData(!0),O.width*O.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var fa="";k&&(fa="&w="+Math.round(2*O.width)+"&h="+Math.round(2*O.height));var S=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(B?"1":"0")+fa+"&xml="+encodeURIComponent(f));S.send(mxUtils.bind(this,function(){200<=S.getStatus()&&299>=S.getStatus()?M("data:image/png;base64,"+S.getText()):K({message:mxResources.get("unknownError")})}))}else K({message:mxResources.get("drawingTooLarge")})};-EditorUi.prototype.createEmbedSvg=function(c,f,k,B,z,C,H){var K=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),M=K.getElementsByTagName("a");if(null!=M)for(var O=0;O<M.length;O++){var ea=M[O].getAttribute("href");null!=ea&&"#"==ea.charAt(0)&&"_blank"==M[O].getAttribute("target")&&M[O].removeAttribute("target")}B&&K.setAttribute("content",this.getFileData(!0));f&&this.editor.graph.addSvgShadow(K);if(k){var fa=" ",S="";B&&(fa="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}})(this);\"",S+="cursor:pointer;");c&&(S+="max-width:100%;");this.editor.convertImages(K,mxUtils.bind(this,function(ca){H('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ca))+'"'+(""!=S?' style="'+S+'"':"")+fa+"/>")}))}else S="",B&&(f=this.getSelectedPageIndex(),K.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=f?"&page="+f:"")+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}}})(this);"),S+="cursor:pointer;"),c&&(c=parseInt(K.getAttribute("width")),z=parseInt(K.getAttribute("height")),K.setAttribute("viewBox","-0.5 -0.5 "+c+" "+z),S+="max-width:100%;max-height:"+z+"px;",K.removeAttribute("height")),""!=S&&K.setAttribute("style",S),this.editor.addFontCss(K),this.editor.graph.mathEnabled&&this.editor.addMathCss(K),H(mxUtils.getXml(K))};EditorUi.prototype.timeSince=function(c){c=+"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=C.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";C=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=C.zIndex;var I=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",+speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});I.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",z);this.editor.exportToCanvas(mxUtils.bind(this,function(L){I.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var J=this.createImageDataUri(L,null,"png");L=document.createElement("img");L.style.maxWidth="140px";L.style.maxHeight="140px";+L.style.cursor="pointer";L.style.backgroundColor="white";L.setAttribute("title",mxResources.get("openInNewWindow"));L.setAttribute("border","0");L.setAttribute("src",J);this.exportDialog.appendChild(L);mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.openInNewWindow(J.substring(J.indexOf(",")+1),"image/png",!0);z.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(L){I.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),+this.exportDialog=null);this.handleError(L)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(B)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,B,z){this.isLocalFileSave()?this.saveLocalFile(k,c,B,z,f):this.saveRequest(c,f,mxUtils.bind(this,function(C,I){return this.createEchoRequest(k,C,B,z,f,I)}),k,z,B)};EditorUi.prototype.saveRequest=function(c,f,k,B,z,C,I){I=null!=I?I:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,+function(O,da,fa,V){if("_blank"==da||null!=O&&0<O.length){var ba=k("_blank"==da?null:O,da==App.MODE_DEVICE||"download"==da||null==da||"_blank"==da?"0":"1");null!=ba&&(da==App.MODE_DEVICE||"download"==da||"_blank"==da?ba.simulate(document,"_blank"):(fa=mxUtils.bind(this,function(ma){C=null!=C?C:"pdf"==f?"application/pdf":"image/"+f;if(null!=B)try{this.exportFile(B,O,C,!0,da,ma)}catch(la){this.handleError(la)}else this.spinner.spin(document.body,mxResources.get("saving"))&&ba.send(mxUtils.bind(this,+function(){this.spinner.stop();if(200<=ba.getStatus()&&299>=ba.getStatus())try{this.exportFile(ba.getText(),O,C,!0,da,ma)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=V?fa(V):this.pickFolder(da,fa)))}});z=[App.MODE_BROWSER];I||z.push("_blank");var J=new SaveDialog(this,c,mxUtils.bind(this,function(O,da,fa){L(O.value,da,O,fa);this.hideDialog(null,null,J.container)}),+z,null,"application/pdf");this.showDialog(J.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));J.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,k,B,z,C){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,k){f(null)};+EditorUi.prototype.exportSvg=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(K){Editor.addRetryToError(K,mxUtils.bind(this,function(){this.exportSvg(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba)}));this.handleError(K)})))try{var ma=this.editor.graph.isSelectionEmpty();k=null!=k?k:ma;var la=f?null:this.editor.graph.background;la==mxConstants.NONE&&(la=null);null==la&&0==f&&(la=this.editor.graph.shapeBackgroundColor);var Z=this.editor.graph.addForeignObjectWarning;+Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var ea=this.editor.graph.createSvgImageExport(z),aa=this.editor.graph.getSvg(la,c,I,L,null,k,null,ea,"blank"==O?"_blank":"self"==O?"_top":null,null,!V,da,fa);this.editor.graph.addForeignObjectWarning=Z;B&&this.editor.graph.addSvgShadow(aa);var l=this.getBaseFilename()+(z?".drawio":"")+".svg";ba=null!=ba?ba:mxUtils.bind(this,function(K){this.isLocalFileSave()||K.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",K,"image/svg+xml"):+this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(K)}))});var t=mxUtils.bind(this,function(K){this.spinner.stop();z&&K.setAttribute("content",this.getFileData(!0,null,null,null,k,J,null,null,null,null,null,c,I));ba(Graph.xmlDeclaration+"\n"+(z?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(K))});this.editor.graph.mathEnabled&&this.editor.addMathCss(aa);var H=mxUtils.bind(this,function(K){Editor.replaceSvgDataUris&&+C&&EditorUi.embedSvgImages(K);Editor.foreignObjectImages&&V?this.replaceAlternateContent(K,da,t):t(K)}),U=mxUtils.bind(this,function(K){C&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(K,H,this.thumbImageCache)):H(K)});V?this.embedFonts(aa,U):(this.editor.addFontCss(aa),U(aa))}catch(K){this.handleError(K)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function B(fa,V,ba,ma,la){var Z=mxUtils.createElementNs(c.ownerDocument,+mxConstants.NS_SVG,"image");Z.setAttribute("x",V);Z.setAttribute("y",ba+.5);Z.setAttribute("width",ma.width);Z.setAttribute("height",ma.height);null==Z.setAttributeNS?Z.setAttribute("xlink:href",la):Z.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);fa.replaceChild(Z,fa.lastChild);L()}function z(){if(I<da.length)da[I++](z)}var C="";f=c.getElementsByTagName("style");for(var I=0;I<f.length;I++)C+=f[I].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var L=mxUtils.bind(this,function(){counter--;+0==counter&&k(c)}),J={},O={},da=[];for(I=0;I<f.length;I++)mxUtils.bind(this,function(fa){var V=fa.getElementsByTagName("div");if(0<V.length)try{var ba=V[0].cloneNode(!0),ma=parseInt(ba.style.marginLeft),la=parseInt(ba.style.paddingTop),Z=ba.getElementsByTagName("div")[1],ea=V=!1,aa=ba.style.alignItems,l=ba.style.justifyContent;if(null!=ba.style.writingMode){var t=ba.style.writingMode;ea="vertical-"==t.substring(0,9);V="-rl"==t.substring(t.length-3)}var H=!ea&&"1px"==ba.style.width||ea&&"1px"==ba.style.height;+if(!ea&&"1px"==ba.style.height||ea&&"1px"==ba.style.width)ba.style.alignItems=ea&&V?"unsafe flex-end":"unsafe flex-start";H&&(ba.style.justifyContent="unsafe flex-start");ba.style.paddingTop="";ba.style.marginLeft="";var U=ba.outerHTML,K=J[U];null==K&&(ba.style.position="absolute",ba.style.visibility="hidden",document.body.appendChild(ba),t=1,t="1px"==ba.style.width?Z.offsetWidth:parseInt(ba.style.width),H=1,H="1px"==ba.style.height?Z.offsetHeight:parseInt(ba.style.height),document.body.removeChild(ba),+K=new mxRectangle(ma,la,t,H),J[U]=K);"1px"==ba.style.height&&("unsafe center"==aa?la-=K.height/2:"unsafe flex-end"==aa&&(la-=K.height));if("1px"==ba.style.width)if(!ea&&"unsafe center"==l||ea&&"unsafe center"==aa)ma-=K.width/2;else if(!ea&&"unsafe flex-end"==l||ea&&(!V&&"unsafe flex-end"==aa||V&&"unsafe flex-start"==aa))ma-=K.width;K=new mxRectangle(ma,la,K.width,K.height+parseInt(Z.style.fontSize)/4);da.push(mxUtils.bind(this,function(W){var Y=O[U];null==Y?Graph.htmlToPng(U,K.width,K.height,mxUtils.bind(this,+function(ca){B(fa,ma,la,K,ca);O[U]=ca;W()}),C):(B(fa,ma,la,K,Y),W())}))}catch(W){L()}else L()})(f[I]);0==counter&&k(c);I=0;z()};EditorUi.prototype.addRadiobox=function(c,f,k,B,z,C,I){return this.addCheckbox(c,k,B,z,C,I,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,B,z,C,I,L){C=null!=C?C:!0;var J=document.createElement("input");J.style.marginRight="8px";J.style.marginTop="16px";J.setAttribute("type",I?"radio":"checkbox");I="geCheckbox-"+Editor.guid();J.id=I;null!=L&&J.setAttribute("name",L);+k&&(J.setAttribute("checked","checked"),J.defaultChecked=!0);B&&J.setAttribute("disabled","disabled");C&&(c.appendChild(J),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",I),c.appendChild(k),z||mxUtils.br(c));return J};EditorUi.prototype.addEditButton=function(c,f){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var B=this.getCurrentFile(),z="";null!=B&&B.getMode()!=App.MODE_DEVICE&&B.getMode()!=App.MODE_BROWSER&&(z=window.location.href);+var C=document.createElement("select");C.style.maxWidth="200px";C.style.width="auto";C.style.marginLeft="8px";C.style.marginRight="10px";C.className="geBtn";B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("makeCopy"));C.appendChild(B);var I=document.createElement("option");I.setAttribute("value","custom");mxUtils.write(I,mxResources.get("custom")+"...");C.appendChild(I);c.appendChild(C);mxEvent.addListener(C,"change",mxUtils.bind(this,function(){if("custom"==+C.value){var L=new FilenameDialog(this,z,mxResources.get("ok"),function(J){null!=J?(z=J,I.setAttribute("title",J)):(C.value="blank",I.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){C.value="blank"});this.showDialog(L.container,300,80,!0,!1);L.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==f||f.checked)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return k.checked?+"blank"===C.value?"_blank":z:null},getEditInput:function(){return k},getEditSelect:function(){return C}}};EditorUi.prototype.addLinkSection=function(c,f){function k(){var L=document.createElement("div");L.style.width="100%";L.style.height="100%";L.style.boxSizing="border-box";null!=C&&C!=mxConstants.NONE?(L.style.border="1px solid black",L.style.backgroundColor=C):(L.style.backgroundPosition="center center",L.style.backgroundRepeat="no-repeat",L.style.backgroundImage="url('"+Dialog.prototype.closeImage++"')");I.innerText="";I.appendChild(L)}mxUtils.write(c,mxResources.get("links")+":");var B=document.createElement("select");B.style.width="100px";B.style.padding="0px";B.style.marginLeft="8px";B.style.marginRight="10px";B.className="geBtn";var z=document.createElement("option");z.setAttribute("value","auto");mxUtils.write(z,mxResources.get("automatic"));B.appendChild(z);z=document.createElement("option");z.setAttribute("value","blank");mxUtils.write(z,mxResources.get("openInNewWindow"));B.appendChild(z);+z=document.createElement("option");z.setAttribute("value","self");mxUtils.write(z,mxResources.get("openInThisWindow"));B.appendChild(z);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),B.appendChild(f));c.appendChild(B);mxUtils.write(c,mxResources.get("borderColor")+":");var C="#0000ff",I=null;I=mxUtils.button("",mxUtils.bind(this,function(L){this.pickColor(C||"none",function(J){C=J;k()});+mxEvent.consume(L)}));k();I.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";I.style.marginLeft="4px";I.style.height="22px";I.style.width="22px";I.style.position="relative";I.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";I.className="geColorBtn";c.appendChild(I);mxUtils.br(c);return{getColor:function(){return C},getTarget:function(){return B.value},focus:function(){B.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,B,z,C){C=null!=C?C:[];k&&(C.push("lightbox=1"),+"auto"!=c&&C.push("target="+c),null!=f&&f!=mxConstants.NONE&&C.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=B&&0<B.length&&C.push("edit="+encodeURIComponent(B)),z&&C.push("layers=1"),this.editor.graph.foldingEnabled&&C.push("nav=1"));return C};EditorUi.prototype.createLink=function(c,f,k,B,z,C,I,L,J,O,da){var fa=this.getCurrentFile();J=this.createUrlParameters(c,f,B,z,C,J);c=!0;null!=I?k="#U"+encodeURIComponent(I):L||null==fa||""==fa.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,+null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+fa.getHash(),c=!1);c&&null!=fa&&null!=fa.getTitle()&&fa.getTitle()!=this.defaultFilename&&J.push("title="+encodeURIComponent(fa.getTitle()));O&&1<k.length&&(J.push("open="+k.substring(1)),k="");da&&null!=this.currentPage&&J.push("page-id="+this.currentPage.getId());return(B&&(null!=I||null!=fa&&fa.getMode()!=App.MODE_GITHUB&&fa.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||+EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<J.length?"?"+J.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){this.getBasenames();var ba={};""!=z&&z!=mxConstants.NONE&&(ba.highlight=z);"auto"!==B&&(ba.target=B);O||(ba.lightbox=!1);ba.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(ba.zoom=k/100);k=[];I&&(k.push("pages"),ba.resize=!0,null!=this.pages&&null!=+this.currentPage&&(ba.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),ba.resize=!0);L&&k.push("layers");J&&k.push("tags");null!=V&&(ba["dark-mode"]=V);0<k.length&&(O&&k.push("lightbox"),ba.toolbar=k.join(" "));null!=da&&0<da.length&&(ba.edit=da);null!=c?ba.url=c:ba.xml=this.getFileData(!0,null,null,null,null,!I);f='<div class="mxgraph" style="'+(C?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ba))+'"></div>';+c=null!=c?"&fetch="+encodeURIComponent(c):"";fa(f,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,f,k,B){var z=document.createElement("div");z.style.whiteSpace="nowrap";var C=+document.createElement("h3");mxUtils.write(C,mxResources.get("html"));C.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";z.appendChild(C);var I=document.createElement("div");I.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name","type-embedhtmldialog");+C=L.cloneNode(!0);C.setAttribute("value","copy");I.appendChild(C);var J=document.createElement("span");mxUtils.write(J,mxResources.get("includeCopyOfMyDiagram"));I.appendChild(J);mxUtils.br(I);I.appendChild(L);J=document.createElement("span");mxUtils.write(J,mxResources.get("publicDiagramUrl"));I.appendChild(J);var O=this.getCurrentFile();null==k&&null!=O&&O.constructor==window.DriveFile&&(J=document.createElement("a"),J.style.paddingLeft="12px",J.style.color="gray",J.style.cursor="pointer",mxUtils.write(J,+mxResources.get("share")),I.appendChild(J),mxEvent.addListener(J,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(O.getId(),O)})));C.setAttribute("checked","checked");null==k&&L.setAttribute("disabled","disabled");z.appendChild(I);I=380;var da=this.addLinkSection(z),fa=document.createElement("select");fa.style.maxWidth="260px";fa.style.marginLeft="8px";fa.style.marginTop="16px";J=document.createElement("option");J.setAttribute("value","light");mxUtils.write(J,mxResources.get("light"));+fa.appendChild(J);J=document.createElement("option");J.setAttribute("value","dark");mxUtils.write(J,mxResources.get("dark"));fa.appendChild(J);J=document.createElement("option");J.setAttribute("value","auto");mxUtils.write(J,mxResources.get("automatic"));J.setAttribute("selected","selected");fa.appendChild(J);J.setAttribute("selected","selected");mxUtils.write(z,mxResources.get("appearance")+":");z.appendChild(fa);mxUtils.br(z);I+=26;var V=this.addCheckbox(z,mxResources.get("zoom"),!0,null,!0);mxUtils.write(z,+":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value="100%";z.appendChild(ba);var ma=this.addCheckbox(z,mxResources.get("fit"),!0);J=null!=this.pages&&1<this.pages.length;var la=la=this.addCheckbox(z,mxResources.get("allPages"),J,!J),Z=this.addCheckbox(z,mxResources.get("layers"),!0),ea=this.addCheckbox(z,mxResources.get("tags"),!0),aa=this.addCheckbox(z,mxResources.get("lightbox"),+!0),l=null;if(EditorUi.enableHtmlEditOption){l=this.addEditButton(z,aa);var t=l.getEditInput();t.style.marginBottom="16px";I+=50;mxEvent.addListener(aa,"change",function(){aa.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled");t.checked&&aa.checked?l.getEditSelect().removeAttribute("disabled"):l.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,z,mxUtils.bind(this,function(){B(L.checked?k:null,V.checked,ba.value,da.getTarget(),da.getColor(),ma.checked,+la.checked,Z.checked,ea.checked,aa.checked,null!=l?l.getLink():null,null!=fa?fa.value:null)}),null,c,f);this.showDialog(c.container,340,I,!0,!0);C.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,f,k,B,z,C,I,L,J){var O=document.createElement("div");O.style.whiteSpace="nowrap";var da=document.createElement("h3");mxUtils.write(da,c||mxResources.get("publish"));da.style.width="100%";da.style.textAlign="center";da.style.marginTop="2px";da.style.marginBottom="20px";O.appendChild(da);var fa=+document.createElement("select");c=30;fa.className="geBtn";fa.style.marginBottom="8px";fa.style.marginLeft="0px";fa.style.width="100%";fa.style.boxSizing="border-box";if(null==L||""==L.getHash())z=null!=z?z:"https://www.drawio.com/doc/faq/publish-diagram-as-link",da=document.createElement("option"),mxUtils.write(da,mxResources.get("makeCopy")),da.setAttribute("value","copy"),fa.appendChild(da);da=document.createElement("option");mxUtils.write(da,mxResources.get("authorizationRequired"));da.setAttribute("value",+"auth");fa.appendChild(da);null!=L&&""!=L.getHash()||da.setAttribute("disabled","disabled");L=document.createElement("option");L.setAttribute("value","public");fa.appendChild(L);null!=I?(mxUtils.write(L,mxResources.get("publicDiagramUrl")),L.setAttribute("title",I),fa.value="public"):(mxUtils.write(L,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),L.setAttribute("disabled","disabled"));O.appendChild(fa);mxUtils.br(O);fa.focus();var V=null,ba=null;if(null!=f||null!=+k)c+=30,mxUtils.write(O,mxResources.get("width")+":"),V=document.createElement("input"),V.setAttribute("type","text"),V.style.marginRight="16px",V.style.width="50px",V.style.marginLeft="6px",V.style.marginRight="16px",V.style.marginBottom="10px",V.value="100%",O.appendChild(V),mxUtils.write(O,mxResources.get("height")+":"),ba=document.createElement("input"),ba.setAttribute("type","text"),ba.style.width="50px",ba.style.marginLeft="6px",ba.style.marginBottom="10px",ba.value=k+"px",O.appendChild(ba),+mxUtils.br(O);var ma=this.addLinkSection(O,B),la=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,f=null!=this.currentPage?this.currentPage.getName():"",16<f.length&&(f=f.substring(0,16)+"..."),la=this.addCheckbox(O,mxResources.get("selectedPage")+": "+f));var Z=this.addCheckbox(O,mxResources.get("lightbox"),!0,null,null,!B),ea=this.addEditButton(O,Z),aa=ea.getEditInput();B&&(aa.style.marginLeft=Z.style.marginLeft,Z.style.display="none",c-=20);var l=this.addCheckbox(O,+mxResources.get("layers"),!0);l.style.marginLeft=aa.style.marginLeft;l.style.marginTop="8px";var t=this.addCheckbox(O,mxResources.get("tags"),!0);t.style.marginLeft=aa.style.marginLeft;t.style.marginBottom="16px";t.style.marginTop="16px";mxEvent.addListener(Z,"change",function(){Z.checked?(l.removeAttribute("disabled"),aa.removeAttribute("disabled"),t.removeAttribute("disabled")):(l.setAttribute("disabled","disabled"),aa.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));aa.checked&&+Z.checked?ea.getEditSelect().removeAttribute("disabled"):ea.getEditSelect().setAttribute("disabled","disabled")});B=new CustomDialog(this,O,mxUtils.bind(this,function(){J(ma.getTarget(),ma.getColor(),null==la?!1:la.checked,Z.checked,ea.getLink(),l.checked,null!=V?V.value:null,null!=ba?ba.value:null,t.checked,fa.value)}),null,mxResources.get("create"),z,C);this.showDialog(B.container,340,296+c,!0,!0);null!=V?(V.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?V.select():document.execCommand("selectAll",+!1,null)):null==fa.parentNode;ma.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,B,z){var C=document.createElement("div");C.style.whiteSpace="nowrap";var I=document.createElement("h3");mxUtils.write(I,mxResources.get("image"));I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(z?"10":"4")+"px";C.appendChild(I);if(z){mxUtils.write(C,mxResources.get("zoom")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.marginRight="16px";+L.style.width="60px";L.style.marginLeft="4px";L.style.marginRight="12px";L.value=this.lastExportZoom||"100%";C.appendChild(L);mxUtils.write(C,mxResources.get("borderWidth")+":");var J=document.createElement("input");J.setAttribute("type","text");J.style.marginRight="16px";J.style.width="60px";J.style.marginLeft="4px";J.value=this.lastExportBorder||"0";C.appendChild(J);mxUtils.br(C)}var O=this.addCheckbox(C,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),da=B?null:this.addCheckbox(C,+mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);I=this.editor.graph;var fa=B?null:this.addCheckbox(C,mxResources.get("transparentBackground"),I.background==mxConstants.NONE||null==I.background);null!=fa&&(fa.style.marginBottom="16px");c=new CustomDialog(this,C,mxUtils.bind(this,function(){var V=parseInt(L.value)/100||1,ba=parseInt(J.value)||0;k(!O.checked,null!=da?da.checked:!1,null!=fa?fa.checked:!1,V,ba)}),null,c,f);this.showDialog(c.container,300,(z?25:0)+(B?125:210),!0,+!0)};EditorUi.prototype.showExportDialog=function(c,f,k,B,z,C,I,L,J){I=null!=I?I:Editor.defaultIncludeDiagram;var O=document.createElement("div");O.style.whiteSpace="nowrap";var da=this.editor.graph,fa="jpeg"==L||"webp"==L?220:320,V=document.createElement("h3");mxUtils.write(V,c);V.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";O.appendChild(V);mxUtils.write(O,mxResources.get("zoom")+":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight=+"16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value=this.lastExportZoom||"100%";O.appendChild(ba);mxUtils.write(O,mxResources.get("borderWidth")+":");var ma=document.createElement("input");ma.setAttribute("type","text");ma.style.marginRight="16px";ma.style.width="60px";ma.style.marginLeft="4px";ma.value=this.lastExportBorder||"0";O.appendChild(ma);mxUtils.br(O);var la=this.addCheckbox(O,mxResources.get("selectionOnly"),!1,da.isSelectionEmpty()),Z=document.createElement("input");+Z.style.marginTop="16px";Z.style.marginRight="8px";Z.style.marginLeft="24px";Z.setAttribute("disabled","disabled");Z.setAttribute("type","checkbox");var ea=document.createElement("select");ea.style.marginTop="16px";ea.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(V=0;V<c.length;V++)if(!da.isSelectionEmpty()||"selectionOnly"!=c[V]){var aa=document.createElement("option");mxUtils.write(aa,mxResources.get(c[V]));aa.setAttribute("value",c[V]);ea.appendChild(aa)}J?(mxUtils.write(O,mxResources.get("size")++":"),O.appendChild(ea),mxUtils.br(O),fa+=26,mxEvent.addListener(ea,"change",function(){"selectionOnly"==ea.value&&(la.checked=!0)})):C&&(O.appendChild(Z),mxUtils.write(O,mxResources.get("crop")),mxUtils.br(O),fa+=30,mxEvent.addListener(la,"change",function(){la.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")}));da.isSelectionEmpty()?J&&(la.style.display="none",la.nextSibling.style.display="none",la.nextSibling.nextSibling.style.display="none",fa-=30):(ea.value="diagram",+Z.setAttribute("checked","checked"),Z.defaultChecked=!0,mxEvent.addListener(la,"change",function(){ea.value=la.checked?"selectionOnly":"diagram"}));var l=this.addCheckbox(O,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=L&&"webp"!=L),t=document.createElement("select");t.style.maxWidth="260px";t.style.marginLeft="8px";t.style.marginTop="16px";C=document.createElement("option");C.setAttribute("value","light");mxUtils.write(C,mxResources.get("light"));t.appendChild(C);J=document.createElement("option");+J.setAttribute("value","dark");mxUtils.write(J,mxResources.get("dark"));t.appendChild(J);"svg"==L?(C=document.createElement("option"),C.setAttribute("value","auto"),mxUtils.write(C,mxResources.get("automatic")),C.setAttribute("selected","selected"),t.appendChild(C)):Editor.isDarkMode()?J.setAttribute("selected","selected"):C.setAttribute("selected","selected");mxUtils.write(O,mxResources.get("appearance")+":");O.appendChild(t);mxUtils.br(O);fa+=26;var H=this.addCheckbox(O,mxResources.get("shadow"),+da.shadowVisible),U=null;if("png"==L||"jpeg"==L||"webp"==L)U=this.addCheckbox(O,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),fa+=30;var K=this.addCheckbox(O,mxResources.get("includeCopyOfMyDiagram")+":",I,null,null,"jpeg"!=L&&"webp"!=L),W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="28px";"png"==L||"svg"==L?(I=function(){K.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},da=document.createElement("option"),da.setAttribute("value",+"allPages"),mxUtils.write(da,mxResources.get("allPages")),W.appendChild(da),da=document.createElement("option"),da.setAttribute("value","currentPage"),mxUtils.write(da,mxResources.get("currentPage")),W.appendChild(da),K.style.marginBottom="12px",W.style.marginBottom="16px",O.appendChild(W),mxUtils.br(O),fa+=20,null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(K,"change",I),I()):K.style.marginBottom="16px";var Y=document.createElement("input");Y.style.marginBottom="16px";+Y.style.marginRight="8px";Y.setAttribute("type","checkbox");var ca=document.createElement("input");ca.style.marginBottom="16px";ca.style.marginRight="8px";ca.setAttribute("type","checkbox");f&&(Y.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,O.appendChild(Y),mxUtils.write(O,mxResources.get("embedImages")),mxUtils.br(O),ca.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,O.appendChild(ca),mxUtils.write(O,mxResources.get("embedFonts")),mxUtils.br(O),fa+=50);var ja=document.createElement("select");+ja.style.maxWidth="260px";ja.style.marginLeft="8px";C=document.createElement("option");C.setAttribute("value","auto");mxUtils.write(C,mxResources.get("automatic"));ja.appendChild(C);I=document.createElement("option");I.setAttribute("value","blank");mxUtils.write(I,mxResources.get("openInNewWindow"));ja.appendChild(I);I=document.createElement("option");I.setAttribute("value","self");mxUtils.write(I,mxResources.get("openInThisWindow"));ja.appendChild(I);I=document.createElement("div");mxUtils.write(I,+mxResources.get("LinksLost"));I.style.margin="7px";I.style.display="none";"svg"==L&&(mxUtils.write(O,mxResources.get("links")+":"),O.appendChild(ja),O.appendChild(I),mxUtils.br(O),mxUtils.br(O),fa+=50);k=new CustomDialog(this,O,mxUtils.bind(this,function(){this.lastExportBorder=ma.value;this.lastExportZoom=ba.value;this.lastEmbedImages=Y.checked;this.lastEmbedFonts=ca.checked;this.lastEmbedInclude=W.value;z(ba.value,l.checked,!la.checked,H.checked,K.checked,Y.checked&&f,ma.value,Z.checked,("png"==+L||"svg"==L)&&"currentPage"==W.value,ja.value,null!=U?U.checked:null,null!=t?t.value:null,ea.value,ca.checked)}),null,k,B);this.showDialog(k.container,340,fa,!0,!0,null,null,null,null,!0);ba.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ba.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,k,B,z){var C=document.createElement("div");C.style.whiteSpace="nowrap";var I=this.editor.graph;if(null!=f){var L=document.createElement("h3");+mxUtils.write(L,f);L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";C.appendChild(L)}var J=this.addCheckbox(C,mxResources.get("fit"),!0),O=this.addCheckbox(C,mxResources.get("shadow"),I.shadowVisible&&B,!B),da=this.addCheckbox(C,k),fa=this.addCheckbox(C,mxResources.get("lightbox"),!0),V=this.addEditButton(C,fa),ba=V.getEditInput(),ma=1<I.model.getChildCount(I.model.getRoot()),la=this.addCheckbox(C,mxResources.get("layers"),ma,!ma);la.style.marginLeft=ba.style.marginLeft;+la.style.marginBottom="12px";la.style.marginTop="8px";mxEvent.addListener(fa,"change",function(){fa.checked?(ma&&la.removeAttribute("disabled"),ba.removeAttribute("disabled")):(la.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));ba.checked&&fa.checked?V.getEditSelect().removeAttribute("disabled"):V.getEditSelect().setAttribute("disabled","disabled")});f=new CustomDialog(this,C,mxUtils.bind(this,function(){c(J.checked,O.checked,da.checked,fa.checked,V.getLink(),la.checked)}),+null,mxResources.get("embed"),z);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,B,z,C,I,L){function J(ba){var ma=" ",la="";B&&(ma=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost++"/?client=1"+(null!=da?"&page="+da:"")+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}})(this);\"",la+="cursor:pointer;");c&&(la+="max-width:100%;");var Z="";k&&(Z=' width="'+Math.round(O.width)+'" height="'+Math.round(O.height)+'"');I('<img src="'+ba+'"'+Z+(""!=la?' style="'+la+'"':"")+ma+"/>")}var O=this.editor.graph.getGraphBounds(),da=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ba){var ma=B?this.getFileData(!0):null;ba=this.createImageDataUri(ba,+ma,"png");J(ba)}),null,null,null,mxUtils.bind(this,function(ba){L({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),O.width*O.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var fa="";k&&(fa="&w="+Math.round(2*O.width)+"&h="+Math.round(2*O.height));var V=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(B?"1":"0")+fa+"&xml="+encodeURIComponent(f));V.send(mxUtils.bind(this,function(){200<=V.getStatus()&&299>=V.getStatus()?+J("data:image/png;base64,"+V.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,k,B,z,C,I){var L=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),J=L.getElementsByTagName("a");if(null!=J)for(var O=0;O<J.length;O++){var da=J[O].getAttribute("href");null!=da&&"#"==da.charAt(0)&&"_blank"==J[O].getAttribute("target")&&J[O].removeAttribute("target")}B&&L.setAttribute("content",+this.getFileData(!0));f&&this.editor.graph.addSvgShadow(L);if(k){var fa=" ",V="";B&&(fa="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}})(this);\"",V+=+"cursor:pointer;");c&&(V+="max-width:100%;");this.editor.convertImages(L,mxUtils.bind(this,function(ba){I('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ba))+'"'+(""!=V?' style="'+V+'"':"")+fa+"/>")}))}else V="",B&&(f=this.getSelectedPageIndex(),L.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=f?"&page="+f:"")+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}}})(this);"),V+="cursor:pointer;"),c&&(c=parseInt(L.getAttribute("width")),z=parseInt(L.getAttribute("height")),L.setAttribute("viewBox","-0.5 -0.5 "+c+" "+z),V+="max-width:100%;max-height:"+z+"px;",L.removeAttribute("height")),""!=V&&L.setAttribute("style",V),this.editor.addFontCss(L),this.editor.graph.mathEnabled&&this.editor.addMathCss(L),I(mxUtils.getXml(L))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var k=null;if("diagram"==c.nodeName)k=c;else if("mxfile"==c.nodeName){var B=c.getElementsByTagName("diagram");if(0<B.length){k=B[0];var z=f.getGlobalVariable;f.getGlobalVariable=function(C){return"page"==C?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==C?1:z.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}B=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(C){}finally{this.editor.graph=B}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};-EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var B=parseFloat(c.getAttribute("scale"));!isNaN(B)&&0<B&&(f=B)}c.hasAttribute("border")&&(B=parseInt(c.getAttribute("border")),!isNaN(B)&&0<B&&(k=B))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,f,k,B,z){try{var C=this.editor.graph,H=null;if(null!=k&&0<k.length)C=this.createTemporaryGraph(C.getStylesheet()),document.body.appendChild(C.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,-!0),C),H=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){C=this.createTemporaryGraph(C.getStylesheet());var K=C.getGlobalVariable;C.setBackgroundImage=this.editor.graph.setBackgroundImage;var M=this.pages[0];this.currentPage==M?C.setBackgroundImage(this.editor.graph.backgroundImage):null!=M.viewState&&null!=M.viewState&&C.setBackgroundImage(M.viewState.backgroundImage);C.getGlobalVariable=function(O){return"page"==O?M.getName():"pagenumber"==O?1:K.apply(this,arguments)};document.body.appendChild(C.container);-C.model.setRoot(M.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(O){try{null==H&&(H=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var ea=O.toDataURL("image/png");ea=Editor.writeGraphModelToPng(ea,"tEXt","mxfile",encodeURIComponent(H));c(ea.substring(ea.lastIndexOf(",")+1));C!=this.editor.graph&&C.container.parentNode.removeChild(C.container)}catch(fa){null!=f&&f(fa)}}),null,null,null,mxUtils.bind(this,function(O){null!=f&&f(O)}),null,null,B,null,C.shadowVisible,null,-C,z,null,null,null,"diagram",null)}catch(O){null!=f&&f(O)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){K=null!=K?K:!0;ea=null!=ea?ea:0;H=null!=M?M:f.background;H==mxConstants.NONE&&(H=null);null==H&&"none"==f.getAdaptiveColors()&&(H="#ffffff");M=this.editor.graph.createSvgImageExport(null!=c);C=f.getSvg(H,O,ea,null,null,C,null,M,null,f.shadowVisible||fa,null,S,"diagram");(f.shadowVisible||fa)&&f.addSvgShadow(C,null,null,0==ea);null!=c&&C.setAttribute("content",c);null!=-k&&C.setAttribute("resource",k);var ca=mxUtils.bind(this,function(ma){ma=(B?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(ma);null!=z&&z(ma);return ma});f.mathEnabled&&this.editor.addMathCss(C);if(null!=z)this.embedFonts(C,mxUtils.bind(this,function(ma){K?this.editor.convertImages(ma,mxUtils.bind(this,function(la){ca(la)})):ca(ma)}));else return ca(C)};EditorUi.prototype.embedFonts=function(c,f){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=-this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(k){try{null!=k&&this.editor.addFontCss(c,k),f(c)}catch(B){f(c)}}))}catch(k){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){M=null!=M?M:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ma){Editor.addRetryToError(ma,mxUtils.bind(this,function(){this.exportImage(c,f,k,B,z,C,H,K,M,O,ea,fa,-S)}));this.handleError(ma)}))){var ca=this.editor.graph.isSelectionEmpty();k=null!=k?k:ca;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ma){this.spinner.stop();try{this.saveCanvas(ma,z?this.getFileData(!0,null,null,null,k,K,null,null,null,null,null,c,C):null,M,null==this.pages||0==this.pages.length,ea)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ma){this.spinner.stop();this.handleError(ma)}),-null,k,c||1,f,B,null,null,C,H,O,fa,S)}catch(ma){this.spinner.stop(),this.handleError(ma)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,B,z,C,H){f=null!=f?f:0;k=null!=k?k:0;var K=[];try{var M=this.editor.graph;if(null!=c&&0<c.length){M.model.beginUpdate();-try{var O=mxUtils.parseXml(c);c={};var ea=this.editor.extractGraphModel(O.documentElement,null!=this.pages);if(null!=ea&&"mxfile"==ea.nodeName&&null!=this.pages){var fa=ea.getElementsByTagName("diagram");if(1==fa.length&&!C){if(ea=Editor.parseDiagramNode(fa[0]),null!=this.currentPage&&(c[fa[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var S=fa[0].getAttribute("name");null!=S&&""!=S&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,S))}}else if(0<fa.length){C=-[];var ca=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[fa[0].getAttribute("id")]=this.pages[0].getId(),S=fa[0].getAttribute("name"),null!=S&&""!=S&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],S)),ea=Editor.parseDiagramNode(fa[0]),B=!1,ca=1);for(;ca<fa.length;ca++){var ma=fa[ca].getAttribute("id");fa[ca].removeAttribute("id");var la=this.updatePageRoot(new DiagramPage(fa[ca]));c[ma]=fa[ca].getAttribute("id");var Z=this.pages.length;null==la.getName()&&la.setName(mxResources.get("pageWithNumber",-[Z+1]));M.model.execute(new ChangePage(this,la,la,Z,!0));C.push(la)}this.updatePageLinks(c,C)}}if(null!=ea&&"mxGraphModel"===ea.nodeName){K=M.importGraphModel(ea,f,k,B);if(null!=K)for(this.addLocalPagesToMapping(c),ca=0;ca<K.length;ca++)this.updatePageLinksForCell(c,K[ca]);var da=M.parseBackgroundImage(ea.getAttribute("backgroundImage"));if(null!=da&&null!=da.originalSrc){this.updateBackgroundPageLink(c,da);var aa=new ChangePageSetup(this,null,da);aa.ignoreColor=!0;M.model.execute(aa)}}H&&M.pasteCellStyles(M.includeDescendants(K),-M.defaultVertexStyle,M.defaultEdgeStyle)}finally{M.model.endUpdate()}}}catch(l){if(z)throw l;this.handleError(l)}return K};EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var k=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=-k&&(f.originalSrc="data:page/id,"+k)}}catch(B){}};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),B=this.editor.graph,z=B.getLinkForCell(f);null!=z&&B.setLinkForCell(f,this.updatePageLink(c,z));if(B.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(B.getLabel(f));for(var C=k.getElementsByTagName("a"),H=!1,K=0;K<C.length;K++)z=C[K].getAttribute("href"),null!=z&&(C[K].setAttribute("href",this.updatePageLink(c,z)),H=!0);H&&B.labelChanged(f,k.innerHTML)}for(K=-0;K<B.model.getChildCount(f);K++)this.updatePageLinksForCell(c,B.model.getChildAt(f,K))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var B=JSON.parse(f.substring(17));if(null!=B.actions){for(var z=0;z<B.actions.length;z++){var C=B.actions[z];if(null!=C.open&&Graph.isPageLink(C.open)){var H=C.open.substring(C.open.indexOf(",")+1);k=c[H];null!=k?C.open=-"data:page/id,"+k:null==this.getPageById(H)&&delete C.open}}f="data:action/json,"+JSON.stringify(B)}}catch(K){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,B,z){var C=mxUtils.bind(this,function(H){this.loadingExtensions=!1;null!=k?k(H):this.handleError(H)});this.createTimeout(null,mxUtils.bind(this,function(H){B=null!=B?B:c.name;var K=mxUtils.bind(this,function(O){H.clear()&&-C(O)}),M=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var O=this.isRemoteVisioFormat(B);try{var ea=B.lastIndexOf(".");if(0<=ea&&ea<B.length)B.substring(ea+1).toUpperCase();else{var fa=B.lastIndexOf("/");0<=fa&&fa<B.length&&(B=B.substring(fa+1))}}catch(ca){}if(O)if(null==VSD_CONVERT_URL||this.isOffline())K({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{O=new FormData;O.append("file1",c,-B);var S=new XMLHttpRequest;S.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(B)?"?stencil=1":""));S.responseType="blob";this.addRemoteServiceSecurityCheck(S);null!=z&&S.setRequestHeader("x-convert-custom",z);S.onreadystatechange=mxUtils.bind(this,function(){if(4==S.readyState&&H.clear())if(200<=S.status&&299>=S.status)try{var ca=S.response;if("text/xml"==ca.type){var ma=new FileReader;ma.onload=mxUtils.bind(this,function(la){try{f(la.target.result)}catch(Z){K({message:mxResources.get("errorLoadingFile")})}});-ma.readAsText(ca)}else this.doImportVisio(ca,f,K,B)}catch(la){K(la)}else try{""==S.responseType||"text"==S.responseType?K({message:S.responseText}):(ma=new FileReader,ma.onload=function(){try{K({message:JSON.parse(ma.result).Message})}catch(la){K(la)}},ma.readAsText(S.response))}catch(la){K({})}});S.send(O)}else if(H.clear())try{this.doImportVisio(c,f,K,B)}catch(ca){K(ca)}}else K({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?-M():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",M,null,null,null,K))}),C)};EditorUi.prototype.importGraphML=function(c,f,k){var B=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=k?k(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){var C=mxUtils.bind(this,function(K){z.clear()&&B(K)}),H=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(z.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,B)}catch(K){C(K)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});-this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?H():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,C))}),B)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.createTimeout(null,mxUtils.bind(this,function(k){var B=mxUtils.bind(this,function(C){k.clear()&&f(C)}),z=mxUtils.bind(this,function(){this.loadingExtensions=+EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var B=parseFloat(c.getAttribute("scale"));!isNaN(B)&&0<B&&(f=B)}c.hasAttribute("border")&&(B=parseInt(c.getAttribute("border")),!isNaN(B)&&0<B&&(k=B))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,f,k,B,z){try{var C=this.editor.graph,I=null;if(null!=k&&0<k.length)C=this.createTemporaryGraph(C.getStylesheet()),document.body.appendChild(C.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,+!0),C),I=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){C=this.createTemporaryGraph(C.getStylesheet());var L=C.getGlobalVariable;C.setBackgroundImage=this.editor.graph.setBackgroundImage;var J=this.pages[0];this.currentPage==J?C.setBackgroundImage(this.editor.graph.backgroundImage):null!=J.viewState&&null!=J.viewState&&C.setBackgroundImage(J.viewState.backgroundImage);C.getGlobalVariable=function(O){return"page"==O?J.getName():"pagenumber"==O?1:L.apply(this,arguments)};document.body.appendChild(C.container);+C.model.setRoot(J.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(O){try{null==I&&(I=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var da=O.toDataURL("image/png");da=Editor.writeGraphModelToPng(da,"tEXt","mxfile",encodeURIComponent(I));c(da.substring(da.lastIndexOf(",")+1));C!=this.editor.graph&&C.container.parentNode.removeChild(C.container)}catch(fa){null!=f&&f(fa)}}),null,null,null,mxUtils.bind(this,function(O){null!=f&&f(O)}),null,null,B,null,C.shadowVisible,null,+C,z,null,null,null,"diagram",null)}catch(O){null!=f&&f(O)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){L=null!=L?L:!0;da=null!=da?da:0;I=null!=J?J:f.background;I==mxConstants.NONE&&(I=null);null==I&&"none"==f.getAdaptiveColors()&&(I="#ffffff");J=this.editor.graph.createSvgImageExport(null!=c);C=f.getSvg(I,O,da,null,null,C,null,J,null,f.shadowVisible||fa,null,V,"diagram");(f.shadowVisible||fa)&&f.addSvgShadow(C,null,null,0==da);null!=c&&C.setAttribute("content",c);null!=+k&&C.setAttribute("resource",k);var ba=mxUtils.bind(this,function(ma){ma=(B?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(ma);null!=z&&z(ma);return ma});f.mathEnabled&&this.editor.addMathCss(C);if(null!=z)this.embedFonts(C,mxUtils.bind(this,function(ma){L?this.editor.convertImages(ma,mxUtils.bind(this,function(la){ba(la)})):ba(ma)}));else return ba(C)};EditorUi.prototype.embedFonts=function(c,f){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=+this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(k){try{null!=k&&this.editor.addFontCss(c,k),f(c)}catch(B){f(c)}}))}catch(k){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){J=null!=J?J:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ma){Editor.addRetryToError(ma,mxUtils.bind(this,function(){this.exportImage(c,f,k,B,z,C,I,L,J,O,da,fa,+V)}));this.handleError(ma)}))){var ba=this.editor.graph.isSelectionEmpty();k=null!=k?k:ba;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ma){this.spinner.stop();try{this.saveCanvas(ma,z?this.getFileData(!0,null,null,null,k,L,null,null,null,null,null,c,C):null,J,null==this.pages||0==this.pages.length,da)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ma){this.spinner.stop();this.handleError(ma)}),+null,k,c||1,f,B,null,null,C,I,O,fa,V)}catch(ma){this.spinner.stop(),this.handleError(ma)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,B,z,C,I){f=null!=f?f:0;k=null!=k?k:0;var L=[];try{var J=this.editor.graph;if(null!=c&&0<c.length){J.model.beginUpdate();+try{var O=mxUtils.parseXml(c);c={};var da=this.editor.extractGraphModel(O.documentElement,null!=this.pages);if(null!=da&&"mxfile"==da.nodeName&&null!=this.pages){var fa=da.getElementsByTagName("diagram");if(1==fa.length&&!C){if(da=Editor.parseDiagramNode(fa[0]),null!=this.currentPage&&(c[fa[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var V=fa[0].getAttribute("name");null!=V&&""!=V&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,V))}}else if(0<fa.length){C=+[];var ba=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[fa[0].getAttribute("id")]=this.pages[0].getId(),V=fa[0].getAttribute("name"),null!=V&&""!=V&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],V)),da=Editor.parseDiagramNode(fa[0]),B=!1,ba=1);for(;ba<fa.length;ba++){var ma=fa[ba].getAttribute("id");fa[ba].removeAttribute("id");var la=this.updatePageRoot(new DiagramPage(fa[ba]));c[ma]=fa[ba].getAttribute("id");var Z=this.pages.length;null==la.getName()&&la.setName(mxResources.get("pageWithNumber",+[Z+1]));J.model.execute(new ChangePage(this,la,la,Z,!0));C.push(la)}this.updatePageLinks(c,C)}}if(null!=da&&"mxGraphModel"===da.nodeName){L=J.importGraphModel(da,f,k,B);if(null!=L)for(this.addLocalPagesToMapping(c),ba=0;ba<L.length;ba++)this.updatePageLinksForCell(c,L[ba]);var ea=J.parseBackgroundImage(da.getAttribute("backgroundImage"));if(null!=ea&&null!=ea.originalSrc){this.updateBackgroundPageLink(c,ea);var aa=new ChangePageSetup(this,null,ea);aa.ignoreColor=!0;J.model.execute(aa)}}I&&J.pasteCellStyles(J.includeDescendants(L),+J.defaultVertexStyle,J.defaultEdgeStyle)}finally{J.model.endUpdate()}}}catch(l){if(z)throw l;this.handleError(l)}return L};EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var k=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=+k&&(f.originalSrc="data:page/id,"+k)}}catch(B){}};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),B=this.editor.graph,z=B.getLinkForCell(f);null!=z&&B.setLinkForCell(f,this.updatePageLink(c,z));if(B.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(B.getLabel(f));for(var C=k.getElementsByTagName("a"),I=!1,L=0;L<C.length;L++)z=C[L].getAttribute("href"),null!=z&&(C[L].setAttribute("href",this.updatePageLink(c,z)),I=!0);I&&B.labelChanged(f,k.innerHTML)}for(L=+0;L<B.model.getChildCount(f);L++)this.updatePageLinksForCell(c,B.model.getChildAt(f,L))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var B=JSON.parse(f.substring(17));if(null!=B.actions){for(var z=0;z<B.actions.length;z++){var C=B.actions[z];if(null!=C.open&&Graph.isPageLink(C.open)){var I=C.open.substring(C.open.indexOf(",")+1);k=c[I];null!=k?C.open=+"data:page/id,"+k:null==this.getPageById(I)&&delete C.open}}f="data:action/json,"+JSON.stringify(B)}}catch(L){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,B,z){var C=mxUtils.bind(this,function(I){this.loadingExtensions=!1;null!=k?k(I):this.handleError(I)});this.createTimeout(null,mxUtils.bind(this,function(I){B=null!=B?B:c.name;var L=mxUtils.bind(this,function(O){I.clear()&&+C(O)}),J=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var O=this.isRemoteVisioFormat(B);try{var da=B.lastIndexOf(".");if(0<=da&&da<B.length)B.substring(da+1).toUpperCase();else{var fa=B.lastIndexOf("/");0<=fa&&fa<B.length&&(B=B.substring(fa+1))}}catch(ba){}if(O)if(null==VSD_CONVERT_URL||this.isOffline())L({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{O=new FormData;O.append("file1",c,+B);var V=new XMLHttpRequest;V.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(B)?"?stencil=1":""));V.responseType="blob";this.addRemoteServiceSecurityCheck(V);null!=z&&V.setRequestHeader("x-convert-custom",z);V.onreadystatechange=mxUtils.bind(this,function(){if(4==V.readyState&&I.clear())if(200<=V.status&&299>=V.status)try{var ba=V.response;if("text/xml"==ba.type){var ma=new FileReader;ma.onload=mxUtils.bind(this,function(la){try{f(la.target.result)}catch(Z){L({message:mxResources.get("errorLoadingFile")})}});+ma.readAsText(ba)}else this.doImportVisio(ba,f,L,B)}catch(la){L(la)}else try{""==V.responseType||"text"==V.responseType?L({message:V.responseText}):(ma=new FileReader,ma.onload=function(){try{L({message:JSON.parse(ma.result).Message})}catch(la){L(la)}},ma.readAsText(V.response))}catch(la){L({})}});V.send(O)}else if(I.clear())try{this.doImportVisio(c,f,L,B)}catch(ba){L(ba)}}else L({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?+J():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",J,null,null,null,L))}),C)};EditorUi.prototype.importGraphML=function(c,f,k){var B=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=k?k(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){var C=mxUtils.bind(this,function(L){z.clear()&&B(L)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(z.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,B)}catch(L){C(L)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});+this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?I():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,C))}),B)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.createTimeout(null,mxUtils.bind(this,function(k){var B=mxUtils.bind(this,function(C){k.clear()&&f(C)}),z=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||B({message:mxResources.get("unknownError")})}catch(C){B(C)}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(z,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",z,null,null,null,B))}),f)}};EditorUi.prototype.convertLucidChart=function(c,-f,k){var B=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=k?k(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){var C=mxUtils.bind(this,function(K){z.clear()&&B(K)}),H=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(z.clear())if("undefined"!==typeof window.LucidImporter)try{var K=JSON.parse(c);f(LucidImporter.importState(K));try{if(null!=window.console&&"1"==urlParams.test){var M=[(new Date).toISOString(),"convertLucidChart",K];null!=K.state&&-M.push(JSON.parse(K.state));if(null!=K.svgThumbs)for(var O=0;O<K.svgThumbs.length;O++)M.push(Editor.createSvgDataUri(K.svgThumbs[O]));null!=K.thumb&&M.push(K.thumb);console.log.apply(console,M)}}catch(ea){}}catch(ea){null!=window.console&&console.error(ea),C(ea)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(H,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",-function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",H,null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,C))}),B)};EditorUi.prototype.createMermaidXml=function(c,f,k,B,z,C){var H=new Graph(document.createElement("div"));-k=H.insertVertex(null,null,null,0,0,B,z,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+k+";");H.setAttributeForCell(k,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=C&&H.setAttributeForCell(k,"templatePrompt",C);c=(new mxCodec).encode(H.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k){var B=0,z=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(C){var H=new mxXmlRequest("https://www.draw.io/generate/v2",-c,"POST"),K=mxUtils.bind(this,function(M){C.clear()&&k(M)});H.send(mxUtils.bind(this,function(M){if(C.isAlive())if(200<=M.getStatus()&&299>=M.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ea=mxUtils.trim(M.getText());this.generateMermaidImage(ea,null,mxUtils.bind(this,function(fa,S,ca){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",ea),f(ea,fa,S,ca))}),K)}),K,mxUtils.bind(this,function(fa){3>-B++?C.clear()&&z():K(fa)}))}),K);else{var O={message:mxResources.get("error")+" "+M.getStatus()};try{O=JSON.parse(M.getText()),O=O.error}catch(ea){}K(O)}}),K)}),k)});z()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("%%");f=1<f.length?f:c.split("(Begins)");c=mxUtils.trim(1>=f.length?c:f[1]);f=c.split("\n");var k=1<f.length?+f,k){var B=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=k?k(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){var C=mxUtils.bind(this,function(L){z.clear()&&B(L)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(z.clear())if("undefined"!==typeof window.LucidImporter)try{var L=JSON.parse(c);f(LucidImporter.importState(L));try{if(null!=window.console&&"1"==urlParams.test){var J=[(new Date).toISOString(),"convertLucidChart",L];null!=L.state&&+J.push(JSON.parse(L.state));if(null!=L.svgThumbs)for(var O=0;O<L.svgThumbs.length;O++)J.push(Editor.createSvgDataUri(L.svgThumbs[O]));null!=L.thumb&&J.push(L.thumb);console.log.apply(console,J)}}catch(da){}}catch(da){null!=window.console&&console.error(da),C(da)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(I,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",+function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",I,null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,C))}),B)};EditorUi.prototype.createMermaidXml=function(c,f,k,B,z,C){var I=new Graph(document.createElement("div"));+k=I.insertVertex(null,null,null,0,0,B,z,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+k+";");I.setAttributeForCell(k,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=C&&I.setAttributeForCell(k,"templatePrompt",C);c=(new mxCodec).encode(I.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k){var B=0,z=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(C){var I=new mxXmlRequest("https://www.draw.io/generate/v2",+c,"POST"),L=mxUtils.bind(this,function(J){C.clear()&&k(J)});I.send(mxUtils.bind(this,function(J){if(C.isAlive())if(200<=J.getStatus()&&299>=J.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var da=mxUtils.trim(J.getText());this.generateMermaidImage(da,null,mxUtils.bind(this,function(fa,V,ba){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",da),f(da,fa,V,ba))}),L)}),L,mxUtils.bind(this,function(fa){3>+B++?C.clear()&&z():L(fa)}))}),L);else{var O={message:mxResources.get("error")+" "+J.getStatus()};try{O=JSON.parse(J.getText()),O=O.error}catch(da){}L(O)}}),L)}),k)});z()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("%%");f=1<f.length?f:c.split("(Begins)");c=mxUtils.trim(1>=f.length?c:f[1]);f=c.split("\n");var k=1<f.length?f[1]:null;if(null!=k){var B=k.indexOf("-");0<B&&(k=k.substring(0,B))}if(0<f.length&&"mermaid"==mxUtils.trim(f[0])||null!=k&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k))f.shift(),c=mxUtils.trim(f.join("\n")),f=c.split("\n");k=f[0].split(" ")[0].replace(/:$/,"");B=k.indexOf("-");0<B&&(k=k.substring(0,B));try{"mindmap"==k&&2<f.length&&(c=extractMermaidMindmap(f))}catch(z){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k)&&(c=null);return c};EditorUi.prototype.generateMermaidImage=function(c,-f,k,B,z){var C=mxUtils.bind(this,function(K){this.loadingMermaid=!1;null!=B?B(K):this.handleError(K)}),H=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;"undefined"!==typeof mxMermaidToDrawio&&f.flowchart&&0<=c.indexOf("$$")&&(f.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(f.theme="dark");var K=mxUtils.bind(this,function(M){try{if(mxClient.IS_IE||mxClient.IS_IE11)M=-M.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var O=mxUtils.parseXml(M).getElementsByTagName("svg");if(0<O.length&&"error"!=O[0].getAttribute("aria-roledescription")){var ea=parseFloat(O[0].getAttribute("width")),fa=parseFloat(O[0].getAttribute("height"));if(isNaN(ea)||isNaN(fa))try{var S=O[0].getAttribute("viewBox").split(/\s+/);ea=parseFloat(S[2]);fa=parseFloat(S[3])}catch(ca){ea=ea||100,fa=fa||100}k(this.convertDataUri(Editor.createSvgDataUri(M)),-ea,fa)}else null!=z?z():B({message:mxResources.get("invalidInput")})}catch(ca){B(ca)}});mermaid.mermaidAPI.initialize(f);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(function(M){K(M.svg)}).catch(function(M){null!=z?z(M):B(M)})}catch(M){B(M)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(H,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(K){this.importXml(K,-null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",H,null,null,null,C)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,C))};EditorUi.prototype.generatePlantUmlImage=function(c,f,k,B){function z(K,M,O){c1=K>>2;c2=(K&3)<<4|M>>4;c3=(M&15)<<2|O>>6;c4=O&63;r="";r+=C(c1&63);r+=C(c2&63);r+=C(c3&63);return r+=C(c4&63)}function C(K){if(10>K)return String.fromCharCode(48+K);K-=10;if(26>K)return String.fromCharCode(65+K);K-=26;if(26>K)return String.fromCharCode(97+-K);K-=26;return 0==K?"-":1==K?"_":"?"}var H=new XMLHttpRequest;H.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(K){r="";for(i=0;i<K.length;i+=3)r=i+2==K.length?r+z(K.charCodeAt(i),K.charCodeAt(i+1),0):i+1==K.length?r+z(K.charCodeAt(i),0,0):r+z(K.charCodeAt(i),K.charCodeAt(i+1),K.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=f&&(H.responseType="blob");H.onload=function(K){if(200<=this.status&&300>this.status)if("txt"==-f)k(this.response);else{var M=new FileReader;M.readAsDataURL(this.response);M.onloadend=function(O){var ea=new Image;ea.onload=function(){try{var fa=ea.width,S=ea.height;if(0==fa&&0==S){var ca=M.result,ma=ca.indexOf(","),la=decodeURIComponent(escape(atob(ca.substring(ma+1)))),Z=mxUtils.parseXml(la).getElementsByTagName("svg");0<Z.length&&(fa=parseFloat(Z[0].getAttribute("width")),S=parseFloat(Z[0].getAttribute("height")))}k(M.result,fa,S)}catch(da){B(da)}};ea.src=M.result};M.onerror=function(O){B(O)}}else B(K)};-H.onerror=function(K){B(K)};H.send()};EditorUi.prototype.insertAsPreText=function(c,f,k){var B=this.editor.graph,z=null;B.getModel().beginUpdate();try{z=B.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),B.updateCellSize(z,!0)}finally{B.getModel().endUpdate()}return z};EditorUi.prototype.insertTextAt=function(c,f,k,B,z,C,H,K){C=null!=C?C:!0;H=null!=H?H:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?-this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(S){4==S.readyState&&200<=S.status&&299>=S.status&&this.editor.graph.setSelectionCells(this.insertTextAt(S.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(z||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var M=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var O=Editor.extractGraphModelFromPdf(c);if(null!=-O&&0<O.length)return this.importXml(O,f,k,C,!0,K)}if(Editor.isPngDataUrl(c)&&(O=Editor.extractGraphModelFromPng(c),null!=O&&0<O.length))return this.importXml(O,f,k,C,!0,K);if("data:image/svg+xml;"==c.substring(0,19))try{O=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(O=c.substring(c.indexOf(",")+1),O=window.atob&&!mxClient.IS_SF?atob(O):Base64.decode(O,!0)):O=decodeURIComponent(c.substring(c.indexOf(",")+1));var ea=this.importXml(O,f,k,C,!0,K);if(0<ea.length)return ea}catch(S){}this.loadImage(c,-mxUtils.bind(this,function(S){if("data:"==c.substring(0,5))this.resizeImage(S,c,mxUtils.bind(this,function(la,Z,da){M.setSelectionCell(M.insertVertex(null,null,"",M.snap(f),M.snap(k),Z,da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(la)+";"))}),H,this.maxImageSize);else{var ca=Math.min(1,Math.min(this.maxImageSize/S.width,this.maxImageSize/S.height)),ma=Math.round(S.width*ca);S=Math.round(S.height*ca);-M.setSelectionCell(M.insertVertex(null,null,"",M.snap(f),M.snap(k),ma,S,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var S=null;M.getModel().beginUpdate();try{S=M.insertVertex(M.getDefaultParent(),null,c,M.snap(f),M.snap(k),1,1,"text;"+(B?"html=1;":"")),M.updateCellSize(S),M.fireEvent(new mxEventObject("textInserted","cells",[S]))}finally{M.getModel().endUpdate()}M.setSelectionCell(S)}))}else{c=-Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,C,null,K);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(S){this.editor.graph.setSelectionCells(this.importXml(S,f,k,C,null,K))}),mxUtils.bind(this,function(S){this.handleError(S)}));else{M=this.editor.graph;z=null;M.getModel().beginUpdate();try{z=M.insertVertex(M.getDefaultParent(),null,"",M.snap(f),M.snap(k),1,1,"text;whiteSpace=wrap;"+(B?"html=1;":""));M.fireEvent(new mxEventObject("textInserted",-"cells",[z]));B&&(c=M.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");z.value=c;M.updateCellSize(z);if(0<this.maxTextWidth&&z.geometry.width>this.maxTextWidth){var fa=M.getPreferredSizeForCell(z,this.maxTextWidth);z.geometry.width=fa.width;z.geometry.height=fa.height}Graph.isLink(z.value)&&M.setLinkForCell(z,z.value);z.geometry.width+=M.gridSize;z.geometry.height+=M.gridSize}finally{M.getModel().endUpdate()}return[z]}}return[]};EditorUi.prototype.formatFileSize=+f,k,B,z){var C=mxUtils.bind(this,function(L){this.loadingMermaid=!1;null!=B?B(L):this.handleError(L)}),I=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;"undefined"!==typeof mxMermaidToDrawio&&f.flowchart&&0<=c.indexOf("$$")&&(f.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(f.theme="dark");var L=mxUtils.bind(this,function(J){try{if(mxClient.IS_IE||mxClient.IS_IE11)J=+J.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var O=mxUtils.parseXml(J).getElementsByTagName("svg");if(0<O.length&&"error"!=O[0].getAttribute("aria-roledescription")){var da=parseFloat(O[0].getAttribute("width")),fa=parseFloat(O[0].getAttribute("height"));if(isNaN(da)||isNaN(fa))try{var V=O[0].getAttribute("viewBox").split(/\s+/);da=parseFloat(V[2]);fa=parseFloat(V[3])}catch(ba){da=da||100,fa=fa||100}k(this.convertDataUri(Editor.createSvgDataUri(J)),+da,fa)}else null!=z?z():B({message:mxResources.get("invalidInput")})}catch(ba){B(ba)}});mermaid.mermaidAPI.initialize(f);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(function(J){L(J.svg)}).catch(function(J){null!=z?z(J):B(J)})}catch(J){B(J)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(I,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(L){this.importXml(L,+null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",I,null,null,null,C)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,C))};EditorUi.prototype.generatePlantUmlImage=function(c,f,k,B){function z(L,J,O){c1=L>>2;c2=(L&3)<<4|J>>4;c3=(J&15)<<2|O>>6;c4=O&63;r="";r+=C(c1&63);r+=C(c2&63);r+=C(c3&63);return r+=C(c4&63)}function C(L){if(10>L)return String.fromCharCode(48+L);L-=10;if(26>L)return String.fromCharCode(65+L);L-=26;if(26>L)return String.fromCharCode(97++L);L-=26;return 0==L?"-":1==L?"_":"?"}var I=new XMLHttpRequest;I.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(L){r="";for(i=0;i<L.length;i+=3)r=i+2==L.length?r+z(L.charCodeAt(i),L.charCodeAt(i+1),0):i+1==L.length?r+z(L.charCodeAt(i),0,0):r+z(L.charCodeAt(i),L.charCodeAt(i+1),L.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=f&&(I.responseType="blob");I.onload=function(L){if(200<=this.status&&300>this.status)if("txt"==+f)k(this.response);else{var J=new FileReader;J.readAsDataURL(this.response);J.onloadend=function(O){var da=new Image;da.onload=function(){try{var fa=da.width,V=da.height;if(0==fa&&0==V){var ba=J.result,ma=ba.indexOf(","),la=decodeURIComponent(escape(atob(ba.substring(ma+1)))),Z=mxUtils.parseXml(la).getElementsByTagName("svg");0<Z.length&&(fa=parseFloat(Z[0].getAttribute("width")),V=parseFloat(Z[0].getAttribute("height")))}k(J.result,fa,V)}catch(ea){B(ea)}};da.src=J.result};J.onerror=function(O){B(O)}}else B(L)};+I.onerror=function(L){B(L)};I.send()};EditorUi.prototype.insertAsPreText=function(c,f,k){var B=this.editor.graph,z=null;B.getModel().beginUpdate();try{z=B.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),B.updateCellSize(z,!0)}finally{B.getModel().endUpdate()}return z};EditorUi.prototype.insertTextAt=function(c,f,k,B,z,C,I,L){C=null!=C?C:!0;I=null!=I?I:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?+this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(V){4==V.readyState&&200<=V.status&&299>=V.status&&this.editor.graph.setSelectionCells(this.insertTextAt(V.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(z||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var J=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var O=Editor.extractGraphModelFromPdf(c);if(null!=+O&&0<O.length)return this.importXml(O,f,k,C,!0,L)}if(Editor.isPngDataUrl(c)&&(O=Editor.extractGraphModelFromPng(c),null!=O&&0<O.length))return this.importXml(O,f,k,C,!0,L);if("data:image/svg+xml;"==c.substring(0,19))try{O=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(O=c.substring(c.indexOf(",")+1),O=window.atob&&!mxClient.IS_SF?atob(O):Base64.decode(O,!0)):O=decodeURIComponent(c.substring(c.indexOf(",")+1));var da=this.importXml(O,f,k,C,!0,L);if(0<da.length)return da}catch(V){}this.loadImage(c,+mxUtils.bind(this,function(V){if("data:"==c.substring(0,5))this.resizeImage(V,c,mxUtils.bind(this,function(la,Z,ea){J.setSelectionCell(J.insertVertex(null,null,"",J.snap(f),J.snap(k),Z,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(la)+";"))}),I,this.maxImageSize);else{var ba=Math.min(1,Math.min(this.maxImageSize/V.width,this.maxImageSize/V.height)),ma=Math.round(V.width*ba);V=Math.round(V.height*ba);+J.setSelectionCell(J.insertVertex(null,null,"",J.snap(f),J.snap(k),ma,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var V=null;J.getModel().beginUpdate();try{V=J.insertVertex(J.getDefaultParent(),null,c,J.snap(f),J.snap(k),1,1,"text;"+(B?"html=1;":"")),J.updateCellSize(V),J.fireEvent(new mxEventObject("textInserted","cells",[V]))}finally{J.getModel().endUpdate()}J.setSelectionCell(V)}))}else{c=+Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,C,null,L);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(V){this.editor.graph.setSelectionCells(this.importXml(V,f,k,C,null,L))}),mxUtils.bind(this,function(V){this.handleError(V)}));else{J=this.editor.graph;z=null;J.getModel().beginUpdate();try{z=J.insertVertex(J.getDefaultParent(),null,"",J.snap(f),J.snap(k),1,1,"text;whiteSpace=wrap;"+(B?"html=1;":""));J.fireEvent(new mxEventObject("textInserted",+"cells",[z]));B&&(c=J.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");z.value=c;J.updateCellSize(z);if(0<this.maxTextWidth&&z.geometry.width>this.maxTextWidth){var fa=J.getPreferredSizeForCell(z,this.maxTextWidth);z.geometry.width=fa.width;z.geometry.height=fa.height}Graph.isLink(z.value)&&J.setLinkForCell(z,z.value);z.geometry.width+=J.gridSize;z.geometry.height+=J.gridSize}finally{J.getModel().endUpdate()}return[z]}}return[]};EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display="none";document.body.appendChild(k);this.importFileInputElt=k}this.importFileInputElt.click()}else{window.openNew=-!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(H,K){StorageFile.listFiles(this,"F",H,K)});window.openBrowserFile=mxUtils.bind(this,function(H,K,M){StorageFile.getFileContent(this,H,K,M)});window.deleteBrowserFile=mxUtils.bind(this,function(H,K,M){StorageFile.deleteFile(this,H,K,M)});if(!f){var B=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(H){this.hideDialog(H)}));window.openFile.setConsumer(mxUtils.bind(this,-function(H,K){null!=K&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(K)?(H=new Blob([H],{type:"application/octet-stream"}),this.importVisio(H,mxUtils.bind(this,function(M){this.importXml(M,0,0,!0)}),null,K)):this.editor.graph.setSelectionCells(this.importXml(H,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var z=this.dialog,C=z.close;this.dialog.close=mxUtils.bind(this,function(H){Editor.useLocalStorage=-B;C.apply(z,arguments);H&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var B=this,z=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(C){if(mxUtils.isEmptyObject(C.files))k();else{var H=0,K,M=!1;C.forEach(function(O,ea){O=ea.name.toLowerCase();"diagram/diagram.xml"==O?(M=!0,ea.async("string").then(function(fa){0==fa.indexOf("<mxfile ")?f(fa):k()})):0==O.indexOf("versions/")&&-(O=parseInt(O.substr(9)),O>H&&(H=O,K=ea))});0<H?K.async("string").then(function(O){(new XMLHttpRequest).upload&&B.isRemoteFileFormat(O,c.name)?B.isOffline()?B.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):B.parseFileData(O,mxUtils.bind(this,function(ea){4==ea.readyState&&(200<=ea.status&&299>=ea.status?f(ea.responseText):k())}),c.name):k()}):M||k()}},function(C){k(C)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?z():(this.loadingExtensions=-!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",z,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,B,z,C,H,K,M,O,ea,fa){O=null!=O?O:!0;var S=!1,ca=null,ma=mxUtils.bind(this,function(la){var Z=null;null!=la&&"<mxlibrary"==la.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,la,H)),this.showSidebar()):Z=this.importXml(la,k,B,O,null,null!=fa?mxEvent.isControlDown(fa):null);null!=K&&K(Z)});"image"==f.substring(0,5)?(M=!1,"image/png"==f.substring(0,9)&&(f=ea?null:this.extractGraphModelFromPng(c),-null!=f&&0<f.length&&(ca=this.importXml(f,k,B,O,null,null!=fa?mxEvent.isControlDown(fa):null),M=!0)),M||(f=this.editor.graph,M=c.indexOf(";"),0<M&&(c=c.substring(0,M)+c.substring(c.indexOf(",",M+1))),O&&f.isGridEnabled()&&(k=f.snap(k),B=f.snap(B)),ca=[f.insertVertex(null,null,"",k,B,z,C,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";")])):/(\.*<graphml )/.test(c)?(S=!0,this.importGraphML(c,ma)):null!=M&&null!=H&&EditorUi.isVisioFilename(H)?-(S=!0,this.importVisio(M,ma)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,H)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(S=!0,z=mxUtils.bind(this,function(la){4==la.readyState&&(200<=la.status&&299>=la.status?ma(la.responseText):null!=K&&(K(null),this.showError(mxResources.get("error"),413==la.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,z,H):this.parseFile(M,z,H)):0==c.indexOf("PK")&&-null!=M?(S=!0,this.importZipFile(M,ma,mxUtils.bind(this,function(){ca=this.insertTextAt(this.validateFileData(c),k,B,!0,null,O);K(ca)}))):/(\.v(sd|dx))($|\?)/i.test(H)||/(\.vs(s|x))($|\?)/i.test(H)||(ca=this.insertTextAt(this.validateFileData(c),k,B,!0,null,O,null,null!=fa?mxEvent.isControlDown(fa):null));S||null==K||K(ca);return ca};EditorUi.prototype.importFiles=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){B=null!=B?B:this.maxImageSize;O=null!=O?O:this.maxImageBytes;var ca=null!=f&&null!=k,ma=!0;f=null!=-f?f:0;k=null!=k?k:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var Z=ea||this.resampleThreshold,da=0;da<c.length;da++)if("image/svg"!==c[da].type.substring(0,9)&&"image/"===c[da].type.substring(0,6)&&c[da].size>Z){la=!0;break}var aa=mxUtils.bind(this,function(){var l=this.editor.graph,t=l.gridSize;z=null!=z?z:mxUtils.bind(this,function(ba,ja,oa,qa,ra,xa,Ba,ya,Da){try{if(null!=ba&&"<mxlibrary"==ba.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ba,Ba)),this.showSidebar(),-null;this.isCompatibleString(ba)&&1==c.length&&null!=S&&"drop"==S.type&&this.isBlankFile()&&!this.canUndo()&&(ca=!1,qa=oa=0);return this.importFile(ba,ja,oa,qa,ra,xa,Ba,ya,Da,ca,fa,S)}catch(La){return this.handleError(La),null}});C=null!=C?C:mxUtils.bind(this,function(ba){l.setSelectionCells(ba)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var I=c.length,V=I,J=[],W=mxUtils.bind(this,function(ba,ja){J[ba]=ja;if(0==--V){this.spinner.stop();if(null!=K)K(J);else{var oa=[];l.getModel().beginUpdate();-try{for(ba=0;ba<J.length;ba++){var qa=J[ba]();null!=qa&&(oa=oa.concat(qa))}}finally{l.getModel().endUpdate()}}C(oa)}}),Y=0;Y<I;Y++)mxUtils.bind(this,function(ba){var ja=c[ba];if(null!=ja){var oa=new FileReader;oa.onload=mxUtils.bind(this,function(qa){if(null==H||H(ja))try{if("image/"==ja.type.substring(0,6))if("image/svg"==ja.type.substring(0,9)){var ra=Graph.clipSvgDataUri(qa.target.result),xa=ra.indexOf(","),Ba=decodeURIComponent(escape(atob(ra.substring(xa+1)))),ya=mxUtils.parseXml(Ba),Da=ya.getElementsByTagName("svg");-if(0<Da.length){var La=Da[0],sa=fa?null:La.getAttribute("content");null!=sa&&"<"!=sa.charAt(0)&&"%"!=sa.charAt(0)&&(sa=unescape(window.atob?atob(sa):Base64.decode(sa,!0)));null!=sa&&"%"==sa.charAt(0)&&(sa=decodeURIComponent(sa));null==sa||"<mxfile "!==sa.substring(0,8)&&"<mxGraphModel "!==sa.substring(0,14)?W(ba,mxUtils.bind(this,function(){try{if(null!=ya){var Ka=ya.getElementsByTagName("svg");if(0<Ka.length){var Ma=Ka[0],za=Ma.getAttribute("width"),Wa=Ma.getAttribute("height");za=null!=za&&"%"!=-za.charAt(za.length-1)?parseFloat(za):NaN;Wa=null!=Wa&&"%"!=Wa.charAt(Wa.length-1)?parseFloat(Wa):NaN;var Ia=Ma.getAttribute("viewBox");if(null==Ia||0==Ia.length)Ma.setAttribute("viewBox","0 0 "+za+" "+Wa);else if(isNaN(za)||isNaN(Wa)){var Xa=Ia.split(" ");3<Xa.length&&(za=parseFloat(Xa[2]),Wa=parseFloat(Xa[3]))}ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var Pa=Math.min(1,Math.min(B/Math.max(1,za)),B/Math.max(1,Wa)),u=z(ra,ja.type,f+ba*t,k+ba*t,Math.max(1,Math.round(za*Pa)),Math.max(1,Math.round(Wa*-Pa)),ja.name);if(null!=u&&(isNaN(za)||isNaN(Wa))){var N=new Image;N.onload=mxUtils.bind(this,function(){za=Math.max(1,N.width);Wa=Math.max(1,N.height);u[0].geometry.width=za;u[0].geometry.height=Wa;Ma.setAttribute("viewBox","0 0 "+za+" "+Wa);ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var R=ra.indexOf(";");0<R&&(ra=ra.substring(0,R)+ra.substring(ra.indexOf(",",R+1)));l.setCellStyles("image",ra,[u[0]])});N.src=Editor.createSvgDataUri(mxUtils.getXml(Ma))}return u}}}catch(R){}return null})):W(ba,-mxUtils.bind(this,function(){return z(sa,"text/xml",f+ba*t,k+ba*t,0,0,ja.name)}))}else W(ba,mxUtils.bind(this,function(){return null}))}else{xa=!1;if("image/png"==ja.type){var Aa=fa?null:this.extractGraphModelFromPng(qa.target.result);if(null!=Aa&&0<Aa.length){var Ea=new Image;Ea.src=qa.target.result;W(ba,mxUtils.bind(this,function(){return z(Aa,"text/xml",f+ba*t,k+ba*t,Ea.width,Ea.height,ja.name)}));xa=!0}}xa||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),-mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(qa.target.result,mxUtils.bind(this,function(Ka){this.resizeImage(Ka,qa.target.result,mxUtils.bind(this,function(Ma,za,Wa){W(ba,mxUtils.bind(this,function(){if(null!=Ma&&Ma.length<O){var Ia=ma&&this.isResampleImageSize(ja.size,ea)?Math.min(1,Math.min(B/za,B/Wa)):1;return z(Ma,ja.type,f+ba*t,k+ba*t,Math.round(za*Ia),Math.round(Wa*Ia),-ja.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ma,B,ea,ja.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ra=qa.target.result,z(ra,ja.type,f+ba*t,k+ba*t,240,160,ja.name,function(Ka){W(ba,function(){return Ka})},ja)}catch(Ka){W(ba,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ka,ja)}else W(ba,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(ja.name)?-z(null,ja.type,f+ba*t,k+ba*t,240,160,ja.name,function(qa){W(ba,function(){return qa})},ja):"image"==ja.type.substring(0,5)||"application/pdf"==ja.type?oa.readAsDataURL(ja):oa.readAsText(ja)}})(Y)});if(la){la=[];for(da=0;da<c.length;da++)la.push(c[da]);c=la;this.confirmImageResize(function(l){ma=l;aa()},M)}else aa()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=-function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},B=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,z=function(C,H){if(C||f)mxSettings.setResizeImages(C?H:null),mxSettings.save();k();c(H)};null==B||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(C){z(C,!0)},function(C){z(C,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage++!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(I,L){StorageFile.listFiles(this,"F",I,L)});window.openBrowserFile=mxUtils.bind(this,function(I,L,J){StorageFile.getFileContent(this,I,L,J)});window.deleteBrowserFile=mxUtils.bind(this,function(I,L,J){StorageFile.deleteFile(this,I,L,J)});if(!f){var B=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(I){this.hideDialog(I)}));window.openFile.setConsumer(mxUtils.bind(this,+function(I,L){null!=L&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(L)?(I=new Blob([I],{type:"application/octet-stream"}),this.importVisio(I,mxUtils.bind(this,function(J){this.importXml(J,0,0,!0)}),null,L)):this.editor.graph.setSelectionCells(this.importXml(I,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var z=this.dialog,C=z.close;this.dialog.close=mxUtils.bind(this,function(I){Editor.useLocalStorage=+B;C.apply(z,arguments);I&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var B=this,z=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(C){if(mxUtils.isEmptyObject(C.files))k();else{var I=0,L,J=!1;C.forEach(function(O,da){O=da.name.toLowerCase();"diagram/diagram.xml"==O?(J=!0,da.async("string").then(function(fa){0==fa.indexOf("<mxfile ")?f(fa):k()})):0==O.indexOf("versions/")&&+(O=parseInt(O.substr(9)),O>I&&(I=O,L=da))});0<I?L.async("string").then(function(O){(new XMLHttpRequest).upload&&B.isRemoteFileFormat(O,c.name)?B.isOffline()?B.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):B.parseFileData(O,mxUtils.bind(this,function(da){4==da.readyState&&(200<=da.status&&299>=da.status?f(da.responseText):k())}),c.name):k()}):J||k()}},function(C){k(C)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?z():(this.loadingExtensions=+!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",z,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,B,z,C,I,L,J,O,da,fa){O=null!=O?O:!0;var V=!1,ba=null,ma=mxUtils.bind(this,function(la){var Z=null;null!=la&&"<mxlibrary"==la.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,la,I)),this.showSidebar()):Z=this.importXml(la,k,B,O,null,null!=fa?mxEvent.isControlDown(fa):null);null!=L&&L(Z)});"image"==f.substring(0,5)?(J=!1,"image/png"==f.substring(0,9)&&(f=da?null:this.extractGraphModelFromPng(c),+null!=f&&0<f.length&&(ba=this.importXml(f,k,B,O,null,null!=fa?mxEvent.isControlDown(fa):null),J=!0)),J||(f=this.editor.graph,J=c.indexOf(";"),0<J&&(c=c.substring(0,J)+c.substring(c.indexOf(",",J+1))),O&&f.isGridEnabled()&&(k=f.snap(k),B=f.snap(B)),ba=[f.insertVertex(null,null,"",k,B,z,C,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";")])):/(\.*<graphml )/.test(c)?(V=!0,this.importGraphML(c,ma)):null!=J&&null!=I&&EditorUi.isVisioFilename(I)?+(V=!0,this.importVisio(J,ma)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,I)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(V=!0,z=mxUtils.bind(this,function(la){4==la.readyState&&(200<=la.status&&299>=la.status?ma(la.responseText):null!=L&&(L(null),this.showError(mxResources.get("error"),413==la.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,z,I):this.parseFile(J,z,I)):0==c.indexOf("PK")&&+null!=J?(V=!0,this.importZipFile(J,ma,mxUtils.bind(this,function(){ba=this.insertTextAt(this.validateFileData(c),k,B,!0,null,O);L(ba)}))):/(\.v(sd|dx))($|\?)/i.test(I)||/(\.vs(s|x))($|\?)/i.test(I)||(ba=this.insertTextAt(this.validateFileData(c),k,B,!0,null,O,null,null!=fa?mxEvent.isControlDown(fa):null));V||null==L||L(ba);return ba};EditorUi.prototype.importFiles=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){B=null!=B?B:this.maxImageSize;O=null!=O?O:this.maxImageBytes;var ba=null!=f&&null!=k,ma=!0;f=null!=+f?f:0;k=null!=k?k:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var Z=da||this.resampleThreshold,ea=0;ea<c.length;ea++)if("image/svg"!==c[ea].type.substring(0,9)&&"image/"===c[ea].type.substring(0,6)&&c[ea].size>Z){la=!0;break}var aa=mxUtils.bind(this,function(){var l=this.editor.graph,t=l.gridSize;z=null!=z?z:mxUtils.bind(this,function(ca,ja,oa,qa,ra,xa,Ba,ya,Da){try{if(null!=ca&&"<mxlibrary"==ca.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ca,Ba)),this.showSidebar(),+null;this.isCompatibleString(ca)&&1==c.length&&null!=V&&"drop"==V.type&&this.isBlankFile()&&!this.canUndo()&&(ba=!1,qa=oa=0);return this.importFile(ca,ja,oa,qa,ra,xa,Ba,ya,Da,ba,fa,V)}catch(La){return this.handleError(La),null}});C=null!=C?C:mxUtils.bind(this,function(ca){l.setSelectionCells(ca)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var H=c.length,U=H,K=[],W=mxUtils.bind(this,function(ca,ja){K[ca]=ja;if(0==--U){this.spinner.stop();if(null!=L)L(K);else{var oa=[];l.getModel().beginUpdate();+try{for(ca=0;ca<K.length;ca++){var qa=K[ca]();null!=qa&&(oa=oa.concat(qa))}}finally{l.getModel().endUpdate()}}C(oa)}}),Y=0;Y<H;Y++)mxUtils.bind(this,function(ca){var ja=c[ca];if(null!=ja){var oa=new FileReader;oa.onload=mxUtils.bind(this,function(qa){if(null==I||I(ja))try{if("image/"==ja.type.substring(0,6))if("image/svg"==ja.type.substring(0,9)){var ra=Graph.clipSvgDataUri(qa.target.result),xa=ra.indexOf(","),Ba=decodeURIComponent(escape(atob(ra.substring(xa+1)))),ya=mxUtils.parseXml(Ba),Da=ya.getElementsByTagName("svg");+if(0<Da.length){var La=Da[0],sa=fa?null:La.getAttribute("content");null!=sa&&"<"!=sa.charAt(0)&&"%"!=sa.charAt(0)&&(sa=unescape(window.atob?atob(sa):Base64.decode(sa,!0)));null!=sa&&"%"==sa.charAt(0)&&(sa=decodeURIComponent(sa));null==sa||"<mxfile "!==sa.substring(0,8)&&"<mxGraphModel "!==sa.substring(0,14)?W(ca,mxUtils.bind(this,function(){try{if(null!=ya){var Ka=ya.getElementsByTagName("svg");if(0<Ka.length){var Ma=Ka[0],za=Ma.getAttribute("width"),Wa=Ma.getAttribute("height");za=null!=za&&"%"!=+za.charAt(za.length-1)?parseFloat(za):NaN;Wa=null!=Wa&&"%"!=Wa.charAt(Wa.length-1)?parseFloat(Wa):NaN;var Ia=Ma.getAttribute("viewBox");if(null==Ia||0==Ia.length)Ma.setAttribute("viewBox","0 0 "+za+" "+Wa);else if(isNaN(za)||isNaN(Wa)){var Xa=Ia.split(" ");3<Xa.length&&(za=parseFloat(Xa[2]),Wa=parseFloat(Xa[3]))}ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var Pa=Math.min(1,Math.min(B/Math.max(1,za)),B/Math.max(1,Wa)),u=z(ra,ja.type,f+ca*t,k+ca*t,Math.max(1,Math.round(za*Pa)),Math.max(1,Math.round(Wa*+Pa)),ja.name);if(null!=u&&(isNaN(za)||isNaN(Wa))){var N=new Image;N.onload=mxUtils.bind(this,function(){za=Math.max(1,N.width);Wa=Math.max(1,N.height);u[0].geometry.width=za;u[0].geometry.height=Wa;Ma.setAttribute("viewBox","0 0 "+za+" "+Wa);ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var R=ra.indexOf(";");0<R&&(ra=ra.substring(0,R)+ra.substring(ra.indexOf(",",R+1)));l.setCellStyles("image",ra,[u[0]])});N.src=Editor.createSvgDataUri(mxUtils.getXml(Ma))}return u}}}catch(R){}return null})):W(ca,+mxUtils.bind(this,function(){return z(sa,"text/xml",f+ca*t,k+ca*t,0,0,ja.name)}))}else W(ca,mxUtils.bind(this,function(){return null}))}else{xa=!1;if("image/png"==ja.type){var Aa=fa?null:this.extractGraphModelFromPng(qa.target.result);if(null!=Aa&&0<Aa.length){var Ea=new Image;Ea.src=qa.target.result;W(ca,mxUtils.bind(this,function(){return z(Aa,"text/xml",f+ca*t,k+ca*t,Ea.width,Ea.height,ja.name)}));xa=!0}}xa||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),+mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(qa.target.result,mxUtils.bind(this,function(Ka){this.resizeImage(Ka,qa.target.result,mxUtils.bind(this,function(Ma,za,Wa){W(ca,mxUtils.bind(this,function(){if(null!=Ma&&Ma.length<O){var Ia=ma&&this.isResampleImageSize(ja.size,da)?Math.min(1,Math.min(B/za,B/Wa)):1;return z(Ma,ja.type,f+ca*t,k+ca*t,Math.round(za*Ia),Math.round(Wa*Ia),+ja.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ma,B,da,ja.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ra=qa.target.result,z(ra,ja.type,f+ca*t,k+ca*t,240,160,ja.name,function(Ka){W(ca,function(){return Ka})},ja)}catch(Ka){W(ca,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ka,ja)}else W(ca,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(ja.name)?+z(null,ja.type,f+ca*t,k+ca*t,240,160,ja.name,function(qa){W(ca,function(){return qa})},ja):"image"==ja.type.substring(0,5)||"application/pdf"==ja.type?oa.readAsDataURL(ja):oa.readAsText(ja)}})(Y)});if(la){la=[];for(ea=0;ea<c.length;ea++)la.push(c[ea]);c=la;this.confirmImageResize(function(l){ma=l;aa()},J)}else aa()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=+function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},B=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,z=function(C,I){if(C||f)mxSettings.setResizeImages(C?I:null),mxSettings.save();k();c(I)};null==B||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(C){z(C,!0)},function(C){z(C,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):z(!1,B)};EditorUi.prototype.parseFile=function(c,f,k){k=null!=k?k:c.name;var B=new FileReader;B.onload=mxUtils.bind(this,function(){this.parseFileData(B.result,f,k)});B.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,k){var B=new XMLHttpRequest;B.open("POST",OPEN_URL);B.setRequestHeader("Content-Type","application/x-www-form-urlencoded");-B.onreadystatechange=function(){f(B)};B.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(z){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,B,z,C,H){z=null!=z?z:this.maxImageSize;var K=Math.max(1,c.width),M=Math.max(1,c.height),O=f;if(B&&this.isResampleImageSize(null!=H?H:f.length,-C))try{var ea=Math.max(K/z,M/z);if(1<ea){var fa=Math.round(K/ea),S=Math.round(M/ea),ca=document.createElement("canvas");ca.width=fa;ca.height=S;ca.getContext("2d").drawImage(c,0,0,fa,S);var ma=ca.toDataURL();if(ma.length<f.length){var la=document.createElement("canvas");la.width=fa;la.height=S;var Z=la.toDataURL();ma!==Z&&(f=ma,K=fa,M=S)}}}catch(da){}B&&O!=f&&z>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,B,z/1.5,C,H):k(f,K,M)};EditorUi.prototype.extractGraphModelFromPng=+B.onreadystatechange=function(){f(B)};B.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(z){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,B,z,C,I){z=null!=z?z:this.maxImageSize;var L=Math.max(1,c.width),J=Math.max(1,c.height),O=f;if(B&&this.isResampleImageSize(null!=I?I:f.length,+C))try{var da=Math.max(L/z,J/z);if(1<da){var fa=Math.round(L/da),V=Math.round(J/da),ba=document.createElement("canvas");ba.width=fa;ba.height=V;ba.getContext("2d").drawImage(c,0,0,fa,V);var ma=ba.toDataURL();if(ma.length<f.length){var la=document.createElement("canvas");la.width=fa;la.height=V;var Z=la.toDataURL();ma!==Z&&(f=ma,L=fa,J=V)}}}catch(ea){}B&&O!=f&&z>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,B,z/1.5,C,I):k(f,L,J)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var B=new Image;B.onload=function(){B.width=0<B.width?B.width:120;B.height=0<B.height?B.height:120;f(B)};null!=k&&(B.onerror=k);B.src=c}catch(z){if(null!=k)k(z);else throw z;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var v=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());v.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var p=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();-var c=this,f=this.editor.graph,k=f.isEnabled;f.isEnabled=function(){return k.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(t){var I=t.getEvent();return null==t.getState()&&!mxEvent.isMouseEvent(I)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(I)&&(null==t.getState()||mxEvent.isControlDown(I)||mxEvent.isShiftDown(I))});f.cellEditor.editPlantUmlData=function(t,I,V){var J=JSON.parse(V);I=new TextareaDialog(c,mxResources.get("plantUml")+":",J.data,-function(W){null!=W&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(W,J.format,function(Y,ba,ja){c.spinner.stop();f.getModel().beginUpdate();try{if("txt"==J.format)f.labelChanged(t,"<pre>"+Y+"</pre>"),f.updateCellSize(t,!0);else{f.setCellStyles("image",c.convertDataUri(Y),[t]);var oa=f.model.getGeometry(t);null!=oa&&(oa=oa.clone(),oa.width=ba,oa.height=ja,f.cellsResized([t],[oa],!1))}f.setAttributeForCell(t,"plantUmlData",JSON.stringify({data:W,format:J.format}))}finally{f.getModel().endUpdate()}},-function(Y){c.handleError(Y)})},null,null,400,220);c.showDialog(I.container,420,300,!0,!0);I.init()};f.cellEditor.editMermaidData=function(t,I,V){var J=JSON.parse(V);I=new TextareaDialog(c,mxResources.get("mermaid")+":",J.data,function(W){null!=W&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(W,J.config,function(Y,ba,ja){c.spinner.stop();f.getModel().beginUpdate();try{f.setCellStyles("image",Y,[t]);var oa=f.model.getGeometry(t);null!=oa&&(oa=oa.clone(),oa.width=-Math.max(oa.width,ba),oa.height=Math.max(oa.height,ja),f.cellsResized([t],[oa],!1));f.setAttributeForCell(t,"mermaidData",JSON.stringify({data:W,config:J.config},null,2))}finally{f.getModel().endUpdate()}},function(Y){c.handleError(Y)})},null,null,400,220);c.showDialog(I.container,420,300,!0,!0);I.init()};var B=f.cellEditor.startEditing;f.cellEditor.startEditing=function(t,I){try{var V=this.graph.getAttributeForCell(t,"plantUmlData");if(null!=V)this.editPlantUmlData(t,I,V);else if(V=this.graph.getAttributeForCell(t,-"mermaidData"),null!=V&&window.isMermaidEnabled)this.editMermaidData(t,I,V);else{var J=f.getCellStyle(t);"1"==mxUtils.getValue(J,"metaEdit","0")?c.showDataDialog(t):B.apply(this,arguments)}}catch(W){c.handleError(W)}};f.getLinkTitle=function(t){return c.getLinkTitle(t)};f.customLinkClicked=function(t,I){var V=!1;try{var J=this.getGraphBounds();c.handleCustomLink(t,I);V=!0;c.chromelessResize&&!J.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(I))}catch(W){c.handleError(W)}return V};-var z=f.parseBackgroundImage;f.parseBackgroundImage=function(t){var I=z.apply(this,arguments);null!=I&&null!=I.src&&Graph.isPageLink(I.src)&&(I={originalSrc:I.src});return I};var C=f.setBackgroundImage;f.setBackgroundImage=function(t){null!=t&&null!=t.originalSrc&&(t=c.createImageForPageLink(t.originalSrc,c.currentPage,this));C.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,-function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(t,I){t=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=t){var V=t.indexOf(",");if(0<V)for(t=t.substring(V+1),I=I.getProperty("patches"),V=0;V<I.length;V++)if(null!=I[V][EditorUi.DIFF_UPDATE]&&null!=I[V][EditorUi.DIFF_UPDATE][t]||null!=I[V][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(I[V][EditorUi.DIFF_REMOVE],t)){f.refreshBackgroundImage();break}}}));var H=f.getBackgroundImageObject;-f.getBackgroundImageObject=function(t,I){var V=H.apply(this,arguments);null!=V&&null!=V.originalSrc&&(V=I?c.createImageForPageLink(V.originalSrc,null,null,!0):{src:V.originalSrc});return V};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";-var K=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(t){t=null!=t?t:"";"1"==urlParams.dev&&(t+=(0<t.length?"&":"?")+"dev=1");return K.apply(this,arguments)};var M=f.addClickHandler;f.addClickHandler=function(t,I,V){var J=I;I=function(W,Y,ba){if(null==Y){var ja=mxEvent.getSource(W);"a"==ja.nodeName.toLowerCase()&&(Y=ja.getAttribute("href"))}null!=Y&&f.isCustomLink(Y)&&(mxEvent.isTouchEvent(W)||!mxEvent.isPopupTrigger(W))&&f.customLinkClicked(Y,ba)&&mxEvent.consume(W);null!=J&&J(W,Y,-ba)};M.call(this,t,I,V)};p.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var O=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(t,I,V){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(t,["zoomIn","zoomOut","-"],null,V);O.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(t,["-","addToScratchpad"],null,V);f.isSelectionEmpty()&&-"simple"==Editor.currentTheme&&this.addMenuItems(t,["-","exitGroup","home"],null,V)};var ea=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(t,I,V){if(c.editor.graph.isSelectionEmpty())ea.apply(this,arguments),c.menus.addMenuItems(t,["copyAsImage"],null,V);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(t,I,V):this.addPopupMenuArrangeItems(t,I,V),this.addMenuItems(t,"- cut copy copyAsImage duplicate -".split(" "),null,V),this.isShowCellEditItems()||this.addPopupDeleteItem(t,-I,V),this.addMenuItems(t,["lockUnlock","-"],null,V),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(I)&&f.isCellEditable(I)&&(this.addSubmenu("editCell",t,null,mxResources.get("edit")),t.addSeparator(),f.getModel().isEdge(I))){this.addSubmenu("line",t);var J=f.getModel().getGeometry(I);null!=J&&null!=J.points&&0<J.points.length&&this.addMenuItems(t,["clearWaypoints"],null,V)}1==f.getSelectionCount()&&this.addMenuItems(t,["enterGroup"],null,V);J=c.getSelectionState();null!=J.mergeCell?-this.addMenuItem(t,"mergeCells"):(1<J.style.colspan||1<J.style.rowspan)&&this.addMenuItem(t,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.defaultFilename=mxResources.get("untitledDiagram");var fa=-f.getExportVariables;f.getExportVariables=function(){var t=fa.apply(this,arguments),I=c.getCurrentFile();null!=I&&(t.filename=I.getTitle());t.pagecount=null!=c.pages?c.pages.length:1;t.page=null!=c.currentPage?c.currentPage.getName():"";t.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return t};var S=f.getGlobalVariable;f.getGlobalVariable=function(t){var I=c.getCurrentFile();return"filename"==t&&null!=I?I.getTitle():"page"==t&&null!=c.currentPage?c.currentPage.getName():-"pagenumber"==t?null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==t?null!=c.pages?c.pages.length:1:S.apply(this,arguments)};var ca=null,ma=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var t=this.getCurrentFile(),I=null!=t&&null!=t.getTitle()?t.getTitle():this.defaultFilename;ca!=I&&t==ma&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());ca=I;ma=t}));var la=f.labelLinkClicked;f.labelLinkClicked=function(t,-I,V){var J=I.getAttribute("href");if(null==J||!f.isCustomLink(J)||!mxEvent.isTouchEvent(V)&&mxEvent.isPopupTrigger(V))la.apply(this,arguments);else{if(!f.isEnabled()||null!=t&&f.isCellLocked(t.cell))f.customLinkClicked(J),f.getRubberband().reset();mxEvent.consume(V)}};this.editor.getOrCreateFilename=function(){var t=c.defaultFilename,I=c.getCurrentFile();null!=I&&(t=null!=I.getTitle()?I.getTitle():t);return t};var Z=this.actions.get("print");Z.setEnabled(!mxClient.IS_IOS||!navigator.standalone);Z.visible=+var c=this,f=this.editor.graph,k=f.isEnabled;f.isEnabled=function(){return k.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(t){var H=t.getEvent();return null==t.getState()&&!mxEvent.isMouseEvent(H)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(H)&&(null==t.getState()||mxEvent.isControlDown(H)||mxEvent.isShiftDown(H))});f.cellEditor.editPlantUmlData=function(t,H,U){var K=JSON.parse(U);H=new TextareaDialog(c,mxResources.get("plantUml")+":",K.data,+function(W){null!=W&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(W,K.format,function(Y,ca,ja){c.spinner.stop();f.getModel().beginUpdate();try{if("txt"==K.format)f.labelChanged(t,"<pre>"+Y+"</pre>"),f.updateCellSize(t,!0);else{f.setCellStyles("image",c.convertDataUri(Y),[t]);var oa=f.model.getGeometry(t);null!=oa&&(oa=oa.clone(),oa.width=ca,oa.height=ja,f.cellsResized([t],[oa],!1))}f.setAttributeForCell(t,"plantUmlData",JSON.stringify({data:W,format:K.format}))}finally{f.getModel().endUpdate()}},+function(Y){c.handleError(Y)})},null,null,400,220);c.showDialog(H.container,420,300,!0,!0);H.init()};f.cellEditor.editMermaidData=function(t,H,U){var K=JSON.parse(U);H=new TextareaDialog(c,mxResources.get("mermaid")+":",K.data,function(W){null!=W&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(W,K.config,function(Y,ca,ja){c.spinner.stop();f.getModel().beginUpdate();try{f.setCellStyles("image",Y,[t]);var oa=f.model.getGeometry(t);null!=oa&&(oa=oa.clone(),oa.width=+Math.max(oa.width,ca),oa.height=Math.max(oa.height,ja),f.cellsResized([t],[oa],!1));f.setAttributeForCell(t,"mermaidData",JSON.stringify({data:W,config:K.config},null,2))}finally{f.getModel().endUpdate()}},function(Y){c.handleError(Y)})},null,null,400,220);c.showDialog(H.container,420,300,!0,!0);H.init()};var B=f.cellEditor.startEditing;f.cellEditor.startEditing=function(t,H){try{var U=this.graph.getAttributeForCell(t,"plantUmlData");if(null!=U)this.editPlantUmlData(t,H,U);else if(U=this.graph.getAttributeForCell(t,+"mermaidData"),null!=U&&window.isMermaidEnabled)this.editMermaidData(t,H,U);else{var K=f.getCellStyle(t);"1"==mxUtils.getValue(K,"metaEdit","0")?c.showDataDialog(t):B.apply(this,arguments)}}catch(W){c.handleError(W)}};f.getLinkTitle=function(t){return c.getLinkTitle(t)};f.customLinkClicked=function(t,H){var U=!1;try{var K=this.getGraphBounds();c.handleCustomLink(t,H);U=!0;c.chromelessResize&&!K.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(H))}catch(W){c.handleError(W)}return U};+var z=f.parseBackgroundImage;f.parseBackgroundImage=function(t){var H=z.apply(this,arguments);null!=H&&null!=H.src&&Graph.isPageLink(H.src)&&(H={originalSrc:H.src});return H};var C=f.setBackgroundImage;f.setBackgroundImage=function(t){null!=t&&null!=t.originalSrc&&(t=c.createImageForPageLink(t.originalSrc,c.currentPage,this));C.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,+function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(t,H){t=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=t){var U=t.indexOf(",");if(0<U)for(t=t.substring(U+1),H=H.getProperty("patches"),U=0;U<H.length;U++)if(null!=H[U][EditorUi.DIFF_UPDATE]&&null!=H[U][EditorUi.DIFF_UPDATE][t]||null!=H[U][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(H[U][EditorUi.DIFF_REMOVE],t)){f.refreshBackgroundImage();break}}}));var I=f.getBackgroundImageObject;+f.getBackgroundImageObject=function(t,H){var U=I.apply(this,arguments);null!=U&&null!=U.originalSrc&&(U=H?c.createImageForPageLink(U.originalSrc,null,null,!0):{src:U.originalSrc});return U};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";+var L=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(t){t=null!=t?t:"";"1"==urlParams.dev&&(t+=(0<t.length?"&":"?")+"dev=1");return L.apply(this,arguments)};var J=f.addClickHandler;f.addClickHandler=function(t,H,U){var K=H;H=function(W,Y,ca){if(null==Y){var ja=mxEvent.getSource(W);"a"==ja.nodeName.toLowerCase()&&(Y=ja.getAttribute("href"))}null!=Y&&f.isCustomLink(Y)&&(mxEvent.isTouchEvent(W)||!mxEvent.isPopupTrigger(W))&&f.customLinkClicked(Y,ca)&&mxEvent.consume(W);null!=K&&K(W,Y,+ca)};J.call(this,t,H,U)};p.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var O=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(t,H,U){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(t,["zoomIn","zoomOut","-"],null,U);O.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(t,["-","addToScratchpad"],null,U);f.isSelectionEmpty()&&+"simple"==Editor.currentTheme&&this.addMenuItems(t,["-","exitGroup","home"],null,U)};var da=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(t,H,U){if(c.editor.graph.isSelectionEmpty())da.apply(this,arguments),c.menus.addMenuItems(t,["copyAsImage"],null,U);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(t,H,U):this.addPopupMenuArrangeItems(t,H,U),this.addMenuItems(t,"- cut copy copyAsImage duplicate -".split(" "),null,U),this.isShowCellEditItems()||this.addPopupDeleteItem(t,+H,U),this.addMenuItems(t,["lockUnlock","-"],null,U),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(H)&&f.isCellEditable(H)&&(this.addSubmenu("editCell",t,null,mxResources.get("edit")),t.addSeparator(),f.getModel().isEdge(H))){this.addSubmenu("line",t);var K=f.getModel().getGeometry(H);null!=K&&null!=K.points&&0<K.points.length&&this.addMenuItems(t,["clearWaypoints"],null,U)}1==f.getSelectionCount()&&this.addMenuItems(t,["enterGroup"],null,U);K=c.getSelectionState();null!=K.mergeCell?+this.addMenuItem(t,"mergeCells"):(1<K.style.colspan||1<K.style.rowspan)&&this.addMenuItem(t,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.defaultFilename=mxResources.get("untitledDiagram");var fa=+f.getExportVariables;f.getExportVariables=function(){var t=fa.apply(this,arguments),H=c.getCurrentFile();null!=H&&(t.filename=H.getTitle());t.pagecount=null!=c.pages?c.pages.length:1;t.page=null!=c.currentPage?c.currentPage.getName():"";t.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return t};var V=f.getGlobalVariable;f.getGlobalVariable=function(t){var H=c.getCurrentFile();return"filename"==t&&null!=H?H.getTitle():"page"==t&&null!=c.currentPage?c.currentPage.getName():+"pagenumber"==t?null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==t?null!=c.pages?c.pages.length:1:V.apply(this,arguments)};var ba=null,ma=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var t=this.getCurrentFile(),H=null!=t&&null!=t.getTitle()?t.getTitle():this.defaultFilename;ba!=H&&t==ma&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());ba=H;ma=t}));var la=f.labelLinkClicked;f.labelLinkClicked=function(t,+H,U){var K=H.getAttribute("href");if(null==K||!f.isCustomLink(K)||!mxEvent.isTouchEvent(U)&&mxEvent.isPopupTrigger(U))la.apply(this,arguments);else{if(!f.isEnabled()||null!=t&&f.isCellLocked(t.cell))f.customLinkClicked(K),f.getRubberband().reset();mxEvent.consume(U)}};this.editor.getOrCreateFilename=function(){var t=c.defaultFilename,H=c.getCurrentFile();null!=H&&(t=null!=H.getTitle()?H.getTitle():t);return t};var Z=this.actions.get("print");Z.setEnabled(!mxClient.IS_IOS||!navigator.standalone);Z.visible=Z.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,-!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&f.addListener(mxEvent.ESCAPE,function(t,I){null!=I&&f.isEnabled()&&!f.isEditing()&&null!=I.getProperty("event")&&c.actions.get("exit").funct()}),this.installImagePasteHandler(),this.installNativeClipboardHandler();-this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateUserElement()}));this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(t){var I=f.cellEditor.text2,V=null;null!=I&&(mxEvent.addListener(I,"dragleave",function(J){null!=V&&(V.parentNode.removeChild(V),V=null);J.stopPropagation();J.preventDefault()}),mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(J){null==V&&(!mxClient.IS_IE||10<document.documentMode)&&-(V=this.highlightElement(I));J.stopPropagation();J.preventDefault()})),mxEvent.addListener(I,"drop",mxUtils.bind(this,function(J){null!=V&&(V.parentNode.removeChild(V),V=null);if(0<J.dataTransfer.files.length)this.importFiles(J.dataTransfer.files,0,0,this.maxImageSize,function(Y,ba,ja,oa,qa,ra){f.insertImage(Y,qa,ra)},function(){},function(Y){return"image/"==Y.type.substring(0,6)},function(Y){for(var ba=0;ba<Y.length;ba++)Y[ba]()},mxEvent.isControlDown(J));else if(0<=mxUtils.indexOf(J.dataTransfer.types,-"text/uri-list")){var W=J.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(W)?this.loadImage(decodeURIComponent(W),mxUtils.bind(this,function(Y){var ba=Math.max(1,Y.width);Y=Math.max(1,Y.height);var ja=this.maxImageSize;ja=Math.min(1,Math.min(ja/Math.max(1,ba)),ja/Math.max(1,Y));f.insertImage(decodeURIComponent(W),ba*ja,Y*ja)})):document.execCommand("insertHTML",!1,J.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(J.dataTransfer.types,"text/html")?document.execCommand("insertHTML",-!1,J.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(J.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,J.dataTransfer.getData("text/plain"));J.stopPropagation();J.preventDefault()})))}));if(Editor.isSettingsEnabled()){Z=this.editor.graph.view;var da=mxSettings.getUnit();Z.setUnit(da);Editor.pageSizeUnit=da==mxConstants.METERS?mxConstants.MILLIMETERS:da;Z.addListener("unitChanged",function(t,I){t=I.getProperty("unit");mxSettings.setUnit(t);mxSettings.save();Editor.pageSizeUnit=+!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&f.addListener(mxEvent.ESCAPE,function(t,H){null!=H&&f.isEnabled()&&!f.isEditing()&&null!=H.getProperty("event")&&c.actions.get("exit").funct()}),this.installImagePasteHandler(),this.installNativeClipboardHandler();+this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateUserElement()}));this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(t){var H=f.cellEditor.text2,U=null;null!=H&&(mxEvent.addListener(H,"dragleave",function(K){null!=U&&(U.parentNode.removeChild(U),U=null);K.stopPropagation();K.preventDefault()}),mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(K){null==U&&(!mxClient.IS_IE||10<document.documentMode)&&+(U=this.highlightElement(H));K.stopPropagation();K.preventDefault()})),mxEvent.addListener(H,"drop",mxUtils.bind(this,function(K){null!=U&&(U.parentNode.removeChild(U),U=null);if(0<K.dataTransfer.files.length)this.importFiles(K.dataTransfer.files,0,0,this.maxImageSize,function(Y,ca,ja,oa,qa,ra){f.insertImage(Y,qa,ra)},function(){},function(Y){return"image/"==Y.type.substring(0,6)},function(Y){for(var ca=0;ca<Y.length;ca++)Y[ca]()},mxEvent.isControlDown(K));else if(0<=mxUtils.indexOf(K.dataTransfer.types,+"text/uri-list")){var W=K.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(W)?this.loadImage(decodeURIComponent(W),mxUtils.bind(this,function(Y){var ca=Math.max(1,Y.width);Y=Math.max(1,Y.height);var ja=this.maxImageSize;ja=Math.min(1,Math.min(ja/Math.max(1,ca)),ja/Math.max(1,Y));f.insertImage(decodeURIComponent(W),ca*ja,Y*ja)})):document.execCommand("insertHTML",!1,K.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(K.dataTransfer.types,"text/html")?document.execCommand("insertHTML",+!1,K.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(K.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,K.dataTransfer.getData("text/plain"));K.stopPropagation();K.preventDefault()})))}));if(Editor.isSettingsEnabled()){Z=this.editor.graph.view;var ea=mxSettings.getUnit();Z.setUnit(ea);Editor.pageSizeUnit=ea==mxConstants.METERS?mxConstants.MILLIMETERS:ea;Z.addListener("unitChanged",function(t,H){t=H.getProperty("unit");mxSettings.setUnit(t);mxSettings.save();Editor.pageSizeUnit=t==mxConstants.METERS?mxConstants.MILLIMETERS:t});this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,Z.unit);this.refresh()}if("1"==urlParams.styledev){Z=document.getElementById("geFooter");null!=Z&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",-this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),Z.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(t,I){0<this.editor.graph.getSelectionCount()?(t=this.editor.graph.getSelectionCell(),+this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),Z.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(t,H){0<this.editor.graph.getSelectionCount()?(t=this.editor.graph.getSelectionCell(),t=this.editor.graph.getModel().getStyle(t),this.styleInput.value=t||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var aa=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==this.styleInput?!0:aa.apply(this,arguments)}}Z=document.getElementById("geInfo");null!=Z&&Z.parentNode.removeChild(Z);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var l=null;mxEvent.addListener(f.container,"dragleave",-function(t){f.isEnabled()&&(null!=l&&(l.parentNode.removeChild(l),l=null),t.stopPropagation(),t.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(t){null==l&&(!mxClient.IS_IE||10<document.documentMode)&&(l=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();t.stopPropagation();t.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(t){null!=l&&(l.parentNode.removeChild(l),l=null);if(f.isEnabled()){var I=-mxUtils.convertPoint(f.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),V=t.dataTransfer.files,J=f.view.translate,W=f.view.scale,Y=I.x/W-J.x,ba=I.y/W-J.y;if(0<V.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(t)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(V,!0)):(mxEvent.isAltDown(t)&&(ba=Y=null),this.importFiles(V,Y,ba,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(t),null,null,mxEvent.isShiftDown(t),t));else{mxEvent.isAltDown(t)&&-(ba=Y=0);var ja=0<=mxUtils.indexOf(t.dataTransfer.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):null;I=this.extractGraphModelFromEvent(t,null!=this.pages);if(null!=I)f.setSelectionCells(this.importXml(I,Y,ba,!0));else if(0<=mxUtils.indexOf(t.dataTransfer.types,"text/html")){var oa=t.dataTransfer.getData("text/html");I=document.createElement("div");I.innerHTML=Graph.sanitizeHtml(oa);var qa=null;V=I.getElementsByTagName("img");null!=V&&1==V.length?(oa=V[0].getAttribute("src"),null==-oa&&(oa=V[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(oa)||(qa=!0)):(V=I.getElementsByTagName("a"),null!=V&&1==V.length?oa=V[0].getAttribute("href"):(I=I.getElementsByTagName("pre"),null!=I&&1==I.length&&(oa=mxUtils.getTextContent(I[0]))));var ra=!0,xa=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(oa,Y,ba,!0,qa,null,ra,mxEvent.isControlDown(t)))});qa&&null!=oa&&oa.length>this.resampleThreshold?this.confirmImageResize(function(Ba){ra=Ba;xa()},mxEvent.isControlDown(t)):-xa()}else null!=ja&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ja)?this.loadImage(decodeURIComponent(ja),mxUtils.bind(this,function(Ba){var ya=Math.max(1,Ba.width);Ba=Math.max(1,Ba.height);var Da=this.maxImageSize;Da=Math.min(1,Math.min(Da/Math.max(1,ya)),Da/Math.max(1,Ba));f.setSelectionCell(f.insertVertex(null,null,"",Y,ba,ya*Da,Ba*Da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ja+";"))}),mxUtils.bind(this,function(Ba){f.setSelectionCells(this.insertTextAt(ja,-Y,ba,!0))})):0<=mxUtils.indexOf(t.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(t.dataTransfer.getData("text/plain"),Y,ba,!0))}}t.stopPropagation();t.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&-f.view.validateBackground()});f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var t=parseInt(this.div.offsetLeft),I=parseInt(this.div.offsetWidth),V=c.embedViewport.x+c.embedViewport.width,J=parseInt(this.div.offsetTop),W=parseInt(this.div.offsetHeight),Y=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,-Math.min(t,V-I))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(J,Y-W))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme)Z=Editor.currentTheme,Editor.currentTheme="",this.doSetCurrentTheme(Z,mxUtils.bind(this,function(){"1"==urlParams.embedInline?+function(t){f.isEnabled()&&(null!=l&&(l.parentNode.removeChild(l),l=null),t.stopPropagation(),t.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(t){null==l&&(!mxClient.IS_IE||10<document.documentMode)&&(l=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();t.stopPropagation();t.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(t){null!=l&&(l.parentNode.removeChild(l),l=null);if(f.isEnabled()){var H=+mxUtils.convertPoint(f.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),U=t.dataTransfer.files,K=f.view.translate,W=f.view.scale,Y=H.x/W-K.x,ca=H.y/W-K.y;if(0<U.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(t)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(U,!0)):(mxEvent.isAltDown(t)&&(ca=Y=null),this.importFiles(U,Y,ca,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(t),null,null,mxEvent.isShiftDown(t),t));else{mxEvent.isAltDown(t)&&+(ca=Y=0);var ja=0<=mxUtils.indexOf(t.dataTransfer.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):null;H=this.extractGraphModelFromEvent(t,null!=this.pages);if(null!=H)f.setSelectionCells(this.importXml(H,Y,ca,!0));else if(0<=mxUtils.indexOf(t.dataTransfer.types,"text/html")){var oa=t.dataTransfer.getData("text/html");H=document.createElement("div");H.innerHTML=Graph.sanitizeHtml(oa);var qa=null;U=H.getElementsByTagName("img");null!=U&&1==U.length?(oa=U[0].getAttribute("src"),null==+oa&&(oa=U[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(oa)||(qa=!0)):(U=H.getElementsByTagName("a"),null!=U&&1==U.length?oa=U[0].getAttribute("href"):(H=H.getElementsByTagName("pre"),null!=H&&1==H.length&&(oa=mxUtils.getTextContent(H[0]))));var ra=!0,xa=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(oa,Y,ca,!0,qa,null,ra,mxEvent.isControlDown(t)))});qa&&null!=oa&&oa.length>this.resampleThreshold?this.confirmImageResize(function(Ba){ra=Ba;xa()},mxEvent.isControlDown(t)):+xa()}else null!=ja&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ja)?this.loadImage(decodeURIComponent(ja),mxUtils.bind(this,function(Ba){var ya=Math.max(1,Ba.width);Ba=Math.max(1,Ba.height);var Da=this.maxImageSize;Da=Math.min(1,Math.min(Da/Math.max(1,ya)),Da/Math.max(1,Ba));f.setSelectionCell(f.insertVertex(null,null,"",Y,ca,ya*Da,Ba*Da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ja+";"))}),mxUtils.bind(this,function(Ba){f.setSelectionCells(this.insertTextAt(ja,+Y,ca,!0))})):0<=mxUtils.indexOf(t.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(t.dataTransfer.getData("text/plain"),Y,ca,!0))}}t.stopPropagation();t.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&+f.view.validateBackground()});f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var t=parseInt(this.div.offsetLeft),H=parseInt(this.div.offsetWidth),U=c.embedViewport.x+c.embedViewport.width,K=parseInt(this.div.offsetTop),W=parseInt(this.div.offsetHeight),Y=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,+Math.min(t,U-H))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(K,Y-W))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme)Z=Editor.currentTheme,Editor.currentTheme="",this.doSetCurrentTheme(Z,mxUtils.bind(this,function(){"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<Editor.smallScreenWidth&&this.toggleFormatPanel(!1);this.fireEvent(new mxEventObject("themeInitialized"))}));if("atlas"!=Editor.currentTheme&&(Z=!1,null!=urlParams.dark?Z=urlParams.dark:"dark"==Editor.currentTheme?Z=!0:Editor.isSettingsEnabled()&&"1"!=urlParams.embed&&(Z=mxSettings.settings.darkMode),"auto"==Z&&this.isAutoDarkModeSupported()&&(Z=window.matchMedia("(prefers-color-scheme: dark)").matches),this.setDarkMode("string"===typeof Z?"1"==Z:Z),this.isAutoDarkModeSupported()))try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(t){this.isAutoDarkMode()&&this.setDarkMode(t.matches)}))}catch(t){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast&&this.setHighContrast(mxSettings.settings.highContrast);-this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(t,I){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts()};var A=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,+this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(t,H){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts()};var A=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));this.lastWindowWidth=c}A.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,B=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(O){mxEvent.getSource(O)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(O),mxEvent.getClientY(O)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var z=document.createElement("div");z.style.position="absolute";z.style.width="10px";z.style.height="10px";z.style.borderRadius="5px";z.style.border="1px solid gray";z.style.background="#ffffff";z.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(z);-this.bottomResizer=z;var C=null,H=null,K=null,M=null;mxEvent.addGestureListeners(z,mxUtils.bind(this,function(O){M=parseInt(this.diagramContainer.style.height);H=mxEvent.getClientY(O);B.popupMenuHandler.hideMenu();mxEvent.consume(O)}));z=z.cloneNode(!1);z.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(z);this.rightResizer=z;mxEvent.addGestureListeners(z,mxUtils.bind(this,function(O){K=parseInt(this.diagramContainer.style.width);C=mxEvent.getClientX(O);B.popupMenuHandler.hideMenu();-mxEvent.consume(O)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(O){var ea=!1;null!=C&&(this.diagramContainer.style.width=Math.max(20,K+mxEvent.getClientX(O)-C)+"px",ea=!0);null!=H&&(this.diagramContainer.style.height=Math.max(20,M+mxEvent.getClientY(O)-H)+"px",ea=!0);ea&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),-function(O){null==C&&null==H||mxEvent.consume(O);H=C=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(O){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",+this.bottomResizer=z;var C=null,I=null,L=null,J=null;mxEvent.addGestureListeners(z,mxUtils.bind(this,function(O){J=parseInt(this.diagramContainer.style.height);I=mxEvent.getClientY(O);B.popupMenuHandler.hideMenu();mxEvent.consume(O)}));z=z.cloneNode(!1);z.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(z);this.rightResizer=z;mxEvent.addGestureListeners(z,mxUtils.bind(this,function(O){L=parseInt(this.diagramContainer.style.width);C=mxEvent.getClientX(O);B.popupMenuHandler.hideMenu();+mxEvent.consume(O)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(O){var da=!1;null!=C&&(this.diagramContainer.style.width=Math.max(20,L+mxEvent.getClientX(O)-C)+"px",da=!0);null!=I&&(this.diagramContainer.style.height=Math.max(20,J+mxEvent.getClientY(O)-I)+"px",da=!0);da&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),+function(O){null==C&&null==I||mxEvent.consume(O);I=C=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(O){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(O){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var c=this.editor.graph;c.container.addEventListener("paste",-mxUtils.bind(this,function(f){if(!mxEvent.isConsumed(f))try{for(var k=f.clipboardData||f.originalEvent.clipboardData,B=!1,z=0;z<k.types.length;z++)if("text/"===k.types[z].substring(0,5)){B=!0;break}if(!B){var C=k.items;for(index in C){var H=C[index];if("file"===H.kind){if(c.isEditing())this.importFiles([H.getAsFile()],0,0,this.maxImageSize,function(M,O,ea,fa,S,ca){c.insertImage(M,S,ca)},function(){},function(M){return"image/"==M.type.substring(0,6)},function(M){for(var O=0;O<M.length;O++)M[O]()});-else{var K=this.editor.graph.getInsertPoint();this.importFiles([H.getAsFile()],K.x,K.y,this.maxImageSize);mxEvent.consume(f)}break}}}}catch(M){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck",+mxUtils.bind(this,function(f){if(!mxEvent.isConsumed(f))try{for(var k=f.clipboardData||f.originalEvent.clipboardData,B=!1,z=0;z<k.types.length;z++)if("text/"===k.types[z].substring(0,5)){B=!0;break}if(!B){var C=k.items;for(index in C){var I=C[index];if("file"===I.kind){if(c.isEditing())this.importFiles([I.getAsFile()],0,0,this.maxImageSize,function(J,O,da,fa,V,ba){c.insertImage(J,V,ba)},function(){},function(J){return"image/"==J.type.substring(0,6)},function(J){for(var O=0;O<J.length;O++)J[O]()});+else{var L=this.editor.graph.getInsertPoint();this.importFiles([I.getAsFile()],L.x,L.y,this.maxImageSize);mxEvent.consume(f)}break}}}}catch(J){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";var B=!1;this.keyHandler.bindControlKey(88,-null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(C){var H=mxEvent.getSource(C);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==H.nodeName||"TEXTAREA"==H.nodeName||"true"==H.contentEditable||224!=C.keyCode&&(mxClient.IS_MAC||17!=C.keyCode)&&(!mxClient.IS_MAC||91!=C.keyCode&&93!=C.keyCode)||B||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+-10+"px",C=f.container.scrollLeft,H=f.container.scrollTop,f.container.appendChild(k),B=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=C,f.container.scrollTop=H)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(C){var H=C.keyCode;window.setTimeout(mxUtils.bind(this,function(){!B||224!=H&&17!=H&&91!=H&&93!=H||(B=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),-0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(H){this.handleError(H)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(H){this.handleError(H)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(C){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=C.clipboardData&&(Graph.removePasteFormatting(k.firstChild),-this.pasteCells(C,k,!0,!0)),!mxEvent.isConsumed(C)){var H=f.container.scrollLeft,K=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=H,f.container.scrollTop=K,Graph.removePasteFormatting(k.firstChild),this.pasteCells(C,k,!1,!0)}catch(M){this.handleError(M)}}),0)}}catch(M){this.handleError(M)}}),!0);var z=this.isSelectionAllowed;this.isSelectionAllowed=function(C){return mxEvent.getSource(C)==k?!0:z.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=-function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){function k(K){return"simple"==K||"sketch"==K}var B=Editor.currentTheme,z=k(B)&&this.isDefaultTheme(c)||this.isDefaultTheme(B)&&k(c),C=z&&"sketch"!=c&&"sketch"!=B;if(z&&!this.themeSwitching){var H=this.saveScrollState();+null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(C){var I=mxEvent.getSource(C);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==I.nodeName||"TEXTAREA"==I.nodeName||"true"==I.contentEditable||224!=C.keyCode&&(mxClient.IS_MAC||17!=C.keyCode)&&(!mxClient.IS_MAC||91!=C.keyCode&&93!=C.keyCode)||B||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop++10+"px",C=f.container.scrollLeft,I=f.container.scrollTop,f.container.appendChild(k),B=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=C,f.container.scrollTop=I)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(C){var I=C.keyCode;window.setTimeout(mxUtils.bind(this,function(){!B||224!=I&&17!=I&&91!=I&&93!=I||(B=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),+0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(C){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=C.clipboardData&&(Graph.removePasteFormatting(k.firstChild),+this.pasteCells(C,k,!0,!0)),!mxEvent.isConsumed(C)){var I=f.container.scrollLeft,L=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=I,f.container.scrollTop=L,Graph.removePasteFormatting(k.firstChild),this.pasteCells(C,k,!1,!0)}catch(J){this.handleError(J)}}),0)}}catch(J){this.handleError(J)}}),!0);var z=this.isSelectionAllowed;this.isSelectionAllowed=function(C){return mxEvent.getSource(C)==k?!0:z.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=+function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){function k(L){return"simple"==L||"sketch"==L}var B=Editor.currentTheme,z=k(B)&&this.isDefaultTheme(c)||this.isDefaultTheme(B)&&k(c),C=z&&"sketch"!=c&&"sketch"!=B;if(z&&!this.themeSwitching){var I=this.saveScrollState();this.editor.graph.stopEditing(!1);this.container.style.opacity=0;Editor.currentTheme=c;this.themeSwitching=!0;window.setTimeout(mxUtils.bind(this,function(){k(B)&&this.isDefaultTheme(c)?(this.menubarContainer.style.display="",this.toolbarContainer.style.display="block",this.tabContainer.style.display="flex",this.hsplit.style.display="block",this.menubarHeight=App.prototype.menubarHeight):this.isDefaultTheme(B)&&k(c)&&(this.menubarContainer.style.display="none",this.toolbarContainer.style.display=-"none",this.menubarHeight=0,"simple"!=c?(this.tabContainer.style.display="none",this.hsplit.style.display="none",this.hsplitPosition=0):this.tabContainer.style.display="flex");this.switchTheme(c);this.fireEvent(new mxEventObject("currentThemeChanged"));this.editor.fireEvent(new mxEventObject("statusChanged"));this.editor.graph.refresh();this.restoreScrollState(H);this.container.style.opacity="";delete this.themeSwitching;isLocalStorage&&k(c)&&this.setTabContainerVisible(null!=mxSettings.settings.pages?+"none",this.menubarHeight=0,"simple"!=c?(this.tabContainer.style.display="none",this.hsplit.style.display="none",this.hsplitPosition=0):this.tabContainer.style.display="flex");this.switchTheme(c);this.fireEvent(new mxEventObject("currentThemeChanged"));this.editor.fireEvent(new mxEventObject("statusChanged"));this.editor.graph.refresh();this.restoreScrollState(I);this.container.style.opacity="";delete this.themeSwitching;isLocalStorage&&k(c)&&this.setTabContainerVisible(null!=mxSettings.settings.pages?mxSettings.settings.pages:!0);null!=f&&f()}),0)}return C};EditorUi.prototype.saveScrollState=function(){var c=this.editor.graph.view.translate,f=this.diagramContainer.scrollLeft,k=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(f-=this.embedViewport.x,k-=this.embedViewport.y):(f+=this.embedViewport.x,k+=this.embedViewport.y));return{x:f,y:k,tx:c.x,ty:c.y}};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,k=this.editor.graph.view.translate;this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="inline-flex")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var B=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=B&&null!=B.getAttribute("class");if(!f&&null!=B){B=B.getAttribute("title");var z=this.getCurrentFile();z=null!=z?z.savingStatusKey:DrawioFile.prototype.savingStatusKey;B==mxResources.get(z)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(z))+@@ -3791,7 +3793,7 @@ var k=this.formatWindow.window.toggleMinimized,B=240;this.formatWindow.window.to"dblclick",mxUtils.bind(this,function(z){mxEvent.getSource(z)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?(c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,(1200>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)||708>c)&&this.formatWindow.window.toggleMinimized()):this.formatWindow.window.setVisible(!1)}};var G=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):G.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var f=EditorUi.prototype.hsplitPosition;0==f&&(f=this.defaultSidebarWidth);var k=this.hsplitPosition,B=mxUtils.bind(this,function(){this.hsplitPosition=z;this.refresh();this.diagramContainer.scrollLeft-=k-this.hsplitPosition}),z=c?f:0;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==z?"translateX(0)":"translateX(-100%)");0!=z&&B();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==z?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform 0.3s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,-"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==z&&B()}),300)}),10)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var T=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():T.apply(this,arguments)};var F=EditorUi.prototype.refresh;EditorUi.prototype.refresh=+"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==z&&B()}),300)}),10)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var S=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():S.apply(this,arguments)};var F=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(c){if(null!=this.sketchWrapperElt&&null!=this.sketchWrapperElt.parentNode){c=null!=c?c:!0;if("1"!=urlParams.embedInline){var f=this.container.clientWidth;this.container==document.body&&(f=document.body.clientWidth||document.documentElement.clientWidth);var k=this.getDiagramContainerOffset();var B=k.x;var z=k.y;"simple"==Editor.currentTheme&&(z+=this.sketchMainMenuElt.offsetHeight);this.diagramContainer.style.top=z+"px";this.diagramContainer.style.bottom="0";"simple"==Editor.currentTheme?(this.hsplit.style.top=this.sketchMainMenuElt.offsetHeight+"px",this.sidebarContainer.style.top=this.hsplit.style.top,this.formatContainer.style.top=this.hsplit.style.top,f=Math.max(0,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-this.formatWidth,Math.min(this.hsplitPosition,f-this.splitSize-40))),this.sidebarContainer.style.width=f+"px",this.diagramContainer.style.left=f+B+"px",this.tabContainer.style.left=f+"px",this.tabContainer.style.right=this.formatWidth+1+"px",this.sketchMainMenuElt.style.left="0px",this.sketchMainMenuElt.style.right="0px",this.hsplit.style.left=f+"px",this.diagramContainer.style.right=this.formatWidth+"px",this.formatContainer.style.width=this.formatWidth+"px",this.hsplit.style.bottom=this.tabContainer.offsetHeight+"px",this.diagramContainer.style.bottom=this.hsplit.style.bottom,this.checkTabScrollerOverflow()):(this.diagramContainer.style.left=k.x+"px",this.diagramContainer.style.right="0")}c&&this.editor.graph.sizeDidChange()}else F.apply(this,@@ -3823,109 +3825,109 @@ this.addListener("customFontsChanged",mxUtils.bind(this,function(f,k){mxSettingsthis.addListener("pageFormatChanged",mxUtils.bind(this,function(f,k){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,k){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,k){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(f,k){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(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.copyImage=function(c,f,k){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(B,z){try{this.spinner.stop();var C=this.createImageDataUri(B,f,"png"),H=parseInt(z.getAttribute("width")),K=parseInt(z.getAttribute("height"));this.writeImageToClipboard(C,H,K,mxUtils.bind(this,-function(M){this.handleError(M)}))}catch(M){this.handleError(M)}}),null,null,null,mxUtils.bind(this,function(B){this.spinner.stop();this.handleError(B)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(B){this.handleError(B)}};EditorUi.prototype.copyCells=function(c,f){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var B=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),+function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(c,f,k){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(B,z){try{this.spinner.stop();var C=this.createImageDataUri(B,f,"png"),I=parseInt(z.getAttribute("width")),L=parseInt(z.getAttribute("height"));this.writeImageToClipboard(C,I,L,mxUtils.bind(this,+function(J){this.handleError(J)}))}catch(J){this.handleError(J)}}),null,null,null,mxUtils.bind(this,function(B){this.spinner.stop();this.handleError(B)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(B){this.handleError(B)}};EditorUi.prototype.copyCells=function(c,f){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var B=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),z=mxUtils.getXml(k.encodeCells(B));mxUtils.setTextContent(c,encodeURIComponent(z));f?(k.removeCells(B,!1),k.lastPasteXml=null):(k.lastPasteXml=z,k.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeCipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};-EditorUi.prototype.pasteXml=function(c,f,k,B,z){z=null!=z?z:!0;var C=this.editor.graph,H=null;C.lastPasteXml==c?C.pasteCounter++:(C.lastPasteXml=c,C.pasteCounter=0);var K=C.pasteCounter*C.gridSize;if(k||this.isCompatibleString(c))H=this.importXml(c,K,K),C.setSelectionCells(H);else if(f&&1==C.getSelectionCount()){z=C.getStartEditingCell(C.getSelectionCell(),B);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==C.getCurrentCellStyle(z)[mxConstants.STYLE_SHAPE])C.setCellStyles(mxConstants.STYLE_IMAGE,-c,[z]);else{C.model.beginUpdate();try{C.labelChanged(z,c),Graph.isLink(c)&&C.setLinkForCell(z,c)}finally{C.model.endUpdate()}}C.setSelectionCell(z)}else H=C.getInsertPoint(),C.isMouseInsertPoint()&&(K=0,C.lastPasteXml==c&&0<C.pasteCounter&&C.pasteCounter--),H=this.insertTextAt(c,H.x+K,H.y+K,z),C.setSelectionCells(H);C.isSelectionEmpty()||(C.scrollCellToVisible(C.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(C.view.getState(C.getSelectionCell())));return H};EditorUi.prototype.pasteCells=-function(c,f,k,B){if(!mxEvent.isConsumed(c)){var z=f,C=!1;if(k&&null!=c.clipboardData&&c.clipboardData.getData){var H=c.clipboardData.getData("text/plain"),K=!1;if(null!=H&&0<H.length&&"%3CmxGraphModel%3E"==H.substring(0,18))try{var M=decodeURIComponent(H);this.isCompatibleString(M)&&(K=!0,H=M)}catch(ma){}K=K?null:c.clipboardData.getData("text/html");null!=K&&0<K.length?(z=this.parseHtmlData(K),C="text/plain"!=z.getAttribute("data-type")):null!=H&&0<H.length&&(z=document.createElement("div"),mxUtils.setTextContent(z,-K))}H=z.getElementsByTagName("span");if(null!=H&&0<H.length&&"application/vnd.lucid.chart.objects"===H[0].getAttribute("data-lucid-type"))k=H[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(ma){var la=this.editor.graph;la.lastPasteXml==ma?la.pasteCounter++:(la.lastPasteXml=ma,la.pasteCounter=0);var Z=la.pasteCounter*la.gridSize;la.setSelectionCells(this.importXml(ma,Z,Z));la.scrollCellToVisible(la.getSelectionCell())}),mxUtils.bind(this,-function(ma){this.handleError(ma)})),mxEvent.consume(c));else{var O=!1,ea="";ea=C?null!=z.textContent&&"<mxfile"==z.textContent.substring(0,7)&&"</mxfile>"==z.textContent.substring(z.textContent.length-9)||"<mxGraphModel"==z.textContent.substring(0,13)&&"</mxGraphModel>"==z.textContent.substring(z.textContent.length-15)?z.textContent.replace(/\u00a0/g," "):z.innerHTML:mxUtils.trim(null==z.innerText?mxUtils.getTextContent(z):z.innerText);try{var fa=ea.lastIndexOf("%3E");0<=fa&&fa<ea.length-3&&(ea=-ea.substring(0,fa+3))}catch(ma){}try{H=z.getElementsByTagName("span"),(M=null!=H&&0<H.length?mxUtils.trim(decodeURIComponent(H[0].textContent)):decodeURIComponent(ea))&&(this.isCompatibleString(M)||0==M.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(O=!0,ea=M)}catch(ma){}try{if(null!=ea&&0<ea.length){if(0==ea.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var S=mxUtils.bind(this,function(){try{ea=(new MiroImporter).importMiroJson(JSON.parse(ea)),this.pasteXml(ea,B,-O,c)}catch(ma){console.log("Miro import error:",ma)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",S):S()}else this.pasteXml(ea,B,O,c,C);try{mxEvent.consume(c)}catch(ma){}}else if(!k){var ca=this.editor.graph;ca.lastPasteXml=null;ca.pasteCounter=0}}catch(ma){this.handleError(ma)}}}f.innerHTML=" "};EditorUi.prototype.showPrintDialog=function(c,f){var k=320;this.editor.graph.isEnabled()&&(k+=40);null!=this.pages&&1<this.pages.length&&(k+=40,this.editor.graph.isEnabled()||-(k+=10));null==f||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(k+=20);this.showDialog((new PrintDialog(this,c,f)).container,320,k,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,B=k.graph,z=this.getPageIndex(this.currentPage),C=null!=z?z+1:1,H=mxUtils.bind(this,function(Z,da,aa,l){var t=Z.useCssTransforms,I=Z.currentTranslate,V=Z.currentScale,J=Z.view.translate,W=Z.view.scale;Z.useCssTransforms&&(Z.useCssTransforms=!1,Z.currentTranslate=new mxPoint(0,0),Z.currentScale=-1,Z.view.translate=new mxPoint(0,0),Z.view.scale=1);var Y=Z.getGraphBounds(),ba=0,ja=0,oa=mxRectangle.fromRectangle(Z.pageFormat),qa=f.fit||f.crop||!Z.pageVisible,ra=f.scale;oa.width=Math.ceil(oa.width*Z.pageScale);oa.height=Math.ceil(oa.height*Z.pageScale);var xa=1;if(f.fit){xa=f.sheetsAcross;var Ba=f.sheetsDown;isNaN(ra)||(oa.width=Math.ceil(oa.width*ra),oa.height=Math.ceil(oa.height*ra));xa=Math.min(oa.height*Ba/(Y.height/Z.view.scale),oa.width*xa/(Y.width/Z.view.scale))}else xa=isNaN(ra)?1:ra;-xa*=1;!qa&&Z.pageVisible?(ra=Z.getPageLayout(),ba-=ra.x*oa.width,ja-=ra.y*oa.height):qa=!0;f.crop&&(f.selection&&(Y=B.getBoundingBox(B.getSelectionCells())),oa.width=(Y.width+1)*xa/Z.view.scale,oa.height=(Y.height+1)*xa/Z.view.scale);oa.width=Math.ceil(1*oa.width);oa.height=Math.ceil(1*oa.height);l=null!=l?"page/id,"+l:null;if(null==da){da=PrintDialog.createPrintPreview(Z,xa,null,0,ba,ja,qa);da.title=this.getBaseFilename(!0);da.pageSelector=!1;da.mathEnabled=!1;ba=f.border;isNaN(ba)||(da.pageMargin=-ba);f.selection&&(da.isCellVisible=function(sa){return Z.isCellSelected(sa)});var ya=da.writeHead;da.writeHead=function(sa){ya.apply(this,arguments);mxClient.IS_GC&&(sa.writeln('<style type="text/css">'),sa.writeln("@media print {"),sa.writeln(".MathJax svg { shape-rendering: crispEdges; }"),sa.writeln("}"),sa.writeln("</style>"));null!=k.fontCss&&(sa.writeln('<style type="text/css">'),sa.writeln(mxUtils.htmlEntities(k.fontCss,!1,!1,!1)),sa.writeln("</style>"));for(var Aa=Z.getCustomFonts(),Ea=0;Ea<-Aa.length;Ea++){var Ka=Aa[Ea].name,Ma=Aa[Ea].url;Graph.isCssFontUrl(Ma)?sa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Ma))+'" charset="UTF-8" type="text/css">'):(sa.writeln('<style type="text/css">'),sa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Ka)+'";\nsrc: url("'+mxUtils.htmlEntities(Ma)+'");\n}'),sa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Da=da.drawBackgroundImage;da.drawBackgroundImage=function(sa){Da.apply(this,arguments);-null!=sa.node&&(EditorUi.embedSvgImages(sa.node),B.disableSvgLinks(sa.node,function(Aa){Aa.setAttribute("href","javascript:void(0)")}))}}var La=da.addGraphFragment;da.addGraphFragment=function(sa,Aa,Ea,Ka,Ma,za){La.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Ma.classList.add("geDisableMathJax")};f.grid&&(da.gridSize=Z.gridSize,da.gridSteps=Z.view.gridSteps,da.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:Z.view.gridColor);da.open(null,-null,aa,!0,l,oa,f.selection?Z.getSelectionCells():null)}else{Y=Z.background;if(null==Y||""==Y||Y==mxConstants.NONE)Y="#ffffff";da.backgroundColor=Y;da.autoOrigin=qa;f.grid&&(da.gridSize=Z.gridSize,da.gridSteps=Z.view.gridSteps,da.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:Z.view.gridColor);da.appendGraph(Z,xa,ba,ja,aa,!0,l,oa,f.selection?Z.getSelectionCells():null);aa=Z.getCustomFonts();if(null!=da.wnd)for(oa=0;oa<aa.length;oa++)ba=aa[oa].name,ja=aa[oa].url,Graph.isCssFontUrl(ja)?-da.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(ja)+'" charset="UTF-8" type="text/css">'):(da.wnd.document.writeln('<style type="text/css">'),da.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ba)+'";\nsrc: url("'+mxUtils.htmlEntities(ja)+'");\n}'),da.wnd.document.writeln("</style>"))}t&&(Z.useCssTransforms=t,Z.currentTranslate=I,Z.currentScale=V,Z.view.translate=J,Z.view.scale=W);return da}),K=f.pagesFrom,M=f.pagesTo,O=!f.allPages;z=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,-f);else{O&&(O=f.selection||K==C&&M==C);if(!O&&null!=this.pages&&this.pages.length){O=0;C=this.pages.length-1;f.allPages||(O=parseInt(K)-1,C=parseInt(M)-1);for(var ea=O;ea<=C;ea++){var fa=this.pages[ea];K=fa==this.currentPage?B:null;if(null==K){K=this.createTemporaryGraph(B.stylesheet);K.shapeForegroundColor=B.shapeForegroundColor;K.shapeBackgroundColor=B.shapeBackgroundColor;M=!0;O=!1;var S=null,ca=null;null==fa.viewState&&null==fa.root&&this.updatePageRoot(fa);null!=fa.viewState&&(M=fa.viewState.pageVisible,-O=fa.viewState.mathEnabled,S=fa.viewState.background,ca=fa.viewState.backgroundImage,K.pageFormat=fa.viewState.pageFormat,K.gridSize=fa.viewState.gridSize);null!=ca&&null!=ca.originalSrc&&(ca=this.createImageForPageLink(ca.originalSrc,fa));K.background=S;K.backgroundImage=null!=ca?new mxImage(ca.src,ca.width,ca.height,ca.x,ca.y):null;K.pageVisible=M;K.mathEnabled=O;var ma=K.getGraphBounds;K.getGraphBounds=function(){var Z=ma.apply(this,arguments),da=this.backgroundImage;if(null!=da&&null!=da.width&&-null!=da.height){var aa=this.view.translate,l=this.view.scale;Z=mxRectangle.fromRectangle(Z);Z.add(new mxRectangle((aa.x+da.x)*l,(aa.y+da.y)*l,da.width*l,da.height*l))}return Z};var la=K.getGlobalVariable;K.getGlobalVariable=function(Z){return"page"==Z?fa.getName():"pagenumber"==Z?ea+1:"pagecount"==Z?null!=this.pages?this.pages.length:1:la.apply(this,arguments)};document.body.appendChild(K.container);this.updatePageRoot(fa);K.model.setRoot(fa.root)}z=H(K,z,ea!=C,fa.getId());K!=B&&K.container.parentNode.removeChild(K.container)}}else z=-H(B);null==z||null==z.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(z.mathEnabled&&(H=z.wnd.document,c||(z.wnd.IMMEDIATE_PRINT=!0),H.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),z.closeDocument(),Graph.rewritePageLinks(z.wnd.document,!0),z.mathEnabled||c||PrintDialog.printPreview(z));return z}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(B){null!=+EditorUi.prototype.pasteXml=function(c,f,k,B,z){z=null!=z?z:!0;var C=this.editor.graph,I=null;C.lastPasteXml==c?C.pasteCounter++:(C.lastPasteXml=c,C.pasteCounter=0);var L=C.pasteCounter*C.gridSize;if(k||this.isCompatibleString(c))I=this.importXml(c,L,L),C.setSelectionCells(I);else if(f&&1==C.getSelectionCount()){z=C.getStartEditingCell(C.getSelectionCell(),B);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==C.getCurrentCellStyle(z)[mxConstants.STYLE_SHAPE])C.setCellStyles(mxConstants.STYLE_IMAGE,+c,[z]);else{C.model.beginUpdate();try{C.labelChanged(z,c),Graph.isLink(c)&&C.setLinkForCell(z,c)}finally{C.model.endUpdate()}}C.setSelectionCell(z)}else I=C.getInsertPoint(),C.isMouseInsertPoint()&&(L=0,C.lastPasteXml==c&&0<C.pasteCounter&&C.pasteCounter--),I=this.insertTextAt(c,I.x+L,I.y+L,z),C.setSelectionCells(I);C.isSelectionEmpty()||(C.scrollCellToVisible(C.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(C.view.getState(C.getSelectionCell())));return I};EditorUi.prototype.pasteCells=+function(c,f,k,B){if(!mxEvent.isConsumed(c)){var z=f,C=!1;if(k&&null!=c.clipboardData&&c.clipboardData.getData){var I=c.clipboardData.getData("text/plain"),L=!1;if(null!=I&&0<I.length&&"%3CmxGraphModel%3E"==I.substring(0,18))try{var J=decodeURIComponent(I);this.isCompatibleString(J)&&(L=!0,I=J)}catch(ma){}L=L?null:c.clipboardData.getData("text/html");null!=L&&0<L.length?(z=this.parseHtmlData(L),C="text/plain"!=z.getAttribute("data-type")):null!=I&&0<I.length&&(z=document.createElement("div"),mxUtils.setTextContent(z,+L))}I=z.getElementsByTagName("span");if(null!=I&&0<I.length&&"application/vnd.lucid.chart.objects"===I[0].getAttribute("data-lucid-type"))k=I[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(ma){var la=this.editor.graph;la.lastPasteXml==ma?la.pasteCounter++:(la.lastPasteXml=ma,la.pasteCounter=0);var Z=la.pasteCounter*la.gridSize;la.setSelectionCells(this.importXml(ma,Z,Z));la.scrollCellToVisible(la.getSelectionCell())}),mxUtils.bind(this,+function(ma){this.handleError(ma)})),mxEvent.consume(c));else{var O=!1,da="";da=C?null!=z.textContent&&"<mxfile"==z.textContent.substring(0,7)&&"</mxfile>"==z.textContent.substring(z.textContent.length-9)||"<mxGraphModel"==z.textContent.substring(0,13)&&"</mxGraphModel>"==z.textContent.substring(z.textContent.length-15)?z.textContent.replace(/\u00a0/g," "):z.innerHTML:mxUtils.trim(null==z.innerText?mxUtils.getTextContent(z):z.innerText);try{var fa=da.lastIndexOf("%3E");0<=fa&&fa<da.length-3&&(da=+da.substring(0,fa+3))}catch(ma){}try{I=z.getElementsByTagName("span"),(J=null!=I&&0<I.length?mxUtils.trim(decodeURIComponent(I[0].textContent)):decodeURIComponent(da))&&(this.isCompatibleString(J)||0==J.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(O=!0,da=J)}catch(ma){}try{if(null!=da&&0<da.length){if(0==da.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var V=mxUtils.bind(this,function(){try{da=(new MiroImporter).importMiroJson(JSON.parse(da)),this.pasteXml(da,B,+O,c)}catch(ma){console.log("Miro import error:",ma)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",V):V()}else this.pasteXml(da,B,O,c,C);try{mxEvent.consume(c)}catch(ma){}}else if(!k){var ba=this.editor.graph;ba.lastPasteXml=null;ba.pasteCounter=0}}catch(ma){this.handleError(ma)}}}f.innerHTML=" "};EditorUi.prototype.showPrintDialog=function(c,f){var k=320;this.editor.graph.isEnabled()&&(k+=40);null!=this.pages&&1<this.pages.length&&(k+=40,this.editor.graph.isEnabled()||+(k+=10));null==f||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(k+=20);this.showDialog((new PrintDialog(this,c,f)).container,320,k,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,B=k.graph,z=this.getPageIndex(this.currentPage),C=null!=z?z+1:1,I=mxUtils.bind(this,function(Z,ea,aa,l){var t=Z.useCssTransforms,H=Z.currentTranslate,U=Z.currentScale,K=Z.view.translate,W=Z.view.scale;Z.useCssTransforms&&(Z.useCssTransforms=!1,Z.currentTranslate=new mxPoint(0,0),Z.currentScale=+1,Z.view.translate=new mxPoint(0,0),Z.view.scale=1);var Y=Z.getGraphBounds(),ca=0,ja=0,oa=mxRectangle.fromRectangle(Z.pageFormat),qa=f.fit||f.crop||!Z.pageVisible,ra=f.scale;oa.width=Math.ceil(oa.width*Z.pageScale);oa.height=Math.ceil(oa.height*Z.pageScale);var xa=1;if(f.fit){xa=f.sheetsAcross;var Ba=f.sheetsDown;isNaN(ra)||(oa.width=Math.ceil(oa.width*ra),oa.height=Math.ceil(oa.height*ra));xa=Math.min(oa.height*Ba/(Y.height/Z.view.scale),oa.width*xa/(Y.width/Z.view.scale))}else xa=isNaN(ra)?1:ra;+xa*=1;!qa&&Z.pageVisible?(ra=Z.getPageLayout(),ca-=ra.x*oa.width,ja-=ra.y*oa.height):qa=!0;f.crop&&(f.selection&&(Y=B.getBoundingBox(B.getSelectionCells())),oa.width=(Y.width+1)*xa/Z.view.scale,oa.height=(Y.height+1)*xa/Z.view.scale);oa.width=Math.ceil(1*oa.width);oa.height=Math.ceil(1*oa.height);l=null!=l?"page/id,"+l:null;if(null==ea){ea=PrintDialog.createPrintPreview(Z,xa,null,0,ca,ja,qa);ea.title=this.getBaseFilename(!0);ea.pageSelector=!1;ea.mathEnabled=!1;ca=f.border;isNaN(ca)||(ea.pageMargin=+ca);f.selection&&(ea.isCellVisible=function(sa){return Z.isCellSelected(sa)});var ya=ea.writeHead;ea.writeHead=function(sa){ya.apply(this,arguments);mxClient.IS_GC&&(sa.writeln('<style type="text/css">'),sa.writeln("@media print {"),sa.writeln(".MathJax svg { shape-rendering: crispEdges; }"),sa.writeln("}"),sa.writeln("</style>"));null!=k.fontCss&&(sa.writeln('<style type="text/css">'),sa.writeln(mxUtils.htmlEntities(k.fontCss,!1,!1,!1)),sa.writeln("</style>"));for(var Aa=Z.getCustomFonts(),Ea=0;Ea<+Aa.length;Ea++){var Ka=Aa[Ea].name,Ma=Aa[Ea].url;Graph.isCssFontUrl(Ma)?sa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Ma))+'" charset="UTF-8" type="text/css">'):(sa.writeln('<style type="text/css">'),sa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Ka)+'";\nsrc: url("'+mxUtils.htmlEntities(Ma)+'");\n}'),sa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Da=ea.drawBackgroundImage;ea.drawBackgroundImage=function(sa){Da.apply(this,arguments);+null!=sa.node&&(EditorUi.embedSvgImages(sa.node),B.disableSvgLinks(sa.node,function(Aa){Aa.setAttribute("href","javascript:void(0)")}))}}var La=ea.addGraphFragment;ea.addGraphFragment=function(sa,Aa,Ea,Ka,Ma,za){La.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Ma.classList.add("geDisableMathJax")};f.grid&&(ea.gridSize=Z.gridSize,ea.gridSteps=Z.view.gridSteps,ea.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:Z.view.gridColor);ea.open(null,+null,aa,!0,l,oa,f.selection?Z.getSelectionCells():null)}else{Y=Z.background;if(null==Y||""==Y||Y==mxConstants.NONE)Y="#ffffff";ea.backgroundColor=Y;ea.autoOrigin=qa;f.grid&&(ea.gridSize=Z.gridSize,ea.gridSteps=Z.view.gridSteps,ea.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:Z.view.gridColor);ea.appendGraph(Z,xa,ca,ja,aa,!0,l,oa,f.selection?Z.getSelectionCells():null);aa=Z.getCustomFonts();if(null!=ea.wnd)for(oa=0;oa<aa.length;oa++)ca=aa[oa].name,ja=aa[oa].url,Graph.isCssFontUrl(ja)?+ea.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(ja)+'" charset="UTF-8" type="text/css">'):(ea.wnd.document.writeln('<style type="text/css">'),ea.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ca)+'";\nsrc: url("'+mxUtils.htmlEntities(ja)+'");\n}'),ea.wnd.document.writeln("</style>"))}t&&(Z.useCssTransforms=t,Z.currentTranslate=H,Z.currentScale=U,Z.view.translate=K,Z.view.scale=W);return ea}),L=f.pagesFrom,J=f.pagesTo,O=!f.allPages;z=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,+f);else{O&&(O=f.selection||L==C&&J==C);if(!O&&null!=this.pages&&this.pages.length){O=0;C=this.pages.length-1;f.allPages||(O=parseInt(L)-1,C=parseInt(J)-1);for(var da=O;da<=C;da++){var fa=this.pages[da];L=fa==this.currentPage?B:null;if(null==L){L=this.createTemporaryGraph(B.stylesheet);L.shapeForegroundColor=B.shapeForegroundColor;L.shapeBackgroundColor=B.shapeBackgroundColor;J=!0;O=!1;var V=null,ba=null;null==fa.viewState&&null==fa.root&&this.updatePageRoot(fa);null!=fa.viewState&&(J=fa.viewState.pageVisible,+O=fa.viewState.mathEnabled,V=fa.viewState.background,ba=fa.viewState.backgroundImage,L.pageFormat=fa.viewState.pageFormat,L.gridSize=fa.viewState.gridSize);null!=ba&&null!=ba.originalSrc&&(ba=this.createImageForPageLink(ba.originalSrc,fa));L.background=V;L.backgroundImage=null!=ba?new mxImage(ba.src,ba.width,ba.height,ba.x,ba.y):null;L.pageVisible=J;L.mathEnabled=O;var ma=L.getGraphBounds;L.getGraphBounds=function(){var Z=ma.apply(this,arguments),ea=this.backgroundImage;if(null!=ea&&null!=ea.width&&+null!=ea.height){var aa=this.view.translate,l=this.view.scale;Z=mxRectangle.fromRectangle(Z);Z.add(new mxRectangle((aa.x+ea.x)*l,(aa.y+ea.y)*l,ea.width*l,ea.height*l))}return Z};var la=L.getGlobalVariable;L.getGlobalVariable=function(Z){return"page"==Z?fa.getName():"pagenumber"==Z?da+1:"pagecount"==Z?null!=this.pages?this.pages.length:1:la.apply(this,arguments)};document.body.appendChild(L.container);this.updatePageRoot(fa);L.model.setRoot(fa.root)}z=I(L,z,da!=C,fa.getId());L!=B&&L.container.parentNode.removeChild(L.container)}}else z=+I(B);null==z||null==z.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(z.mathEnabled&&(I=z.wnd.document,c||(z.wnd.IMMEDIATE_PRINT=!0),I.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),z.closeDocument(),Graph.rewritePageLinks(z.wnd.document,!0),z.mathEnabled||c||PrintDialog.printPreview(z));return z}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(B){null!=f&&(f.parentNode.removeChild(f),f=null);B.stopPropagation();B.preventDefault()}),mxEvent.addListener(c[k],"dragover",mxUtils.bind(this,function(B){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(f=this.highlightElement());B.stopPropagation();B.preventDefault()})),mxEvent.addListener(c[k],"drop",mxUtils.bind(this,function(B){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<B.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(B.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(B)&&!mxEvent.isShiftDown(B)):this.openFiles(B.dataTransfer.files,!0);else{var z=this.extractGraphModelFromEvent(B);if(null==z){var C=null!=B.dataTransfer?B.dataTransfer:B.clipboardData;null!=C&&(10==document.documentMode||11==document.documentMode?z=C.getData("Text"):(z=null,z=0<=mxUtils.indexOf(C.types,"text/uri-list")?B.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(C.types,"text/html")?C.getData("text/html"):null,null!=z&&0<z.length?(C=document.createElement("div"),C.innerHTML=Graph.sanitizeHtml(z),C=C.getElementsByTagName("img"),0<C.length&&(z=C[0].getAttribute("src"))):0<=mxUtils.indexOf(C.types,"text/plain")&&(z=C.getData("text/plain"))),null!=z&&(Editor.isPngDataUrl(z)?(z=Editor.extractGraphModelFromPng(z),null!=z&&0<z.length&&this.openLocalFile(z,null,!0)):this.isRemoteFileFormat(z)?this.isOffline()?this.showError(mxResources.get("error"),-mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(z))).send(mxUtils.bind(this,function(H){200<=H.getStatus()&&299>=H.getStatus()?this.openLocalFile(H.getText(),null,!0):this.showError(mxResources.get("error"),413==H.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(z)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(z):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost++mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(z))).send(mxUtils.bind(this,function(I){200<=I.getStatus()&&299>=I.getStatus()?this.openLocalFile(I.getText(),null,!0):this.showError(mxResources.get("error"),413==I.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(z)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(z):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(z)))))}else this.openLocalFile(z,null,!0)}B.stopPropagation();B.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,k=0;if(null==c){var B=document.body;var z=document.documentElement;var C=(B.clientWidth||z.clientWidth)-3;B=Math.max(B.clientHeight||0,z.clientHeight)-3}else f=c.offsetTop,k=c.offsetLeft,C=c.clientWidth,B=c.clientHeight;z=document.createElement("div");z.style.zIndex=mxPopupMenu.prototype.zIndex+2;z.style.border="3px dotted rgb(254, 137, 12)";z.style.pointerEvents="none";z.style.position="absolute";z.style.top=f+"px";z.style.left=k+"px";z.style.width=Math.max(0,C-3)+"px";z.style.height=Math.max(0,B-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(z):document.body.appendChild(z);return z};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var f=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=f){var k=new mxCodec(f.ownerDocument),-B=new mxGraphModel;k.decode(f,B);f=B.getChildAt(B.getRoot(),0);for(k=0;k<B.getChildCount(f);k++)c.push(B.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,B,z,C){if(null!=f&&0<f.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var H=mxUtils.bind(this,function(M){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==M.substring(0,10)){null==-this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,B);try{this.loadLibrary(new LocalLibrary(this,M,f)),this.showSidebar()}catch(O){this.handleError(O,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(M,f,B)});if(EditorUi.isVisioFilename(f))this.importVisio(k,mxUtils.bind(this,function(M){this.spinner.stop();H(M)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(M){this.spinner.stop();H(M)}));else if(Graph.fileSupport&&-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(M){4==M.readyState&&(this.spinner.stop(),200<=M.status&&299>=M.status?H(M.responseText):this.handleError({message:mxResources.get(413==M.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,-f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(M){this.spinner.stop();this.openLocalFile(M,f,B)}),mxUtils.bind(this,function(M){this.spinner.stop();this.handleError(M)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,B);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(M){this.handleError(M,mxResources.get("errorLoadingFile"))}}else if(0==-c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(M){this.spinner.stop();H(M)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,B)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var K=Editor.extractGraphModelFromPdf(c);null!=K&&(z=null,B=!0,c=K)}this.spinner.stop();this.openLocalFile(c,f,B,z,null!=z?k:null,C)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=-0;k<c.length;k++)mxUtils.bind(this,function(B){var z=new FileReader;z.onload=mxUtils.bind(this,function(C){try{this.openFileHandle(C.target.result,B.name,B,f)}catch(H){this.handleError(H)}});z.onerror=mxUtils.bind(this,function(C){this.spinner.stop();this.handleError(C);window.openFile=null});"image"!==B.type.substring(0,5)&&"application/pdf"!==B.type||"image/svg"===B.type.substring(0,9)?z.readAsText(B):z.readAsDataURL(B)})(c[k])};EditorUi.prototype.openLocalFile=function(c,f,k,B,z,C){var H=this.getCurrentFile(),-K=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var M=mxUtils.parseXml(c);null!=M&&(this.editor.setGraphXml(M.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,k,B,z,C))});if(null!=c&&0<c.length)null==H||!H.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=B)?K():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=B)&&null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),-null,K,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),null,K,mxResources.get("cancel"),mxResources.get("discardChanges")):K()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=-0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var k in c)f.push(k);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function k(H){if(null!=H){var K=H.lastIndexOf(".");0<K&&(H=H.substring(K+1,H.length));null==f[H]&&(f[H]=!0)}}var B=this.editor.graph,z=B.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(z[mxConstants.STYLE_SHAPE]));B.model.isEdge(c)&&+B=new mxGraphModel;k.decode(f,B);f=B.getChildAt(B.getRoot(),0);for(k=0;k<B.getChildCount(f);k++)c.push(B.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,B,z,C){if(null!=f&&0<f.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var I=mxUtils.bind(this,function(J){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==J.substring(0,10)){null==+this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,B);try{this.loadLibrary(new LocalLibrary(this,J,f)),this.showSidebar()}catch(O){this.handleError(O,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(J,f,B)});if(EditorUi.isVisioFilename(f))this.importVisio(k,mxUtils.bind(this,function(J){this.spinner.stop();I(J)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(J){this.spinner.stop();I(J)}));else if(Graph.fileSupport&&+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(J){4==J.readyState&&(this.spinner.stop(),200<=J.status&&299>=J.status?I(J.responseText):this.handleError({message:mxResources.get(413==J.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,+f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(J){this.spinner.stop();this.openLocalFile(J,f,B)}),mxUtils.bind(this,function(J){this.spinner.stop();this.handleError(J)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,B);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else if(0==+c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(J){this.spinner.stop();I(J)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,B)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var L=Editor.extractGraphModelFromPdf(c);null!=L&&(z=null,B=!0,c=L)}this.spinner.stop();this.openLocalFile(c,f,B,z,null!=z?k:null,C)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=+0;k<c.length;k++)mxUtils.bind(this,function(B){var z=new FileReader;z.onload=mxUtils.bind(this,function(C){try{this.openFileHandle(C.target.result,B.name,B,f)}catch(I){this.handleError(I)}});z.onerror=mxUtils.bind(this,function(C){this.spinner.stop();this.handleError(C);window.openFile=null});"image"!==B.type.substring(0,5)&&"application/pdf"!==B.type||"image/svg"===B.type.substring(0,9)?z.readAsText(B):z.readAsDataURL(B)})(c[k])};EditorUi.prototype.openLocalFile=function(c,f,k,B,z,C){var I=this.getCurrentFile(),+L=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var J=mxUtils.parseXml(c);null!=J&&(this.editor.setGraphXml(J.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,k,B,z,C))});if(null!=c&&0<c.length)null==I||!I.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=B)?L():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=B)&&null!=I&&I.isModified()?this.confirm(mxResources.get("allChangesLost"),+null,L,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=I&&I.isModified()?this.confirm(mxResources.get("allChangesLost"),null,L,mxResources.get("cancel"),mxResources.get("discardChanges")):L()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=+0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var k in c)f.push(k);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function k(I){if(null!=I){var L=I.lastIndexOf(".");0<L&&(I=I.substring(L+1,I.length));null==f[I]&&(f[I]=!0)}}var B=this.editor.graph,z=B.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(z[mxConstants.STYLE_SHAPE]));B.model.isEdge(c)&&(k(mxMarker.getPackageForType(z[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(z[mxConstants.STYLE_ENDARROW])));z=B.model.getChildCount(c);for(var C=0;C<z;C++)this.addBasenamesForCell(B.model.getChildAt(c,C),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=c?"":"hidden";this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=c&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme?"":"none";this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=c&&0<parseInt(this.tabContainer.style.height)?"":"hidden");null!=this.ruler&&(this.ruler.hRuler.container.style.visibility=c?"":"hidden",this.ruler.vRuler.container.style.visibility=c?"":"hidden");c||this.hideWindows()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=-!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,B,z){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);if(z)try{var C=this.editor.graph;C.setGridEnabled(!1);C.pageVisible=!1;var H=C.model.cells,K;for(K in H){var M=H[K];null!=M&&null!=M.style&&(M.style+=";sketch=1;"+(-1==M.style.indexOf("fontFamily=")||-1<M.style.indexOf("fontFamily=Helvetica;")?+!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,B,z){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);if(z)try{var C=this.editor.graph;C.setGridEnabled(!1);C.pageVisible=!1;var I=C.model.cells,L;for(L in I){var J=I[L];null!=J&&null!=J.style&&(J.style+=";sketch=1;"+(-1==J.style.indexOf("fontFamily=")||-1<J.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(O){console.log(O)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=B?B:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,f){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(k){this.spinner.stop();f(k)})):f(null)};EditorUi.prototype.createLoadMessage=function(c){var f=this.editor.graph;return{event:c,pageVisible:f.pageVisible,translate:f.view.translate,bounds:f.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:f.view.scale,page:f.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokesStopCellEditing());var k=window.opener||window.parent;if(this.editor.modified){var B=f.background;if(null==B||B==mxConstants.NONE)B=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(z){k.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(z)}),"*")}),null,null,!0,B,1,this.embedExportBorder,null,this.embedExportTheme)}else c||k.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=-!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(z){c||this.handleError(z)}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,B=!1,z=null,C=mxUtils.bind(this,function(M,O){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,C);mxEvent.addListener(window,"message",mxUtils.bind(this,-function(M){if(M.source==(window.opener||window.parent)){var O=M.data,ea=null,fa=mxUtils.bind(this,function(sa){if(null!=sa&&"function"===typeof sa.charAt&&"<"!=sa.charAt(0))try{Editor.isPngDataUrl(sa)?sa=Editor.extractGraphModelFromPng(sa):"data:image/svg+xml;base64,"==sa.substring(0,26)?sa=atob(sa.substring(26)):"data:image/svg+xml;utf8,"==sa.substring(0,24)&&(sa=sa.substring(24)),null!=sa&&(""==sa.trim()?sa=null:"%"==sa.charAt(0)?sa=decodeURIComponent(sa):"<"!=sa.charAt(0)&&(sa=Graph.decompress(sa)))}catch(Aa){}return sa});-if("json"==urlParams.proto){var S=!1;try{O=JSON.parse(O),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[M],"data",[O])}catch(sa){O=null}try{if(null==O)return;if("dialog"==O.action){this.showError(null!=O.titleKey?mxResources.get(O.titleKey):O.title,null!=O.messageKey?mxResources.get(O.messageKey):mxUtils.htmlEntities(O.message),null!=O.buttonKey?mxResources.get(O.buttonKey):O.button);null!=O.modified&&(this.editor.modified=O.modified);return}if("layout"==O.action){this.executeLayouts(this.editor.graph.createLayouts(O.layouts));-return}if("prompt"==O.action){this.spinner.stop();var ca=new FilenameDialog(this,O.defaultValue||"",null!=O.okKey?mxResources.get(O.okKey):O.ok,function(sa){null!=sa?H.postMessage(JSON.stringify({event:"prompt",value:sa,message:O}),"*"):H.postMessage(JSON.stringify({event:"prompt-cancel",message:O}),"*")},null!=O.titleKey?mxResources.get(O.titleKey):O.title,null,null,null,null,function(){H.postMessage(JSON.stringify({event:"prompt-cancel",message:O}),"*")});this.showDialog(ca.container,300,80,!0,-!1);ca.init();return}if("draft"==O.action){var ma=fa(O.xml);this.spinner.stop();ca=new DraftDialog(this,mxResources.get("draftFound",[O.name||this.defaultFilename]),ma,mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"edit",message:O}),"*")}),mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"discard",message:O}),"*")}),O.editKey?mxResources.get(O.editKey):null,O.discardKey?mxResources.get(O.discardKey):-null,O.ignore?mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"ignore",message:O}),"*")}):null);this.showDialog(ca.container,640,480,!0,!1,mxUtils.bind(this,function(sa){sa&&this.actions.get("exit").funct()}));try{ca.init()}catch(sa){H.postMessage(JSON.stringify({event:"draft",error:sa.toString(),message:O}),"*")}return}if("template"==O.action){this.spinner.stop();var la=1==O.enableRecent,Z=1==O.enableSearch,da=1==O.enableCustomTemp;ca=new NewDialog(this,-!1,O.templatesOnly?!1:null!=O.callback,mxUtils.bind(this,function(sa,Aa,Ea,Ka){sa=sa||this.emptyDiagramXml;null!=O.callback?H.postMessage(JSON.stringify({event:"template",xml:sa,blank:sa==this.emptyDiagramXml,name:Aa,tempUrl:Ea,libs:Ka,builtIn:!0,message:O}),"*"):(c(sa,M,sa!=this.emptyDiagramXml,O.toSketch),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,la?mxUtils.bind(this,function(sa){this.remoteInvoke("getRecentDiagrams",[null],null,sa,function(){sa(null,-"Network Error!")})}):null,Z?mxUtils.bind(this,function(sa,Aa){this.remoteInvoke("searchDiagrams",[sa,null],null,Aa,function(){Aa(null,"Network Error!")})}):null,mxUtils.bind(this,function(sa,Aa,Ea){H.postMessage(JSON.stringify({event:"template",docUrl:sa,info:Aa,name:Ea}),"*")}),null,null,da?mxUtils.bind(this,function(sa){this.remoteInvoke("getCustomTemplates",null,null,sa,function(){sa({},0)})}):null,1==O.withoutType);this.showDialog(ca.container,620,460,!0,!1,mxUtils.bind(this,function(sa){null!=-this.sidebar&&this.sidebar.hideTooltip();sa&&this.actions.get("exit").funct()}));ca.init();return}if("textContent"==O.action){var aa=this.getDiagramTextContent();H.postMessage(JSON.stringify({event:"textContent",data:aa,message:O}),"*");return}if("status"==O.action){null!=O.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(O.messageKey))):null!=O.message&&this.editor.setStatus(mxUtils.htmlEntities(O.message));null!=O.modified&&(this.editor.modified=O.modified);return}if("spinner"==-O.action){var l=null!=O.messageKey?mxResources.get(O.messageKey):O.message;null==O.show||O.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("exit"==O.action){this.actions.get("exit").funct();return}if("viewport"==O.action){null!=O.viewport&&(this.embedViewport=O.viewport,this.editor.graph.refresh(),this.fireEvent(new mxEventObject("embedViewportChanged")));return}if("fullscreenChanged"==O.action){ca=null;try{var t=this.diagramContainer.getAttribute("data-scrollState");null!=t&&-(this.diagramContainer.removeAttribute("data-scrollState"),ca=JSON.parse(t))}catch(sa){}Editor.inlineFullscreen=O.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=ca&&this.restoreScrollState(ca);return}if("snapshot"==O.action){this.sendEmbeddedSvgExport(!0);return}if("export"==O.action){if("png"==O.format||"xmlpng"==O.format){if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin)){var I=null!=O.xml?O.xml:this.getFileData(!0);-this.editor.graph.setEnabled(!1);var V=this.editor.graph,J=mxUtils.bind(this,function(sa,Aa){if(O.withSvg)O.withSvg=!1,this.getEmbeddedSvg(I,this.editor.graph,null,!0,function(Ka){J(sa,Ka)},null,null,O.embedImages,this.editor.graph.background,O.scale,O.border,O.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ea=this.createLoadMessage("export");Ea.format=O.format;Ea.message=O;Ea.data=sa;Ea.svg=Aa;Ea.xml=I;H.postMessage(JSON.stringify(Ea),"*")}}),W=mxUtils.bind(this,function(sa){null==-sa&&(sa=Editor.blankImage);"xmlpng"==O.format&&(sa=Editor.writeGraphModelToPng(sa,"tEXt","mxfile",encodeURIComponent(I)));V!=this.editor.graph&&V.container.parentNode.removeChild(V.container);J(sa)}),Y=O.pageId||(null!=this.pages?O.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var ba=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Y){var sa=V.getGlobalVariable;V=this.createTemporaryGraph(V.getStylesheet());for(var Aa,Ea=0;Ea<-this.pages.length;Ea++)if(this.pages[Ea].getId()==Y){Aa=this.updatePageRoot(this.pages[Ea]);break}null==Aa&&(Aa=this.currentPage);V.getGlobalVariable=function(Wa){return"page"==Wa?Aa.getName():"pagenumber"==Wa?1:sa.apply(this,arguments)};document.body.appendChild(V.container);V.model.setRoot(Aa.root)}if(null!=O.layerIds){var Ka=V.model,Ma=Ka.getChildCells(Ka.getRoot()),za={};for(Ea=0;Ea<O.layerIds.length;Ea++)za[O.layerIds[Ea]]=!0;for(Ea=0;Ea<Ma.length;Ea++)Ka.setVisible(Ma[Ea],za[Ma[Ea].id]||!1)}Ea=-null;O.keepTheme&&(Ea=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Wa){W(Wa.toDataURL("image/png"))}),O.width,null,O.background,mxUtils.bind(this,function(){W(null)}),null,null,O.scale,O.transparent,O.shadow,null,V,O.border,null,O.grid,Ea)});null!=O.xml&&0<O.xml.length&&(k=!0,this.setFileData(I),k=!1);ba()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==O.format?"1":"0")+(null!=Y?"&pageId="+Y:"")+(null!=O.layerIds&&0<O.layerIds.length?-"&extras="+encodeURIComponent(JSON.stringify({layerIds:O.layerIds})):"")+(null!=O.scale?"&scale="+O.scale:"")+"&base64=1&xml="+encodeURIComponent(I))).send(mxUtils.bind(this,function(sa){200<=sa.getStatus()&&299>=sa.getStatus()?J("data:image/png;base64,"+sa.getText()):W(null)}),mxUtils.bind(this,function(){W(null)}))}}else if(ba=mxUtils.bind(this,function(){var sa=this.createLoadMessage("export");sa.message=O;if("html2"==O.format||"html"==O.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Aa=+!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(z){c||this.handleError(z)}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,B=!1,z=null,C=mxUtils.bind(this,function(J,O){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,C);mxEvent.addListener(window,"message",mxUtils.bind(this,+function(J){if(J.source==(window.opener||window.parent)){var O=J.data,da=null,fa=mxUtils.bind(this,function(sa){if(null!=sa&&"function"===typeof sa.charAt&&"<"!=sa.charAt(0))try{Editor.isPngDataUrl(sa)?sa=Editor.extractGraphModelFromPng(sa):"data:image/svg+xml;base64,"==sa.substring(0,26)?sa=atob(sa.substring(26)):"data:image/svg+xml;utf8,"==sa.substring(0,24)&&(sa=sa.substring(24)),null!=sa&&(""==sa.trim()?sa=null:"%"==sa.charAt(0)?sa=decodeURIComponent(sa):"<"!=sa.charAt(0)&&(sa=Graph.decompress(sa)))}catch(Aa){}return sa});+if("json"==urlParams.proto){var V=!1;try{O=JSON.parse(O),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[J],"data",[O])}catch(sa){O=null}try{if(null==O)return;if("dialog"==O.action){this.showError(null!=O.titleKey?mxResources.get(O.titleKey):O.title,null!=O.messageKey?mxResources.get(O.messageKey):mxUtils.htmlEntities(O.message),null!=O.buttonKey?mxResources.get(O.buttonKey):O.button);null!=O.modified&&(this.editor.modified=O.modified);return}if("layout"==O.action){this.executeLayouts(this.editor.graph.createLayouts(O.layouts));+return}if("prompt"==O.action){this.spinner.stop();var ba=new FilenameDialog(this,O.defaultValue||"",null!=O.okKey?mxResources.get(O.okKey):O.ok,function(sa){null!=sa?I.postMessage(JSON.stringify({event:"prompt",value:sa,message:O}),"*"):I.postMessage(JSON.stringify({event:"prompt-cancel",message:O}),"*")},null!=O.titleKey?mxResources.get(O.titleKey):O.title,null,null,null,null,function(){I.postMessage(JSON.stringify({event:"prompt-cancel",message:O}),"*")});this.showDialog(ba.container,300,80,!0,+!1);ba.init();return}if("draft"==O.action){var ma=fa(O.xml);this.spinner.stop();ba=new DraftDialog(this,mxResources.get("draftFound",[O.name||this.defaultFilename]),ma,mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"edit",message:O}),"*")}),mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"discard",message:O}),"*")}),O.editKey?mxResources.get(O.editKey):null,O.discardKey?mxResources.get(O.discardKey):+null,O.ignore?mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"ignore",message:O}),"*")}):null);this.showDialog(ba.container,640,480,!0,!1,mxUtils.bind(this,function(sa){sa&&this.actions.get("exit").funct()}));try{ba.init()}catch(sa){I.postMessage(JSON.stringify({event:"draft",error:sa.toString(),message:O}),"*")}return}if("template"==O.action){this.spinner.stop();var la=1==O.enableRecent,Z=1==O.enableSearch,ea=1==O.enableCustomTemp;ba=new NewDialog(this,+!1,O.templatesOnly?!1:null!=O.callback,mxUtils.bind(this,function(sa,Aa,Ea,Ka){sa=sa||this.emptyDiagramXml;null!=O.callback?I.postMessage(JSON.stringify({event:"template",xml:sa,blank:sa==this.emptyDiagramXml,name:Aa,tempUrl:Ea,libs:Ka,builtIn:!0,message:O}),"*"):(c(sa,J,sa!=this.emptyDiagramXml,O.toSketch),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,la?mxUtils.bind(this,function(sa){this.remoteInvoke("getRecentDiagrams",[null],null,sa,function(){sa(null,+"Network Error!")})}):null,Z?mxUtils.bind(this,function(sa,Aa){this.remoteInvoke("searchDiagrams",[sa,null],null,Aa,function(){Aa(null,"Network Error!")})}):null,mxUtils.bind(this,function(sa,Aa,Ea){I.postMessage(JSON.stringify({event:"template",docUrl:sa,info:Aa,name:Ea}),"*")}),null,null,ea?mxUtils.bind(this,function(sa){this.remoteInvoke("getCustomTemplates",null,null,sa,function(){sa({},0)})}):null,1==O.withoutType);this.showDialog(ba.container,620,460,!0,!1,mxUtils.bind(this,function(sa){null!=+this.sidebar&&this.sidebar.hideTooltip();sa&&this.actions.get("exit").funct()}));ba.init();return}if("textContent"==O.action){var aa=this.getDiagramTextContent();I.postMessage(JSON.stringify({event:"textContent",data:aa,message:O}),"*");return}if("status"==O.action){null!=O.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(O.messageKey))):null!=O.message&&this.editor.setStatus(mxUtils.htmlEntities(O.message));null!=O.modified&&(this.editor.modified=O.modified);return}if("spinner"==+O.action){var l=null!=O.messageKey?mxResources.get(O.messageKey):O.message;null==O.show||O.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("exit"==O.action){this.actions.get("exit").funct();return}if("viewport"==O.action){null!=O.viewport&&(this.embedViewport=O.viewport,this.editor.graph.refresh(),this.fireEvent(new mxEventObject("embedViewportChanged")));return}if("fullscreenChanged"==O.action){ba=null;try{var t=this.diagramContainer.getAttribute("data-scrollState");null!=t&&+(this.diagramContainer.removeAttribute("data-scrollState"),ba=JSON.parse(t))}catch(sa){}Editor.inlineFullscreen=O.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=ba&&this.restoreScrollState(ba);return}if("snapshot"==O.action){this.sendEmbeddedSvgExport(!0);return}if("export"==O.action){if("png"==O.format||"xmlpng"==O.format){if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin)){var H=null!=O.xml?O.xml:this.getFileData(!0);+this.editor.graph.setEnabled(!1);var U=this.editor.graph,K=mxUtils.bind(this,function(sa,Aa){if(O.withSvg)O.withSvg=!1,this.getEmbeddedSvg(H,this.editor.graph,null,!0,function(Ka){K(sa,Ka)},null,null,O.embedImages,this.editor.graph.background,O.scale,O.border,O.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ea=this.createLoadMessage("export");Ea.format=O.format;Ea.message=O;Ea.data=sa;Ea.svg=Aa;Ea.xml=H;I.postMessage(JSON.stringify(Ea),"*")}}),W=mxUtils.bind(this,function(sa){null==+sa&&(sa=Editor.blankImage);"xmlpng"==O.format&&(sa=Editor.writeGraphModelToPng(sa,"tEXt","mxfile",encodeURIComponent(H)));U!=this.editor.graph&&U.container.parentNode.removeChild(U.container);K(sa)}),Y=O.pageId||(null!=this.pages?O.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var ca=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Y){var sa=U.getGlobalVariable;U=this.createTemporaryGraph(U.getStylesheet());for(var Aa,Ea=0;Ea<+this.pages.length;Ea++)if(this.pages[Ea].getId()==Y){Aa=this.updatePageRoot(this.pages[Ea]);break}null==Aa&&(Aa=this.currentPage);U.getGlobalVariable=function(Wa){return"page"==Wa?Aa.getName():"pagenumber"==Wa?1:sa.apply(this,arguments)};document.body.appendChild(U.container);U.model.setRoot(Aa.root)}if(null!=O.layerIds){var Ka=U.model,Ma=Ka.getChildCells(Ka.getRoot()),za={};for(Ea=0;Ea<O.layerIds.length;Ea++)za[O.layerIds[Ea]]=!0;for(Ea=0;Ea<Ma.length;Ea++)Ka.setVisible(Ma[Ea],za[Ma[Ea].id]||!1)}Ea=+null;O.keepTheme&&(Ea=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Wa){W(Wa.toDataURL("image/png"))}),O.width,null,O.background,mxUtils.bind(this,function(){W(null)}),null,null,O.scale,O.transparent,O.shadow,null,U,O.border,null,O.grid,Ea)});null!=O.xml&&0<O.xml.length&&(k=!0,this.setFileData(H),k=!1);ca()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==O.format?"1":"0")+(null!=Y?"&pageId="+Y:"")+(null!=O.layerIds&&0<O.layerIds.length?+"&extras="+encodeURIComponent(JSON.stringify({layerIds:O.layerIds})):"")+(null!=O.scale?"&scale="+O.scale:"")+"&base64=1&xml="+encodeURIComponent(H))).send(mxUtils.bind(this,function(sa){200<=sa.getStatus()&&299>=sa.getStatus()?K("data:image/png;base64,"+sa.getText()):W(null)}),mxUtils.bind(this,function(){W(null)}))}}else if(ca=mxUtils.bind(this,function(){var sa=this.createLoadMessage("export");sa.message=O;if("html2"==O.format||"html"==O.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Aa=this.getXmlFileData();sa.xml=mxUtils.getXml(Aa);sa.data=this.getFileData(null,null,!0,null,null,null,Aa);sa.format=O.format}else if("html"==O.format)Aa=this.editor.getGraphXml(),sa.data=this.getHtml(Aa,this.editor.graph),sa.xml=mxUtils.getXml(Aa),sa.format=O.format;else{mxSvgCanvas2D.prototype.foAltText=null;Aa=null!=O.background?O.background:this.editor.graph.background;Aa==mxConstants.NONE&&(Aa=null);sa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);sa.format="svg";var Ea=mxUtils.bind(this,-function(Ma){this.editor.graph.setEnabled(!0);this.spinner.stop();sa.data=Editor.createSvgDataUri(Ma);H.postMessage(JSON.stringify(sa),"*")}),Ka="auto";O.keepTheme&&(Ka=Editor.isDarkMode()?"dark":"light");null!=O.theme&&(Ka=O.theme);if("xmlsvg"==O.format){if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin)){Ka=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ka="auto";null!=O.theme&&(Ka=O.theme);this.getEmbeddedSvg(sa.xml,this.editor.graph,+function(Ma){this.editor.graph.setEnabled(!0);this.spinner.stop();sa.data=Editor.createSvgDataUri(Ma);I.postMessage(JSON.stringify(sa),"*")}),Ka="auto";O.keepTheme&&(Ka=Editor.isDarkMode()?"dark":"light");null!=O.theme&&(Ka=O.theme);if("xmlsvg"==O.format){if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin)){Ka=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ka="auto";null!=O.theme&&(Ka=O.theme);this.getEmbeddedSvg(sa.xml,this.editor.graph,null,!0,Ea,null,null,O.embedImages,Aa,O.scale,O.border,O.shadow,Ka)}}else if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin))this.editor.graph.setEnabled(!1),Aa=this.editor.graph.getSvg(Aa,O.scale,O.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||O.shadow,null,Ka),(this.editor.graph.shadowVisible||O.shadow)&&this.editor.graph.addSvgShadow(Aa),this.embedFonts(Aa,mxUtils.bind(this,function(Ma){O.embedImages||null==-O.embedImages?this.editor.convertImages(Ma,mxUtils.bind(this,function(za){Ea(mxUtils.getXml(za))})):Ea(mxUtils.getXml(Ma))}));return}H.postMessage(JSON.stringify(sa),"*")}),null!=O.xml&&0<O.xml.length){if(this.editor.graph.mathEnabled){var ja=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ja.apply(this,arguments);ba()}}k=!0;this.setFileData(O.xml);k=!1;this.editor.graph.mathEnabled||ba()}else ba();return}if("load"==O.action){S=O.toSketch;B=1==O.autosave;this.hideDialog();null!=O.modified&&null==+O.embedImages?this.editor.convertImages(Ma,mxUtils.bind(this,function(za){Ea(mxUtils.getXml(za))})):Ea(mxUtils.getXml(Ma))}));return}I.postMessage(JSON.stringify(sa),"*")}),null!=O.xml&&0<O.xml.length){if(this.editor.graph.mathEnabled){var ja=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ja.apply(this,arguments);ca()}}k=!0;this.setFileData(O.xml);k=!1;this.editor.graph.mathEnabled||ca()}else ca();return}if("load"==O.action){V=O.toSketch;B=1==O.autosave;this.hideDialog();null!=O.modified&&null==urlParams.modified&&(urlParams.modified=O.modified);null!=O.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=O.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+Shift+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=O.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=O.noSaveBtn);if(null!=O.rough){var oa=Editor.sketchMode;this.doSetSketchMode(O.rough);oa!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=O.dark&&this.setDarkMode(O.dark);null!=O.border&&(this.embedExportBorder=O.border);null!=O.theme&&(this.embedExportTheme=O.theme);null!=O.background&&(this.embedExportBackground=O.background);null!=O.viewport&&(this.embedViewport=O.viewport);this.embedExitPoint=null;if(null!=O.rect){var qa=this.embedExportBorder;-this.diagramContainer.style.left=Math.max(60,O.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,O.rect.top)+"px";this.minInlineWidth=O.minWidth;this.minInlineHeight=O.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var ra=O.maxFitScale,xa=O.rect.width+2*qa,Ba=O.rect.height+2*qa;ea=mxUtils.bind(this,function(){var sa=mxUtils.getDocumentSize();xa=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,+this.diagramContainer.style.left=Math.max(60,O.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,O.rect.top)+"px";this.minInlineWidth=O.minWidth;this.minInlineHeight=O.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var ra=O.maxFitScale,xa=O.rect.width+2*qa,Ba=O.rect.height+2*qa;da=mxUtils.bind(this,function(){var sa=mxUtils.getDocumentSize();xa=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,xa):xa,sa.width-80);sa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Ba):Ba,sa.height-80);this.diagramContainer.style.width=xa+"px";this.diagramContainer.style.height=sa+"px";var Aa=this.editor.graph;sa=Aa.maxFitScale;Aa.maxFitScale=ra;Aa.fit(2*qa,null,null,null,null,null,Ba);this.setPageVisible(!1);if(null!=this.minInlineWidth&&Aa.getGraphBounds().width<this.minInlineWidth){var Ea=Aa.container.scrollTop;this.resetScrollbars();Aa.container.scrollTop=Ea}Aa.maxFitScale=sa;Aa.container.scrollTop-=qa;Aa.container.scrollLeft-=qa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[O]));Aa.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Aa.container.style.top);var Ka=Aa.getGraphBounds();Aa.container.clientWidth>Ka.width+2*qa&&(Aa.container.scrollLeft=Ka.x+(Ka.width+qa-Aa.container.clientWidth)/2)}),10)})}null!=O.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=O.noExitBtn);null!=O.title&&null!=this.buttonContainer&&(ma=this.createStatusDiv(""),mxUtils.write(ma,O.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(ma),this.embedFilenameSpan=ma);try{O.libs&&this.sidebar.showEntries(O.libs)}catch(sa){}O=null!=O.xmlpng?this.extractGraphModelFromPng(O.xmlpng):null!=O.descriptor?O.descriptor:O.xml}else{if("merge"==O.action){var ya=this.getCurrentFile();-null!=ya&&(ma=fa(O.xml),null!=ma&&""!=ma&&ya.mergeFile(new LocalFile(this,ma),function(){H.postMessage(JSON.stringify({event:"merge",message:O}),"*")},function(sa){H.postMessage(JSON.stringify({event:"merge",message:O,error:sa}),"*")}))}else"remoteInvokeReady"==O.action?this.handleRemoteInvokeReady(H):"remoteInvoke"==O.action?this.handleRemoteInvoke(O,M.origin):"remoteInvokeResponse"==O.action?this.handleRemoteInvokeResponse(O):H.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(O)}),-"*");return}}catch(sa){this.handleError(sa)}}var Da=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),La=mxUtils.bind(this,function(sa,Aa){k=!0;try{c(sa,Aa,null,S)}catch(Ea){this.handleError(Ea)}k=!1;null!=urlParams.modified&&this.editor.setStatus("");z=Da();B&&null==f&&(f=mxUtils.bind(this,function(Ea,Ka){Ea=Da();Ea==z||k||(Ka=this.createLoadMessage("autosave"),Ka.xml=Ea,(window.opener||+null!=ya&&(ma=fa(O.xml),null!=ma&&""!=ma&&ya.mergeFile(new LocalFile(this,ma),function(){I.postMessage(JSON.stringify({event:"merge",message:O}),"*")},function(sa){I.postMessage(JSON.stringify({event:"merge",message:O,error:sa}),"*")}))}else"remoteInvokeReady"==O.action?this.handleRemoteInvokeReady(I):"remoteInvoke"==O.action?this.handleRemoteInvoke(O,J.origin):"remoteInvokeResponse"==O.action?this.handleRemoteInvokeResponse(O):I.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(O)}),+"*");return}}catch(sa){this.handleError(sa)}}var Da=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),La=mxUtils.bind(this,function(sa,Aa){k=!0;try{c(sa,Aa,null,V)}catch(Ea){this.handleError(Ea)}k=!1;null!=urlParams.modified&&this.editor.setStatus("");z=Da();B&&null==f&&(f=mxUtils.bind(this,function(Ea,Ka){Ea=Da();Ea==z||k||(Ka=this.createLoadMessage("autosave"),Ka.xml=Ea,(window.opener||window.parent).postMessage(JSON.stringify(Ka),"*"));z=Ea}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",-f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));if("1"==urlParams.returnbounds||"json"==urlParams.proto)Aa=this.createLoadMessage("load"),Aa.xml=sa,H.postMessage(JSON.stringify(Aa),"*");null!=ea&&ea()});null!=O&&"function"===typeof O.substring&&"data:application/vnd.visio;base64,"==O.substring(0,34)?(fa="0M8R4KGxGuE"==O.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(O.substring(O.indexOf(",")+1)),function(sa){La(sa,M)},mxUtils.bind(this,-function(sa){this.handleError(sa)}),fa)):null!=O&&"function"===typeof O.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(O,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(O,mxUtils.bind(this,function(sa){4==sa.readyState&&(200<=sa.status&&299>=sa.status&&"<mxGraphModel"==sa.responseText.substring(0,13)?La(sa.responseText,M):this.handleError({message:413==sa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),-""):null!=O&&"function"===typeof O.substring&&this.isLucidChartData(O)?this.convertLucidChart(O,mxUtils.bind(this,function(sa){La(sa)}),mxUtils.bind(this,function(sa){this.handleError(sa)})):null==O||"object"!==typeof O||null==O.format||null==O.data&&null==O.url?(O=fa(O),La(O,M)):this.loadDescriptor(O,mxUtils.bind(this,function(sa){La(Da(),M)}),mxUtils.bind(this,function(sa){this.handleError(sa,mxResources.get("errorLoadingFile"))}))}}));var H=window.opener||window.parent;C="json"==urlParams.proto?-JSON.stringify({event:"init"}):urlParams.ready||"ready";H.postMessage(C,"*");if("json"==urlParams.proto){var K=this.editor.graph.openLink;this.editor.graph.openLink=function(M,O,ea){K.apply(this,arguments);H.postMessage(JSON.stringify({event:"openLink",href:M,target:O,allowOpener:ea}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,f,k,B){var z="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme,C=document.createElement("button");C.setAttribute("title",+f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));if("1"==urlParams.returnbounds||"json"==urlParams.proto)Aa=this.createLoadMessage("load"),Aa.xml=sa,I.postMessage(JSON.stringify(Aa),"*");null!=da&&da()});null!=O&&"function"===typeof O.substring&&"data:application/vnd.visio;base64,"==O.substring(0,34)?(fa="0M8R4KGxGuE"==O.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(O.substring(O.indexOf(",")+1)),function(sa){La(sa,J)},mxUtils.bind(this,+function(sa){this.handleError(sa)}),fa)):null!=O&&"function"===typeof O.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(O,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(O,mxUtils.bind(this,function(sa){4==sa.readyState&&(200<=sa.status&&299>=sa.status&&"<mxGraphModel"==sa.responseText.substring(0,13)?La(sa.responseText,J):this.handleError({message:413==sa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),+""):null!=O&&"function"===typeof O.substring&&this.isLucidChartData(O)?this.convertLucidChart(O,mxUtils.bind(this,function(sa){La(sa)}),mxUtils.bind(this,function(sa){this.handleError(sa)})):null==O||"object"!==typeof O||null==O.format||null==O.data&&null==O.url?(O=fa(O),La(O,J)):this.loadDescriptor(O,mxUtils.bind(this,function(sa){La(Da(),J)}),mxUtils.bind(this,function(sa){this.handleError(sa,mxResources.get("errorLoadingFile"))}))}}));var I=window.opener||window.parent;C="json"==urlParams.proto?+JSON.stringify({event:"init"}):urlParams.ready||"ready";I.postMessage(C,"*");if("json"==urlParams.proto){var L=this.editor.graph.openLink;this.editor.graph.openLink=function(J,O,da){L.apply(this,arguments);I.postMessage(JSON.stringify({event:"openLink",href:J,target:O,allowOpener:da}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,f,k,B){var z="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme,C=document.createElement("button");C.setAttribute("title",c+(null!=k?" ("+k+")":""));C.style.marginLeft="6px";mxUtils.write(C,c);z?(C.className=B?"gePrimaryBtn":"",C.style.marginLeft="8px",C.style.padding="6px"):C.className="geBigButton"+(B?"":" geBigStandardButton");mxEvent.addListener(C,"click",f);return C};EditorUi.prototype.addEmbedButtons=function(){var c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.marginLeft="auto";"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme&&(c.style.marginRight="66px",c.style["float"]="right","atlas"==Editor.currentTheme&&(c.style.marginTop="2px"));document.createElement("button").className="geBigButton";"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&c.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(c.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&c.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&c.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct));"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||null==this.buttonContainer?null!=this.menubar&&(this.toolbar.container.appendChild(c),this.toolbar.staticElements.push(c)):(this.buttonContainer.appendChild(c),this.editor.fireEvent(new mxEventObject("statusChanged")))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var B=JSON.parse(k);this.executeLayouts(this.editor.graph.createLayouts(B));this.customLayoutConfig=B;this.hideDialog()}catch(z){this.handleError(z)}}),-null,null,null,null,mxUtils.bind(this,function(k,B){var z=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var C=B.value;B.value=JSON.stringify(JSON.parse(C));B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));B.value=C}catch(H){this.handleError(H)}}));z.setAttribute("title","copy");z.className="geBtn";k.appendChild(z)}),!0,null,+null,null,null,null,mxUtils.bind(this,function(k,B){var z=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var C=B.value;B.value=JSON.stringify(JSON.parse(C));B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));B.value=C}catch(I){this.handleError(I)}}));z.setAttribute("title","copy");z.className="geBtn";k.appendChild(z)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(f.container,620,460,!0,!0);f.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(f){var k=mxUtils.bind(this,function(){this.loadingOrgChart=!1;f.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),B=mxUtils.bind(this,function(z){this.loadingOrgChart=!1;f.clear()&&this.handleError(z)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?k():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",k,null,null,null,B)},null,null,null,B)},null,null,null,B)},null,null,null,B):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",k,null,null,null,B))}),onerror)};-EditorUi.prototype.importCsv=function(c,f){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f)}))};EditorUi.prototype.doImportCsv=function(c,f){try{var k=c.split("\n"),B=[],z=[],C=[],H={};if(0<k.length){var K={},M=this.editor.graph,O=null,ea=null,fa=null,S=null,ca=null,ma=null,la=null,Z="whiteSpace=wrap;html=1;",da=null,aa=null,l="",t="auto",I="auto",V=!1,J=null,W=null,Y=40,ba=40,ja=100,oa=0,qa=mxUtils.bind(this,function(){null!=f?f(Ca):(M.setSelectionCells(Ca),M.scrollCellToVisible(M.getSelectionCell()));-null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ra=M.getFreeInsertPoint(),xa=ra.x,Ba=ra.y;ra=Ba;var ya=null,Da="auto";aa=null;for(var La=[],sa=null,Aa=null,Ea=0;Ea<k.length&&"#"==k[Ea].charAt(0);){c=k[Ea].replace(/\r$/,"");for(Ea++;Ea<k.length&&"\\"==c.charAt(c.length-1)&&"#"==k[Ea].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(k[Ea].substring(1)),Ea++;if("#"!=c.charAt(1)){var Ka=c.indexOf(":");if(0<Ka){var Ma=mxUtils.trim(c.substring(1,-Ka)),za=mxUtils.trim(c.substring(Ka+1));"label"==Ma?ya=Graph.sanitizeHtml(za):"labelname"==Ma&&0<za.length&&"-"!=za?ca=za:"labels"==Ma&&0<za.length&&"-"!=za?la=JSON.parse(za):"style"==Ma?ea=za:"parentstyle"==Ma?Z=za:"unknownStyle"==Ma&&"-"!=za?ma=za:"stylename"==Ma&&0<za.length&&"-"!=za?S=za:"styles"==Ma&&0<za.length&&"-"!=za?fa=JSON.parse(za):"vars"==Ma&&0<za.length&&"-"!=za?O=JSON.parse(za):"identity"==Ma&&0<za.length&&"-"!=za?da=za:"parent"==Ma&&0<za.length&&"-"!=za?aa=za:"namespace"==Ma&&0<za.length&&-"-"!=za?l=za:"width"==Ma?t=za:"height"==Ma?I=za:"collapsed"==Ma&&"-"!=za?V="true"==za:"left"==Ma&&0<za.length?J=za:"top"==Ma&&0<za.length?W=za:"ignore"==Ma?Aa=za.split(","):"connect"==Ma?La.push(JSON.parse(za)):"link"==Ma?sa=za:"padding"==Ma?oa=parseFloat(za):"edgespacing"==Ma?Y=parseFloat(za):"nodespacing"==Ma?ba=parseFloat(za):"levelspacing"==Ma?ja=parseFloat(za):"layout"==Ma&&(Da=za)}}}if(null==k[Ea])throw Error(mxResources.get("invalidOrMissingFile"));var Wa=this.editor.csvToArray(k[Ea].replace(/\r$/,-""));Ka=c=null;Ma=[];for(za=0;za<Wa.length;za++)da==Wa[za]&&(c=za),aa==Wa[za]&&(Ka=za),Ma.push(mxUtils.trim(Wa[za]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ya&&(ya="%"+Ma[0]+"%");if(null!=La)for(var Ia=0;Ia<La.length;Ia++)null==K[La[Ia].to]&&(K[La[Ia].to]={});da=[];for(za=Ea+1;za<k.length;za++){var Xa=this.editor.csvToArray(k[za].replace(/\r$/,""));if(null==Xa){var Pa=40<k[za].length?k[za].substring(0,40)+"...":k[za];throw Error(Pa+" ("+za+"):\n"+mxResources.get("containsValidationErrors"));-}0<Xa.length&&da.push(Xa)}M.model.beginUpdate();try{for(za=0;za<da.length;za++){Xa=da[za];var u=null,N=null!=c?l+Xa[c]:null;k=!1;null!=N&&(u=M.model.getCell(N),k=null==u||0<=mxUtils.indexOf(B,u));var R=new mxCell(ya,new mxGeometry(xa,ra,0,0),ea||"whiteSpace=wrap;html=1;");R.collapsed=V;R.vertex=!0;R.id=N;null==u||k||M.model.setCollapsed(u,V);for(var X=0;X<Xa.length;X++)M.setAttributeForCell(R,Ma[X],Xa[X]),null==u||k||M.setAttributeForCell(u,Ma[X],Xa[X]);if(null!=ca&&null!=la){var ia=la[R.getAttribute(ca)];-null!=ia&&(M.labelChanged(R,ia),null==u||k||M.cellLabelChanged(u,ia))}if(null!=S&&null!=fa){var ka=fa[R.getAttribute(S)];null!=ka&&(R.style=ka)}M.setAttributeForCell(R,"placeholders","1");R.style=M.replacePlaceholders(R,R.style,O);null==u||k?M.fireEvent(new mxEventObject("cellsInserted","cells",[R])):(M.model.setStyle(u,R.style),0>mxUtils.indexOf(C,u)&&C.push(u),M.fireEvent(new mxEventObject("cellsInserted","cells",[u])));k=null!=u;u=R;if(!k)for(Ia=0;Ia<La.length;Ia++)K[La[Ia].to][u.getAttribute(La[Ia].to)]=-u;null!=sa&&"link"!=sa&&(M.setLinkForCell(u,u.getAttribute(sa)),M.setAttributeForCell(u,sa,null));var pa=this.editor.graph.getPreferredSizeForCell(u);aa=null!=Ka?M.model.getCell(l+Xa[Ka]):null;if(u.vertex){Pa=null!=aa?0:xa;Ea=null!=aa?0:Ba;null!=J&&null!=u.getAttribute(J)&&(u.geometry.x=Pa+parseFloat(u.getAttribute(J)));null!=W&&null!=u.getAttribute(W)&&(u.geometry.y=Ea+parseFloat(u.getAttribute(W)));var wa="@"==t.charAt(0)?u.getAttribute(t.substring(1)):null;u.geometry.width=null!=wa&&"auto"!=wa?-parseFloat(u.getAttribute(t.substring(1))):"auto"==t||"auto"==wa?pa.width+oa:parseFloat(t);var ta="@"==I.charAt(0)?u.getAttribute(I.substring(1)):null;u.geometry.height=null!=ta&&"auto"!=ta&&"width"!=I?parseFloat(ta):"auto"==I||"auto"==ta?pa.height+oa:"width"==I?u.geometry.width:parseFloat(I);ra+=u.geometry.height+ba}k?(null==H[N]&&(H[N]=[]),H[N].push(u)):(B.push(u),null!=aa?(aa.style=M.replacePlaceholders(aa,Z,O),M.addCell(u,aa),z.push(aa)):C.push(M.addCell(u)))}for(za=0;za<z.length;za++)wa="@"==-t.charAt(0)?z[za].getAttribute(t.substring(1)):null,ta="@"==I.charAt(0)?z[za].getAttribute(I.substring(1)):null,"auto"!=t&&"auto"!=wa||"auto"!=I&&"auto"!=ta||M.updateGroupBounds([z[za]],oa,!0);var ua=C.slice(),Ca=C.slice();for(Ia=0;Ia<La.length;Ia++){var Na=La[Ia];for(za=0;za<B.length;za++){u=B[za];var Ya=mxUtils.bind(this,function(nb,lb,db){var mb=lb.getAttribute(db.from);if(null!=mb&&""!=mb){mb=mb.split(",");for(var ub=0;ub<mb.length;ub++){var eb=K[db.to][mb[ub]];if(null==eb&&null!=ma){eb=new mxCell(mb[ub],-new mxGeometry(xa,Ba,0,0),ma);eb.style=M.replacePlaceholders(lb,eb.style,O);var ob=this.editor.graph.getPreferredSizeForCell(eb);eb.geometry.width=ob.width+oa;eb.geometry.height=ob.height+oa;K[db.to][mb[ub]]=eb;eb.vertex=!0;eb.id=mb[ub];C.push(M.addCell(eb))}if(null!=eb){ob=db.label;null!=db.fromlabel&&(ob=(lb.getAttribute(db.fromlabel)||"")+(ob||""));null!=db.sourcelabel&&(ob=M.replacePlaceholders(lb,db.sourcelabel,O)+(ob||""));null!=db.tolabel&&(ob=(ob||"")+(eb.getAttribute(db.tolabel)||""));null!=-db.targetlabel&&(ob=(ob||"")+M.replacePlaceholders(eb,db.targetlabel,O));var tb="target"==db.placeholders==!db.invert?eb:nb;tb=null!=db.style?M.replacePlaceholders(tb,db.style,O):M.createCurrentEdgeStyle();ob=M.insertEdge(null,null,ob||"",db.invert?eb:nb,db.invert?nb:eb,tb);if(null!=db.labels)for(tb=0;tb<db.labels.length;tb++){var pb=db.labels[tb],wb=new mxCell(pb.label||tb,new mxGeometry(null!=pb.x?pb.x:0,null!=pb.y?pb.y:0,0,0),"resizable=0;html=1;");wb.vertex=!0;wb.connectable=!1;wb.geometry.relative=-!0;null!=pb.placeholders&&(wb.value=M.replacePlaceholders("target"==pb.placeholders==!db.invert?eb:nb,wb.value,O));if(null!=pb.dx||null!=pb.dy)wb.geometry.offset=new mxPoint(null!=pb.dx?pb.dx:0,null!=pb.dy?pb.dy:0);ob.insert(wb)}if(null!=db.data)for(var vb in db.data)M.setAttributeForCell(ob,vb,db.data[vb]);Ca.push(ob);mxUtils.remove(db.invert?nb:eb,ua)}}}});Ya(u,u,Na);if(null!=H[u.id])for(X=0;X<H[u.id].length;X++)Ya(u,H[u.id][X],Na)}}if(null!=Aa)for(za=0;za<B.length;za++)for(u=B[za],X=0;X<Aa.length;X++)M.setAttributeForCell(u,-mxUtils.trim(Aa[X]),null);if(0<C.length){var Za=new mxParallelEdgeLayout(M);Za.spacing=Y;Za.checkOverlap=!0;var ab=function(){0<Za.spacing&&Za.execute(M.getDefaultParent());for(var nb=0;nb<C.length;nb++){var lb=M.getCellGeometry(C[nb]);lb.x=Math.round(M.snap(lb.x));lb.y=Math.round(M.snap(lb.y));"auto"==t&&(lb.width=Math.round(M.snap(lb.width)));"auto"==I&&(lb.height=Math.round(M.snap(lb.height)))}};if("["==Da.charAt(0)){var Ra=qa;M.view.validate();this.executeLayouts(M.createLayouts(JSON.parse(Da)),-function(){ab();Ra()});qa=null}else if("circle"==Da){var Oa=new mxCircleLayout(M);Oa.disableEdgeStyle=!1;Oa.resetEdges=!1;var kb=Oa.isVertexIgnored;Oa.isVertexIgnored=function(nb){return kb.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){Oa.execute(M.getDefaultParent());ab()},!0,qa);qa=null}else if("horizontaltree"==Da||"verticaltree"==Da||"auto"==Da&&Ca.length==2*C.length-1&&1==ua.length){M.view.validate();var cb=new mxCompactTreeLayout(M,"horizontaltree"==Da);cb.levelDistance=-ba;cb.edgeRouting=!1;cb.resetEdges=!1;cb.sortEdges=!0;this.executeLayout(function(){cb.execute(M.getDefaultParent(),0<ua.length?ua[0]:null)},!0,qa);qa=null}else if("horizontalflow"==Da||"verticalflow"==Da||"auto"==Da&&1==ua.length){M.view.validate();var $a=new mxHierarchicalLayout(M,"horizontalflow"==Da?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);$a.intraCellSpacing=ba;$a.parallelEdgeSpacing=Y;$a.interRankCellSpacing=ja;$a.disableEdgeStyle=!1;this.executeLayout(function(){$a.execute(M.getDefaultParent(),-Ca);M.moveCells(Ca,xa,Ba)},!0,qa);qa=null}else if("orgchart"==Da){M.view.validate();var fb=new mxOrgChartLayout(M,2,ja,ba),jb=fb.isVertexIgnored;fb.isVertexIgnored=function(nb){return jb.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){fb.execute(M.getDefaultParent());ab()},!0,qa);qa=null}else if("organic"==Da||"auto"==Da&&Ca.length>C.length){M.view.validate();var sb=new mxFastOrganicLayout(M);sb.forceConstant=3*ba;sb.disableEdgeStyle=!1;sb.resetEdges=!1;var Ab=sb.isVertexIgnored;-sb.isVertexIgnored=function(nb){return Ab.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){sb.execute(M.getDefaultParent());ab()},!0,qa);qa=null}}this.hideDialog()}finally{M.model.endUpdate()}null!=qa&&qa()}}catch(nb){this.handleError(nb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",B;for(B in urlParams)0>mxUtils.indexOf(c,B)&&null!=urlParams[B]&&(f+=k+B+"="+urlParams[B],+EditorUi.prototype.importCsv=function(c,f){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f)}))};EditorUi.prototype.doImportCsv=function(c,f){try{var k=c.split("\n"),B=[],z=[],C=[],I={};if(0<k.length){var L={},J=this.editor.graph,O=null,da=null,fa=null,V=null,ba=null,ma=null,la=null,Z="whiteSpace=wrap;html=1;",ea=null,aa=null,l="",t="auto",H="auto",U=!1,K=null,W=null,Y=40,ca=40,ja=100,oa=0,qa=mxUtils.bind(this,function(){null!=f?f(Ca):(J.setSelectionCells(Ca),J.scrollCellToVisible(J.getSelectionCell()));+null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ra=J.getFreeInsertPoint(),xa=ra.x,Ba=ra.y;ra=Ba;var ya=null,Da="auto";aa=null;for(var La=[],sa=null,Aa=null,Ea=0;Ea<k.length&&"#"==k[Ea].charAt(0);){c=k[Ea].replace(/\r$/,"");for(Ea++;Ea<k.length&&"\\"==c.charAt(c.length-1)&&"#"==k[Ea].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(k[Ea].substring(1)),Ea++;if("#"!=c.charAt(1)){var Ka=c.indexOf(":");if(0<Ka){var Ma=mxUtils.trim(c.substring(1,+Ka)),za=mxUtils.trim(c.substring(Ka+1));"label"==Ma?ya=Graph.sanitizeHtml(za):"labelname"==Ma&&0<za.length&&"-"!=za?ba=za:"labels"==Ma&&0<za.length&&"-"!=za?la=JSON.parse(za):"style"==Ma?da=za:"parentstyle"==Ma?Z=za:"unknownStyle"==Ma&&"-"!=za?ma=za:"stylename"==Ma&&0<za.length&&"-"!=za?V=za:"styles"==Ma&&0<za.length&&"-"!=za?fa=JSON.parse(za):"vars"==Ma&&0<za.length&&"-"!=za?O=JSON.parse(za):"identity"==Ma&&0<za.length&&"-"!=za?ea=za:"parent"==Ma&&0<za.length&&"-"!=za?aa=za:"namespace"==Ma&&0<za.length&&+"-"!=za?l=za:"width"==Ma?t=za:"height"==Ma?H=za:"collapsed"==Ma&&"-"!=za?U="true"==za:"left"==Ma&&0<za.length?K=za:"top"==Ma&&0<za.length?W=za:"ignore"==Ma?Aa=za.split(","):"connect"==Ma?La.push(JSON.parse(za)):"link"==Ma?sa=za:"padding"==Ma?oa=parseFloat(za):"edgespacing"==Ma?Y=parseFloat(za):"nodespacing"==Ma?ca=parseFloat(za):"levelspacing"==Ma?ja=parseFloat(za):"layout"==Ma&&(Da=za)}}}if(null==k[Ea])throw Error(mxResources.get("invalidOrMissingFile"));var Wa=this.editor.csvToArray(k[Ea].replace(/\r$/,+""));Ka=c=null;Ma=[];for(za=0;za<Wa.length;za++)ea==Wa[za]&&(c=za),aa==Wa[za]&&(Ka=za),Ma.push(mxUtils.trim(Wa[za]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ya&&(ya="%"+Ma[0]+"%");if(null!=La)for(var Ia=0;Ia<La.length;Ia++)null==L[La[Ia].to]&&(L[La[Ia].to]={});ea=[];for(za=Ea+1;za<k.length;za++){var Xa=this.editor.csvToArray(k[za].replace(/\r$/,""));if(null==Xa){var Pa=40<k[za].length?k[za].substring(0,40)+"...":k[za];throw Error(Pa+" ("+za+"):\n"+mxResources.get("containsValidationErrors"));+}0<Xa.length&&ea.push(Xa)}J.model.beginUpdate();try{for(za=0;za<ea.length;za++){Xa=ea[za];var u=null,N=null!=c?l+Xa[c]:null;k=!1;null!=N&&(u=J.model.getCell(N),k=null==u||0<=mxUtils.indexOf(B,u));var R=new mxCell(ya,new mxGeometry(xa,ra,0,0),da||"whiteSpace=wrap;html=1;");R.collapsed=U;R.vertex=!0;R.id=N;null==u||k||J.model.setCollapsed(u,U);for(var X=0;X<Xa.length;X++)J.setAttributeForCell(R,Ma[X],Xa[X]),null==u||k||J.setAttributeForCell(u,Ma[X],Xa[X]);if(null!=ba&&null!=la){var ia=la[R.getAttribute(ba)];+null!=ia&&(J.labelChanged(R,ia),null==u||k||J.cellLabelChanged(u,ia))}if(null!=V&&null!=fa){var ka=fa[R.getAttribute(V)];null!=ka&&(R.style=ka)}J.setAttributeForCell(R,"placeholders","1");R.style=J.replacePlaceholders(R,R.style,O);null==u||k?J.fireEvent(new mxEventObject("cellsInserted","cells",[R])):(J.model.setStyle(u,R.style),0>mxUtils.indexOf(C,u)&&C.push(u),J.fireEvent(new mxEventObject("cellsInserted","cells",[u])));k=null!=u;u=R;if(!k)for(Ia=0;Ia<La.length;Ia++)L[La[Ia].to][u.getAttribute(La[Ia].to)]=+u;null!=sa&&"link"!=sa&&(J.setLinkForCell(u,u.getAttribute(sa)),J.setAttributeForCell(u,sa,null));var pa=this.editor.graph.getPreferredSizeForCell(u);aa=null!=Ka?J.model.getCell(l+Xa[Ka]):null;if(u.vertex){Pa=null!=aa?0:xa;Ea=null!=aa?0:Ba;null!=K&&null!=u.getAttribute(K)&&(u.geometry.x=Pa+parseFloat(u.getAttribute(K)));null!=W&&null!=u.getAttribute(W)&&(u.geometry.y=Ea+parseFloat(u.getAttribute(W)));var wa="@"==t.charAt(0)?u.getAttribute(t.substring(1)):null;u.geometry.width=null!=wa&&"auto"!=wa?+parseFloat(u.getAttribute(t.substring(1))):"auto"==t||"auto"==wa?pa.width+oa:parseFloat(t);var ta="@"==H.charAt(0)?u.getAttribute(H.substring(1)):null;u.geometry.height=null!=ta&&"auto"!=ta&&"width"!=H?parseFloat(ta):"auto"==H||"auto"==ta?pa.height+oa:"width"==H?u.geometry.width:parseFloat(H);ra+=u.geometry.height+ca}k?(null==I[N]&&(I[N]=[]),I[N].push(u)):(B.push(u),null!=aa?(aa.style=J.replacePlaceholders(aa,Z,O),J.addCell(u,aa),z.push(aa)):C.push(J.addCell(u)))}for(za=0;za<z.length;za++)wa="@"==+t.charAt(0)?z[za].getAttribute(t.substring(1)):null,ta="@"==H.charAt(0)?z[za].getAttribute(H.substring(1)):null,"auto"!=t&&"auto"!=wa||"auto"!=H&&"auto"!=ta||J.updateGroupBounds([z[za]],oa,!0);var ua=C.slice(),Ca=C.slice();for(Ia=0;Ia<La.length;Ia++){var Na=La[Ia];for(za=0;za<B.length;za++){u=B[za];var Ya=mxUtils.bind(this,function(nb,lb,db){var mb=lb.getAttribute(db.from);if(null!=mb&&""!=mb){mb=mb.split(",");for(var ub=0;ub<mb.length;ub++){var eb=L[db.to][mb[ub]];if(null==eb&&null!=ma){eb=new mxCell(mb[ub],+new mxGeometry(xa,Ba,0,0),ma);eb.style=J.replacePlaceholders(lb,eb.style,O);var ob=this.editor.graph.getPreferredSizeForCell(eb);eb.geometry.width=ob.width+oa;eb.geometry.height=ob.height+oa;L[db.to][mb[ub]]=eb;eb.vertex=!0;eb.id=mb[ub];C.push(J.addCell(eb))}if(null!=eb){ob=db.label;null!=db.fromlabel&&(ob=(lb.getAttribute(db.fromlabel)||"")+(ob||""));null!=db.sourcelabel&&(ob=J.replacePlaceholders(lb,db.sourcelabel,O)+(ob||""));null!=db.tolabel&&(ob=(ob||"")+(eb.getAttribute(db.tolabel)||""));null!=+db.targetlabel&&(ob=(ob||"")+J.replacePlaceholders(eb,db.targetlabel,O));var tb="target"==db.placeholders==!db.invert?eb:nb;tb=null!=db.style?J.replacePlaceholders(tb,db.style,O):J.createCurrentEdgeStyle();ob=J.insertEdge(null,null,ob||"",db.invert?eb:nb,db.invert?nb:eb,tb);if(null!=db.labels)for(tb=0;tb<db.labels.length;tb++){var pb=db.labels[tb],wb=new mxCell(pb.label||tb,new mxGeometry(null!=pb.x?pb.x:0,null!=pb.y?pb.y:0,0,0),"resizable=0;html=1;");wb.vertex=!0;wb.connectable=!1;wb.geometry.relative=+!0;null!=pb.placeholders&&(wb.value=J.replacePlaceholders("target"==pb.placeholders==!db.invert?eb:nb,wb.value,O));if(null!=pb.dx||null!=pb.dy)wb.geometry.offset=new mxPoint(null!=pb.dx?pb.dx:0,null!=pb.dy?pb.dy:0);ob.insert(wb)}if(null!=db.data)for(var vb in db.data)J.setAttributeForCell(ob,vb,db.data[vb]);Ca.push(ob);mxUtils.remove(db.invert?nb:eb,ua)}}}});Ya(u,u,Na);if(null!=I[u.id])for(X=0;X<I[u.id].length;X++)Ya(u,I[u.id][X],Na)}}if(null!=Aa)for(za=0;za<B.length;za++)for(u=B[za],X=0;X<Aa.length;X++)J.setAttributeForCell(u,+mxUtils.trim(Aa[X]),null);if(0<C.length){var Za=new mxParallelEdgeLayout(J);Za.spacing=Y;Za.checkOverlap=!0;var ab=function(){0<Za.spacing&&Za.execute(J.getDefaultParent());for(var nb=0;nb<C.length;nb++){var lb=J.getCellGeometry(C[nb]);lb.x=Math.round(J.snap(lb.x));lb.y=Math.round(J.snap(lb.y));"auto"==t&&(lb.width=Math.round(J.snap(lb.width)));"auto"==H&&(lb.height=Math.round(J.snap(lb.height)))}};if("["==Da.charAt(0)){var Ra=qa;J.view.validate();this.executeLayouts(J.createLayouts(JSON.parse(Da)),+function(){ab();Ra()});qa=null}else if("circle"==Da){var Oa=new mxCircleLayout(J);Oa.disableEdgeStyle=!1;Oa.resetEdges=!1;var kb=Oa.isVertexIgnored;Oa.isVertexIgnored=function(nb){return kb.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){Oa.execute(J.getDefaultParent());ab()},!0,qa);qa=null}else if("horizontaltree"==Da||"verticaltree"==Da||"auto"==Da&&Ca.length==2*C.length-1&&1==ua.length){J.view.validate();var cb=new mxCompactTreeLayout(J,"horizontaltree"==Da);cb.levelDistance=+ca;cb.edgeRouting=!1;cb.resetEdges=!1;cb.sortEdges=!0;this.executeLayout(function(){cb.execute(J.getDefaultParent(),0<ua.length?ua[0]:null)},!0,qa);qa=null}else if("horizontalflow"==Da||"verticalflow"==Da||"auto"==Da&&1==ua.length){J.view.validate();var $a=new mxHierarchicalLayout(J,"horizontalflow"==Da?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);$a.intraCellSpacing=ca;$a.parallelEdgeSpacing=Y;$a.interRankCellSpacing=ja;$a.disableEdgeStyle=!1;this.executeLayout(function(){$a.execute(J.getDefaultParent(),+Ca);J.moveCells(Ca,xa,Ba)},!0,qa);qa=null}else if("orgchart"==Da){J.view.validate();var fb=new mxOrgChartLayout(J,2,ja,ca),jb=fb.isVertexIgnored;fb.isVertexIgnored=function(nb){return jb.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){fb.execute(J.getDefaultParent());ab()},!0,qa);qa=null}else if("organic"==Da||"auto"==Da&&Ca.length>C.length){J.view.validate();var sb=new mxFastOrganicLayout(J);sb.forceConstant=3*ca;sb.disableEdgeStyle=!1;sb.resetEdges=!1;var Ab=sb.isVertexIgnored;+sb.isVertexIgnored=function(nb){return Ab.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){sb.execute(J.getDefaultParent());ab()},!0,qa);qa=null}}this.hideDialog()}finally{J.model.endUpdate()}null!=qa&&qa()}}catch(nb){this.handleError(nb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",B;for(B in urlParams)0>mxUtils.indexOf(c,B)&&null!=urlParams[B]&&(f+=k+B+"="+urlParams[B],k="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),B;for(B in urlParams)0>mxUtils.indexOf(k,B)&&(c=0==f?c+"?":c+"&",null!=urlParams[B]&&(c+=B+"="+urlParams[B],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,k,B,z){c=new LinkDialog(this,c,f,k,!0,B,z);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var k=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();@@ -3937,62 +3939,62 @@ f=this.getCurrentFile(),k=this.getSelectionState(),B=this.isDiagramActive(),z="10==k.edges.length&&1==k.vertices.length);this.actions.get("editImage").setEnabled(B&&k.image&&0<k.cells.length);this.actions.get("crop").setEnabled(B&&k.image&&0<k.cells.length);this.actions.get("pageSetup").setEnabled(B);this.actions.get("shadowVisible").setEnabled(B);this.actions.get("connectionArrows").setEnabled(B);this.actions.get("connectionPoints").setEnabled(B);this.actions.get("copyStyle").setEnabled(B&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&B&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length);this.actions.get("createShape").setEnabled(B);this.actions.get("createRevision").setEnabled(B);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(B&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=-f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("hidden"!=this.diagramContainer.style.visibility);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(B&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var U=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=-null);U.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,B,z,C,H,K){var M=c.editor.graph;if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(M.getSvg(B,z,C)),"image/svg+xml");else{var O=c.getFileData(!0,null,null,null,null,!0),ea=M.getGraphBounds(),fa=Math.floor(ea.width*z/M.view.scale),S=-Math.floor(ea.height*z/M.view.scale);if(O.length<=MAX_REQUEST_SIZE&&fa*S<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.isExportToCanvas()){var ca={globalVars:M.getExportVariables()};K&&(ca.grid={size:M.gridSize,steps:M.view.gridSteps,color:M.view.gridColor});c.saveRequest(f,k,function(ma,la){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(la||"0")+(null!=ma?"&filename="+encodeURIComponent(ma):"")+"&extras="+encodeURIComponent(JSON.stringify(ca))+(0<H?"&dpi="+H:"")+"&bg="+-(null!=B?B:"none")+"&w="+fa+"&h="+S+"&border="+C+"&xml="+encodeURIComponent(O))})}else"png"==k?c.exportImage(z,null==B||"none"==B,!0,!1,!1,C,!0,!1,null,K,H):c.exportImage(z,!1,!0,!1,!1,C,!0,!1,"jpeg",K);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var B=c;this.currentPage!=this.pages[k]&&(B=this.createTemporaryGraph(c.getStylesheet()),+f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("hidden"!=this.diagramContainer.style.visibility);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(B&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var T=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=+null);T.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,B,z,C,I,L){var J=c.editor.graph;if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(J.getSvg(B,z,C)),"image/svg+xml");else{var O=c.getFileData(!0,null,null,null,null,!0),da=J.getGraphBounds(),fa=Math.floor(da.width*z/J.view.scale),V=+Math.floor(da.height*z/J.view.scale);if(O.length<=MAX_REQUEST_SIZE&&fa*V<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.isExportToCanvas()){var ba={globalVars:J.getExportVariables()};L&&(ba.grid={size:J.gridSize,steps:J.view.gridSteps,color:J.view.gridColor});c.saveRequest(f,k,function(ma,la){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(la||"0")+(null!=ma?"&filename="+encodeURIComponent(ma):"")+"&extras="+encodeURIComponent(JSON.stringify(ba))+(0<I?"&dpi="+I:"")+"&bg="++(null!=B?B:"none")+"&w="+fa+"&h="+V+"&border="+C+"&xml="+encodeURIComponent(O))})}else"png"==k?c.exportImage(z,null==B||"none"==B,!0,!1,!1,C,!0,!1,null,L,I):c.exportImage(z,!1,!0,!1,!1,C,!0,!1,"jpeg",L);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var B=c;this.currentPage!=this.pages[k]&&(B=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),B.model.setRoot(this.pages[k].root));f+=this.pages[k].getName()+" "+B.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},k=document.createElement("div");k.style.whiteSpace="nowrap";var B=document.createElement("h3");mxUtils.write(B,mxUtils.htmlEntities(c));B.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(B);var z=-document.createElement("div");z.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";z.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var C={};try{var H=mxSettings.getCustomLibraries();for(c=0;c<H.length;c++){var K=H[c];if("R"==K.substring(0,1)){var M=JSON.parse(decodeURIComponent(K.substring(1)));C[M[0]]={id:M[0],title:M[1],downloadUrl:M[2]}}}}catch(O){}this.remoteInvoke("getCustomLibraries",null,null,function(O){z.innerText="";-if(0==O.length)z.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var ea=0;ea<O.length;ea++){var fa=O[ea];C[fa.id]&&(f[fa.id]=fa);var S=this.addCheckbox(z,fa.title,C[fa.id]);(function(ca,ma){mxEvent.addListener(ma,"change",function(){this.checked?f[ca.id]=ca:delete f[ca.id]})})(fa,S)}},mxUtils.bind(this,function(O){z.innerText="";var ea=document.createElement("div");ea.style.padding="8px";ea.style.textAlign=-"center";mxUtils.write(ea,mxResources.get("error")+": ");mxUtils.write(ea,null!=O&&null!=O.message?O.message:mxResources.get("unknownError"));z.appendChild(ea)}));k.appendChild(z);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var O=0,ea;for(ea in f)null==C[ea]&&(O++,mxUtils.bind(this,function(fa){this.remoteInvoke("getFileContent",[fa.downloadUrl],null,mxUtils.bind(this,function(S){O--;0==O&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,-S,fa)),this.showSidebar()}catch(ca){this.handleError(ca,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){O--;0==O&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[ea]));for(ea in C)f[ea]||this.closeLibrary(new RemoteLibrary(this,null,C[ea]));0==O&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns=+document.createElement("div");z.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";z.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var C={};try{var I=mxSettings.getCustomLibraries();for(c=0;c<I.length;c++){var L=I[c];if("R"==L.substring(0,1)){var J=JSON.parse(decodeURIComponent(L.substring(1)));C[J[0]]={id:J[0],title:J[1],downloadUrl:J[2]}}}}catch(O){}this.remoteInvoke("getCustomLibraries",null,null,function(O){z.innerText="";+if(0==O.length)z.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var da=0;da<O.length;da++){var fa=O[da];C[fa.id]&&(f[fa.id]=fa);var V=this.addCheckbox(z,fa.title,C[fa.id]);(function(ba,ma){mxEvent.addListener(ma,"change",function(){this.checked?f[ba.id]=ba:delete f[ba.id]})})(fa,V)}},mxUtils.bind(this,function(O){z.innerText="";var da=document.createElement("div");da.style.padding="8px";da.style.textAlign=+"center";mxUtils.write(da,mxResources.get("error")+": ");mxUtils.write(da,null!=O&&null!=O.message?O.message:mxResources.get("unknownError"));z.appendChild(da)}));k.appendChild(z);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var O=0,da;for(da in f)null==C[da]&&(O++,mxUtils.bind(this,function(fa){this.remoteInvoke("getFileContent",[fa.downloadUrl],null,mxUtils.bind(this,function(V){O--;0==O&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,+V,fa)),this.showSidebar()}catch(ba){this.handleError(ba,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){O--;0==O&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[da]));for(da in C)f[da]||this.closeLibrary(new RemoteLibrary(this,null,C[da]));0==O&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=-[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,B,z){var C=!0,H=window.setTimeout(mxUtils.bind(this,function(){C=!1;z({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),-this.timeout),K=mxUtils.bind(this,function(){window.clearTimeout(H);C&&B.apply(this,arguments)}),M=mxUtils.bind(this,function(){window.clearTimeout(H);C&&z.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:K,error:M});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,-f){var k=mxUtils.bind(this,function(O,ea){var fa={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=ea?fa.error={errResp:ea}:null!=O&&(fa.resp=O);this.remoteWin.postMessage(JSON.stringify(fa),"*")});try{var B=c.funtionName,z=this.remoteInvokableFns[B];if(null!=z&&"function"===typeof this[B]){if(z.allowedDomains){for(var C=!1,H=0;H<z.allowedDomains.length;H++)if(f=="https://"+z.allowedDomains[H]){C=!0;break}if(!C){k(null,"Invalid Call: "+B+" is not allowed.");return}}var K=c.functionArgs;-Array.isArray(K)||(K=[]);if(z.isAsync)K.push(function(){k(Array.prototype.slice.apply(arguments))}),K.push(function(O){k(null,O||"Unkown Error")}),this[B].apply(this,K);else{var M=this[B].apply(this,K);k([M])}}else k(null,"Invalid Call: "+B+" is not found.")}catch(O){k(null,"Invalid Call: An error occurred, "+O.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var B=k.open("database",-2);B.onupgradeneeded=function(z){try{var C=B.result;1>z.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>z.oldVersion&&(C.createObjectStore("files",{keyPath:"title"}),C.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(H){null!=f&&f(H)}};B.onsuccess=mxUtils.bind(this,function(z){try{var C=B.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||-(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(H){if(!H||"1"==urlParams.forceMigration){var K=document.createElement("iframe");K.style.display="none";K.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(K);var M=!0,O=!1,ea,fa=0,S=mxUtils.bind(this,function(){O=!0;this.setDatabaseItem(".drawioMigrated3",!0);K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",-funtionName:"setMigratedFlag"}),"*")}),ca=mxUtils.bind(this,function(){fa++;ma()}),ma=mxUtils.bind(this,function(){try{if(fa>=ea.length)S();else{var Z=ea[fa];StorageFile.getFileContent(this,Z,mxUtils.bind(this,function(da){null==da||".scratchpad"==Z&&da==this.emptyLibraryXml?K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[Z]}),"*"):ca()}),ca)}}catch(da){console.log(da)}}),la=mxUtils.bind(this,function(Z){try{this.setDatabaseItem(null,-[{title:Z.title,size:Z.data.length,lastModified:Date.now(),type:Z.isLib?"L":"F"},{title:Z.title,data:Z.data}],ca,ca,["filesInfo","files"])}catch(da){console.log(da)}});H=mxUtils.bind(this,function(Z){try{if(Z.source==K.contentWindow){var da={};try{da=JSON.parse(Z.data)}catch(aa){}"init"==da.event?(K.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=-da.event||O||(M?null!=da.resp&&0<da.resp.length&&null!=da.resp[0]?(ea=da.resp[0],M=!1,ma()):S():null!=da.resp&&0<da.resp.length&&null!=da.resp[0]?la(da.resp[0]):ca())}}catch(aa){console.log(aa)}});window.addEventListener("message",H)}})));c(C);C.onversionchange=function(){C.close()}}catch(H){null!=f?f(H):null!=window.console&&console.warn(H)}});B.onerror=f;B.onblocked=function(){}}catch(z){null!=f?f(z):null!=window.console&&console.error(z)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};-EditorUi.prototype.setDatabaseItem=function(c,f,k,B,z){this.openDatabase(mxUtils.bind(this,function(C){try{z=z||"objects";Array.isArray(z)||(z=[z],c=[c],f=[f]);var H=C.transaction(z,"readwrite");H.oncomplete=k;H.onerror=B;for(C=0;C<z.length;C++)H.objectStore(z[C]).put(null!=c&&null!=c[C]?{key:c[C],data:f[C]}:f[C])}catch(K){null!=B&&B(K)}}),B)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,B){this.openDatabase(mxUtils.bind(this,function(z){try{B=B||"objects";Array.isArray(B)||(B=[B],c=[c]);-var C=z.transaction(B,"readwrite");C.oncomplete=f;C.onerror=k;for(z=0;z<B.length;z++)C.objectStore(B[z]).delete(c[z])}catch(H){null!=k&&k(H)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,B){this.openDatabase(mxUtils.bind(this,function(z){try{B=B||"objects";var C=z.transaction([B],"readonly").objectStore(B).get(c);C.onsuccess=function(){f(C.result)};C.onerror=k}catch(H){null!=k&&k(H)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(B){try{k=-k||"objects";var z=B.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),C=[];z.onsuccess=function(H){null==H.target.result?c(C):(C.push(H.target.result.value),H.target.result.continue())};z.onerror=f}catch(H){null!=f&&f(H)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(B){try{k=k||"objects";var z=B.transaction([k],"readonly").objectStore(k).getAllKeys();z.onsuccess=function(){c(z.result)};z.onerror=f}catch(C){null!=+[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,B,z){var C=!0,I=window.setTimeout(mxUtils.bind(this,function(){C=!1;z({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),+this.timeout),L=mxUtils.bind(this,function(){window.clearTimeout(I);C&&B.apply(this,arguments)}),J=mxUtils.bind(this,function(){window.clearTimeout(I);C&&z.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:L,error:J});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,+f){var k=mxUtils.bind(this,function(O,da){var fa={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=da?fa.error={errResp:da}:null!=O&&(fa.resp=O);this.remoteWin.postMessage(JSON.stringify(fa),"*")});try{var B=c.funtionName,z=this.remoteInvokableFns[B];if(null!=z&&"function"===typeof this[B]){if(z.allowedDomains){for(var C=!1,I=0;I<z.allowedDomains.length;I++)if(f=="https://"+z.allowedDomains[I]){C=!0;break}if(!C){k(null,"Invalid Call: "+B+" is not allowed.");return}}var L=c.functionArgs;+Array.isArray(L)||(L=[]);if(z.isAsync)L.push(function(){k(Array.prototype.slice.apply(arguments))}),L.push(function(O){k(null,O||"Unkown Error")}),this[B].apply(this,L);else{var J=this[B].apply(this,L);k([J])}}else k(null,"Invalid Call: "+B+" is not found.")}catch(O){k(null,"Invalid Call: An error occurred, "+O.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var B=k.open("database",+2);B.onupgradeneeded=function(z){try{var C=B.result;1>z.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>z.oldVersion&&(C.createObjectStore("files",{keyPath:"title"}),C.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(I){null!=f&&f(I)}};B.onsuccess=mxUtils.bind(this,function(z){try{var C=B.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||+(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(I){if(!I||"1"==urlParams.forceMigration){var L=document.createElement("iframe");L.style.display="none";L.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(L);var J=!0,O=!1,da,fa=0,V=mxUtils.bind(this,function(){O=!0;this.setDatabaseItem(".drawioMigrated3",!0);L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",+funtionName:"setMigratedFlag"}),"*")}),ba=mxUtils.bind(this,function(){fa++;ma()}),ma=mxUtils.bind(this,function(){try{if(fa>=da.length)V();else{var Z=da[fa];StorageFile.getFileContent(this,Z,mxUtils.bind(this,function(ea){null==ea||".scratchpad"==Z&&ea==this.emptyLibraryXml?L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[Z]}),"*"):ba()}),ba)}}catch(ea){console.log(ea)}}),la=mxUtils.bind(this,function(Z){try{this.setDatabaseItem(null,+[{title:Z.title,size:Z.data.length,lastModified:Date.now(),type:Z.isLib?"L":"F"},{title:Z.title,data:Z.data}],ba,ba,["filesInfo","files"])}catch(ea){console.log(ea)}});I=mxUtils.bind(this,function(Z){try{if(Z.source==L.contentWindow){var ea={};try{ea=JSON.parse(Z.data)}catch(aa){}"init"==ea.event?(L.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=+ea.event||O||(J?null!=ea.resp&&0<ea.resp.length&&null!=ea.resp[0]?(da=ea.resp[0],J=!1,ma()):V():null!=ea.resp&&0<ea.resp.length&&null!=ea.resp[0]?la(ea.resp[0]):ba())}}catch(aa){console.log(aa)}});window.addEventListener("message",I)}})));c(C);C.onversionchange=function(){C.close()}}catch(I){null!=f?f(I):null!=window.console&&console.warn(I)}});B.onerror=f;B.onblocked=function(){}}catch(z){null!=f?f(z):null!=window.console&&console.error(z)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};+EditorUi.prototype.setDatabaseItem=function(c,f,k,B,z){this.openDatabase(mxUtils.bind(this,function(C){try{z=z||"objects";Array.isArray(z)||(z=[z],c=[c],f=[f]);var I=C.transaction(z,"readwrite");I.oncomplete=k;I.onerror=B;for(C=0;C<z.length;C++)I.objectStore(z[C]).put(null!=c&&null!=c[C]?{key:c[C],data:f[C]}:f[C])}catch(L){null!=B&&B(L)}}),B)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,B){this.openDatabase(mxUtils.bind(this,function(z){try{B=B||"objects";Array.isArray(B)||(B=[B],c=[c]);+var C=z.transaction(B,"readwrite");C.oncomplete=f;C.onerror=k;for(z=0;z<B.length;z++)C.objectStore(B[z]).delete(c[z])}catch(I){null!=k&&k(I)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,B){this.openDatabase(mxUtils.bind(this,function(z){try{B=B||"objects";var C=z.transaction([B],"readonly").objectStore(B).get(c);C.onsuccess=function(){f(C.result)};C.onerror=k}catch(I){null!=k&&k(I)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(B){try{k=+k||"objects";var z=B.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),C=[];z.onsuccess=function(I){null==I.target.result?c(C):(C.push(I.target.result.value),I.target.result.continue())};z.onerror=f}catch(I){null!=f&&f(I)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(B){try{k=k||"objects";var z=B.transaction([k],"readonly").objectStore(k).getAllKeys();z.onsuccess=function(){c(z.result)};z.onerror=f}catch(C){null!=f&&f(C)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var k=this.getCurrentFile();null!=k?k.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,k){var B=this.getCurrentFile();null!=B?B.addComment(c,f,k):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,f){var k=this.getCurrentFile();return null!=k?k.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=-function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,B,z,C,H,K){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,B,z,C,H,K)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=-function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la)};EditorUi.prototype.createImageUrlConverter=+function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,B,z,C,I,L){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,B,z,C,I,L)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=+function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,B){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,k,B)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,k,B){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,k,B)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,k,B,z){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,k,B,z)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var k=localStorage.key(f),B=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<B.length){var z="<mxfile "===B.substring(0,8)||"<?xml"===B.substring(0,5)||"\x3c!--[if IE]>"===B.substring(0,12);B="<mxlibrary>"===B.substring(0,11);(z||B)&&c.push(k)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,e,g,m,v,p){function A(){for(var S=C.getElementsByTagName("div"),ca=0,ma=0;ma<S.length;ma++)"none"!=S[ma].style.display&&S[ma].parentNode==C&&ca++;H.style.display=0==ca?"block":"none"}function G(S,ca,ma,la){function Z(){ca.removeChild(l);ca.removeChild(t);aa.style.display="block";da.style.display="block"}k={div:ca,comment:S,saveCallback:ma,deleteOnCancel:la};var da=ca.querySelector(".geCommentTxt"),aa=ca.querySelector(".geCommentActionsList"),l=document.createElement("textarea");-l.className="geCommentEditTxtArea";l.style.minHeight=da.offsetHeight+"px";l.value=S.content;ca.insertBefore(l,da);var t=document.createElement("div");t.className="geCommentEditBtns";var I=mxUtils.button(mxResources.get("cancel"),function(){la?(ca.parentNode.removeChild(ca),A()):Z();k=null});I.className="geCommentEditBtn";t.appendChild(I);var V=mxUtils.button(mxResources.get("save"),function(){da.innerText="";S.content=l.value;mxUtils.write(da,S.content);Z();ma(S);k=null});mxEvent.addListener(l,"keydown",-mxUtils.bind(this,function(J){mxEvent.isConsumed(J)||((mxEvent.isControlDown(J)||mxClient.IS_MAC&&mxEvent.isMetaDown(J))&&13==J.keyCode?(V.click(),mxEvent.consume(J)):27==J.keyCode&&(I.click(),mxEvent.consume(J)))}));V.focus();V.className="geCommentEditBtn gePrimaryBtn";t.appendChild(V);ca.insertBefore(t,da);aa.style.display="none";da.style.display="none";l.focus()}function T(S,ca){ca.innerText="";S=new Date(S.modifiedDate);var ma=b.timeSince(S);null==ma&&(ma=mxResources.get("lessThanAMinute"));mxUtils.write(ca,-mxResources.get("timeAgo",[ma],"{1} ago"));ca.setAttribute("title",S.toLocaleDateString()+" "+S.toLocaleTimeString())}function F(S){var ca=document.createElement("img");ca.className="geCommentBusyImg";ca.src=IMAGE_PATH+"/spin.gif";S.appendChild(ca);S.busyImg=ca}function P(S){S.style.border="1px solid red";S.busyImg.parentNode==S&&S.removeChild(S.busyImg)}function Q(S){S.style.border="";S.busyImg.parentNode==S&&S.removeChild(S.busyImg)}function U(S,ca,ma,la,Z){function da(Y,ba,ja){var oa=document.createElement("li");-oa.className="geCommentAction";var qa=document.createElement("a");qa.className="geCommentActionLnk";mxUtils.write(qa,Y);oa.appendChild(qa);mxEvent.addListener(qa,"click",function(ra){ba(ra,S);ra.preventDefault();mxEvent.consume(ra)});W.appendChild(oa);ja&&(oa.style.display="none")}function aa(){function Y(oa){ba.push(ja);if(null!=oa.replies)for(var qa=0;qa<oa.replies.length;qa++)ja=ja.nextSibling,Y(oa.replies[qa])}var ba=[],ja=t;Y(S);return{pdiv:ja,replies:ba}}function l(Y,ba,ja,oa,qa){function ra(){F(Da);-S.addReply(ya,function(La){ya.id=La;S.replies.push(ya);Q(Da);ja&&ja()},function(La){xa();P(Da);b.handleError(La,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},oa,qa)}function xa(){G(ya,Da,function(La){ra()},!0)}var Ba=aa().pdiv,ya=b.newComment(Y,b.getCurrentUser());ya.pCommentId=S.id;null==S.replies&&(S.replies=[]);var Da=U(ya,S.replies,Ba,la+1);ba?xa():ra()}if(Z||!S.isResolved){H.style.display="none";var t=document.createElement("div");t.className="geCommentContainer";t.setAttribute("data-commentId",-S.id);t.style.marginLeft=20*la+5+"px";S.isResolved&&(t.style.backgroundColor="light-dark(ghostWhite, transparent)");var I=document.createElement("div");I.className="geCommentHeader";var V=document.createElement("img");V.className="geCommentUserImg";V.src=null!=S.user&&null!=S.user.pictureUrl?S.user.pictureUrl:Editor.userImage;I.appendChild(V);V=document.createElement("div");V.className="geCommentHeaderTxt";I.appendChild(V);var J=document.createElement("div");J.className="geCommentUsername";mxUtils.write(J,-null!=S.user?S.user.displayName:mxResources.get("unknownUser"));V.appendChild(J);J=document.createElement("div");J.className="geCommentDate";J.setAttribute("data-commentId",S.id);T(S,J);V.appendChild(J);t.appendChild(I);I=document.createElement("div");I.className="geCommentTxt";mxUtils.write(I,S.content||"");t.appendChild(I);S.isLocked&&(t.style.opacity="0.5");I=document.createElement("div");I.className="geCommentActions";var W=document.createElement("ul");W.className="geCommentActionsList";I.appendChild(W);-c||S.isLocked||0!=la&&!f||da(mxResources.get("reply"),function(){l("",!0)},S.isResolved);V=b.getCurrentUser();null==V||null==S.user||V.id!=S.user.id||c||S.isLocked||(da(mxResources.get("edit"),function(){function Y(){G(S,t,function(){F(t);S.editComment(S.content,function(){Q(t)},function(ba){P(t);Y();b.handleError(ba,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Y()},S.isResolved),da(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){F(t);-S.deleteComment(function(Y){if(!0===Y){Y=t.querySelector(".geCommentTxt");Y.innerText="";mxUtils.write(Y,mxResources.get("msgDeleted"));var ba=t.querySelectorAll(".geCommentAction");for(Y=0;Y<ba.length;Y++)ba[Y].parentNode.removeChild(ba[Y]);Q(t);t.style.opacity="0.5"}else{ba=aa(S).replies;for(Y=0;Y<ba.length;Y++)C.removeChild(ba[Y]);for(Y=0;Y<ca.length;Y++)if(ca[Y]==S){ca.splice(Y,1);break}H.style.display=0==C.getElementsByTagName("div").length?"block":"none"}},function(Y){P(t);b.handleError(Y,null,-null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},S.isResolved));c||S.isLocked||0!=la||da(S.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Y){function ba(){var ja=Y.target;ja.innerText="";S.isResolved=!S.isResolved;mxUtils.write(ja,S.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var oa=S.isResolved?"none":"",qa=aa(S).replies,ra="light-dark("+(S.isResolved?"ghostWhite":"white")+", transparent)",xa=0;xa<qa.length;xa++){qa[xa].style.backgroundColor=-ra;for(var Ba=qa[xa].querySelectorAll(".geCommentAction"),ya=0;ya<Ba.length;ya++)Ba[ya]!=ja.parentNode&&(Ba[ya].style.display=oa);O||(qa[xa].style.display="none")}A()}S.isResolved?l(mxResources.get("reOpened")+": ",!0,ba,!1,!0):l(mxResources.get("markedAsResolved"),!1,ba,!0)});t.appendChild(I);null!=ma?C.insertBefore(t,ma.nextSibling):C.appendChild(t);for(ma=0;null!=S.replies&&ma<S.replies.length;ma++)I=S.replies[ma],I.isResolved=S.isResolved,U(I,S.replies,null,la+1,Z);null!=k&&(k.comment.id==S.id?-(Z=S.content,S.content=k.comment.content,G(S,t,k.saveCallback,k.deleteOnCancel),S.content=Z):null==k.comment.id&&k.comment.pCommentId==S.id&&(C.appendChild(k.div),G(k.comment,k.div,k.saveCallback,k.deleteOnCancel)));return t}}var c=!b.canComment(),f=b.canReplyToReplies(),k=null,B=document.createElement("div");B.className="geCommentsWin";B.style.background="light-dark(whiteSmoke, "+Editor.darkColor+")";var z=EditorUi.compactUi?"26px":"30px",C=document.createElement("div");C.className="geCommentsList";-C.style.backgroundColor="light-dark(whiteSmoke, "+Editor.darkColor+")";C.style.bottom=parseInt(z)+7+"px";B.appendChild(C);var H=document.createElement("span");H.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(H,mxResources.get("noCommentsFound"));var K=document.createElement("div");K.className="geToolbarContainer geCommentsToolbar";K.style.height=z;K.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";z=document.createElement("a");z.className="geButton";if(!c){var M=-z.cloneNode();M.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';M.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(M,"click",function(S){function ca(){G(ma,la,function(Z){F(la);b.addComment(Z,function(da){Z.id=da;ea.push(Z);Q(la)},function(da){P(la);ca();b.handleError(da,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ma=b.newComment("",b.getCurrentUser()),la=U(ma,ea,null,0);ca();S.preventDefault();mxEvent.consume(S)});-K.appendChild(M)}M=z.cloneNode();M.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';M.setAttribute("title",mxResources.get("showResolved"));M.className="geButton";var O=!1;mxEvent.addListener(M,"click",function(S){this.className=(O=!O)?"geButton geCheckedBtn":"geButton";fa();S.preventDefault();mxEvent.consume(S)});K.appendChild(M);b.commentsRefreshNeeded()&&(M=z.cloneNode(),M.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',-M.setAttribute("title",mxResources.get("refresh")),M.className="geButton",mxEvent.addListener(M,"click",function(S){fa();S.preventDefault();mxEvent.consume(S)}),K.appendChild(M));b.commentsSaveNeeded()&&(z=z.cloneNode(),z.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',z.setAttribute("title",mxResources.get("save")),z.className="geButton geAdaptiveAsset",mxEvent.addListener(z,"click",function(S){p();S.preventDefault();mxEvent.consume(S)}),K.appendChild(z));B.appendChild(K);-var ea=[],fa=mxUtils.bind(this,function(){this.hasError=!1;if(null!=k)try{k.div=k.div.cloneNode(!0);var S=k.div.querySelector(".geCommentEditTxtArea"),ca=k.div.querySelector(".geCommentEditBtns");k.comment.content=S.value;S.parentNode.removeChild(S);ca.parentNode.removeChild(ca)}catch(ma){b.handleError(ma)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";f=b.canReplyToReplies();-b.commentsSupported()?b.getComments(function(ma){function la(Z){if(null!=Z){Z.sort(function(aa,l){return new Date(aa.modifiedDate)-new Date(l.modifiedDate)});for(var da=0;da<Z.length;da++)la(Z[da].replies)}}ma.sort(function(Z,da){return new Date(Z.modifiedDate)-new Date(da.modifiedDate)});C.innerText="";C.appendChild(H);H.style.display="block";ea=ma;for(ma=0;ma<ea.length;ma++)la(ea[ma].replies),U(ea[ma],ea,null,0,O);null!=k&&null==k.comment.id&&null==k.comment.pCommentId&&(C.appendChild(k.div),G(k.comment,-k.div,k.saveCallback,k.deleteOnCancel))},mxUtils.bind(this,function(ma){C.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ma&&ma.message?": "+ma.message:""));this.hasError=!0})):C.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});fa();this.refreshComments=fa;K=mxUtils.bind(this,function(){function S(da){var aa=ma[da.id];if(null!=aa)for(T(da,aa),aa=0;null!=da.replies&&aa<da.replies.length;aa++)S(da.replies[aa])}if(this.window.isVisible()){for(var ca=C.querySelectorAll(".geCommentDate"),-ma={},la=0;la<ca.length;la++){var Z=ca[la];ma[Z.getAttribute("data-commentId")]=Z}for(la=0;la<ea.length;la++)S(ea[la])}});setInterval(K,6E4);this.refreshCommentsTime=K;this.window=new mxWindow(mxResources.get("comments"),B,e,g,m,v,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));-b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,g,m,v,p,A,G,T,F,P){var Q=document.createElement("div");Q.style.textAlign="center";P=null!=P?P:44;var U=document.createElement("div");U.style.padding="6px";U.style.overflow="auto";U.style.maxHeight=P+"px";U.style.lineHeight="1.2em";mxUtils.write(U,e);Q.appendChild(U);null!=F&&(U=document.createElement("div"),U.style.padding="6px 0 6px 0",e=document.createElement("img"),e.setAttribute("src",F),U.appendChild(e),Q.appendChild(U));F=document.createElement("div");+var CommentsWindow=function(b,e,g,m,v,p){function A(){for(var V=C.getElementsByTagName("div"),ba=0,ma=0;ma<V.length;ma++)"none"!=V[ma].style.display&&V[ma].parentNode==C&&ba++;I.style.display=0==ba?"block":"none"}function G(V,ba,ma,la){function Z(){ba.removeChild(l);ba.removeChild(t);aa.style.display="block";ea.style.display="block"}k={div:ba,comment:V,saveCallback:ma,deleteOnCancel:la};var ea=ba.querySelector(".geCommentTxt"),aa=ba.querySelector(".geCommentActionsList"),l=document.createElement("textarea");+l.className="geCommentEditTxtArea";l.style.minHeight=ea.offsetHeight+"px";l.value=V.content;ba.insertBefore(l,ea);var t=document.createElement("div");t.className="geCommentEditBtns";var H=mxUtils.button(mxResources.get("cancel"),function(){la?(ba.parentNode.removeChild(ba),A()):Z();k=null});H.className="geCommentEditBtn";t.appendChild(H);var U=mxUtils.button(mxResources.get("save"),function(){ea.innerText="";V.content=l.value;mxUtils.write(ea,V.content);Z();ma(V);k=null});mxEvent.addListener(l,"keydown",+mxUtils.bind(this,function(K){mxEvent.isConsumed(K)||((mxEvent.isControlDown(K)||mxClient.IS_MAC&&mxEvent.isMetaDown(K))&&13==K.keyCode?(U.click(),mxEvent.consume(K)):27==K.keyCode&&(H.click(),mxEvent.consume(K)))}));U.focus();U.className="geCommentEditBtn gePrimaryBtn";t.appendChild(U);ba.insertBefore(t,ea);aa.style.display="none";ea.style.display="none";l.focus()}function S(V,ba){ba.innerText="";V=new Date(V.modifiedDate);var ma=b.timeSince(V);null==ma&&(ma=mxResources.get("lessThanAMinute"));mxUtils.write(ba,+mxResources.get("timeAgo",[ma],"{1} ago"));ba.setAttribute("title",V.toLocaleDateString()+" "+V.toLocaleTimeString())}function F(V){var ba=document.createElement("img");ba.className="geCommentBusyImg";ba.src=IMAGE_PATH+"/spin.gif";V.appendChild(ba);V.busyImg=ba}function P(V){V.style.border="1px solid red";V.busyImg.parentNode==V&&V.removeChild(V.busyImg)}function Q(V){V.style.border="";V.busyImg.parentNode==V&&V.removeChild(V.busyImg)}function T(V,ba,ma,la,Z){function ea(Y,ca,ja){var oa=document.createElement("li");+oa.className="geCommentAction";var qa=document.createElement("a");qa.className="geCommentActionLnk";mxUtils.write(qa,Y);oa.appendChild(qa);mxEvent.addListener(qa,"click",function(ra){ca(ra,V);ra.preventDefault();mxEvent.consume(ra)});W.appendChild(oa);ja&&(oa.style.display="none")}function aa(){function Y(oa){ca.push(ja);if(null!=oa.replies)for(var qa=0;qa<oa.replies.length;qa++)ja=ja.nextSibling,Y(oa.replies[qa])}var ca=[],ja=t;Y(V);return{pdiv:ja,replies:ca}}function l(Y,ca,ja,oa,qa){function ra(){F(Da);+V.addReply(ya,function(La){ya.id=La;V.replies.push(ya);Q(Da);ja&&ja()},function(La){xa();P(Da);b.handleError(La,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},oa,qa)}function xa(){G(ya,Da,function(La){ra()},!0)}var Ba=aa().pdiv,ya=b.newComment(Y,b.getCurrentUser());ya.pCommentId=V.id;null==V.replies&&(V.replies=[]);var Da=T(ya,V.replies,Ba,la+1);ca?xa():ra()}if(Z||!V.isResolved){I.style.display="none";var t=document.createElement("div");t.className="geCommentContainer";t.setAttribute("data-commentId",+V.id);t.style.marginLeft=20*la+5+"px";V.isResolved&&(t.style.backgroundColor="light-dark(ghostWhite, transparent)");var H=document.createElement("div");H.className="geCommentHeader";var U=document.createElement("img");U.className="geCommentUserImg";U.src=null!=V.user&&null!=V.user.pictureUrl?V.user.pictureUrl:Editor.userImage;H.appendChild(U);U=document.createElement("div");U.className="geCommentHeaderTxt";H.appendChild(U);var K=document.createElement("div");K.className="geCommentUsername";mxUtils.write(K,+null!=V.user?V.user.displayName:mxResources.get("unknownUser"));U.appendChild(K);K=document.createElement("div");K.className="geCommentDate";K.setAttribute("data-commentId",V.id);S(V,K);U.appendChild(K);t.appendChild(H);H=document.createElement("div");H.className="geCommentTxt";mxUtils.write(H,V.content||"");t.appendChild(H);V.isLocked&&(t.style.opacity="0.5");H=document.createElement("div");H.className="geCommentActions";var W=document.createElement("ul");W.className="geCommentActionsList";H.appendChild(W);+c||V.isLocked||0!=la&&!f||ea(mxResources.get("reply"),function(){l("",!0)},V.isResolved);U=b.getCurrentUser();null==U||null==V.user||U.id!=V.user.id||c||V.isLocked||(ea(mxResources.get("edit"),function(){function Y(){G(V,t,function(){F(t);V.editComment(V.content,function(){Q(t)},function(ca){P(t);Y();b.handleError(ca,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Y()},V.isResolved),ea(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){F(t);+V.deleteComment(function(Y){if(!0===Y){Y=t.querySelector(".geCommentTxt");Y.innerText="";mxUtils.write(Y,mxResources.get("msgDeleted"));var ca=t.querySelectorAll(".geCommentAction");for(Y=0;Y<ca.length;Y++)ca[Y].parentNode.removeChild(ca[Y]);Q(t);t.style.opacity="0.5"}else{ca=aa(V).replies;for(Y=0;Y<ca.length;Y++)C.removeChild(ca[Y]);for(Y=0;Y<ba.length;Y++)if(ba[Y]==V){ba.splice(Y,1);break}I.style.display=0==C.getElementsByTagName("div").length?"block":"none"}},function(Y){P(t);b.handleError(Y,null,+null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},V.isResolved));c||V.isLocked||0!=la||ea(V.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Y){function ca(){var ja=Y.target;ja.innerText="";V.isResolved=!V.isResolved;mxUtils.write(ja,V.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var oa=V.isResolved?"none":"",qa=aa(V).replies,ra="light-dark("+(V.isResolved?"ghostWhite":"white")+", transparent)",xa=0;xa<qa.length;xa++){qa[xa].style.backgroundColor=+ra;for(var Ba=qa[xa].querySelectorAll(".geCommentAction"),ya=0;ya<Ba.length;ya++)Ba[ya]!=ja.parentNode&&(Ba[ya].style.display=oa);O||(qa[xa].style.display="none")}A()}V.isResolved?l(mxResources.get("reOpened")+": ",!0,ca,!1,!0):l(mxResources.get("markedAsResolved"),!1,ca,!0)});t.appendChild(H);null!=ma?C.insertBefore(t,ma.nextSibling):C.appendChild(t);for(ma=0;null!=V.replies&&ma<V.replies.length;ma++)H=V.replies[ma],H.isResolved=V.isResolved,T(H,V.replies,null,la+1,Z);null!=k&&(k.comment.id==V.id?+(Z=V.content,V.content=k.comment.content,G(V,t,k.saveCallback,k.deleteOnCancel),V.content=Z):null==k.comment.id&&k.comment.pCommentId==V.id&&(C.appendChild(k.div),G(k.comment,k.div,k.saveCallback,k.deleteOnCancel)));return t}}var c=!b.canComment(),f=b.canReplyToReplies(),k=null,B=document.createElement("div");B.className="geCommentsWin";B.style.background="light-dark(whiteSmoke, "+Editor.darkColor+")";var z=EditorUi.compactUi?"26px":"30px",C=document.createElement("div");C.className="geCommentsList";+C.style.backgroundColor="light-dark(whiteSmoke, "+Editor.darkColor+")";C.style.bottom=parseInt(z)+7+"px";B.appendChild(C);var I=document.createElement("span");I.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(I,mxResources.get("noCommentsFound"));var L=document.createElement("div");L.className="geToolbarContainer geCommentsToolbar";L.style.height=z;L.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";z=document.createElement("a");z.className="geButton";if(!c){var J=+z.cloneNode();J.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';J.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(J,"click",function(V){function ba(){G(ma,la,function(Z){F(la);b.addComment(Z,function(ea){Z.id=ea;da.push(Z);Q(la)},function(ea){P(la);ba();b.handleError(ea,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ma=b.newComment("",b.getCurrentUser()),la=T(ma,da,null,0);ba();V.preventDefault();mxEvent.consume(V)});+L.appendChild(J)}J=z.cloneNode();J.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';J.setAttribute("title",mxResources.get("showResolved"));J.className="geButton";var O=!1;mxEvent.addListener(J,"click",function(V){this.className=(O=!O)?"geButton geCheckedBtn":"geButton";fa();V.preventDefault();mxEvent.consume(V)});L.appendChild(J);b.commentsRefreshNeeded()&&(J=z.cloneNode(),J.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',+J.setAttribute("title",mxResources.get("refresh")),J.className="geButton",mxEvent.addListener(J,"click",function(V){fa();V.preventDefault();mxEvent.consume(V)}),L.appendChild(J));b.commentsSaveNeeded()&&(z=z.cloneNode(),z.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',z.setAttribute("title",mxResources.get("save")),z.className="geButton geAdaptiveAsset",mxEvent.addListener(z,"click",function(V){p();V.preventDefault();mxEvent.consume(V)}),L.appendChild(z));B.appendChild(L);+var da=[],fa=mxUtils.bind(this,function(){this.hasError=!1;if(null!=k)try{k.div=k.div.cloneNode(!0);var V=k.div.querySelector(".geCommentEditTxtArea"),ba=k.div.querySelector(".geCommentEditBtns");k.comment.content=V.value;V.parentNode.removeChild(V);ba.parentNode.removeChild(ba)}catch(ma){b.handleError(ma)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";f=b.canReplyToReplies();+b.commentsSupported()?b.getComments(function(ma){function la(Z){if(null!=Z){Z.sort(function(aa,l){return new Date(aa.modifiedDate)-new Date(l.modifiedDate)});for(var ea=0;ea<Z.length;ea++)la(Z[ea].replies)}}ma.sort(function(Z,ea){return new Date(Z.modifiedDate)-new Date(ea.modifiedDate)});C.innerText="";C.appendChild(I);I.style.display="block";da=ma;for(ma=0;ma<da.length;ma++)la(da[ma].replies),T(da[ma],da,null,0,O);null!=k&&null==k.comment.id&&null==k.comment.pCommentId&&(C.appendChild(k.div),G(k.comment,+k.div,k.saveCallback,k.deleteOnCancel))},mxUtils.bind(this,function(ma){C.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ma&&ma.message?": "+ma.message:""));this.hasError=!0})):C.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});fa();this.refreshComments=fa;L=mxUtils.bind(this,function(){function V(ea){var aa=ma[ea.id];if(null!=aa)for(S(ea,aa),aa=0;null!=ea.replies&&aa<ea.replies.length;aa++)V(ea.replies[aa])}if(this.window.isVisible()){for(var ba=C.querySelectorAll(".geCommentDate"),+ma={},la=0;la<ba.length;la++){var Z=ba[la];ma[Z.getAttribute("data-commentId")]=Z}for(la=0;la<da.length;la++)V(da[la])}});setInterval(L,6E4);this.refreshCommentsTime=L;this.window=new mxWindow(mxResources.get("comments"),B,e,g,m,v,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));+b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,g,m,v,p,A,G,S,F,P){var Q=document.createElement("div");Q.style.textAlign="center";P=null!=P?P:44;var T=document.createElement("div");T.style.padding="6px";T.style.overflow="auto";T.style.maxHeight=P+"px";T.style.lineHeight="1.2em";mxUtils.write(T,e);Q.appendChild(T);null!=F&&(T=document.createElement("div"),T.style.padding="6px 0 6px 0",e=document.createElement("img"),e.setAttribute("src",F),T.appendChild(e),Q.appendChild(T));F=document.createElement("div");F.style.textAlign="center";F.style.whiteSpace="nowrap";var c=document.createElement("input");c.setAttribute("type","checkbox");p=mxUtils.button(p||mxResources.get("cancel"),function(){b.hideDialog();null!=m&&m(c.checked)});p.className="geBtn";null!=G&&(p.innerHTML=G+"<br>"+p.innerHTML,p.style.paddingBottom="8px",p.style.paddingTop="8px",p.style.height="auto",p.style.width="40%");b.editor.cancelFirst&&F.appendChild(p);var f=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=g&&-g(c.checked)});F.appendChild(f);null!=A?(f.innerHTML=A+"<br>"+f.innerHTML+"<br>",f.style.paddingBottom="8px",f.style.paddingTop="8px",f.style.height="auto",f.className="geBtn",f.style.width="40%"):f.className="geBtn gePrimaryBtn";b.editor.cancelFirst||F.appendChild(p);Q.appendChild(F);T?(F.style.marginTop="10px",U=document.createElement("p"),U.style.marginTop="20px",U.style.marginBottom="0px",U.appendChild(c),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),-U.appendChild(v),Q.appendChild(U),mxEvent.addListener(v,"click",function(k){c.checked=!c.checked;mxEvent.consume(k)})):F.style.marginTop="12px";this.init=function(){f.focus()};this.container=Q},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};+g(c.checked)});F.appendChild(f);null!=A?(f.innerHTML=A+"<br>"+f.innerHTML+"<br>",f.style.paddingBottom="8px",f.style.paddingTop="8px",f.style.height="auto",f.className="geBtn",f.style.width="40%"):f.className="geBtn gePrimaryBtn";b.editor.cancelFirst||F.appendChild(p);Q.appendChild(F);S?(F.style.marginTop="10px",T=document.createElement("p"),T.style.marginTop="20px",T.style.marginBottom="0px",T.appendChild(c),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),+T.appendChild(v),Q.appendChild(T),mxEvent.addListener(v,"click",function(k){c.checked=!c.checked;mxEvent.consume(k)})):F.style.marginTop="12px";this.init=function(){f.focus()};this.container=Q},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};function DiagramPage(b,e){this.node=b;null!=e?this.node.setAttribute("id",e):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,e,g){this.ui=b;this.page=e;this.previous=this.name=g}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(b,e,g){this.ui=b;this.oldIndex=e;this.newIndex=g}@@ -4014,7 +4016,7 @@ function(){b.checkDefaultParent()}));var p=mxUtils.bind(this,function(){this.updthis.toolbar&&this.toolbar.updateZoom()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(A,G){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}))}};EditorUi.prototype.scrollToPage=function(b,e){var g=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),m=null!=b?b:this.currentPage;null!=g&&null!=this.tabScroller&&this.tabScroller.children.length>g&&null!=this.tabScroller.children[g]&&(m!=this.lastScrollPage||e)&&(this.tabScroller.children[g].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[g].className="geTab gePageTab geActivePage",this.lastScrollPage=m)};EditorUi.prototype.restoreViewState=function(b,e,g){b=null!=b?this.getPageById(b.getId()):null;var m=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,e):(m.setViewState(e),this.editor.updateGraphComponents(),m.view.revalidate(),m.sizeDidChange()),m.container.scrollLeft=m.view.translate.x*m.view.scale+e.scrollLeft,m.container.scrollTop=m.view.translate.y*m.view.scale+e.scrollTop,m.restoreSelection(g))};-Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),g=parseFloat(b.getAttribute("pageScale")),m=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),p=b.getAttribute("background"),A=this.parseBackgroundImage(b.getAttribute("backgroundImage")),G=b.getAttribute("extFonts");if(G)try{G=G.split("|").map(function(T){T=T.split("^");return{name:T[0],url:T[1]}})}catch(T){console.log("ExtFonts format error: "+T.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),g=parseFloat(b.getAttribute("pageScale")),m=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),p=b.getAttribute("background"),A=this.parseBackgroundImage(b.getAttribute("backgroundImage")),G=b.getAttribute("extFonts");if(G)try{G=G.split("|").map(function(S){S=S.split("^");return{name:S[0],url:S[1]}})}catch(S){console.log("ExtFonts format error: "+S.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=e?"0"!=e:this.defaultPageVisible,background:null!=p&&0<p.length?p:null,backgroundImage:A,pageScale:isNaN(g)?mxGraph.prototype.pageScale:g,pageFormat:isNaN(m)||isNaN(v)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,m,v),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:G||[]}};Graph.prototype.saveViewState=function(b,e,g,m){g||(e.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),e.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),e.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),e.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),e.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),e.setAttribute("connect",null==b||b.connect?"1":"0"),e.setAttribute("arrows",null==b||b.arrows?"1":"0"),e.setAttribute("fold",@@ -4038,7 +4040,7 @@ EditorUi.prototype.insertPage=function(b,e,g){this.editor.graph.isEnabled()&&(thEditorUi.prototype.createPage=function(b,e,g){e=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),e);e.setName(null!=b?b:this.createPageName());this.initDiagramNode(e,g);return e};EditorUi.prototype.createPageName=function(){for(var b={},e=0;e<this.pages.length;e++){var g=this.pages[e].getName();null!=g&&0<g.length&&(b[g]=g)}e=this.pages.length;do g=mxResources.get("pageWithNumber",[++e]);while(null!=b[g]);return g};EditorUi.prototype.removePage=function(b){try{var e=this.editor.graph,g=mxUtils.indexOf(this.pages,b);if(e.isEnabled()&&0<=g){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);e.model.beginUpdate();try{var m=this.currentPage;m==b&&1<this.pages.length?(g==this.pages.length-1?g--:g++,m=this.pages[g]):1>=this.pages.length&&(m=this.insertPage(),e.model.execute(new RenamePage(this,m,mxResources.get("pageWithNumber",[1]))));e.model.execute(new ChangePage(this,b,m))}finally{e.model.endUpdate()}}}catch(v){this.handleError(v)}return b};EditorUi.prototype.duplicatePage=function(b,e){var g=null;try{var m=this.editor.graph;if(m.isEnabled()){m.isEditing()&&m.stopEditing();var v=b.node.cloneNode(!1);v.removeAttribute("id");var p={},A=m.createCellLookup([m.model.root]);g=new DiagramPage(v);g.root=m.cloneCell(m.model.root,null,p);var G=new mxGraphModel;G.prefix=Editor.guid()+"-";G.setRoot(g.root);m.updateCustomLinks(m.createCellMapping(p,A),[g.root]);g.viewState=b==this.currentPage?m.getViewState():b.viewState;this.initDiagramNode(g);-g.viewState.scale=1;delete g.viewState.scrollLeft;delete g.viewState.scrollTop;delete g.viewState.currentRoot;delete g.viewState.defaultParent;g.setName(e);g=this.insertPage(g,mxUtils.indexOf(this.pages,b)+1)}}catch(T){this.handleError(T)}return g};EditorUi.prototype.initDiagramNode=function(b,e){null==e&&(e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,e);EditorUi.removeChildNodes(b.node);b.node.appendChild(e)};+g.viewState.scale=1;delete g.viewState.scrollLeft;delete g.viewState.scrollTop;delete g.viewState.currentRoot;delete g.viewState.defaultParent;g.setName(e);g=this.insertPage(g,mxUtils.indexOf(this.pages,b)+1)}}catch(S){this.handleError(S)}return g};EditorUi.prototype.initDiagramNode=function(b,e){null==e&&(e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,e);EditorUi.removeChildNodes(b.node);b.node.appendChild(e)};EditorUi.prototype.clonePages=function(b){for(var e=[],g=[],m=0;m<b.length;m++)try{g.push(this.clonePage(b[m]))}catch(v){e.push(mxResources.get("pageWithNumber",[m+1])+": "+v.toString())}if(0<e.length){b=Error(e.join("\n"));try{0<g.length&&(b.fallbackFileData=this.getXmlForPages(g))}catch(v){}throw b;}return g};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var e=new DiagramPage(b.node.cloneNode(!0)),g=b==this.currentPage?this.editor.graph.getViewState():b.viewState;e.viewState=mxUtils.clone(g,EditorUi.transientViewStateProperties);e.root=this.editor.graph.model.cloneCell(b.root,null,!0);e.diagramModified=b.diagramModified;return e};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var e=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(g){null!=g&&0<g.length&&this.editor.graph.model.execute(new RenamePage(this,b,g))}),mxResources.get("rename"));this.showDialog(e.container,300,80,!0,!0);e.init()}return b};EditorUi.prototype.movePage=function(b,e){this.editor.graph.model.execute(new MovePage(this,b,e))};@@ -4056,99 +4058,99 @@ EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(nEditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.thinArrowRightImage,mxUtils.bind(this,function(b){var e=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:e,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=e;mxEvent.consume(b)}))};EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.verticalDotsImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var e=new mxPopupMenu(mxUtils.bind(this,function(v,p){this.menus.get("pages").funct(v,p)}));e.div.className+=" geMenubarMenu";e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);e.destroy()});var g=mxEvent.getClientX(b),m=mxEvent.getClientY(b);e.popup(g,m,null,b);this.setCurrentMenu(e);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,e){var g=this.createTab(),m=b.getName()||mxResources.get("untitled"),v=b.getId();g.setAttribute("title",m+(null!=v?" ("+v+")":"")+" ["+e+"]");e=document.createElement("span");e.style.maxWidth="160px";e.style.textOverflow="ellipsis";e.style.overflow="hidden";mxUtils.write(e,m);g.appendChild(e);this.addTabListeners(b,g);return g};-EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var g=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(T){this.renamePage(b);mxEvent.consume(T)}));var m=document.createElement("div");m.className="geTabMenuButton";m.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";m.style.backgroundPosition="center center";m.style.backgroundRepeat="no-repeat";m.style.backgroundSize="10px";e.appendChild(m);var v=!1,p=!1,A=mxUtils.bind(this,-function(T){v=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);g.isMouseDown||p||this.selectPage(b)}),G=mxUtils.bind(this,function(T){if(g.isEnabled()&&!g.isMouseDown&&(p&&(mxEvent.isTouchEvent(T)||mxEvent.getSource(T)==m)||mxEvent.isPopupTrigger(T))&&(g.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(T)||!v)){var F=new mxPopupMenu(this.createPageMenu(b));F.div.className+=" geMenubarMenu";F.smartSeparators=!0;F.showDisabled=!0;F.autoExpand=!0;F.hideMenu=mxUtils.bind(this,-function(){mxPopupMenu.prototype.hideMenu.apply(F,arguments);this.resetCurrentMenu();F.destroy()});var P=mxEvent.getClientX(T),Q=mxEvent.getClientY(T);F.popup(P,Q,null,T);this.setCurrentMenu(F,e)}mxEvent.consume(T)});mxEvent.addGestureListeners(m,A,null,G);mxEvent.addGestureListeners(e,A,null,G)};+EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var g=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(S){this.renamePage(b);mxEvent.consume(S)}));var m=document.createElement("div");m.className="geTabMenuButton";m.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";m.style.backgroundPosition="center center";m.style.backgroundRepeat="no-repeat";m.style.backgroundSize="10px";e.appendChild(m);var v=!1,p=!1,A=mxUtils.bind(this,+function(S){v=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);g.isMouseDown||p||this.selectPage(b)}),G=mxUtils.bind(this,function(S){if(g.isEnabled()&&!g.isMouseDown&&(p&&(mxEvent.isTouchEvent(S)||mxEvent.getSource(S)==m)||mxEvent.isPopupTrigger(S))&&(g.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(S)||!v)){var F=new mxPopupMenu(this.createPageMenu(b));F.div.className+=" geMenubarMenu";F.smartSeparators=!0;F.showDisabled=!0;F.autoExpand=!0;F.hideMenu=mxUtils.bind(this,+function(){mxPopupMenu.prototype.hideMenu.apply(F,arguments);this.resetCurrentMenu();F.destroy()});var P=mxEvent.getClientX(S),Q=mxEvent.getClientY(S);F.popup(P,Q,null,S);this.setCurrentMenu(F,e)}mxEvent.consume(S)});mxEvent.addGestureListeners(m,A,null,G);mxEvent.addGestureListeners(e,A,null,G)};EditorUi.prototype.createPageMenu=function(b,e){return mxUtils.bind(this,function(g,m){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||g.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),m));g.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",[b.getName()]))}),m);g.addSeparator(m);this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",g,m,mxResources.get("move"));g.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),m);g.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,e)}),m)})};(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var b=new mxObjectCodec(new MovePage,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){e=m.oldIndex;m.oldIndex=m.newIndex;m.newIndex=e;return m};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new RenamePage,["ui","page"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){e=m.previous;m.previous=m.name;m.name=e;return m};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","page","previousPage"]);b.afterEncode=function(e,g,m){m.setAttribute("relatedPage",g.relatedPage.getId());null==g.index&&(m.setAttribute("name",g.relatedPage.getName()),null!=g.relatedPage.viewState&&m.setAttribute("viewState",JSON.stringify(g.relatedPage.viewState,function(v,p){return 0>mxUtils.indexOf(EditorUi.transientViewStateProperties,v)?p:void 0})),null!=g.relatedPage.root&&e.encodeCell(g.relatedPage.root,m));return m};b.beforeDecode=function(e,g,m){m.ui=e.ui;m.relatedPage=m.ui.getPageById(g.getAttribute("relatedPage"));if(null==m.relatedPage){var v=g.ownerDocument.createElement("diagram");v.setAttribute("id",g.getAttribute("relatedPage"));v.setAttribute("name",g.getAttribute("name"));m.relatedPage=new DiagramPage(v);v=g.getAttribute("viewState");null!=v&&(m.relatedPage.viewState=JSON.parse(v),g.removeAttribute("viewState"));g=g.cloneNode(!0);v=g.firstChild;if(null!=v)for(m.relatedPage.root=e.decodeCell(v,!1),m=-v.nextSibling,v.parentNode.removeChild(v),v=m;null!=v;){m=v.nextSibling;if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var p=v.getAttribute("id");null==e.lookup(p)&&e.decodeCell(v)}v.parentNode.removeChild(v);v=m}}return g};b.afterDecode=function(e,g,m){m.index=m.previousIndex;return m};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(m,v,p,A,G){v=null!=v?v:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),m));this.stopEditing();this.model.beginUpdate();try{for(var T=p.slice(),F=0;F<p.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[F]),"treeFolding","0")&&this.foldTreeCell(m,p[F]);p=T;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(m,v){this.model.beginUpdate();try{var p=-[];this.traverse(v,!0,mxUtils.bind(this,function(G,T){var F=null!=T&&this.isTreeEdge(T);F&&p.push(T);G==v||null!=T&&!F||p.push(G);return(null==T||F)&&(G==v||!this.model.isCollapsed(G))}));this.model.setCollapsed(v,m);for(var A=0;A<p.length;A++)this.model.setVisible(p[A],!m)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(m){return!this.isEdgeIgnored(m)};Graph.prototype.getTreeEdges=function(m,v,p,A,G,T){return this.model.filterCells(this.getEdges(m,v,p,A,G,T),mxUtils.bind(this,-function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function m(Z){return k.isVertex(Z)&&p(Z)}function v(Z){var da=!1;null!=Z&&(da=-"1"==f.getCurrentCellStyle(Z).treeMoving);return da}function p(Z){var da=!1;null!=Z&&(Z=k.getParent(Z),da=f.view.getState(Z),da="tree"==(null!=da?da.style:f.getCellStyle(Z)).containerType);return da}function A(Z){var da=!1;null!=Z&&(Z=k.getParent(Z),da=f.view.getState(Z),f.view.getState(Z),da=null!=(null!=da?da.style:f.getCellStyle(Z)).childLayout);return da}function G(Z){Z=f.view.getState(Z);if(null!=Z){var da=f.getIncomingTreeEdges(Z.cell);if(0<da.length&&(da=f.view.getState(da[0]),null!=da&&(da=-da.absolutePoints,null!=da&&0<da.length&&(da=da[da.length-1],null!=da)))){if(da.y==Z.y&&Math.abs(da.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_SOUTH;if(da.y==Z.y+Z.height&&Math.abs(da.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_NORTH;if(da.x>Z.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function T(Z,da){da=null!=da?da:!0;f.model.beginUpdate();try{var aa=f.model.getParent(Z),l=f.getIncomingTreeEdges(Z),t=f.cloneCells([l[0],Z]);f.model.setTerminal(t[0],-f.model.getTerminal(l[0],!0),!0);var I=G(Z),V=aa.geometry;I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?t[1].geometry.x+=da?Z.geometry.width+10:-t[1].geometry.width-10:t[1].geometry.y+=da?Z.geometry.height+10:-t[1].geometry.height-10;f.view.currentRoot!=aa&&(t[1].geometry.x-=V.x,t[1].geometry.y-=V.y);var J=f.view.getState(Z),W=f.view.scale;if(null!=J){var Y=mxRectangle.fromRectangle(J);I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?Y.x+=(da?Z.geometry.width+10:-t[1].geometry.width--10)*W:Y.y+=(da?Z.geometry.height+10:-t[1].geometry.height-10)*W;var ba=f.getOutgoingTreeEdges(f.model.getTerminal(l[0],!0));if(null!=ba){for(var ja=I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH,oa=V=l=0;oa<ba.length;oa++){var qa=f.model.getTerminal(ba[oa],!1);if(I==G(qa)){var ra=f.view.getState(qa);qa!=Z&&null!=ra&&(ja&&da!=ra.getCenterX()<J.getCenterX()||!ja&&da!=ra.getCenterY()<J.getCenterY())&&mxUtils.intersects(Y,ra)&&(l=10+Math.max(l,(Math.min(Y.x+Y.width,ra.x+ra.width)-Math.max(Y.x,-ra.x))/W),V=10+Math.max(V,(Math.min(Y.y+Y.height,ra.y+ra.height)-Math.max(Y.y,ra.y))/W))}}ja?V=0:l=0;for(oa=0;oa<ba.length;oa++)if(qa=f.model.getTerminal(ba[oa],!1),I==G(qa)&&(ra=f.view.getState(qa),qa!=Z&&null!=ra&&(ja&&da!=ra.getCenterX()<J.getCenterX()||!ja&&da!=ra.getCenterY()<J.getCenterY()))){var xa=[];f.traverse(ra.cell,!0,function(Ba,ya){var Da=null!=ya&&f.isTreeEdge(ya);Da&&xa.push(ya);(null==ya||Da)&&xa.push(Ba);return null==ya||Da});f.moveCells(xa,(da?1:-1)*l,(da?1:-1)*V)}}}return f.addCells(t,-aa)}finally{f.model.endUpdate()}}function F(Z){f.model.beginUpdate();try{var da=G(Z),aa=f.getIncomingTreeEdges(Z),l=f.cloneCells([aa[0],Z]);f.model.setTerminal(aa[0],l[1],!1);f.model.setTerminal(l[0],l[1],!0);f.model.setTerminal(l[0],Z,!1);var t=f.model.getParent(Z),I=t.geometry,V=[];f.view.currentRoot!=t&&(l[1].geometry.x-=I.x,l[1].geometry.y-=I.y);f.traverse(Z,!0,function(Y,ba){var ja=null!=ba&&f.isTreeEdge(ba);ja&&V.push(ba);(null==ba||ja)&&V.push(Y);return null==ba||ja});var J=Z.geometry.width+-40,W=Z.geometry.height+40;da==mxConstants.DIRECTION_SOUTH?J=0:da==mxConstants.DIRECTION_NORTH?(J=0,W=-W):da==mxConstants.DIRECTION_WEST?(J=-J,W=0):da==mxConstants.DIRECTION_EAST&&(W=0);f.moveCells(V,J,W);return f.addCells(l,t)}finally{f.model.endUpdate()}}function P(Z,da){f.model.beginUpdate();try{var aa=f.model.getParent(Z),l=f.getIncomingTreeEdges(Z),t=G(Z);0==l.length&&(l=[f.createEdge(aa,null,"",null,null,f.createCurrentEdgeStyle())],t=da);var I=f.cloneCells([l[0],Z]);f.model.setTerminal(I[0],-Z,!0);null==f.model.getTerminal(I[0],!1)&&(f.model.setTerminal(I[0],I[1],!1),f.applyNewEdgeStyle(I[1],[I[0]],t));l=f.getOutgoingTreeEdges(Z);var V=aa.geometry;da=[];f.view.currentRoot==aa&&(V=new mxRectangle);for(var J=0;J<l.length;J++){var W=f.model.getTerminal(l[J],!1);null!=W&&da.push(W)}var Y=f.view.getBounds(da),ba=f.view.translate,ja=f.view.scale;t==mxConstants.DIRECTION_SOUTH?(I[1].geometry.x=null==Y?Z.geometry.x+(Z.geometry.width-I[1].geometry.width)/2:(Y.x+Y.width)/ja-ba.x-V.x+10,I[1].geometry.y+=-I[1].geometry.height-V.y+40):t==mxConstants.DIRECTION_NORTH?(I[1].geometry.x=null==Y?Z.geometry.x+(Z.geometry.width-I[1].geometry.width)/2:(Y.x+Y.width)/ja-ba.x+-V.x+10,I[1].geometry.y-=I[1].geometry.height+V.y+40):(I[1].geometry.x=t==mxConstants.DIRECTION_WEST?I[1].geometry.x-(I[1].geometry.width+V.x+40):I[1].geometry.x+(I[1].geometry.width-V.x+40),I[1].geometry.y=null==Y?Z.geometry.y+(Z.geometry.height-I[1].geometry.height)/2:(Y.y+Y.height)/ja-ba.y+-V.y+10);return f.addCells(I,aa)}finally{f.model.endUpdate()}}-function Q(Z,da,aa){Z=f.getOutgoingTreeEdges(Z);aa=f.view.getState(aa);var l=[];if(null!=aa&&null!=Z){for(var t=0;t<Z.length;t++){var I=f.view.getState(f.model.getTerminal(Z[t],!1));null!=I&&(!da&&Math.min(I.x+I.width,aa.x+aa.width)>=Math.max(I.x,aa.x)||da&&Math.min(I.y+I.height,aa.y+aa.height)>=Math.max(I.y,aa.y))&&l.push(I)}l.sort(function(V,J){return da?V.x+V.width-J.x-J.width:V.y+V.height-J.y-J.height})}return l}function U(Z,da){var aa=G(Z),l=da==mxConstants.DIRECTION_EAST||da==mxConstants.DIRECTION_WEST;-(aa==mxConstants.DIRECTION_EAST||aa==mxConstants.DIRECTION_WEST)==l&&aa!=da?c.actions.get("selectParent").funct():aa==da?(da=f.getOutgoingTreeEdges(Z),null!=da&&0<da.length&&f.setSelectionCell(f.model.getTerminal(da[0],!1))):(aa=f.getIncomingTreeEdges(Z),null!=aa&&0<aa.length&&(l=Q(f.model.getTerminal(aa[0],!0),l,Z),Z=f.view.getState(Z),null!=Z&&(Z=mxUtils.indexOf(l,Z),0<=Z&&(Z+=da==mxConstants.DIRECTION_NORTH||da==mxConstants.DIRECTION_WEST?-1:1,0<=Z&&Z<=l.length-1&&f.setSelectionCell(l[Z].cell)))))}-var c=this,f=c.editor.graph,k=f.getModel(),B=c.menus.createPopupMenu;c.menus.createPopupMenu=function(Z,da,aa){B.apply(this,arguments);if(1==f.getSelectionCount()){da=f.getSelectionCell();var l=f.getOutgoingTreeEdges(da);Z.addSeparator();0<l.length&&(m(f.getSelectionCell())&&this.addMenuItems(Z,["selectChildren"],null,aa),this.addMenuItems(Z,["selectDescendants"],null,aa));m(f.getSelectionCell())?(Z.addSeparator(),0<f.getIncomingTreeEdges(da).length&&this.addMenuItems(Z,["selectSiblings","selectParent"],-null,aa)):0<f.model.getEdgeCount(da)&&this.addMenuItems(Z,["selectConnections"],null,aa)}};c.actions.addAction("selectChildren",function(Z){if(f.isEnabled()&&1==f.getSelectionCount()){var da=f.getSelectionCell();Z=mxEvent.isControlDown(Z)?null:f.getOutgoingTreeEdges(da);if(null!=Z&&0<Z.length){da=[];for(var aa=0;aa<Z.length;aa++)da.push(f.model.getTerminal(Z[aa],!1));f.setSelectionCells(da)}else f.setSelectionCells(f.model.getChildren(da))}},null,null,"Alt+Shift+C");c.actions.addAction("selectDescendants",-function(Z){var da=f.getSelectionCell();if(f.isEnabled()&&null!=da){var aa=[];mxEvent.isControlDown(Z)||f.traverse(da,!0,function(l,t){var I=null!=t&&f.isTreeEdge(t);I&&mxEvent.isControlDown(Z)&&aa.push(t);(null==t||I)&&aa.push(l);return null==t||I});if(0==aa.length||1==aa.length&&aa[0]==da)aa=f.model.getDescendants(da);f.setSelectionCells(aa)}},null,null,"Alt+Shift+X");c.actions.addAction("selectParent",function(Z){var da=f.getSelectionCell();f.isEnabled()&&null!=da&&(Z=mxEvent.isControlDown(Z)?-null:f.getIncomingTreeEdges(da),null!=Z&&0<Z.length?f.setSelectionCell(f.model.getTerminal(Z[0],!0)):f.selectParentCell())},null,null,"Alt+Shift+P");c.actions.addAction("selectSiblings",function(Z){if(f.isEnabled()&&1==f.getSelectionCount()){var da=f.getSelectionCell(),aa=mxEvent.isControlDown(Z)?null:f.getIncomingTreeEdges(da);Z=[];if(null!=aa&&0<aa.length&&(aa=f.getOutgoingTreeEdges(f.model.getTerminal(aa[0],!0)),null!=aa))for(var l=0;l<aa.length;l++)Z.push(f.model.getTerminal(aa[l],!1));0==Z.length&&-(Z=f.model.getChildren(f.model.getParent(da)));f.setSelectionCells(Z)}},null,null,"Alt+Shift+S");var z=f.removeCells;f.removeCells=function(Z,da){da=null!=da?da:!0;null==Z&&(Z=this.getDeletableCells(this.getSelectionCells()));da&&(Z=this.getDeletableCells(this.addAllEdges(Z)));for(var aa=[],l=0;l<Z.length;l++){var t=Z[l];k.isEdge(t)&&p(t)&&(aa.push(t),t=k.getTerminal(t,!1));if(m(t)){var I=[];f.traverse(t,!0,function(V,J){var W=null!=J&&f.isTreeEdge(J);W&&I.push(J);(null==J||W)&&I.push(V);return null==-J||W});0<I.length&&(aa=aa.concat(I),t=f.getIncomingTreeEdges(Z[l]),Z=Z.concat(t))}else null!=t&&aa.push(Z[l])}Z=aa;return z.apply(this,arguments)};c.hoverIcons.getStateAt=function(Z,da,aa){return m(Z.cell)?null:this.graph.view.getState(this.graph.getCellAt(da,aa))};var C=f.duplicateCells;f.duplicateCells=function(Z,da){Z=null!=Z?Z:this.getSelectionCells();for(var aa=Z.slice(0),l=0;l<aa.length;l++){var t=f.view.getState(aa[l]);if(null!=t&&m(t.cell)){var I=f.getIncomingTreeEdges(t.cell);for(t=0;t<I.length;t++)mxUtils.remove(I[t],-Z)}}this.model.beginUpdate();try{var V=C.call(this,Z,da);if(V.length==Z.length)for(l=0;l<Z.length;l++)if(m(Z[l])){var J=f.getIncomingTreeEdges(V[l]);I=f.getIncomingTreeEdges(Z[l]);if(0==J.length&&0<I.length){var W=this.cloneCell(I[0]);this.addEdge(W,f.getDefaultParent(),this.model.getTerminal(I[0],!0),V[l])}}}finally{this.model.endUpdate()}return V};var H=f.moveCells;f.moveCells=function(Z,da,aa,l,t,I,V){for(var J=null,W=[],Y=0;Y<Z.length;Y++)(v(Z[Y])||m(Z[Y]))&&!A(Z[Y])&&this.isCellCollapsed(Z[Y])?-W=W.concat(this.getSubtree(Z[Y])):W.push(Z[Y]);Z=mxUtils.removeDuplicates(W);this.model.beginUpdate();try{W=t;var ba=this.getCurrentCellStyle(t);if(null!=Z&&m(t)&&"1"==mxUtils.getValue(ba,"treeFolding","0")){for(Y=0;Y<Z.length;Y++)if(m(Z[Y])||f.model.isEdge(Z[Y])&&null==f.model.getTerminal(Z[Y],!0)){t=f.model.getParent(Z[Y]);break}if(null!=W&&t!=W&&null!=this.view.getState(Z[0])){var ja=f.getIncomingTreeEdges(Z[0]);if(0<ja.length){var oa=f.view.getState(f.model.getTerminal(ja[0],!0));if(null!=oa){var qa=-f.view.getState(W);null!=qa&&(da=(qa.getCenterX()-oa.getCenterX())/f.view.scale,aa=(qa.getCenterY()-oa.getCenterY())/f.view.scale)}}}}J=H.apply(this,arguments);if(null!=J&&null!=Z&&J.length==Z.length)for(Y=0;Y<J.length;Y++)if(this.model.isEdge(J[Y]))m(W)&&0>mxUtils.indexOf(J,this.model.getTerminal(J[Y],!0))&&this.model.setTerminal(J[Y],W,!0);else if(m(Z[Y])&&(ja=f.getIncomingTreeEdges(Z[Y]),0<ja.length))if(!l)m(W)&&0>mxUtils.indexOf(Z,this.model.getTerminal(ja[0],!0))&&this.model.setTerminal(ja[0],-W,!0);else if(0==f.getIncomingTreeEdges(J[Y]).length){ba=W;if(null==ba||ba==f.model.getParent(Z[Y]))ba=f.model.getTerminal(ja[0],!0);l=this.cloneCell(ja[0]);this.addEdge(l,f.getDefaultParent(),ba,J[Y])}}finally{this.model.endUpdate()}return J};if(null!=c.sidebar){var K=c.sidebar.dropAndConnect;c.sidebar.dropAndConnect=function(Z,da,aa,l){var t=f.model,I=null;t.beginUpdate();try{if(I=K.apply(this,arguments),m(Z))for(var V=0;V<I.length;V++)if(t.isEdge(I[V])&&null==t.getTerminal(I[V],!0)){t.setTerminal(I[V],-Z,!0);var J=f.getCellGeometry(I[V]);J.points=null;null!=J.getTerminalPoint(!0)&&J.setTerminalPoint(null,!0)}}finally{t.endUpdate()}return I}}var M={67:c.actions.get("selectChildren"),88:c.actions.get("selectDescendants"),80:c.actions.get("selectParent"),83:c.actions.get("selectSiblings")},O={67:c.actions.get("copyStyle"),86:c.actions.get("pasteStyle")},ea=c.onKeyDown;c.onKeyDown=function(Z){try{var da=f.getSelectionCell();if(f.isEnabled()&&!f.isEditing()&&null!=da){var aa=mxEvent.isAltDown(Z)&&mxEvent.isShiftDown(Z)?-M[Z.keyCode]:mxEvent.isAltDown(Z)?O[Z.keyCode]:null;null!=aa?(aa.funct(Z),mxEvent.consume(Z)):m(da)&&(aa=null,0<f.getIncomingTreeEdges(da).length&&(9==Z.which?aa=mxEvent.isShiftDown(Z)?F(da):P(da):13==Z.which&&(aa=T(da,!mxEvent.isShiftDown(Z)))),null!=aa&&0<aa.length?(1==aa.length&&f.model.isEdge(aa[0])?f.setSelectionCell(f.model.getTerminal(aa[0],!1)):f.setSelectionCell(aa[aa.length-1]),null!=c.hoverIcons&&c.hoverIcons.update(f.view.getState(da)),f.startEditingAtCell(da),mxEvent.consume(Z)):37==-Z.keyCode?(U(da,mxConstants.DIRECTION_WEST),mxEvent.consume(Z)):38==Z.keyCode?(U(da,mxConstants.DIRECTION_NORTH),mxEvent.consume(Z)):39==Z.keyCode?(U(da,mxConstants.DIRECTION_EAST),mxEvent.consume(Z)):40==Z.keyCode&&(U(da,mxConstants.DIRECTION_SOUTH),mxEvent.consume(Z)))}}catch(l){c.handleError(l)}mxEvent.isConsumed(Z)||ea.apply(this,arguments)};var fa=f.connectVertex;f.connectVertex=function(Z,da,aa,l,t,I,V){var J=f.getIncomingTreeEdges(Z);if(m(Z)){var W=G(Z),Y=W==mxConstants.DIRECTION_EAST||W==-mxConstants.DIRECTION_WEST,ba=da==mxConstants.DIRECTION_EAST||da==mxConstants.DIRECTION_WEST;return W==da||0==J.length?P(Z,da):Y==ba?F(Z):T(Z,da!=mxConstants.DIRECTION_NORTH&&da!=mxConstants.DIRECTION_WEST)}return fa.apply(this,arguments)};f.getSubtree=function(Z){var da=[Z];!v(Z)&&!m(Z)||A(Z)||f.traverse(Z,!0,function(aa,l){var t=null!=l&&f.isTreeEdge(l);t&&0>mxUtils.indexOf(da,l)&&da.push(l);(null==l||t)&&0>mxUtils.indexOf(da,aa)&&da.push(aa);return null==l||t});return da};var S=mxVertexHandler.prototype.refresh;-mxVertexHandler.prototype.refresh=function(){S.apply(this,arguments);(v(this.state.cell)||m(this.state.cell))&&!A(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height=+v.nextSibling,v.parentNode.removeChild(v),v=m;null!=v;){m=v.nextSibling;if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var p=v.getAttribute("id");null==e.lookup(p)&&e.decodeCell(v)}v.parentNode.removeChild(v);v=m}}return g};b.afterDecode=function(e,g,m){m.index=m.previousIndex;return m};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(m,v,p,A,G){v=null!=v?v:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),m));this.stopEditing();this.model.beginUpdate();try{for(var S=p.slice(),F=0;F<p.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[F]),"treeFolding","0")&&this.foldTreeCell(m,p[F]);p=S;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(m,v){this.model.beginUpdate();try{var p=+[];this.traverse(v,!0,mxUtils.bind(this,function(G,S){var F=null!=S&&this.isTreeEdge(S);F&&p.push(S);G==v||null!=S&&!F||p.push(G);return(null==S||F)&&(G==v||!this.model.isCollapsed(G))}));this.model.setCollapsed(v,m);for(var A=0;A<p.length;A++)this.model.setVisible(p[A],!m)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(m){return!this.isEdgeIgnored(m)};Graph.prototype.getTreeEdges=function(m,v,p,A,G,S){return this.model.filterCells(this.getEdges(m,v,p,A,G,S),mxUtils.bind(this,+function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function m(Z){return k.isVertex(Z)&&p(Z)}function v(Z){var ea=!1;null!=Z&&(ea=+"1"==f.getCurrentCellStyle(Z).treeMoving);return ea}function p(Z){var ea=!1;null!=Z&&(Z=k.getParent(Z),ea=f.view.getState(Z),ea="tree"==(null!=ea?ea.style:f.getCellStyle(Z)).containerType);return ea}function A(Z){var ea=!1;null!=Z&&(Z=k.getParent(Z),ea=f.view.getState(Z),f.view.getState(Z),ea=null!=(null!=ea?ea.style:f.getCellStyle(Z)).childLayout);return ea}function G(Z){Z=f.view.getState(Z);if(null!=Z){var ea=f.getIncomingTreeEdges(Z.cell);if(0<ea.length&&(ea=f.view.getState(ea[0]),null!=ea&&(ea=+ea.absolutePoints,null!=ea&&0<ea.length&&(ea=ea[ea.length-1],null!=ea)))){if(ea.y==Z.y&&Math.abs(ea.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_SOUTH;if(ea.y==Z.y+Z.height&&Math.abs(ea.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_NORTH;if(ea.x>Z.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function S(Z,ea){ea=null!=ea?ea:!0;f.model.beginUpdate();try{var aa=f.model.getParent(Z),l=f.getIncomingTreeEdges(Z),t=f.cloneCells([l[0],Z]);f.model.setTerminal(t[0],+f.model.getTerminal(l[0],!0),!0);var H=G(Z),U=aa.geometry;H==mxConstants.DIRECTION_SOUTH||H==mxConstants.DIRECTION_NORTH?t[1].geometry.x+=ea?Z.geometry.width+10:-t[1].geometry.width-10:t[1].geometry.y+=ea?Z.geometry.height+10:-t[1].geometry.height-10;f.view.currentRoot!=aa&&(t[1].geometry.x-=U.x,t[1].geometry.y-=U.y);var K=f.view.getState(Z),W=f.view.scale;if(null!=K){var Y=mxRectangle.fromRectangle(K);H==mxConstants.DIRECTION_SOUTH||H==mxConstants.DIRECTION_NORTH?Y.x+=(ea?Z.geometry.width+10:-t[1].geometry.width-+10)*W:Y.y+=(ea?Z.geometry.height+10:-t[1].geometry.height-10)*W;var ca=f.getOutgoingTreeEdges(f.model.getTerminal(l[0],!0));if(null!=ca){for(var ja=H==mxConstants.DIRECTION_SOUTH||H==mxConstants.DIRECTION_NORTH,oa=U=l=0;oa<ca.length;oa++){var qa=f.model.getTerminal(ca[oa],!1);if(H==G(qa)){var ra=f.view.getState(qa);qa!=Z&&null!=ra&&(ja&&ea!=ra.getCenterX()<K.getCenterX()||!ja&&ea!=ra.getCenterY()<K.getCenterY())&&mxUtils.intersects(Y,ra)&&(l=10+Math.max(l,(Math.min(Y.x+Y.width,ra.x+ra.width)-Math.max(Y.x,+ra.x))/W),U=10+Math.max(U,(Math.min(Y.y+Y.height,ra.y+ra.height)-Math.max(Y.y,ra.y))/W))}}ja?U=0:l=0;for(oa=0;oa<ca.length;oa++)if(qa=f.model.getTerminal(ca[oa],!1),H==G(qa)&&(ra=f.view.getState(qa),qa!=Z&&null!=ra&&(ja&&ea!=ra.getCenterX()<K.getCenterX()||!ja&&ea!=ra.getCenterY()<K.getCenterY()))){var xa=[];f.traverse(ra.cell,!0,function(Ba,ya){var Da=null!=ya&&f.isTreeEdge(ya);Da&&xa.push(ya);(null==ya||Da)&&xa.push(Ba);return null==ya||Da});f.moveCells(xa,(ea?1:-1)*l,(ea?1:-1)*U)}}}return f.addCells(t,+aa)}finally{f.model.endUpdate()}}function F(Z){f.model.beginUpdate();try{var ea=G(Z),aa=f.getIncomingTreeEdges(Z),l=f.cloneCells([aa[0],Z]);f.model.setTerminal(aa[0],l[1],!1);f.model.setTerminal(l[0],l[1],!0);f.model.setTerminal(l[0],Z,!1);var t=f.model.getParent(Z),H=t.geometry,U=[];f.view.currentRoot!=t&&(l[1].geometry.x-=H.x,l[1].geometry.y-=H.y);f.traverse(Z,!0,function(Y,ca){var ja=null!=ca&&f.isTreeEdge(ca);ja&&U.push(ca);(null==ca||ja)&&U.push(Y);return null==ca||ja});var K=Z.geometry.width++40,W=Z.geometry.height+40;ea==mxConstants.DIRECTION_SOUTH?K=0:ea==mxConstants.DIRECTION_NORTH?(K=0,W=-W):ea==mxConstants.DIRECTION_WEST?(K=-K,W=0):ea==mxConstants.DIRECTION_EAST&&(W=0);f.moveCells(U,K,W);return f.addCells(l,t)}finally{f.model.endUpdate()}}function P(Z,ea){f.model.beginUpdate();try{var aa=f.model.getParent(Z),l=f.getIncomingTreeEdges(Z),t=G(Z);0==l.length&&(l=[f.createEdge(aa,null,"",null,null,f.createCurrentEdgeStyle())],t=ea);var H=f.cloneCells([l[0],Z]);f.model.setTerminal(H[0],+Z,!0);null==f.model.getTerminal(H[0],!1)&&(f.model.setTerminal(H[0],H[1],!1),f.applyNewEdgeStyle(H[1],[H[0]],t));l=f.getOutgoingTreeEdges(Z);var U=aa.geometry;ea=[];f.view.currentRoot==aa&&(U=new mxRectangle);for(var K=0;K<l.length;K++){var W=f.model.getTerminal(l[K],!1);null!=W&&ea.push(W)}var Y=f.view.getBounds(ea),ca=f.view.translate,ja=f.view.scale;t==mxConstants.DIRECTION_SOUTH?(H[1].geometry.x=null==Y?Z.geometry.x+(Z.geometry.width-H[1].geometry.width)/2:(Y.x+Y.width)/ja-ca.x-U.x+10,H[1].geometry.y+=+H[1].geometry.height-U.y+40):t==mxConstants.DIRECTION_NORTH?(H[1].geometry.x=null==Y?Z.geometry.x+(Z.geometry.width-H[1].geometry.width)/2:(Y.x+Y.width)/ja-ca.x+-U.x+10,H[1].geometry.y-=H[1].geometry.height+U.y+40):(H[1].geometry.x=t==mxConstants.DIRECTION_WEST?H[1].geometry.x-(H[1].geometry.width+U.x+40):H[1].geometry.x+(H[1].geometry.width-U.x+40),H[1].geometry.y=null==Y?Z.geometry.y+(Z.geometry.height-H[1].geometry.height)/2:(Y.y+Y.height)/ja-ca.y+-U.y+10);return f.addCells(H,aa)}finally{f.model.endUpdate()}}+function Q(Z,ea,aa){Z=f.getOutgoingTreeEdges(Z);aa=f.view.getState(aa);var l=[];if(null!=aa&&null!=Z){for(var t=0;t<Z.length;t++){var H=f.view.getState(f.model.getTerminal(Z[t],!1));null!=H&&(!ea&&Math.min(H.x+H.width,aa.x+aa.width)>=Math.max(H.x,aa.x)||ea&&Math.min(H.y+H.height,aa.y+aa.height)>=Math.max(H.y,aa.y))&&l.push(H)}l.sort(function(U,K){return ea?U.x+U.width-K.x-K.width:U.y+U.height-K.y-K.height})}return l}function T(Z,ea){var aa=G(Z),l=ea==mxConstants.DIRECTION_EAST||ea==mxConstants.DIRECTION_WEST;+(aa==mxConstants.DIRECTION_EAST||aa==mxConstants.DIRECTION_WEST)==l&&aa!=ea?c.actions.get("selectParent").funct():aa==ea?(ea=f.getOutgoingTreeEdges(Z),null!=ea&&0<ea.length&&f.setSelectionCell(f.model.getTerminal(ea[0],!1))):(aa=f.getIncomingTreeEdges(Z),null!=aa&&0<aa.length&&(l=Q(f.model.getTerminal(aa[0],!0),l,Z),Z=f.view.getState(Z),null!=Z&&(Z=mxUtils.indexOf(l,Z),0<=Z&&(Z+=ea==mxConstants.DIRECTION_NORTH||ea==mxConstants.DIRECTION_WEST?-1:1,0<=Z&&Z<=l.length-1&&f.setSelectionCell(l[Z].cell)))))}+var c=this,f=c.editor.graph,k=f.getModel(),B=c.menus.createPopupMenu;c.menus.createPopupMenu=function(Z,ea,aa){B.apply(this,arguments);if(1==f.getSelectionCount()){ea=f.getSelectionCell();var l=f.getOutgoingTreeEdges(ea);Z.addSeparator();0<l.length&&(m(f.getSelectionCell())&&this.addMenuItems(Z,["selectChildren"],null,aa),this.addMenuItems(Z,["selectDescendants"],null,aa));m(f.getSelectionCell())?(Z.addSeparator(),0<f.getIncomingTreeEdges(ea).length&&this.addMenuItems(Z,["selectSiblings","selectParent"],+null,aa)):0<f.model.getEdgeCount(ea)&&this.addMenuItems(Z,["selectConnections"],null,aa)}};c.actions.addAction("selectChildren",function(Z){if(f.isEnabled()&&1==f.getSelectionCount()){var ea=f.getSelectionCell();Z=mxEvent.isControlDown(Z)?null:f.getOutgoingTreeEdges(ea);if(null!=Z&&0<Z.length){ea=[];for(var aa=0;aa<Z.length;aa++)ea.push(f.model.getTerminal(Z[aa],!1));f.setSelectionCells(ea)}else f.setSelectionCells(f.model.getChildren(ea))}},null,null,"Alt+Shift+C");c.actions.addAction("selectDescendants",+function(Z){var ea=f.getSelectionCell();if(f.isEnabled()&&null!=ea){var aa=[];mxEvent.isControlDown(Z)||f.traverse(ea,!0,function(l,t){var H=null!=t&&f.isTreeEdge(t);H&&mxEvent.isControlDown(Z)&&aa.push(t);(null==t||H)&&aa.push(l);return null==t||H});if(0==aa.length||1==aa.length&&aa[0]==ea)aa=f.model.getDescendants(ea);f.setSelectionCells(aa)}},null,null,"Alt+Shift+X");c.actions.addAction("selectParent",function(Z){var ea=f.getSelectionCell();f.isEnabled()&&null!=ea&&(Z=mxEvent.isControlDown(Z)?+null:f.getIncomingTreeEdges(ea),null!=Z&&0<Z.length?f.setSelectionCell(f.model.getTerminal(Z[0],!0)):f.selectParentCell())},null,null,"Alt+Shift+P");c.actions.addAction("selectSiblings",function(Z){if(f.isEnabled()&&1==f.getSelectionCount()){var ea=f.getSelectionCell(),aa=mxEvent.isControlDown(Z)?null:f.getIncomingTreeEdges(ea);Z=[];if(null!=aa&&0<aa.length&&(aa=f.getOutgoingTreeEdges(f.model.getTerminal(aa[0],!0)),null!=aa))for(var l=0;l<aa.length;l++)Z.push(f.model.getTerminal(aa[l],!1));0==Z.length&&+(Z=f.model.getChildren(f.model.getParent(ea)));f.setSelectionCells(Z)}},null,null,"Alt+Shift+S");var z=f.removeCells;f.removeCells=function(Z,ea){ea=null!=ea?ea:!0;null==Z&&(Z=this.getDeletableCells(this.getSelectionCells()));ea&&(Z=this.getDeletableCells(this.addAllEdges(Z)));for(var aa=[],l=0;l<Z.length;l++){var t=Z[l];k.isEdge(t)&&p(t)&&(aa.push(t),t=k.getTerminal(t,!1));if(m(t)){var H=[];f.traverse(t,!0,function(U,K){var W=null!=K&&f.isTreeEdge(K);W&&H.push(K);(null==K||W)&&H.push(U);return null==+K||W});0<H.length&&(aa=aa.concat(H),t=f.getIncomingTreeEdges(Z[l]),Z=Z.concat(t))}else null!=t&&aa.push(Z[l])}Z=aa;return z.apply(this,arguments)};c.hoverIcons.getStateAt=function(Z,ea,aa){return m(Z.cell)?null:this.graph.view.getState(this.graph.getCellAt(ea,aa))};var C=f.duplicateCells;f.duplicateCells=function(Z,ea){Z=null!=Z?Z:this.getSelectionCells();for(var aa=Z.slice(0),l=0;l<aa.length;l++){var t=f.view.getState(aa[l]);if(null!=t&&m(t.cell)){var H=f.getIncomingTreeEdges(t.cell);for(t=0;t<H.length;t++)mxUtils.remove(H[t],+Z)}}this.model.beginUpdate();try{var U=C.call(this,Z,ea);if(U.length==Z.length)for(l=0;l<Z.length;l++)if(m(Z[l])){var K=f.getIncomingTreeEdges(U[l]);H=f.getIncomingTreeEdges(Z[l]);if(0==K.length&&0<H.length){var W=this.cloneCell(H[0]);this.addEdge(W,f.getDefaultParent(),this.model.getTerminal(H[0],!0),U[l])}}}finally{this.model.endUpdate()}return U};var I=f.moveCells;f.moveCells=function(Z,ea,aa,l,t,H,U){for(var K=null,W=[],Y=0;Y<Z.length;Y++)(v(Z[Y])||m(Z[Y]))&&!A(Z[Y])&&this.isCellCollapsed(Z[Y])?+W=W.concat(this.getSubtree(Z[Y])):W.push(Z[Y]);Z=mxUtils.removeDuplicates(W);this.model.beginUpdate();try{W=t;var ca=this.getCurrentCellStyle(t);if(null!=Z&&m(t)&&"1"==mxUtils.getValue(ca,"treeFolding","0")){for(Y=0;Y<Z.length;Y++)if(m(Z[Y])||f.model.isEdge(Z[Y])&&null==f.model.getTerminal(Z[Y],!0)){t=f.model.getParent(Z[Y]);break}if(null!=W&&t!=W&&null!=this.view.getState(Z[0])){var ja=f.getIncomingTreeEdges(Z[0]);if(0<ja.length){var oa=f.view.getState(f.model.getTerminal(ja[0],!0));if(null!=oa){var qa=+f.view.getState(W);null!=qa&&(ea=(qa.getCenterX()-oa.getCenterX())/f.view.scale,aa=(qa.getCenterY()-oa.getCenterY())/f.view.scale)}}}}K=I.apply(this,arguments);if(null!=K&&null!=Z&&K.length==Z.length)for(Y=0;Y<K.length;Y++)if(this.model.isEdge(K[Y]))m(W)&&0>mxUtils.indexOf(K,this.model.getTerminal(K[Y],!0))&&this.model.setTerminal(K[Y],W,!0);else if(m(Z[Y])&&(ja=f.getIncomingTreeEdges(Z[Y]),0<ja.length))if(!l)m(W)&&0>mxUtils.indexOf(Z,this.model.getTerminal(ja[0],!0))&&this.model.setTerminal(ja[0],+W,!0);else if(0==f.getIncomingTreeEdges(K[Y]).length){ca=W;if(null==ca||ca==f.model.getParent(Z[Y]))ca=f.model.getTerminal(ja[0],!0);l=this.cloneCell(ja[0]);this.addEdge(l,f.getDefaultParent(),ca,K[Y])}}finally{this.model.endUpdate()}return K};if(null!=c.sidebar){var L=c.sidebar.dropAndConnect;c.sidebar.dropAndConnect=function(Z,ea,aa,l){var t=f.model,H=null;t.beginUpdate();try{if(H=L.apply(this,arguments),m(Z))for(var U=0;U<H.length;U++)if(t.isEdge(H[U])&&null==t.getTerminal(H[U],!0)){t.setTerminal(H[U],+Z,!0);var K=f.getCellGeometry(H[U]);K.points=null;null!=K.getTerminalPoint(!0)&&K.setTerminalPoint(null,!0)}}finally{t.endUpdate()}return H}}var J={67:c.actions.get("selectChildren"),88:c.actions.get("selectDescendants"),80:c.actions.get("selectParent"),83:c.actions.get("selectSiblings")},O={67:c.actions.get("copyStyle"),86:c.actions.get("pasteStyle")},da=c.onKeyDown;c.onKeyDown=function(Z){try{var ea=f.getSelectionCell();if(f.isEnabled()&&!f.isEditing()&&null!=ea){var aa=mxEvent.isAltDown(Z)&&mxEvent.isShiftDown(Z)?+J[Z.keyCode]:mxEvent.isAltDown(Z)?O[Z.keyCode]:null;null!=aa?(aa.funct(Z),mxEvent.consume(Z)):m(ea)&&(aa=null,0<f.getIncomingTreeEdges(ea).length&&(9==Z.which?aa=mxEvent.isShiftDown(Z)?F(ea):P(ea):13==Z.which&&(aa=S(ea,!mxEvent.isShiftDown(Z)))),null!=aa&&0<aa.length?(1==aa.length&&f.model.isEdge(aa[0])?f.setSelectionCell(f.model.getTerminal(aa[0],!1)):f.setSelectionCell(aa[aa.length-1]),null!=c.hoverIcons&&c.hoverIcons.update(f.view.getState(ea)),f.startEditingAtCell(ea),mxEvent.consume(Z)):37==+Z.keyCode?(T(ea,mxConstants.DIRECTION_WEST),mxEvent.consume(Z)):38==Z.keyCode?(T(ea,mxConstants.DIRECTION_NORTH),mxEvent.consume(Z)):39==Z.keyCode?(T(ea,mxConstants.DIRECTION_EAST),mxEvent.consume(Z)):40==Z.keyCode&&(T(ea,mxConstants.DIRECTION_SOUTH),mxEvent.consume(Z)))}}catch(l){c.handleError(l)}mxEvent.isConsumed(Z)||da.apply(this,arguments)};var fa=f.connectVertex;f.connectVertex=function(Z,ea,aa,l,t,H,U){var K=f.getIncomingTreeEdges(Z);if(m(Z)){var W=G(Z),Y=W==mxConstants.DIRECTION_EAST||W==+mxConstants.DIRECTION_WEST,ca=ea==mxConstants.DIRECTION_EAST||ea==mxConstants.DIRECTION_WEST;return W==ea||0==K.length?P(Z,ea):Y==ca?F(Z):S(Z,ea!=mxConstants.DIRECTION_NORTH&&ea!=mxConstants.DIRECTION_WEST)}return fa.apply(this,arguments)};f.getSubtree=function(Z){var ea=[Z];!v(Z)&&!m(Z)||A(Z)||f.traverse(Z,!0,function(aa,l){var t=null!=l&&f.isTreeEdge(l);t&&0>mxUtils.indexOf(ea,l)&&ea.push(l);(null==l||t)&&0>mxUtils.indexOf(ea,aa)&&ea.push(aa);return null==l||t});return ea};var V=mxVertexHandler.prototype.refresh;+mxVertexHandler.prototype.refresh=function(){V.apply(this,arguments);(v(this.state.cell)||m(this.state.cell))&&!A(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(Z){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(Z),mxEvent.getClientY(Z),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(Z);this.graph.isMouseDown=!0;c.hoverIcons.reset();mxEvent.consume(Z)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),-this.moveHandle=null)};var ca=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){ca.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var ma=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=-function(Z){ma.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=Z?"":"none")};var la=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(Z,da){la.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var g=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var m=g.apply(this,arguments),v=this.graph,p=this;-return m.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');G.vertex=!0;var T=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-T.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);T.insertEdge(F,!1);A.insert(F);A.insert(G);A.insert(T);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,-0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');G.vertex=!0;var T=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-T.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);T.insertEdge(F,!1);var P=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-P.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),F.style);Q.geometry.relative=!0;Q.edge=!0;G.insertEdge(Q,!0);P.insertEdge(Q,!1);var U=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-U.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),F.style);c.geometry.relative=!0;c.edge=!0;G.insertEdge(c,!0);U.insertEdge(c,!1);var f=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-f.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),F.style);k.geometry.relative=!0;k.edge=!0;G.insertEdge(k,!0);f.insertEdge(k,!1);A.insert(F);A.insert(Q);A.insert(c);A.insert(k);A.insert(G);A.insert(T);A.insert(P);A.insert(U);A.insert(f);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var A=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+this.moveHandle=null)};var ba=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){ba.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var ma=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=+function(Z){ma.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=Z?"":"none")};var la=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(Z,ea){la.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var g=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var m=g.apply(this,arguments),v=this.graph,p=this;+return m.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');G.vertex=!0;var S=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');+S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);A.insert(F);A.insert(G);A.insert(S);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,+0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');G.vertex=!0;var S=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);var P=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+P.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),F.style);Q.geometry.relative=!0;Q.edge=!0;G.insertEdge(Q,!0);P.insertEdge(Q,!1);var T=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+T.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),F.style);c.geometry.relative=!0;c.edge=!0;G.insertEdge(c,!0);T.insertEdge(c,!1);var f=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+f.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),F.style);k.geometry.relative=!0;k.edge=!0;G.insertEdge(k,!0);f.insertEdge(k,!1);A.insert(F);A.insert(Q);A.insert(c);A.insert(k);A.insert(G);A.insert(S);A.insert(P);A.insert(T);A.insert(f);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var A=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');A.vertex=!0;return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var A=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return p.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var A=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return p.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree orgchart organization division",function(){var A=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var G=new mxCell("Organization",new mxGeometry(80,-40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(G,"treeRoot","1");G.vertex=!0;var T=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');T.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);T.insertEdge(F,!1);var P=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');P.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");Q.geometry.relative=-!0;Q.edge=!0;G.insertEdge(Q,!0);P.insertEdge(Q,!1);A.insert(F);A.insert(Q);A.insert(G);A.insert(T);A.insert(P);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree root",function(){var A=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;return p.createVertexTemplateFromCells([A],+40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(G,"treeRoot","1");G.vertex=!0;var S=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);var P=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');P.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");Q.geometry.relative=+!0;Q.edge=!0;G.insertEdge(Q,!0);P.insertEdge(Q,!1);A.insert(F);A.insert(Q);A.insert(G);A.insert(S);A.insert(P);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree root",function(){var A=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree division",function(){var A=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.setTerminalPoint(new mxPoint(0,0),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return p.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree sub sections",function(){var A=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");-G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);var T=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");T.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),G.style);F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;T.insertEdge(F,!1);return p.createVertexTemplateFromCells([G,F,A,T],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;-EditorUi.initMinimalTheme=function(){function b(U,c){if(EditorUi.windowed){var f=U.editor.graph;f.popupMenuHandler.hideMenu();null==U.formatWindow?(c=Math.max(10,U.diagramContainer.clientWidth-248),f=Math.min(566,f.container.clientHeight-10),U.formatWindow=new WrapperWindow(U,mxResources.get("format"),c,60,240,f,function(k){U.createFormat(k).init()}),U.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){U.formatWindow.window.fit()})),U.formatWindow.window.minimumSize=new mxRectangle(0,-0,240,80)):U.formatWindow.window.setVisible(null!=c?c:!U.formatWindow.window.isVisible())}else null==U.formatElt&&(U.formatElt=U.createSidebarContainer(),U.createFormat(U.formatElt).init(),U.formatElt.style.border="none",U.formatElt.style.width="240px",U.formatElt.style.borderLeftWidth="1px",U.formatElt.style.borderLeftStyle="solid",U.formatElt.style.right="0px"),f=U.diagramContainer.parentNode,null!=U.formatElt.parentNode?(U.formatElt.parentNode.removeChild(U.formatElt),f.style.right="0px"):(f.parentNode.appendChild(U.formatElt),-f.style.right=U.formatElt.style.width)}function e(U,c){function f(z,C){var H=U.menus.get(z);z=k.addMenu(C,mxUtils.bind(this,function(){H.funct.apply(this,arguments)}));z.setAttribute("title",C);z.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";z.className="geTitle";c.appendChild(z);return z}var k=new Menubar(U,c);if(Editor.enableCustomLibraries&&-("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=U.actions.get("newLibrary")){var B=document.createElement("div");B.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";B.className="geTitle";mxUtils.write(B,mxResources.get("newLibrary"));c.appendChild(B);mxEvent.addListener(B,"click",this.actions.get("newLibrary").funct);-B=B.cloneNode(!1);B.style.left="50%";B.style.borderLeftStyle="solid";mxUtils.write(B,mxResources.get("openLibrary"));c.appendChild(B);mxEvent.addListener(B,"click",this.actions.get("openLibrary").funct)}else B=f("newLibrary",mxResources.get("newLibrary")),B.style.display="block",B.style.fontSize="11px",B.style.left="0",B=f("openLibraryFrom",mxResources.get("openLibraryFrom")),B.style.borderLeftStyle="solid",B.style.display="block",B.style.fontSize="11px",B.style.left="50%";c.appendChild(U.sidebar.container);-c.style.overflow="hidden"}function g(U,c){if(EditorUi.windowed){var f=U.editor.graph;f.popupMenuHandler.hideMenu();null==U.sidebarWindow?(c=Math.min(f.container.clientWidth-10,218),f=Math.min(f.container.clientHeight-40,650),U.sidebarWindow=new WrapperWindow(U,mxResources.get("shapes"),10,56,c-6,f-6,function(k){e(U,k)}),U.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){U.sidebarWindow.window.fit()})),U.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),U.sidebarWindow.window.setVisible(!0),-isLocalStorage&&U.getLocalData("sidebar",function(k){U.sidebar.showEntries(k,null,!0)}),U.restoreLibraries()):U.sidebarWindow.window.setVisible(null!=c?c:!U.sidebarWindow.window.isVisible())}else null==U.sidebarElt&&(U.sidebarElt=U.createSidebarContainer(),e(U,U.sidebarElt),U.sidebarElt.style.border="none",U.sidebarElt.style.width="210px",U.sidebarElt.style.borderRight="1px solid gray"),f=U.diagramContainer.parentNode,null!=U.sidebarElt.parentNode?(U.sidebarElt.parentNode.removeChild(U.sidebarElt),-f.style.left="0px"):(f.parentNode.appendChild(U.sidebarElt),f.style.left=U.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(U){}Menus.prototype.autoPopup=!1;Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src;+G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);var S=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),G.style);F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;S.insertEdge(F,!1);return p.createVertexTemplateFromCells([G,F,A,S],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+EditorUi.initMinimalTheme=function(){function b(T,c){if(EditorUi.windowed){var f=T.editor.graph;f.popupMenuHandler.hideMenu();null==T.formatWindow?(c=Math.max(10,T.diagramContainer.clientWidth-248),f=Math.min(566,f.container.clientHeight-10),T.formatWindow=new WrapperWindow(T,mxResources.get("format"),c,60,240,f,function(k){T.createFormat(k).init()}),T.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){T.formatWindow.window.fit()})),T.formatWindow.window.minimumSize=new mxRectangle(0,+0,240,80)):T.formatWindow.window.setVisible(null!=c?c:!T.formatWindow.window.isVisible())}else null==T.formatElt&&(T.formatElt=T.createSidebarContainer(),T.createFormat(T.formatElt).init(),T.formatElt.style.border="none",T.formatElt.style.width="240px",T.formatElt.style.borderLeftWidth="1px",T.formatElt.style.borderLeftStyle="solid",T.formatElt.style.right="0px"),f=T.diagramContainer.parentNode,null!=T.formatElt.parentNode?(T.formatElt.parentNode.removeChild(T.formatElt),f.style.right="0px"):(f.parentNode.appendChild(T.formatElt),+f.style.right=T.formatElt.style.width)}function e(T,c){function f(z,C){var I=T.menus.get(z);z=k.addMenu(C,mxUtils.bind(this,function(){I.funct.apply(this,arguments)}));z.setAttribute("title",C);z.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";z.className="geTitle";c.appendChild(z);return z}var k=new Menubar(T,c);if(Editor.enableCustomLibraries&&+("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=T.actions.get("newLibrary")){var B=document.createElement("div");B.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";B.className="geTitle";mxUtils.write(B,mxResources.get("newLibrary"));c.appendChild(B);mxEvent.addListener(B,"click",this.actions.get("newLibrary").funct);+B=B.cloneNode(!1);B.style.left="50%";B.style.borderLeftStyle="solid";mxUtils.write(B,mxResources.get("openLibrary"));c.appendChild(B);mxEvent.addListener(B,"click",this.actions.get("openLibrary").funct)}else B=f("newLibrary",mxResources.get("newLibrary")),B.style.display="block",B.style.fontSize="11px",B.style.left="0",B=f("openLibraryFrom",mxResources.get("openLibraryFrom")),B.style.borderLeftStyle="solid",B.style.display="block",B.style.fontSize="11px",B.style.left="50%";c.appendChild(T.sidebar.container);+c.style.overflow="hidden"}function g(T,c){if(EditorUi.windowed){var f=T.editor.graph;f.popupMenuHandler.hideMenu();null==T.sidebarWindow?(c=Math.min(f.container.clientWidth-10,218),f=Math.min(f.container.clientHeight-40,650),T.sidebarWindow=new WrapperWindow(T,mxResources.get("shapes"),10,56,c-6,f-6,function(k){e(T,k)}),T.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){T.sidebarWindow.window.fit()})),T.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),T.sidebarWindow.window.setVisible(!0),+isLocalStorage&&T.getLocalData("sidebar",function(k){T.sidebar.showEntries(k,null,!0)}),T.restoreLibraries()):T.sidebarWindow.window.setVisible(null!=c?c:!T.sidebarWindow.window.isVisible())}else null==T.sidebarElt&&(T.sidebarElt=T.createSidebarContainer(),e(T,T.sidebarElt),T.sidebarElt.style.border="none",T.sidebarElt.style.width="210px",T.sidebarElt.style.borderRight="1px solid gray"),f=T.diagramContainer.parentNode,null!=T.sidebarElt.parentNode?(T.sidebarElt.parentNode.removeChild(T.sidebarElt),+f.style.left="0px"):(f.parentNode.appendChild(T.sidebarElt),f.style.left=T.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(T){}Menus.prototype.autoPopup=!1;Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=-!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var v=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(U){v.apply(this,arguments);null!=this.tabContainer&&(this.tabContainer.style.right="62px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px")};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=-this.getCurrentFile()||"1"==urlParams.embed)};var A=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(U,c){null!=c.shortcut&&900>m&&!mxClient.IS_IOS?U.firstChild.nextSibling.setAttribute("title",c.shortcut):A.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(U){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=U?U:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||-null==this.formatWindow&&0<this.formatWidth};var G=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();G.apply(this,arguments)};var T=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(U){T.apply(this,arguments);if(U){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=-this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var F=Menus.prototype.init;Menus.prototype.init=function(){F.apply(this,arguments);var U=this.editorUi;EditorUi.enablePlantUml&&!U.isOffline()&&U.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var k=new ParseDialog(U,mxResources.get("plantUml")+"...","plantUml");U.showDialog(k.container,-620,420,!0,!1);k.init()}));U.actions.put("mermaid",new Action(mxResources.get("mermaid")+"...",function(){var k=new ParseDialog(U,mxResources.get("mermaid")+"...","mermaid");U.showDialog(k.container,620,420,!0,!1);k.init()}));var c="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),f=function(k,B,z,C){k.addItem(z,null,mxUtils.bind(this,function(){var H=new CreateGraphDialog(U,z,C);U.showDialog(H.container,620,420,!0,!1);H.init()}),B)};this.put("insertLayout",-new Menu(mxUtils.bind(this,function(k,B){for(var z=0;z<c.length;z++)"-"==c[z]?k.addSeparator(B):f(k,B,mxResources.get(c[z])+"...",c[z])})))};EditorUi.prototype.installFormatToolbar=function(U){var c=this.editor.graph,f=document.createElement("div");f.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";c.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,-function(k,B){0<c.getSelectionCount()?(U.appendChild(f),f.innerHTML="Selected: "+c.getSelectionCount()):null!=f.parentNode&&f.parentNode.removeChild(f)}))};var P=!1;EditorUi.prototype.initFormatWindow=function(){if(!P&&null!=this.formatWindow){P=!0;var U=this.formatWindow.window.toggleMinimized,c=240;this.formatWindow.window.toggleMinimized=function(){U.apply(this,arguments);this.minimized?(c=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=-parseInt(this.div.style.left)+c-140+"px"):(this.div.style.width=c+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-c+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(f){mxEvent.getSource(f)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var Q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function U(ja,oa,qa){var ra=C.menus.get(ja),-xa=O.addMenu(mxResources.get(ja),mxUtils.bind(this,function(){xa.classList.contains("mxDisabled")||ra.funct.apply(this,arguments)}),M);xa.className="geMenuItem";xa.style.display="inline-block";xa.style.boxSizing="border-box";xa.style.top="6px";xa.style.marginRight="6px";xa.style.height="30px";xa.style.paddingTop="6px";xa.style.paddingBottom="6px";xa.style.cursor="pointer";xa.setAttribute("title",mxResources.get(ja));C.menus.menuCreated(ra,xa,"geMenuItem");null!=qa?(xa.style.backgroundImage="url("++!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var v=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(T){v.apply(this,arguments);null!=this.tabContainer&&(this.tabContainer.style.right="62px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px")};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=+this.getCurrentFile()||"1"==urlParams.embed)};var A=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(T,c){null!=c.shortcut&&900>m&&!mxClient.IS_IOS?T.firstChild.nextSibling.setAttribute("title",c.shortcut):A.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(T){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=T?T:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||+null==this.formatWindow&&0<this.formatWidth};var G=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();G.apply(this,arguments)};var S=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(T){S.apply(this,arguments);if(T){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=+this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var F=Menus.prototype.init;Menus.prototype.init=function(){F.apply(this,arguments);var T=this.editorUi;EditorUi.enablePlantUml&&!T.isOffline()&&T.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var k=new ParseDialog(T,mxResources.get("plantUml")+"...","plantUml");T.showDialog(k.container,+620,420,!0,!1);k.init()}));T.actions.put("mermaid",new Action(mxResources.get("mermaid")+"...",function(){var k=new ParseDialog(T,mxResources.get("mermaid")+"...","mermaid");T.showDialog(k.container,620,420,!0,!1);k.init()}));var c="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),f=function(k,B,z,C){k.addItem(z,null,mxUtils.bind(this,function(){var I=new CreateGraphDialog(T,z,C);T.showDialog(I.container,620,420,!0,!1);I.init()}),B)};this.put("insertLayout",+new Menu(mxUtils.bind(this,function(k,B){for(var z=0;z<c.length;z++)"-"==c[z]?k.addSeparator(B):f(k,B,mxResources.get(c[z])+"...",c[z])})))};EditorUi.prototype.installFormatToolbar=function(T){var c=this.editor.graph,f=document.createElement("div");f.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";c.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,+function(k,B){0<c.getSelectionCount()?(T.appendChild(f),f.innerHTML="Selected: "+c.getSelectionCount()):null!=f.parentNode&&f.parentNode.removeChild(f)}))};var P=!1;EditorUi.prototype.initFormatWindow=function(){if(!P&&null!=this.formatWindow){P=!0;var T=this.formatWindow.window.toggleMinimized,c=240;this.formatWindow.window.toggleMinimized=function(){T.apply(this,arguments);this.minimized?(c=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=+parseInt(this.div.style.left)+c-140+"px"):(this.div.style.width=c+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-c+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(f){mxEvent.getSource(f)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var Q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function T(ja,oa,qa){var ra=C.menus.get(ja),+xa=O.addMenu(mxResources.get(ja),mxUtils.bind(this,function(){xa.classList.contains("mxDisabled")||ra.funct.apply(this,arguments)}),J);xa.className="geMenuItem";xa.style.display="inline-block";xa.style.boxSizing="border-box";xa.style.top="6px";xa.style.marginRight="6px";xa.style.height="30px";xa.style.paddingTop="6px";xa.style.paddingBottom="6px";xa.style.cursor="pointer";xa.setAttribute("title",mxResources.get(ja));C.menus.menuCreated(ra,xa,"geMenuItem");null!=qa?(xa.style.backgroundImage="url("+qa+")",xa.style.backgroundPosition="center center",xa.style.backgroundRepeat="no-repeat",xa.style.backgroundSize="24px 24px",xa.style.width="34px",xa.innerText=""):oa||(xa.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",xa.style.backgroundPosition="right 6px center",xa.style.backgroundRepeat="no-repeat",xa.style.paddingRight="22px");return xa}function c(ja,oa,qa,ra,xa,Ba){var ya=document.createElement("a");ya.className="geMenuItem";ya.style.display="inline-block";ya.style.boxSizing=-"border-box";ya.style.height="30px";ya.style.padding="6px";ya.style.position="relative";ya.style.verticalAlign="top";ya.style.top="0px";null!=C.statusContainer?K.insertBefore(ya,C.statusContainer):K.appendChild(ya);null!=Ba?(ya.style.backgroundImage="url("+Ba+")",ya.style.backgroundPosition="center center",ya.style.backgroundRepeat="no-repeat",ya.style.backgroundSize="24px 24px",ya.style.width="34px"):mxUtils.write(ya,ja);mxEvent.addListener(ya,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,-function(Da){Da.preventDefault()}));mxEvent.addListener(ya,"click",function(Da){"disabled"!=ya.getAttribute("disabled")&&oa(Da);mxEvent.consume(Da)});null==qa&&(ya.style.marginRight="4px");null!=ra&&ya.setAttribute("title",ra);null!=xa&&(ja=function(){xa.isEnabled()?(ya.removeAttribute("disabled"),ya.style.cursor="pointer"):(ya.setAttribute("disabled","disabled"),ya.style.cursor="default")},xa.addListener("stateChanged",ja),H.addListener("enabledChanged",ja),ja());return ya}function f(ja,oa,qa){qa=-document.createElement("div");qa.className="geMenuItem";qa.style.display="inline-block";qa.style.verticalAlign="top";qa.style.marginRight="6px";qa.style.padding="0 4px 0 4px";qa.style.height="30px";qa.style.position="relative";qa.style.top="0px";for(var ra=0;ra<ja.length;ra++)null!=ja[ra]&&(ja[ra].style.margin="0px",ja[ra].style.boxShadow="none",qa.appendChild(ja[ra]));null!=oa&&mxUtils.setOpacity(qa,oa);null!=C.statusContainer?K.insertBefore(qa,C.statusContainer):K.appendChild(qa);return qa}function k(){for(var ja=-K.firstChild;null!=ja;){var oa=ja.nextSibling;"geMenuItem"!=ja.className&&"geItem"!=ja.className||ja.parentNode.removeChild(ja);ja=oa}M=K.firstChild;m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;ja=1E3>m;var qa=null;ja||(qa=U("diagram"));oa=ja?U("diagram",null,Editor.menuImage):null;null!=oa&&(qa=oa);f([qa,c(mxResources.get("shapes"),C.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),C.actions.get("image"),ja?Editor.shapesImage:null),c(mxResources.get("format"),-C.actions.get("format").funct,null,mxResources.get("format")+" ("+C.actions.get("format").shortcut+")",C.actions.get("image"),ja?Editor.formatImage:null)],ja?60:null);oa=U("insert",!0,ja?S:null);f([oa,c(mxResources.get("delete"),C.actions.get("delete").funct,null,mxResources.get("delete"),C.actions.get("delete"),ja?Editor.trashImage:null)],ja?60:null);H.isEnabled()||oa.classList.add("mxDisabled");411<=m&&(f([V,J],60),520<=m&&f([W,640<=m?c("",da.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+-" +)",da,Editor.zoomInImage):null,640<=m?c("",aa.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",aa,Editor.zoomOutImage):null],60))}Q.apply(this,arguments);var B=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=B&&(B.classList.add("geSimple"),B.classList.add("geMinimal"));B=Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries);var z=document.createElement("div");z.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";-z.style.bottom=B?"32px":"0px";this.sidebar=this.createSidebar(z);if(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])g(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var C=this,H=C.editor.graph;C.toolbar=this.createToolbar(C.createDiv("geToolbar"));-C.defaultLibraryName=mxResources.get("untitledLibrary");var K=document.createElement("div");K.className="geMenubarContainer";var M=null,O=new Menubar(C,K);C.statusContainer=C.createStatusContainer();C.statusContainer.style.position="relative";C.statusContainer.style.maxWidth="";C.statusContainer.style.cursor="default";var ea=C.hideCurrentMenu;C.hideCurrentMenu=function(){ea.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var fa=C.descriptorChanged;C.descriptorChanged=function(){fa.apply(this,-arguments);var ja=C.getCurrentFile();if(null!=ja&&null!=ja.getTitle()){var oa=ja.getMode();"google"==oa?oa="googleDrive":"github"==oa?oa="gitHub":"gitlab"==oa?oa="gitLab":"onedrive"==oa&&(oa="oneDrive");oa=mxResources.get(oa);K.setAttribute("title",ja.getTitle()+(null!=oa?" ("+oa+")":""))}else K.removeAttribute("title")};C.setStatusText(C.editor.getStatus());K.appendChild(C.statusContainer);C.buttonContainer=document.createElement("div");C.buttonContainer.style.cssText="display:flex;justify-content:flex-end;padding-right:10px;gap:6px;white-space:nowrap;background-color:inherit;align-items:center;min-width:0;margin-left:auto;";-K.appendChild(C.buttonContainer);C.menubarContainer=C.buttonContainer;C.tabContainer=document.createElement("div");C.tabContainer.className="geTabContainer geTabItem";C.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;visibility:hidden;";B=C.diagramContainer.parentNode;z=document.createElement("div");z.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";C.diagramContainer.style.top="47px";var S=Editor.addBoxImage;-if(null!=C.hoverIcons){var ca=C.hoverIcons.update;C.hoverIcons.update=function(){H.freehand.isDrawing()||ca.apply(this,arguments)}}if(null!=H.freehand){var ma=H.freehand.createStyle;H.freehand.createStyle=function(ja){return ma.apply(this,arguments)+"sketch=0;"}}C.editor.addListener("statusChanged",mxUtils.bind(this,function(){C.setStatusText(C.editor.getStatus())}));C.setStatusText(C.editor.getStatus());var la=C.menus.get("viewZoom");if(null!=la){var Z=function(ja){if(mxEvent.isAltDown(ja))C.hideCurrentMenu(),-C.actions.get("customZoom").funct(),mxEvent.consume(ja);else if("geMenuItem"==mxEvent.getSource(ja).className||mxEvent.isShiftDown(ja))C.hideCurrentMenu(),C.actions.get("smartFit").funct(),mxEvent.consume(ja)},da=C.actions.get("zoomIn"),aa=C.actions.get("zoomOut"),l=C.actions.get("resetView"),t=C.actions.get("undo"),I=C.actions.get("redo"),V=c("",t.funct,null,mxResources.get("undo")+" ("+t.shortcut+")",t,Editor.undoImage),J=c("",I.funct,null,mxResources.get("redo")+" ("+I.shortcut+")",I,Editor.redoImage),-W=c("",Z,!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",l,Editor.zoomFitImage);K.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;text-align:left;white-space:nowrap;";this.tabContainer.style.right="70px";var Y=O.addMenu("100%",la.funct);Y.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");Y.className="geTabItem";Y.style.height=C.tabContainerHeight+"px";Y.style.position="absolute";Y.style.display="0"!=urlParams.pages?"flex":"none";Y.style.alignItems=+"border-box";ya.style.height="30px";ya.style.padding="6px";ya.style.position="relative";ya.style.verticalAlign="top";ya.style.top="0px";null!=C.statusContainer?L.insertBefore(ya,C.statusContainer):L.appendChild(ya);null!=Ba?(ya.style.backgroundImage="url("+Ba+")",ya.style.backgroundPosition="center center",ya.style.backgroundRepeat="no-repeat",ya.style.backgroundSize="24px 24px",ya.style.width="34px"):mxUtils.write(ya,ja);mxEvent.addListener(ya,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,+function(Da){Da.preventDefault()}));mxEvent.addListener(ya,"click",function(Da){"disabled"!=ya.getAttribute("disabled")&&oa(Da);mxEvent.consume(Da)});null==qa&&(ya.style.marginRight="4px");null!=ra&&ya.setAttribute("title",ra);null!=xa&&(ja=function(){xa.isEnabled()?(ya.removeAttribute("disabled"),ya.style.cursor="pointer"):(ya.setAttribute("disabled","disabled"),ya.style.cursor="default")},xa.addListener("stateChanged",ja),I.addListener("enabledChanged",ja),ja());return ya}function f(ja,oa,qa){qa=+document.createElement("div");qa.className="geMenuItem";qa.style.display="inline-block";qa.style.verticalAlign="top";qa.style.marginRight="6px";qa.style.padding="0 4px 0 4px";qa.style.height="30px";qa.style.position="relative";qa.style.top="0px";for(var ra=0;ra<ja.length;ra++)null!=ja[ra]&&(ja[ra].style.margin="0px",ja[ra].style.boxShadow="none",qa.appendChild(ja[ra]));null!=oa&&mxUtils.setOpacity(qa,oa);null!=C.statusContainer?L.insertBefore(qa,C.statusContainer):L.appendChild(qa);return qa}function k(){for(var ja=+L.firstChild;null!=ja;){var oa=ja.nextSibling;"geMenuItem"!=ja.className&&"geItem"!=ja.className||ja.parentNode.removeChild(ja);ja=oa}J=L.firstChild;m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;ja=1E3>m;var qa=null;ja||(qa=T("diagram"));oa=ja?T("diagram",null,Editor.menuImage):null;null!=oa&&(qa=oa);f([qa,c(mxResources.get("shapes"),C.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),C.actions.get("image"),ja?Editor.shapesImage:null),c(mxResources.get("format"),+C.actions.get("format").funct,null,mxResources.get("format")+" ("+C.actions.get("format").shortcut+")",C.actions.get("image"),ja?Editor.formatImage:null)],ja?60:null);oa=T("insert",!0,ja?V:null);f([oa,c(mxResources.get("delete"),C.actions.get("delete").funct,null,mxResources.get("delete"),C.actions.get("delete"),ja?Editor.trashImage:null)],ja?60:null);I.isEnabled()||oa.classList.add("mxDisabled");411<=m&&(f([U,K],60),520<=m&&f([W,640<=m?c("",ea.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey++" +)",ea,Editor.zoomInImage):null,640<=m?c("",aa.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",aa,Editor.zoomOutImage):null],60))}Q.apply(this,arguments);var B=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=B&&(B.classList.add("geSimple"),B.classList.add("geMinimal"));B=Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries);var z=document.createElement("div");z.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";+z.style.bottom=B?"32px":"0px";this.sidebar=this.createSidebar(z);if(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])g(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var C=this,I=C.editor.graph;C.toolbar=this.createToolbar(C.createDiv("geToolbar"));+C.defaultLibraryName=mxResources.get("untitledLibrary");var L=document.createElement("div");L.className="geMenubarContainer";var J=null,O=new Menubar(C,L);C.statusContainer=C.createStatusContainer();C.statusContainer.style.position="relative";C.statusContainer.style.maxWidth="";C.statusContainer.style.cursor="default";var da=C.hideCurrentMenu;C.hideCurrentMenu=function(){da.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var fa=C.descriptorChanged;C.descriptorChanged=function(){fa.apply(this,+arguments);var ja=C.getCurrentFile();if(null!=ja&&null!=ja.getTitle()){var oa=ja.getMode();"google"==oa?oa="googleDrive":"github"==oa?oa="gitHub":"gitlab"==oa?oa="gitLab":"onedrive"==oa&&(oa="oneDrive");oa=mxResources.get(oa);L.setAttribute("title",ja.getTitle()+(null!=oa?" ("+oa+")":""))}else L.removeAttribute("title")};C.setStatusText(C.editor.getStatus());L.appendChild(C.statusContainer);C.buttonContainer=document.createElement("div");C.buttonContainer.style.cssText="display:flex;justify-content:flex-end;padding-right:10px;gap:6px;white-space:nowrap;background-color:inherit;align-items:center;min-width:0;margin-left:auto;";+L.appendChild(C.buttonContainer);C.menubarContainer=C.buttonContainer;C.tabContainer=document.createElement("div");C.tabContainer.className="geTabContainer geTabItem";C.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;visibility:hidden;";B=C.diagramContainer.parentNode;z=document.createElement("div");z.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";C.diagramContainer.style.top="47px";var V=Editor.addBoxImage;+if(null!=C.hoverIcons){var ba=C.hoverIcons.update;C.hoverIcons.update=function(){I.freehand.isDrawing()||ba.apply(this,arguments)}}if(null!=I.freehand){var ma=I.freehand.createStyle;I.freehand.createStyle=function(ja){return ma.apply(this,arguments)+"sketch=0;"}}C.editor.addListener("statusChanged",mxUtils.bind(this,function(){C.setStatusText(C.editor.getStatus())}));C.setStatusText(C.editor.getStatus());var la=C.menus.get("viewZoom");if(null!=la){var Z=function(ja){if(mxEvent.isAltDown(ja))C.hideCurrentMenu(),+C.actions.get("customZoom").funct(),mxEvent.consume(ja);else if("geMenuItem"==mxEvent.getSource(ja).className||mxEvent.isShiftDown(ja))C.hideCurrentMenu(),C.actions.get("smartFit").funct(),mxEvent.consume(ja)},ea=C.actions.get("zoomIn"),aa=C.actions.get("zoomOut"),l=C.actions.get("resetView"),t=C.actions.get("undo"),H=C.actions.get("redo"),U=c("",t.funct,null,mxResources.get("undo")+" ("+t.shortcut+")",t,Editor.undoImage),K=c("",H.funct,null,mxResources.get("redo")+" ("+H.shortcut+")",H,Editor.redoImage),+W=c("",Z,!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",l,Editor.zoomFitImage);L.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;text-align:left;white-space:nowrap;";this.tabContainer.style.right="70px";var Y=O.addMenu("100%",la.funct);Y.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");Y.className="geTabItem";Y.style.height=C.tabContainerHeight+"px";Y.style.position="absolute";Y.style.display="0"!=urlParams.pages?"flex":"none";Y.style.alignItems="center";Y.style.justifyContent="center";Y.style.paddingRight="11px";Y.style.whiteSpace="nowrap";Y.style.overflow="hidden";Y.style.fontSize="11px";Y.style.width="51px";Y.style.right="0px";Y.style.bottom="0px";Y.style.boxSizing="content-box";Y.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";Y.style.backgroundPosition="right 6px top 15px";Y.style.backgroundRepeat="no-repeat";Y.style.backgroundSize="10px";Y.style.zIndex="1";z.appendChild(Y);(function(ja){mxEvent.addListener(ja,"click",-Z);var oa=mxUtils.bind(this,function(qa,ra,xa){ja.innerText="";mxUtils.write(ja,Math.round(100*C.editor.graph.view.scale*(null!=xa?xa:1))+"%")});C.editor.graph.view.addListener(mxEvent.EVENT_SCALE,oa);C.editor.addListener("resetGraphView",oa);C.editor.addListener("pageSelected",oa);C.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(qa,ra){oa(qa,ra,ra.getProperty("factor"))}))})(Y);var ba=C.setGraphEnabled;C.setGraphEnabled=function(){ba.apply(this,arguments);null!=this.tabContainer&&-(Y.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="0"!=urlParams.pages&&"hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}z.appendChild(K);z.appendChild(C.diagramContainer);B.appendChild(z);C.updateTabContainer();!EditorUi.windowed&&1E3<=m&&b(this,!0);z.appendChild(C.tabContainer);k();C.addListener("lockedChanged",k);mxEvent.addListener(window,"resize",function(){k();null!=C.sidebarWindow&&C.sidebarWindow.window.fit();null!=C.formatWindow&&+Z);var oa=mxUtils.bind(this,function(qa,ra,xa){ja.innerText="";mxUtils.write(ja,Math.round(100*C.editor.graph.view.scale*(null!=xa?xa:1))+"%")});C.editor.graph.view.addListener(mxEvent.EVENT_SCALE,oa);C.editor.addListener("resetGraphView",oa);C.editor.addListener("pageSelected",oa);C.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(qa,ra){oa(qa,ra,ra.getProperty("factor"))}))})(Y);var ca=C.setGraphEnabled;C.setGraphEnabled=function(){ca.apply(this,arguments);null!=this.tabContainer&&+(Y.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="0"!=urlParams.pages&&"hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}z.appendChild(L);z.appendChild(C.diagramContainer);B.appendChild(z);C.updateTabContainer();!EditorUi.windowed&&1E3<=m&&b(this,!0);z.appendChild(C.tabContainer);k();C.addListener("lockedChanged",k);mxEvent.addListener(window,"resize",function(){k();null!=C.sidebarWindow&&C.sidebarWindow.window.fit();null!=C.formatWindow&&C.formatWindow.window.fit();null!=C.actions.outlineWindow&&C.actions.outlineWindow.window.fit();null!=C.actions.layersWindow&&C.actions.layersWindow.window.fit();null!=C.menus.chatWindow&&C.menus.chatWindow.window.fit();null!=C.menus.tagsWindow&&C.menus.tagsWindow.window.fit();null!=C.menus.findWindow&&C.menus.findWindow.window.fit();null!=C.menus.findReplaceWindow&&C.menus.findReplaceWindow.window.fit()})}}};(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,e,g,m,v,p,A){this.file=b;this.id=e;this.content=g;this.modifiedDate=m;this.createdDate=v;this.isResolved=p;this.user=A;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,e,g,m,v){e()};DrawioComment.prototype.editComment=function(b,e,g){e()};DrawioComment.prototype.deleteComment=function(b,e){b()};DrawioUser=function(b,e,g,m,v){this.id=b;this.email=e;this.displayName=g;this.pictureUrl=m;this.locale=v};mxResources.parse('# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\nabout=About\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nanimations=Animations\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nclassDiagram=Class Diagram\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on connect\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete all\ndeleteColumn=Delete column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatWebp=WebP\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nimproveContrast=Improve Contrast\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save As\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate shape only by 90°\ntype=Type\ntwitter=Twitter\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use black and white\nuseCurrentSettings=Use current settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nworking=Working\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs Import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a file...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the viewer (px)\nheightOfViewer=Height of the viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit owning page\ndeepIndexing=Deep Indexing (Index diagrams that aren\'t used in any page also)\nconfADeepIndexStarted=Deep Indexing Started\nconfADeepIndexDone=Deep Indexing Done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last modified on\nsearchResults=Search Results\nshowAllTemps=Show all templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell checker\nnoChange=No Change\nlblToSvg=Convert labels to SVG\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft save interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow all\nnoTeams=No teams found\nerrorLoadingTeams=Error Loading Teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace Base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate Diagram Detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for production use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];Editor.currentTheme="";window.uiTheme="";GraphViewer=function(b,e,g){this.init(b,e,g)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="1"==urlParams.dev?"https://test.draw.io/":"https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl=window.DRAWIO_BASE_URL+"/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;@@ -4159,56 +4161,56 @@ this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.responsive=(null!=this.graphConfig.responsive?this.graphConfig.responsive:this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.editor=null;var m=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=e&&(this.xmlDocument=e.ownerDocument,this.xmlNode=e,this.xml=mxUtils.getXml(e),null!=b)){var v=mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var G=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?G.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(G.style.padding="8px");G.style.forcedColorAdjust="none";G.style.boxSizing="border-box";G.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var k=this.view.graphBounds,B=this.view.translate;G.setAttribute("viewBox",k.x+B.x-this.panDx+" "+(k.y+B.y-this.panDy)+" "+(k.width+1)+" "+(k.height+1));this.container.style.backgroundColor=G.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",k))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(k){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=-!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var T=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=T&&T!=e)try{this.xml=mxUtils.getXml(T),this.xmlNode=T,this.xmlDocument=T.ownerDocument}catch(k){}this.graph.getImageFromBundles=function(k){return m.getImageUrl(k)};mxClient.IS_SVG&&this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);-if("mxfile"==this.xmlNode.nodeName){var F=this.xmlNode.getElementsByTagName("diagram");if(0<F.length){if(null!=this.pageId)for(T=0;T<F.length;T++)if(this.pageId==F[T].getAttribute("id")){this.currentPage=T;break}var P=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(k){var B=F[m.currentPage];return"page"==k?B.getAttribute("name")||"Page-"+(m.currentPage+1):"pagenumber"==k?m.currentPage+1:"pagecount"==k?F.length:P.apply(this,arguments)}}}this.diagrams=[];var Q=null;this.selectPage=-function(k){this.handlingResize||(this.currentPage=mxUtils.mod(k,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(k){k=this.getIndexById(k);var B=0<=k;B&&this.selectPage(k);return B};T=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=Q&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),Q=this.xmlNode)});var U=this.graph.setBackgroundImage;this.graph.setBackgroundImage=-function(k){if(null!=k&&Graph.isPageLink(k.src)){var B=k.src,z=B.indexOf(",");0<z&&(z=m.getIndexById(B.substring(z+1)),0<=z&&(k=m.getImageForGraphModel(Editor.parseDiagramNode(m.diagrams[z])),k.originalSrc=B))}U.apply(this,arguments)};var c=this.graph.getGraphBounds;this.graph.getGraphBounds=function(k){var B=c.apply(this,arguments);k=this.backgroundImage;if(null!=k){var z=this.view.translate,C=this.view.scale;B=mxRectangle.fromRectangle(B);B.add(new mxRectangle((z.x+k.x)*C,(z.y+k.y)*C,k.width*C,-k.height*C))}return B};this.addListener("xmlNodeChanged",T);T();urlParams.page=m.currentPage;T=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.view.scale=this.graphConfig.zoom||1,T=this.setLayersVisible(),this.fireEvent(new mxEventObject("graphInitialized")),this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8),this.installBackgroundColorHandler(),GraphViewer.viewerInitialized(this)}finally{this.graph.getModel().endUpdate()}this.responsive||+!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var S=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=S&&S!=e)try{this.xml=mxUtils.getXml(S),this.xmlNode=S,this.xmlDocument=S.ownerDocument}catch(k){}this.graph.getImageFromBundles=function(k){return m.getImageUrl(k)};mxClient.IS_SVG&&this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);+if("mxfile"==this.xmlNode.nodeName){var F=this.xmlNode.getElementsByTagName("diagram");if(0<F.length){if(null!=this.pageId)for(S=0;S<F.length;S++)if(this.pageId==F[S].getAttribute("id")){this.currentPage=S;break}var P=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(k){var B=F[m.currentPage];return"page"==k?B.getAttribute("name")||"Page-"+(m.currentPage+1):"pagenumber"==k?m.currentPage+1:"pagecount"==k?F.length:P.apply(this,arguments)}}}this.diagrams=[];var Q=null;this.selectPage=+function(k){this.handlingResize||(this.currentPage=mxUtils.mod(k,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(k){k=this.getIndexById(k);var B=0<=k;B&&this.selectPage(k);return B};S=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=Q&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),Q=this.xmlNode)});var T=this.graph.setBackgroundImage;this.graph.setBackgroundImage=+function(k){if(null!=k&&Graph.isPageLink(k.src)){var B=k.src,z=B.indexOf(",");0<z&&(z=m.getIndexById(B.substring(z+1)),0<=z&&(k=m.getImageForGraphModel(Editor.parseDiagramNode(m.diagrams[z])),k.originalSrc=B))}T.apply(this,arguments)};var c=this.graph.getGraphBounds;this.graph.getGraphBounds=function(k){var B=c.apply(this,arguments);k=this.backgroundImage;if(null!=k){var z=this.view.translate,C=this.view.scale;B=mxRectangle.fromRectangle(B);B.add(new mxRectangle((z.x+k.x)*C,(z.y+k.y)*C,k.width*C,+k.height*C))}return B};this.addListener("xmlNodeChanged",S);S();urlParams.page=m.currentPage;S=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.view.scale=this.graphConfig.zoom||1,S=this.setLayersVisible(),this.fireEvent(new mxEventObject("graphInitialized")),this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8),this.installBackgroundColorHandler(),GraphViewer.viewerInitialized(this)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.graph.panningHandler.isForcePanningEvent=function(k){return!mxEvent.isPopupTrigger(k.getEvent())&&"auto"==this.graph.container.style.overflow},this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.panningHandler.ignoreCell=!0,this.graph.panningHandler.usePopupTrigger=!1,this.graph.panningHandler.pinchEnabled=!1);this.graph.setPanning(!1);null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&b.setAttribute("title",this.graphConfig.titleTooltip||-this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=T&&this.setLayersVisible(T);this.graph.customLinkClicked=function(k,B){try{if(Graph.isPageLink(k)){var z=k.indexOf(",");m.selectPageById(k.substring(z+-1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var C=this.getGraphBounds();this.handleCustomLink(k,B);C.equals(this.getGraphBounds())||m.crop()}}catch(H){alert(H.message)}return!0};var f=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return f.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&+this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=S&&this.setLayersVisible(S);this.graph.customLinkClicked=function(k,B){try{if(Graph.isPageLink(k)){var z=k.indexOf(",");m.selectPageById(k.substring(z++1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var C=this.getGraphBounds();this.handleCustomLink(k,B);C.equals(this.getGraphBounds())||m.crop()}}catch(I){alert(I.message)}return!0};var f=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return f.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof g){var p=this.getObservableParent(b),A=new g(mxUtils.bind(this,function(G){0<b.offsetWidth&&(A.disconnect(),v())}));A.observe(p,{attributes:!0})}else v()}};GraphViewer.prototype.installBackgroundColorHandler=function(){var b=this.graph;if(null!=b){null!=GraphViewer.shapeBackgroundColor&&(b.shapeBackgroundColor=GraphViewer.shapeBackgroundColor);b.defaultPageBackgroundColor="transparent";b.diagramBackgroundColor="transparent";b.transparentBackground=!1;var e=b.background,g=mxUtils.bind(this,function(m){"none"==b.getAdaptiveColors()&&null==e&&(this.isDarkMode()?b.background="#ffffff":b.background=null,m&&b.view.validateBackground())});this.addListener("graphChanged",function(){e=b.background;g(!0)});this.addListener("darkModeChanged",function(){g(!0)});g(!1)}};GraphViewer.prototype.installDarkModeListener=function(){null!=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(){this.darkModeChanged();this.fireEvent(new mxEventObject("darkModeChanged"))}));this.darkModeChanged()};-GraphViewer.prototype.darkModeChanged=function(){if(null!=this.graph){var b=this.graph.container,e=this.isDarkMode();e?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");null!=this.darkMode&&(b.style.colorScheme=e?"dark":"light")}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};+GraphViewer.prototype.darkModeChanged=function(){if(null!=this.graph){var b=this.graph.container,e=this.isDarkMode();e?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");b.style.colorScheme=e?"dark":"light"}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};GraphViewer.prototype.getObservableParent=function(b){for(b=b.parentNode;b!=document.body&&null!=b.parentNode&&"none"!==mxUtils.getCurrentStyle(b).display;)b=b.parentNode;return b};GraphViewer.prototype.getImageUrl=function(b){null!=b&&"http://"!=b.substring(0,7)&&"https://"!=b.substring(0,8)&&"data:image"!=b.substring(0,10)&&("/"==b.charAt(0)&&(b=b.substring(1,b.length)),b=this.imageBaseUrl+b);return b};GraphViewer.prototype.getImageForGraphModel=function(b){var e=Graph.createOffscreenGraph(this.graph.getStylesheet());e.getGlobalVariable=this.graph.getGlobalVariable;document.body.appendChild(e.container);b=(new mxCodec(b.ownerDocument)).decode(b).root;e.model.setRoot(b);b=e.getSvg();var g=e.getGraphBounds();document.body.removeChild(e.container);return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(b)),g.width,g.height,g.x,g.y)};GraphViewer.prototype.getIndexById=function(b){if(null!=this.diagrams)for(var e=0;e<this.diagrams.length;e++)if(this.diagrams[e].getAttribute("id")==b)return e;return-1};GraphViewer.prototype.setXmlNode=function(b){b=this.editor.extractGraphModel(b,!0);this.xmlDocument=b.ownerDocument;this.xml=mxUtils.getXml(b);this.xmlNode=b;this.updateGraphXml(b);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(b){null==this.xmlNode&&(this.xmlDocument=b.ownerDocument,this.xml=mxUtils.getXml(b),this.xmlNode=b);this.setGraphXml(b)};GraphViewer.prototype.updateGraphXml=function(b){this.setGraphXml(b);this.fireEvent(new mxEventObject("graphChanged"))};GraphViewer.prototype.setLayersVisible=function(b){var e=!0;if(!this.autoOrigin){var g=[],m=this.graph.getModel();m.beginUpdate();try{for(var v=0;v<m.getChildCount(m.root);v++){var p=m.getChildAt(m.root,v);e=e&&m.isVisible(p);g.push(m.isVisible(p));m.setVisible(p,null!=b?b[v]:!0)}}finally{m.endUpdate()}}return e?null:g};GraphViewer.prototype.setGraphXml=function(b){if(null!=this.graph){this.graph.view.translate=new mxPoint;this.graph.view.scale=1;var e=null;this.graph.getModel().beginUpdate();try{this.graph.getModel().clear(),this.editor.setGraphXml(b),e=this.setLayersVisible(!0)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph());this.graph.initialViewState=-{translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};e&&this.setLayersVisible(e)}};GraphViewer.prototype.isDarkMode=function(){var b=mxUtils.getCurrentStyle(null!=this.graph?this.graph.container:document.body);return null!=this.darkMode&&"auto"!=this.darkMode?this.darkMode:("light dark"==b.colorScheme||"auto"==this.darkMode)&&null!=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches||null==this.darkMode&&"dark"==b.colorScheme};-GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,e=this.graph.getGraphBounds(),g=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var m=mxUtils.bind(this,function(){if(!g){g=!0;var G=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?G.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){G=b.getBoundingClientRect();var T=mxUtils.getScrollOrigin(document.body);-T="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-T.x,top:-T.y};G={left:G.left-T.left,top:G.top-T.top,bottom:G.bottom-T.top,right:G.right-T.left};this.toolbar.style.left=G.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=G.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=G.top+1+"px"):this.toolbar.style.top=G.top+"px"}else null!=-this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());g=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(G){var T=b.offsetWidth;T==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=G?G:this.graphConfig.zoom||-(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},v=T,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=+{translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};e&&this.setLayersVisible(e)}};GraphViewer.prototype.isDarkMode=function(){return"dark"==this.darkMode||"auto"==this.darkMode&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches};+GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,e=this.graph.getGraphBounds(),g=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var m=mxUtils.bind(this,function(){if(!g){g=!0;var G=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?G.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){G=b.getBoundingClientRect();var S=mxUtils.getScrollOrigin(document.body);+S="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-S.x,top:-S.y};G={left:G.left-S.left,top:G.top-S.top,bottom:G.bottom-S.top,right:G.right-S.left};this.toolbar.style.left=G.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=G.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=G.top+1+"px"):this.toolbar.style.top=G.top+"px"}else null!=+this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());g=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(G){var S=b.offsetWidth;S==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=G?G:this.graphConfig.zoom||+(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},v=S,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=!1}),0))});GraphViewer.useResizeSensor&&(9>=document.documentMode?(mxEvent.addListener(window,"resize",m),this.graph.addListener("size",m)):new ResizeSensor(this.graph.container,m));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=b.style.height&&this.autoFit||this.updateContainerWidth(b,e.width+2*this.graph.border),0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,e.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var p=v=null;m=mxUtils.bind(this,function(){window.clearTimeout(p);this.handlingResize||(p=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",m):new ResizeSensor(this.graph.container,m))}else 9>=document.documentMode||this.graph.addListener("size",-m);var A=mxUtils.bind(this,function(G){var T=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var F=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==G&&this.allowZoomOut&&(this.allowZoomIn||e.width+2*this.graph.border>b.offsetWidth||e.height+2*this.graph.border>F)?(G=null,null!=F&&e.height+2*this.graph.border>F-2&&(G=(F-2*this.graph.border-2)/e.height),this.fitGraph(G)):this.widthIsEmpty||-null!=G||0!=this.graphConfig.resize||""==b.style.height?(G=null!=G?G:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-e.x/this.graph.view.scale)+G.x,Math.floor(this.graph.border-e.y/this.graph.view.scale)+G.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||e.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=T});8==document.documentMode?window.setTimeout(A,0):A();this.positionGraph=function(G){e=this.graph.getGraphBounds();v=null;A(G)}};+m);var A=mxUtils.bind(this,function(G){var S=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var F=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==G&&this.allowZoomOut&&(this.allowZoomIn||e.width+2*this.graph.border>b.offsetWidth||e.height+2*this.graph.border>F)?(G=null,null!=F&&e.height+2*this.graph.border>F-2&&(G=(F-2*this.graph.border-2)/e.height),this.fitGraph(G)):this.widthIsEmpty||+null!=G||0!=this.graphConfig.resize||""==b.style.height?(G=null!=G?G:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-e.x/this.graph.view.scale)+G.x,Math.floor(this.graph.border-e.y/this.graph.view.scale)+G.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||e.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=S});8==document.documentMode?window.setTimeout(A,0):A();this.positionGraph=function(G){e=this.graph.getGraphBounds();v=null;A(G)}};GraphViewer.prototype.crop=function(){var b=this.graph,e=b.getGraphBounds(),g=b.border,m=b.view.scale;b.view.setTranslate(null!=e.x?Math.floor(b.view.translate.x-e.x/m+g):g,null!=e.y?Math.floor(b.view.translate.y-e.y/m+g):g)};GraphViewer.prototype.updateContainerWidth=function(b,e){b.style.width=e+"px"};GraphViewer.prototype.updateContainerHeight=function(b,e){if(this.forceCenter||this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||8==document.documentMode)b.style.height=e+"px"};-GraphViewer.prototype.showLayers=function(b,e){var g=this.graphConfig.layers;g=null!=g&&0<g.length?g.split(" "):[];var m=this.graphConfig.layerIds,v=null!=m&&0<m.length,p=!1;if(0<g.length||v||null!=e){e=null!=e?e.getModel():null;b=b.getModel();b.beginUpdate();try{var A=b.getChildCount(b.root);if(null==e){e=!1;p={};if(v)for(var G=0;G<m.length;G++){var T=b.getCell(m[G]);null!=T&&(e=!0,p[T.id]=!0)}else for(G=0;G<g.length;G++)T=b.getChildAt(b.root,parseInt(g[G])),null!=T&&(e=!0,p[T.id]=!0);for(G=0;e&&-G<A;G++)T=b.getChildAt(b.root,G),b.setVisible(T,p[T.id]||!1)}else for(G=0;G<A;G++)b.setVisible(b.getChildAt(b.root,G),e.isVisible(e.getChildAt(e.root,G)))}finally{b.endUpdate()}p=!0}return p};+GraphViewer.prototype.showLayers=function(b,e){var g=this.graphConfig.layers;g=null!=g&&0<g.length?g.split(" "):[];var m=this.graphConfig.layerIds,v=null!=m&&0<m.length,p=!1;if(0<g.length||v||null!=e){e=null!=e?e.getModel():null;b=b.getModel();b.beginUpdate();try{var A=b.getChildCount(b.root);if(null==e){e=!1;p={};if(v)for(var G=0;G<m.length;G++){var S=b.getCell(m[G]);null!=S&&(e=!0,p[S.id]=!0)}else for(G=0;G<g.length;G++)S=b.getChildAt(b.root,parseInt(g[G])),null!=S&&(e=!0,p[S.id]=!0);for(G=0;e&&+G<A;G++)S=b.getChildAt(b.root,G),b.setVisible(S,p[S.id]||!1)}else for(G=0;G<A;G++)b.setVisible(b.getChildAt(b.root,G),e.isVisible(e.getChildAt(e.root,G)))}finally{b.endUpdate()}p=!0}return p};GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.display="flex";e.style.alignItems="center";e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";e.style.whiteSpace="nowrap";e.style.textAlign="left";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.darkBackgroundColor+")";e.style.height=this.toolbarHeight+"px";var g=mxUtils.bind(this,function(){this.isDarkMode()?(e.classList.add("geDarkMode"),e.style.colorScheme="dark"):(e.classList.remove("geDarkMode"),e.style.colorScheme="light")});this.addListener("darkModeChanged",g);this.toolbar=e;g();if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var m=null,v=null,p=mxUtils.bind(this,function(fa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);m=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,0);m=null;v=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";v=null}),100)}),fa||200)}),A=mxUtils.bind(this,function(fa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,fa||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(fa){mxEvent.isTouchEvent(fa)||(A(30),p())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":"mousemove",function(fa){mxEvent.consume(fa)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(fa){A(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(fa){A(100);mxEvent.consume(fa)}));mxEvent.addListener(e,"mouseleave",-mxUtils.bind(this,function(fa){mxEvent.isTouchEvent(fa)||A(30)}));var G=this.graph,T=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(fa,S){this.startX=S.getGraphX();this.startY=S.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(fa,S){},mouseUp:function(fa,S){mxEvent.isTouchEvent(S.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<T&&Math.abs(this.scrollTop-G.container.scrollTop)<-T&&Math.abs(this.startX-S.getGraphX())<T&&Math.abs(this.startY-S.getGraphY())<T&&(0<parseFloat(e.style.opacity||0)?p():A(30))}})}g=this.toolbarItems;for(var F=0,P=mxUtils.bind(this,function(fa,S,ca,ma){fa=this.createToolbarButton(fa,S,ca,ma);e.appendChild(fa);F++;return fa}),Q=this.graph.getModel(),U=null,c=null,f=null,k=null,B=0;B<g.length;B++){var z=g[B];if("pages"==z){k=b.ownerDocument.createElement("div");k.style.display="inline-flex";k.style.position="relative";k.style.alignItems="center";k.style.padding=-"4px";k.style.fontFamily=GraphViewer.cssFontFamily;k.style.fontSize="12px";k.style.cursor="default";k.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(k,70);var C=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");C.style.borderRightStyle="none";C.style.paddingLeft="0px";C.style.paddingRight="0px";e.appendChild(k);var H=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage+1)}),Editor.nextImage,-mxResources.get("nextPage")||"Next Page");H.style.paddingLeft="0px";H.style.paddingRight="0px";z=mxUtils.bind(this,function(){k.innerText="";mxUtils.write(k,this.currentPage+1+" / "+this.diagrams.length);k.style.display=1<this.diagrams.length?"inline-flex":"none";C.style.display=k.style.display;H.style.display=k.style.display});this.addListener("graphChanged",z);z()}else if("zoom"==z)this.zoomEnabled&&(P(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,mxResources.get("zoomOut")||-"Zoom Out"),P(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),P(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==z){if(this.layersEnabled){var K=P(mxUtils.bind(this,function(fa){if(null!=U)U.parentNode.removeChild(U),U=null;else{U=this.graph.createLayersDialog(mxUtils.bind(this,-function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ca=this.graph.getGraphBounds(),ma=this.graph.view;0>ca.x||0>ca.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ma.translate.clone(),scale:ma.scale}):null!=this.graph.originalViewState&&0<ca.x/ma.scale+this.graph.originalViewState.translate.x-ma.translate.x&&0<ca.y/ma.scale+this.graph.originalViewState.translate.y-ma.translate.y&&(ma.setTranslate(this.graph.originalViewState.translate.x,-this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ma.translate.clone(),scale:ma.scale})}}));mxEvent.addListener(U,"mouseleave",function(){U.parentNode.removeChild(U);U=null});fa=K.getBoundingClientRect();U.style.width="140px";U.style.padding="2px 0px 2px 0px";U.style.border="1px solid #d0d0d0";U.style.backgroundColor="#eee";U.style.fontFamily=GraphViewer.cssFontFamily;U.style.fontSize="11px";U.style.overflowY="auto";U.style.maxHeight=-this.graph.container.clientHeight-this.toolbarHeight-10+"px";U.style.zIndex=this.toolbarZIndex+1;U.style.color="#000";mxUtils.setOpacity(U,85);var S=mxUtils.getDocumentScrollOrigin(document);U.style.left=S.x+fa.left-1+"px";U.style.top=S.y+fa.bottom-2+"px";this.darkMode&&(U.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(U)}}),Editor.layersImage,mxResources.get("layers")||"Layers");Q.addListener(mxEvent.CHANGE,function(){K.style.display=1<Q.getChildCount(Q.root)?"inline-flex":-"none"});K.style.display=1<Q.getChildCount(Q.root)?"inline-flex":"none"}}else if("tags"==z){if(this.tagsEnabled){var M=P(mxUtils.bind(this,function(fa){null==c&&(c=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),c.div.getElementsByTagName("div")[0].style.position="",c.div.style.maxHeight="160px",c.div.style.maxWidth="120px",c.div.style.padding="2px",c.div.style.overflow="auto",c.div.style.height="auto",c.div.style.position="fixed",c.div.style.fontFamily=GraphViewer.cssFontFamily,-c.div.style.fontSize="11px",c.div.style.backgroundColor="#eee",c.div.style.color="#000",c.div.style.border="1px solid #d0d0d0",c.div.style.zIndex=this.toolbarZIndex+1,this.darkMode&&(c.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(c.div,85));if(null!=f)f.parentNode.removeChild(f),f=null;else{f=c.div;f.style.position="absolute";mxEvent.addListener(f,"mouseleave",function(){null!=f&&(f.parentNode.removeChild(f),f=null)});fa=M.getBoundingClientRect();var S=mxUtils.getDocumentScrollOrigin(document);-f.style.left=S.x+fa.left-1+"px";f.style.top=S.y+fa.bottom-2+"px";document.body.appendChild(f);c.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");Q.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){M.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=f&&0==this.graph.getAllTags().length&&(f.parentNode.removeChild(f),f=null)}));M.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==z?this.lightboxEnabled&&P(mxUtils.bind(this,+mxUtils.bind(this,function(fa){mxEvent.isTouchEvent(fa)||A(30)}));var G=this.graph,S=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(fa,V){this.startX=V.getGraphX();this.startY=V.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(fa,V){},mouseUp:function(fa,V){mxEvent.isTouchEvent(V.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<S&&Math.abs(this.scrollTop-G.container.scrollTop)<+S&&Math.abs(this.startX-V.getGraphX())<S&&Math.abs(this.startY-V.getGraphY())<S&&(0<parseFloat(e.style.opacity||0)?p():A(30))}})}g=this.toolbarItems;for(var F=0,P=mxUtils.bind(this,function(fa,V,ba,ma){fa=this.createToolbarButton(fa,V,ba,ma);e.appendChild(fa);F++;return fa}),Q=this.graph.getModel(),T=null,c=null,f=null,k=null,B=0;B<g.length;B++){var z=g[B];if("pages"==z){k=b.ownerDocument.createElement("div");k.style.display="inline-flex";k.style.position="relative";k.style.alignItems="center";k.style.padding=+"4px";k.style.fontFamily=GraphViewer.cssFontFamily;k.style.fontSize="12px";k.style.cursor="default";k.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(k,70);var C=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");C.style.borderRightStyle="none";C.style.paddingLeft="0px";C.style.paddingRight="0px";e.appendChild(k);var I=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage+1)}),Editor.nextImage,+mxResources.get("nextPage")||"Next Page");I.style.paddingLeft="0px";I.style.paddingRight="0px";z=mxUtils.bind(this,function(){k.innerText="";mxUtils.write(k,this.currentPage+1+" / "+this.diagrams.length);k.style.display=1<this.diagrams.length?"inline-flex":"none";C.style.display=k.style.display;I.style.display=k.style.display});this.addListener("graphChanged",z);z()}else if("zoom"==z)this.zoomEnabled&&(P(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,mxResources.get("zoomOut")||+"Zoom Out"),P(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),P(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==z){if(this.layersEnabled){var L=P(mxUtils.bind(this,function(fa){if(null!=T)T.parentNode.removeChild(T),T=null;else{T=this.graph.createLayersDialog(mxUtils.bind(this,+function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ba=this.graph.getGraphBounds(),ma=this.graph.view;0>ba.x||0>ba.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ma.translate.clone(),scale:ma.scale}):null!=this.graph.originalViewState&&0<ba.x/ma.scale+this.graph.originalViewState.translate.x-ma.translate.x&&0<ba.y/ma.scale+this.graph.originalViewState.translate.y-ma.translate.y&&(ma.setTranslate(this.graph.originalViewState.translate.x,+this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ma.translate.clone(),scale:ma.scale})}}));mxEvent.addListener(T,"mouseleave",function(){T.parentNode.removeChild(T);T=null});fa=L.getBoundingClientRect();T.style.width="140px";T.style.padding="2px 0px 2px 0px";T.style.border="1px solid #d0d0d0";T.style.backgroundColor="#eee";T.style.fontFamily=GraphViewer.cssFontFamily;T.style.fontSize="11px";T.style.overflowY="auto";T.style.maxHeight=+this.graph.container.clientHeight-this.toolbarHeight-10+"px";T.style.zIndex=this.toolbarZIndex+1;T.style.color="#000";mxUtils.setOpacity(T,85);var V=mxUtils.getDocumentScrollOrigin(document);T.style.left=V.x+fa.left-1+"px";T.style.top=V.y+fa.bottom-2+"px";this.isDarkMode()&&(T.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(T)}}),Editor.layersImage,mxResources.get("layers")||"Layers");Q.addListener(mxEvent.CHANGE,function(){L.style.display=1<Q.getChildCount(Q.root)?"inline-flex":+"none"});L.style.display=1<Q.getChildCount(Q.root)?"inline-flex":"none"}}else if("tags"==z){if(this.tagsEnabled){var J=P(mxUtils.bind(this,function(fa){null==c&&(c=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),c.div.getElementsByTagName("div")[0].style.position="",c.div.style.maxHeight="160px",c.div.style.maxWidth="120px",c.div.style.padding="2px",c.div.style.overflow="auto",c.div.style.height="auto",c.div.style.position="fixed",c.div.style.fontFamily=GraphViewer.cssFontFamily,+c.div.style.fontSize="11px",c.div.style.backgroundColor="#eee",c.div.style.color="#000",c.div.style.border="1px solid #d0d0d0",c.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(c.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(c.div,85));if(null!=f)f.parentNode.removeChild(f),f=null;else{f=c.div;f.style.position="absolute";mxEvent.addListener(f,"mouseleave",function(){null!=f&&(f.parentNode.removeChild(f),f=null)});fa=J.getBoundingClientRect();var V=mxUtils.getDocumentScrollOrigin(document);+f.style.left=V.x+fa.left-1+"px";f.style.top=V.y+fa.bottom-2+"px";document.body.appendChild(f);c.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");Q.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){J.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=f&&0==this.graph.getAllTags().length&&(f.parentNode.removeChild(f),f=null)}));J.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==z?this.lightboxEnabled&&P(mxUtils.bind(this,function(){try{this.showLightbox()}catch(fa){alert(fa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(z=this.graphConfig["toolbar-buttons"][z],null!=z&&(z.elem=P(null==z.enabled||z.enabled?z.handler:function(){},z.image,z.title,z.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*F);null!=this.graphConfig.title&&(g=b.ownerDocument.createElement("div"),g.style.display="inline-flex",-g.style.position="relative",g.style.alignItems="center",g.style.padding="6px",g.style.fontFamily=GraphViewer.cssFontFamily,g.style.fontSize="12px",g.style.cursor="default",g.style.color="light-dark(#000000, #ffffff)",g.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(g,this.graphConfig.title),mxUtils.setOpacity(g,70),e.appendChild(g),this.filename=g);this.minToolbarWidth=34*F;var O=b.style.border,ea=mxUtils.bind(this,function(){e.style.width="inline"==this.graphConfig["toolbar-position"]?-"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";e.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var fa=b.getBoundingClientRect(),S=mxUtils.getScrollOrigin(document.body);S="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-S.x,top:-S.y};fa={left:fa.left-S.left,top:fa.top-S.top,bottom:fa.bottom-S.top,right:fa.right-S.left};e.style.left=fa.left+"px";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=fa.bottom-1+"px":"inline"!=-this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=fa.top+1+"px"):e.style.top=fa.top+"px";"1px solid transparent"==O&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var ca=mxUtils.bind(this,function(){null!=e.parentNode&&e.parentNode.removeChild(e);null!=f&&(f.parentNode.removeChild(f),f=null);null!=U&&(U.parentNode.removeChild(U),U=null);b.style.border=O});mxEvent.addListener(document,"mousemove",function(ma){for(ma=mxEvent.getSource(ma);null!=-ma;){if(ma==b||ma==e||ma==U||ma==f)return;ma=ma.parentNode}ca()});mxEvent.addListener(document.body,"mouseleave",function(ma){ca()})}else e.style.top=-this.toolbarHeight+"px",b.appendChild(e)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ea):ea();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=e.parentNode&&ea()})).observe(b)};+g.style.position="relative",g.style.alignItems="center",g.style.padding="6px",g.style.fontFamily=GraphViewer.cssFontFamily,g.style.fontSize="12px",g.style.cursor="default",g.style.color="light-dark(#000000, #ffffff)",g.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(g,this.graphConfig.title),mxUtils.setOpacity(g,70),e.appendChild(g),this.filename=g);this.minToolbarWidth=34*F;var O=b.style.border,da=mxUtils.bind(this,function(){e.style.width="inline"==this.graphConfig["toolbar-position"]?+"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";e.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var fa=b.getBoundingClientRect(),V=mxUtils.getScrollOrigin(document.body);V="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-V.x,top:-V.y};fa={left:fa.left-V.left,top:fa.top-V.top,bottom:fa.bottom-V.top,right:fa.right-V.left};e.style.left=fa.left+"px";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=fa.bottom-1+"px":"inline"!=+this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=fa.top+1+"px"):e.style.top=fa.top+"px";"1px solid transparent"==O&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var ba=mxUtils.bind(this,function(){null!=e.parentNode&&e.parentNode.removeChild(e);null!=f&&(f.parentNode.removeChild(f),f=null);null!=T&&(T.parentNode.removeChild(T),T=null);b.style.border=O});mxEvent.addListener(document,"mousemove",function(ma){for(ma=mxEvent.getSource(ma);null!=+ma;){if(ma==b||ma==e||ma==T||ma==f)return;ma=ma.parentNode}ba()});mxEvent.addListener(document.body,"mouseleave",function(ma){ba()})}else e.style.top=-this.toolbarHeight+"px",b.appendChild(e)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",da):da();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=e.parentNode&&da()})).observe(b)};GraphViewer.prototype.createToolbarButton=function(b,e,g,m){var v=document.createElement("div");v.style.borderRight="1px solid #d0d0d0";v.style.display="inline-flex";v.style.alignItems="center";v.style.padding="6px";mxEvent.addListener(v,"click",b);null!=g&&v.setAttribute("title",g);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",e);b.style.width="18px";b.className="geAdaptiveAsset";null==m||m?(mxEvent.addListener(v,"mouseenter",function(){v.style.backgroundColor="light-dark(#dddddd,#333333)"}),mxEvent.addListener(v,"mouseleave",function(){v.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),v.style.cursor="pointer"):mxUtils.setOpacity(v,30);v.appendChild(b);return v};GraphViewer.prototype.disableButton=function(b,e){var g=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=g&&(mxUtils.setOpacity(g.elem,30),mxEvent.removeListener(g.elem,"click",g.handler),mxEvent.addListener(g.elem,"mouseenter",function(){g.elem.style.backgroundColor="#eee"}),e&&g.elem.setAttribute("title",e))};@@ -4221,8 +4223,8 @@ GraphViewer.prototype.showLocalLightbox=function(b){var e=document.createElementg.className="geAdaptiveAsset";var m=mxUtils.bind(this,function(){p.setDarkMode(this.isDarkMode())});mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",m);p.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";urlParams.dark=this.isDarkMode()?"1":"0";this.tagsEnabled&&(urlParams.tags="{}");if(null!=b)try{var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));v.noCloseBtn=!0;urlParams["toolbar-config"]=encodeURIComponent(JSON.stringify(v))}catch(c){}if(null==document.documentMode||10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};v=Graph.prototype.shadowId;Graph.prototype.shadowId="lightboxDropShadow";var p=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",m);p.editor.editBlankUrl=this.editBlankUrl;p.editor.graph.shadowId="lightboxDropShadow";Graph.prototype.shadowId=v;p.refresh=function(){};var A=mxUtils.bind(this,function(c){27==c.keyCode&&p.destroy()}),G=this.initialOverflow,-T=p.destroy;p.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",A),document.body.removeChild(e),document.body.removeChild(g),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,T.apply(this,arguments))};var F=p.editor.graph,P=F.container;P.style.overflow="hidden";this.lightboxChrome&&null==b?(P.style.border="1px solid #c0c0c0",P.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",A)):(e.style.display="none",g.style.display=-"none");var Q=this;F.getImageFromBundles=function(c){return Q.getImageUrl(c)};var U=p.createTemporaryGraph;p.createTemporaryGraph=function(){var c=U.apply(this,arguments);c.getImageFromBundles=function(f){return Q.getImageUrl(f)};return c};this.graphConfig.move&&(F.isMoveCellsEvent=function(c){return!0});mxUtils.setPrefixedStyle(P.style,"border-radius","4px");P.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(F,p);window.setTimeout(mxUtils.bind(this,+S=p.destroy;p.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",A),document.body.removeChild(e),document.body.removeChild(g),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,S.apply(this,arguments))};var F=p.editor.graph,P=F.container;P.style.overflow="hidden";this.lightboxChrome&&null==b?(P.style.border="1px solid #c0c0c0",P.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",A)):(e.style.display="none",g.style.display=+"none");var Q=this;F.getImageFromBundles=function(c){return Q.getImageUrl(c)};var T=p.createTemporaryGraph;p.createTemporaryGraph=function(){var c=T.apply(this,arguments);c.getImageFromBundles=function(f){return Q.getImageUrl(f)};return c};this.graphConfig.move&&(F.isMoveCellsEvent=function(c){return!0});mxUtils.setPrefixedStyle(P.style,"border-radius","4px");P.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(F,p);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(e,"click",function(){p.destroy()}),P.style.outline="none",P.style.zIndex=this.lightboxZIndex,g.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(P)):(document.body.appendChild(P),document.body.appendChild(g)),p.setFileData(this.xml),mxUtils.setPrefixedStyle(P.style,"transform","rotateY(0deg)"),p.chromelessToolbar.style.bottom="60px",p.chromelessToolbar.style.zIndex=this.lightboxZIndex,(b||document.body).appendChild(p.chromelessToolbar),p.getEditBlankXml=mxUtils.bind(this,function(){return this.xml}),this.showLayers(F,this.graph),p.lightboxFit(),p.chromelessResize()}catch(c){p.handleError(c,null,function(){p.destroy()})}}),0);return p};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};GraphViewer.prototype.updateTitle=function(b,e){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",e||b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",e||b))};@@ -4239,9 +4241,9 @@ GraphViewer.getCss=function(){return[".geDarkMode img, .geDarkMode .geSprite {\nGraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,e,g){if(null!=GraphViewer.cachedUrls[b])e(GraphViewer.cachedUrls[b]);else{var m=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;m.open("GET",b);m.onload=function(){e(null!=m.getText?m.getText():m.responseText)};m.onerror=g;m.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeObserver=!0;GraphViewer.useResizeSensor=!0;(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(g){return window.setTimeout(g,20)},e=function(g,m){function v(){this.q=[];this.add=function(k){this.q.push(k)};var c,f;this.call=function(){c=0;for(f=this.q.length;c<f;c++)this.q[c].call()}}function p(c,f){return c.currentStyle?c.currentStyle[f]:window.getComputedStyle?window.getComputedStyle(c,null).getPropertyValue(f):c.style[f]}function A(c,f){if(!c.resizedAttached)c.resizedAttached=new v,c.resizedAttached.add(f);else if(c.resizedAttached){c.resizedAttached.add(f);return}c.resizeSensor=document.createElement("div");c.resizeSensor.className="resize-sensor";c.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";c.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';-c.appendChild(c.resizeSensor);"static"==p(c,"position")&&(c.style.position="relative");var k=c.resizeSensor.childNodes[0],B=k.childNodes[0],z=c.resizeSensor.childNodes[1],C=function(){B.style.width="100000px";B.style.height="100000px";k.scrollLeft=1E5;k.scrollTop=1E5;z.scrollLeft=1E5;z.scrollTop=1E5};C();var H=!1,K=function(){c.resizedAttached&&(H&&(c.resizedAttached.call(),H=!1),b(K))};b(K);var M,O,ea,fa;f=function(){if((ea=c.offsetWidth)!=M||(fa=c.offsetHeight)!=O)H=!0,M=ea,O=fa;C()};var S=function(ca,-ma,la){ca.attachEvent?ca.attachEvent("on"+ma,la):ca.addEventListener(ma,la)};S(k,"scroll",f);S(z,"scroll",f)}var G=function(){GraphViewer.resizeSensorEnabled&&m()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var T=null,F=!1;(new ResizeObserver(function(){F||(null!=T&&window.clearTimeout(T),T=window.setTimeout(function(){F=!0;G();T=null;F=!1},200))})).observe(g)}else{var P=Object.prototype.toString.call(g),Q="[object Array]"===P||"[object NodeList]"===P||"[object HTMLCollection]"===-P||"undefined"!==typeof jQuery&&g instanceof jQuery||"undefined"!==typeof Elements&&g instanceof Elements;if(Q){P=0;for(var U=g.length;P<U;P++)A(g[P],G)}else A(g,G);this.detach=function(){if(Q)for(var c=0,f=g.length;c<f;c++)e.detach(g[c]);else e.detach(g)}}};e.detach=function(g){g.resizeSensor&&(g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached)};window.ResizeSensor=e})();+c.appendChild(c.resizeSensor);"static"==p(c,"position")&&(c.style.position="relative");var k=c.resizeSensor.childNodes[0],B=k.childNodes[0],z=c.resizeSensor.childNodes[1],C=function(){B.style.width="100000px";B.style.height="100000px";k.scrollLeft=1E5;k.scrollTop=1E5;z.scrollLeft=1E5;z.scrollTop=1E5};C();var I=!1,L=function(){c.resizedAttached&&(I&&(c.resizedAttached.call(),I=!1),b(L))};b(L);var J,O,da,fa;f=function(){if((da=c.offsetWidth)!=J||(fa=c.offsetHeight)!=O)I=!0,J=da,O=fa;C()};var V=function(ba,+ma,la){ba.attachEvent?ba.attachEvent("on"+ma,la):ba.addEventListener(ma,la)};V(k,"scroll",f);V(z,"scroll",f)}var G=function(){GraphViewer.resizeSensorEnabled&&m()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var S=null,F=!1;(new ResizeObserver(function(){F||(null!=S&&window.clearTimeout(S),S=window.setTimeout(function(){F=!0;G();S=null;F=!1},200))})).observe(g)}else{var P=Object.prototype.toString.call(g),Q="[object Array]"===P||"[object NodeList]"===P||"[object HTMLCollection]"===+P||"undefined"!==typeof jQuery&&g instanceof jQuery||"undefined"!==typeof Elements&&g instanceof Elements;if(Q){P=0;for(var T=g.length;P<T;P++)A(g[P],G)}else A(g,G);this.detach=function(){if(Q)for(var c=0,f=g.length;c<f;c++)e.detach(g[c]);else e.detach(g)}}};e.detach=function(g){g.resizeSensor&&(g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached)};window.ResizeSensor=e})();function mxBpmnShape(a,d,e,b){mxShape.call(this);this.bounds=a;this.fill=d;this.stroke=e;this.strokewidth=null!=b?b:1}mxUtils.extend(mxBpmnShape,mxShape);mxBpmnShape.prototype.customProperties=[{name:"symbol",dispName:"Event",type:"enum",defVal:"general",enumList:[{val:"general",dispName:"General"},{val:"message",dispName:"Message"},{val:"timer",dispName:"Timer"},{val:"escalation",dispName:"Escalation"},{val:"conditional",dispName:"Conditional"},{val:"link",dispName:"Link"},{val:"error",dispName:"Error"},{val:"cancel",dispName:"Cancel"},{val:"compensation",dispName:"Compensation"},{val:"signal",dispName:"Signal"},{val:"multiple",dispName:"Multiple"},{val:"parallelMultiple",dispName:"Parallel Multiple"},{val:"terminate",dispName:"Terminate"},{val:"exclusiveGw",dispName:"Exclusive Gw"},{val:"parallelGw",dispName:"Parallel Gw"},{val:"complexGw",dispName:"Complex Gw"}]},{name:"outline",dispName:"Event Type",type:"enum",defVal:"standard",enumList:[{val:"standard",dispName:"Standard"},{val:"eventInt",dispName:"Interrupting"},{val:"eventNonint",dispName:"Non-Interrupting"},{val:"catching",dispName:"Catching"},{val:"boundInt",dispName:"Bound Interrupting"},diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.jsindex b75d27427..d771ce1b7 100644--- a/src/main/webapp/js/viewer.min.js+++ b/src/main/webapp/js/viewer.min.js@@ -30,7 +30,7 @@ if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==url"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};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||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.0.3",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.0.4",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&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:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().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:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||@@ -1937,105 +1937,105 @@ Editor.prototype.setModified=function(b){this.modified=b};Editor.prototype.setFiEditor.prototype.createUndoManager=function(){var b=this.graph,e=new mxUndoManager;this.undoListener=function(m,v){e.undoableEditHappened(v.getProperty("edit"))};var g=mxUtils.bind(this,function(m,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,g);b.getView().addListener(mxEvent.UNDO,g);g=function(m,v){m=v.getProperty("edit").changes;m=b.getSelectionCellsForChanges(m);v=!1;if(0<m.length){for(var p=[],A=0;A<m.length;A++)null!=b.view.getState(m[A])&&(p.push(m[A]),v||(b.scrollCellToVisible(m[A]),v=!0));b.setSelectionCells(p)}};e.addListener(mxEvent.UNDO,g);e.addListener(mxEvent.REDO,g);return e};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};OpenFile.prototype.error=function(b){this.cancel(!0);mxUtils.alert(b)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(b){null!=this.done&&this.done(null!=b?b:!0)};-function Dialog(b,e,g,m,v,p,A,G,T,F,P){this.editorUi=b;var Q=T?57:0,U=g,c=m,f=T?0:64,k=Editor.inlineFullscreen||null==b.embedViewport?this.getDocumentSize():mxUtils.clone(b.embedViewport);null==b.embedViewport&&null!=window.innerHeight&&(k.height=window.innerHeight);var B=k.height;k=Math.max(1,Math.round((k.width-g-f)/2));var z=Math.max(1,Math.round((B-m-b.footerHeight)/3));e.style.maxHeight="100%";g=null!=document.body?Math.min(g,document.body.scrollWidth-f):g;m=Math.min(m,B-f);0<b.dialogs.length&&+function Dialog(b,e,g,m,v,p,A,G,S,F,P){this.editorUi=b;var Q=S?57:0,T=g,c=m,f=S?0:64,k=Editor.inlineFullscreen||null==b.embedViewport?this.getDocumentSize():mxUtils.clone(b.embedViewport);null==b.embedViewport&&null!=window.innerHeight&&(k.height=window.innerHeight);var B=k.height;k=Math.max(1,Math.round((k.width-g-f)/2));var z=Math.max(1,Math.round((B-m-b.footerHeight)/3));e.style.maxHeight="100%";g=null!=document.body?Math.min(g,document.body.scrollWidth-f):g;m=Math.min(m,B-f);0<b.dialogs.length&&(this.zIndex+=2*b.dialogs.length);null==this.bg&&(this.bg=b.createDiv("geBackground"),this.bg.style.position="absolute",this.bg.style.height=B+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity));var C=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=C.x+"px";this.bg.style.top=C.y+"px";k+=C.x;z+=C.y;Editor.inlineFullscreen||null==b.embedViewport||(this.bg.style.height=this.getDocumentSize().height+"px",z+=b.embedViewport.y,k+=b.embedViewport.x);-v&&document.body.appendChild(this.bg);var H=b.createDiv(T?"geTransDialog":"geDialog");v=this.getPosition(k,z,g,m);k=v.x;z=v.y;H.style.width=g+"px";H.style.height=m+"px";H.style.left=k+"px";H.style.top=z+"px";H.style.zIndex=this.zIndex;H.appendChild(e);document.body.appendChild(H);!G&&e.clientHeight>H.clientHeight-f&&(e.style.overflowY="auto");e.style.overflowX="hidden";if(p&&(p=document.createElement("img"),p.setAttribute("src",Dialog.prototype.closeImage),p.setAttribute("title",mxResources.get("close")),-p.className="geDialogClose",p.style.top=z+14+"px",p.style.left=k+g+38-Q+"px",p.style.zIndex=this.zIndex,mxEvent.addListener(p,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),document.body.appendChild(p),this.dialogImg=p,!P)){var K=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(M){K=!0}),null,mxUtils.bind(this,function(M){K&&(b.hideDialog(!0),K=!1)}))}this.resizeListener=mxUtils.bind(this,function(){if(null!=F){var M=F();null!=M&&(U=g=M.w,c=m=M.h)}M=Editor.inlineFullscreen||-null==b.embedViewport?this.getDocumentSize():mxUtils.clone(b.embedViewport);B=M.height;this.bg.style.height=B+"px";Editor.inlineFullscreen||null==b.embedViewport||(this.bg.style.height=this.getDocumentSize().height+"px");g=null!=document.body?Math.min(U,document.body.scrollWidth-f):U;m=Math.min(c,B-f);M=Math.max(1,Math.round((M.width-g-f)/2));var O=Math.max(1,Math.round((B-m-b.footerHeight)/3));O=this.getPosition(M,O,g,m);M=O.x;O=O.y;var ea=mxUtils.getDocumentScrollOrigin(document);M+=ea.x;O+=ea.y;-Editor.inlineFullscreen||null==b.embedViewport||(O+=b.embedViewport.y,M+=b.embedViewport.x);H.style.left=M+"px";H.style.top=O+"px";H.style.width=g+"px";H.style.height=m+"px";!G&&e.clientHeight>H.clientHeight-f&&(e.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=O+14+"px",this.dialogImg.style.left=M+g+38-Q+"px")});null!=b.embedViewport?b.addListener("embedViewportChanged",this.resizeListener):mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=A;this.container=-H;b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-2;+v&&document.body.appendChild(this.bg);var I=b.createDiv(S?"geTransDialog":"geDialog");v=this.getPosition(k,z,g,m);k=v.x;z=v.y;I.style.width=g+"px";I.style.height=m+"px";I.style.left=k+"px";I.style.top=z+"px";I.style.zIndex=this.zIndex;I.appendChild(e);document.body.appendChild(I);!G&&e.clientHeight>I.clientHeight-f&&(e.style.overflowY="auto");e.style.overflowX="hidden";if(p&&(p=document.createElement("img"),p.setAttribute("src",Dialog.prototype.closeImage),p.setAttribute("title",mxResources.get("close")),+p.className="geDialogClose",p.style.top=z+14+"px",p.style.left=k+g+38-Q+"px",p.style.zIndex=this.zIndex,mxEvent.addListener(p,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),document.body.appendChild(p),this.dialogImg=p,!P)){var L=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(J){L=!0}),null,mxUtils.bind(this,function(J){L&&(b.hideDialog(!0),L=!1)}))}this.resizeListener=mxUtils.bind(this,function(){if(null!=F){var J=F();null!=J&&(T=g=J.w,c=m=J.h)}J=Editor.inlineFullscreen||+null==b.embedViewport?this.getDocumentSize():mxUtils.clone(b.embedViewport);B=J.height;this.bg.style.height=B+"px";Editor.inlineFullscreen||null==b.embedViewport||(this.bg.style.height=this.getDocumentSize().height+"px");g=null!=document.body?Math.min(T,document.body.scrollWidth-f):T;m=Math.min(c,B-f);J=Math.max(1,Math.round((J.width-g-f)/2));var O=Math.max(1,Math.round((B-m-b.footerHeight)/3));O=this.getPosition(J,O,g,m);J=O.x;O=O.y;var da=mxUtils.getDocumentScrollOrigin(document);J+=da.x;O+=da.y;+Editor.inlineFullscreen||null==b.embedViewport||(O+=b.embedViewport.y,J+=b.embedViewport.x);I.style.left=J+"px";I.style.top=O+"px";I.style.width=g+"px";I.style.height=m+"px";!G&&e.clientHeight>I.clientHeight-f&&(e.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=O+14+"px",this.dialogImg.style.left=J+g+38-Q+"px")});null!=b.embedViewport?b.addListener("embedViewportChanged",this.resizeListener):mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=A;this.container=+I;b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-2;Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":IMAGE_PATH+"/nocolor.png";Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png";Dialog.prototype.clearImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==":IMAGE_PATH+"/clear.gif";Dialog.prototype.bgOpacity=80;Dialog.prototype.getDocumentSize=function(){return mxUtils.getDocumentSize()};Dialog.prototype.getPosition=function(b,e){return new mxPoint(b,e)};Dialog.prototype.close=function(b,e){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,e))return!1;this.onDialogClose=null}null!=this.dialogImg&&null!=this.dialogImg.parentNode&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);null!=this.editorUi.embedViewport?this.editorUi.removeListener(this.resizeListener):mxEvent.removeListener(window,"resize",this.resizeListener);null!=this.container.parentNode&&this.container.parentNode.removeChild(this.container)};-var ErrorDialog=function(b,e,g,m,v,p,A,G,T,F,P){T=null!=T?T:!0;var Q=document.createElement("div");Q.style.textAlign="center";if(null!=e){var U=document.createElement("div");U.style.padding="0px";U.style.margin="0px";U.style.fontSize="18px";U.style.paddingBottom="16px";U.style.marginBottom="10px";U.style.borderBottom="1px solid #c0c0c0";U.style.color="gray";U.style.whiteSpace="nowrap";U.style.textOverflow="ellipsis";U.style.overflow="hidden";mxUtils.write(U,e);U.setAttribute("title",e);Q.appendChild(U)}e=+var ErrorDialog=function(b,e,g,m,v,p,A,G,S,F,P){S=null!=S?S:!0;var Q=document.createElement("div");Q.style.textAlign="center";if(null!=e){var T=document.createElement("div");T.style.padding="0px";T.style.margin="0px";T.style.fontSize="18px";T.style.paddingBottom="16px";T.style.marginBottom="10px";T.style.borderBottom="1px solid #c0c0c0";T.style.color="gray";T.style.whiteSpace="nowrap";T.style.textOverflow="ellipsis";T.style.overflow="hidden";mxUtils.write(T,e);T.setAttribute("title",e);Q.appendChild(T)}e=document.createElement("div");e.style.lineHeight="1.2em";e.style.padding="6px";"string"===typeof g&&(g=g.replace(/\n/g,"<br/>"));e.innerHTML=Graph.sanitizeHtml(g);Q.appendChild(e);g=document.createElement("div");g.style.marginTop="12px";g.style.textAlign="center";null!=p&&(e=mxUtils.button(mxResources.get("tryAgain"),function(){b.hideDialog();p()}),e.className="geBtn",g.appendChild(e),g.style.textAlign="center");null!=F&&(F=mxUtils.button(F,function(){null!=P&&P()}),F.className="geBtn",g.appendChild(F));-var c=mxUtils.button(m,function(){T&&b.hideDialog();null!=v&&v()});c.className="geBtn";g.appendChild(c);null!=A&&(m=mxUtils.button(A,function(){T&&b.hideDialog();null!=G&&G()}),m.className="geBtn gePrimaryBtn",g.appendChild(m));this.init=function(){c.focus()};Q.appendChild(g);this.container=Q},PrintDialog=function(b,e,g){this.create(b,e,g)};-PrintDialog.prototype.create=function(b){function e(c){var f=A.checked||F.checked,k=parseInt(Q.value)/100;isNaN(k)&&(k=1,Q.value="100%");mxClient.IS_SF&&(k*=.75);var B=g.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,z=1/g.pageScale;if(f){var C=A.checked?1:parseInt(P.value);isNaN(C)||(z=mxUtils.getScaleForPageCount(C,g,B))}var H=C=0;B=mxRectangle.fromRectangle(B);B.width=Math.ceil(B.width*k);B.height=Math.ceil(B.height*k);z*=k;!f&&g.pageVisible?(k=g.getPageLayout(),C-=k.x*B.width,H-=k.y*B.height):-f=!0;f=PrintDialog.createPrintPreview(g,z,B,0,C,H,f);f.open();c&&PrintDialog.printPreview(f)}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var A=document.createElement("input");A.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(A);var T=document.createElement("span");mxUtils.write(T," "+mxResources.get("fitPage"));-G.appendChild(T);mxEvent.addListener(T,"click",function(c){A.checked=!A.checked;F.checked=!A.checked;mxEvent.consume(c)});mxEvent.addListener(A,"change",function(){F.checked=!A.checked});p.appendChild(G);v.appendChild(p);p=p.cloneNode(!1);var F=document.createElement("input");F.setAttribute("type","checkbox");G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(F);T=document.createElement("span");mxUtils.write(T," "+mxResources.get("posterPrint")+":");G.appendChild(T);mxEvent.addListener(T,+var c=mxUtils.button(m,function(){S&&b.hideDialog();null!=v&&v()});c.className="geBtn";g.appendChild(c);null!=A&&(m=mxUtils.button(A,function(){S&&b.hideDialog();null!=G&&G()}),m.className="geBtn gePrimaryBtn",g.appendChild(m));this.init=function(){c.focus()};Q.appendChild(g);this.container=Q},PrintDialog=function(b,e,g){this.create(b,e,g)};+PrintDialog.prototype.create=function(b){function e(c){var f=A.checked||F.checked,k=parseInt(Q.value)/100;isNaN(k)&&(k=1,Q.value="100%");mxClient.IS_SF&&(k*=.75);var B=g.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,z=1/g.pageScale;if(f){var C=A.checked?1:parseInt(P.value);isNaN(C)||(z=mxUtils.getScaleForPageCount(C,g,B))}var I=C=0;B=mxRectangle.fromRectangle(B);B.width=Math.ceil(B.width*k);B.height=Math.ceil(B.height*k);z*=k;!f&&g.pageVisible?(k=g.getPageLayout(),C-=k.x*B.width,I-=k.y*B.height):+f=!0;f=PrintDialog.createPrintPreview(g,z,B,0,C,I,f);f.open();c&&PrintDialog.printPreview(f)}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var A=document.createElement("input");A.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(A);var S=document.createElement("span");mxUtils.write(S," "+mxResources.get("fitPage"));+G.appendChild(S);mxEvent.addListener(S,"click",function(c){A.checked=!A.checked;F.checked=!A.checked;mxEvent.consume(c)});mxEvent.addListener(A,"change",function(){F.checked=!A.checked});p.appendChild(G);v.appendChild(p);p=p.cloneNode(!1);var F=document.createElement("input");F.setAttribute("type","checkbox");G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(F);S=document.createElement("span");mxUtils.write(S," "+mxResources.get("posterPrint")+":");G.appendChild(S);mxEvent.addListener(S,"click",function(c){F.checked=!F.checked;A.checked=!F.checked;mxEvent.consume(c)});p.appendChild(G);var P=document.createElement("input");P.setAttribute("value","1");P.setAttribute("type","number");P.setAttribute("min","1");P.setAttribute("size","4");P.setAttribute("disabled","disabled");P.style.width="50px";G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(P);mxUtils.write(G," "+mxResources.get("pages")+" (max)");p.appendChild(G);v.appendChild(p);mxEvent.addListener(F,"change",function(){F.checked?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled");A.checked=!F.checked});p=p.cloneNode(!1);G=document.createElement("td");mxUtils.write(G,mxResources.get("pageScale")+":");p.appendChild(G);G=document.createElement("td");var Q=document.createElement("input");Q.setAttribute("value","100 %");Q.setAttribute("size","5");Q.style.width="50px";G.appendChild(Q);p.appendChild(G);v.appendChild(p);p=document.createElement("tr");G=document.createElement("td");G.colSpan=2;-G.style.paddingTop="20px";G.setAttribute("align","right");T=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});T.className="geBtn";b.editor.cancelFirst&&G.appendChild(T);if(PrintDialog.previewEnabled){var U=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();e(!1)});U.className="geBtn";G.appendChild(U)}U=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();e(!0)});U.className="geBtn gePrimaryBtn";G.appendChild(U);b.editor.cancelFirst||-G.appendChild(T);p.appendChild(G);v.appendChild(p);m.appendChild(v);this.container=m};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(e){}};-PrintDialog.createPrintPreview=function(b,e,g,m,v,p,A){e=new mxPrintPreview(b,e,g,m,v,p);e.title=mxResources.get("preview");e.addPageCss=!mxClient.IS_SF;e.printBackgroundImage=!0;e.autoOrigin=A;A=b.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";e.backgroundColor=A;var G=e.isTextLabel;e.isTextLabel=function(F){return"geHint"==!F.className&&G.apply(this,arguments)};var T=e.getLinkForCellState;e.getLinkForCellState=function(F){return b.getAbsoluteUrl(T.apply(this,arguments))};return e};+G.style.paddingTop="20px";G.setAttribute("align","right");S=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});S.className="geBtn";b.editor.cancelFirst&&G.appendChild(S);if(PrintDialog.previewEnabled){var T=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();e(!1)});T.className="geBtn";G.appendChild(T)}T=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();e(!0)});T.className="geBtn gePrimaryBtn";G.appendChild(T);b.editor.cancelFirst||+G.appendChild(S);p.appendChild(G);v.appendChild(p);m.appendChild(v);this.container=m};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(e){}};+PrintDialog.createPrintPreview=function(b,e,g,m,v,p,A){e=new mxPrintPreview(b,e,g,m,v,p);e.title=mxResources.get("preview");e.addPageCss=!mxClient.IS_SF;e.printBackgroundImage=!0;e.autoOrigin=A;A=b.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";e.backgroundColor=A;var G=e.isTextLabel;e.isTextLabel=function(F){return"geHint"==!F.className&&G.apply(this,arguments)};var S=e.getLinkForCellState;e.getLinkForCellState=function(F){return b.getAbsoluteUrl(S.apply(this,arguments))};return e};PrintDialog.previewEnabled=!0;-var PageSetupDialog=function(b){function e(){var k=Q;null!=k&&null!=k.originalSrc&&(k=b.createImageForPageLink(k.originalSrc,null));null!=k&&null!=k.src?(P.style.backgroundImage="url("+k.src+")",P.style.display="inline-block"):(P.style.backgroundImage="",P.style.display="none");P.style.backgroundColor="";null!=U&&U!=mxConstants.NONE&&(P.style.backgroundColor=U,P.style.display="inline-block")}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");+var PageSetupDialog=function(b){function e(){var k=Q;null!=k&&null!=k.originalSrc&&(k=b.createImageForPageLink(k.originalSrc,null));null!=k&&null!=k.src?(P.style.backgroundImage="url("+k.src+")",P.style.display="inline-block"):(P.style.backgroundImage="",P.style.display="none");P.style.backgroundColor="";null!=T&&T!=mxConstants.NONE&&(P.style.backgroundColor=T,P.style.display="inline-block")}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";mxUtils.write(A,mxResources.get("paperSize")+":");p.appendChild(A);A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";var G=PageSetupDialog.addPageFormatPanel(A,"pagesetupdialog",g.pageFormat);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("gridSize")+":");p.appendChild(A);-A=document.createElement("td");A.style.whiteSpace="nowrap";var T=document.createElement("input");T.setAttribute("type","number");T.setAttribute("min","0");T.style.width="40px";T.style.marginLeft="6px";T.value=g.getGridSize();A.appendChild(T);mxEvent.addListener(T,"change",function(){var k=parseInt(T.value);T.value=Math.max(1,isNaN(k)?g.getGridSize():k)});p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("background")+":");+A=document.createElement("td");A.style.whiteSpace="nowrap";var S=document.createElement("input");S.setAttribute("type","number");S.setAttribute("min","0");S.style.width="40px";S.style.marginLeft="6px";S.value=g.getGridSize();A.appendChild(S);mxEvent.addListener(S,"change",function(){var k=parseInt(S.value);S.value=Math.max(1,isNaN(k)?g.getGridSize():k)});p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("background")+":");p.appendChild(A);A=document.createElement("td");var F=document.createElement("button");F.className="geBtn";F.style.margin="0px";mxUtils.write(F,mxResources.get("change")+"...");var P=document.createElement("div");P.style.display="inline-block";P.style.verticalAlign="middle";P.style.backgroundPosition="center center";P.style.backgroundRepeat="no-repeat";P.style.backgroundSize="contain";P.style.border="1px solid lightGray";P.style.borderRadius="4px";P.style.marginRight="14px";P.style.height="32px";-P.style.width="64px";P.style.cursor="pointer";P.style.padding="4px";var Q=g.backgroundImage,U=g.background,c=g.shadowVisible,f=function(k){b.showBackgroundImageDialog(function(B,z,C,H){z||(null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src}),Q=B,c=H);U=C;e()},Q,U,!0);mxEvent.consume(k)};mxEvent.addListener(F,"click",f);mxEvent.addListener(P,"click",f);e();A.appendChild(P);A.appendChild(F);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");-A.colSpan=2;A.style.paddingTop="16px";A.setAttribute("align","right");F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";b.editor.cancelFirst&&A.appendChild(F);f=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var k=parseInt(T.value);isNaN(k)||g.gridSize===k||g.setGridSize(k);k=new ChangePageSetup(b,U,Q,G.get());k.ignoreColor=g.background==U;k.ignoreImage=(null!=g.backgroundImage?g.backgroundImage.src:null)===(null!=Q?Q.src:null);null!=c&&+P.style.width="64px";P.style.cursor="pointer";P.style.padding="4px";var Q=g.backgroundImage,T=g.background,c=g.shadowVisible,f=function(k){b.showBackgroundImageDialog(function(B,z,C,I){z||(null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src}),Q=B,c=I);T=C;e()},Q,T,!0);mxEvent.consume(k)};mxEvent.addListener(F,"click",f);mxEvent.addListener(P,"click",f);e();A.appendChild(P);A.appendChild(F);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");+A.colSpan=2;A.style.paddingTop="16px";A.setAttribute("align","right");F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";b.editor.cancelFirst&&A.appendChild(F);f=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var k=parseInt(S.value);isNaN(k)||g.gridSize===k||g.setGridSize(k);k=new ChangePageSetup(b,T,Q,G.get());k.ignoreColor=g.background==T;k.ignoreImage=(null!=g.backgroundImage?g.backgroundImage.src:null)===(null!=Q?Q.src:null);null!=c&&(k.shadowVisible=c);g.pageFormat.width==k.previousFormat.width&&g.pageFormat.height==k.previousFormat.height&&k.ignoreColor&&k.ignoreImage&&k.shadowVisible==g.shadowVisible||g.model.execute(k)});f.className="geBtn gePrimaryBtn";A.appendChild(f);b.editor.cancelFirst||A.appendChild(F);p.appendChild(A);v.appendChild(p);m.appendChild(v);this.container=m};PageSetupDialog.addPageFormatPanel=function(b,e,g,m){e="format-"+e;var v=document.createElement("input");v.setAttribute("name",e);v.setAttribute("type","radio");v.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",e);p.setAttribute("type","radio");p.setAttribute("value","landscape");var A=document.createElement("select");A.style.marginBottom="4px";A.style.borderRadius="4px";A.style.borderWidth="1px";A.style.borderStyle="solid";A.style.boxSizing="border-box";-A.style.padding="2px";A.style.width="210px";var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.marginLeft="4px";G.style.width="210px";G.style.height="24px";v.style.marginRight="6px";G.appendChild(v);e=document.createElement("span");e.style.maxWidth="100px";mxUtils.write(e,mxResources.get("portrait"));G.appendChild(e);p.style.marginLeft="10px";p.style.marginRight="6px";G.appendChild(p);var T=document.createElement("span");T.style.width="100px";mxUtils.write(T,mxResources.get("landscape"));-G.appendChild(T);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.marginLeft="4px";F.style.fontSize="12px";F.style.width="210px";F.style.height="24px";var P=document.createElement("input");P.setAttribute("size","7");P.setAttribute("title",mxResources.get("width"));P.style.textAlign="right";F.appendChild(P);mxUtils.write(F," x ");var Q=document.createElement("input");Q.setAttribute("size","7");Q.setAttribute("title",mxResources.get("height"));Q.style.textAlign="right";F.appendChild(Q);-var U=document.createElement("select");U.style.marginLeft="4px";U.style.maxWidth="78px";U.style.width="78px";for(var c=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],f=0;f<c.length;f++){var k=document.createElement("option");k.setAttribute("value",c[f].unit);mxUtils.write(k,c[f].label);U.appendChild(k)}U.value=Editor.pageSizeUnit;F.appendChild(U);G.style.display=-"none";F.style.display="none";var B={},z=PageSetupDialog.getFormats();for(f=0;f<z.length;f++)c=z[f],B[c.key]=c,k=document.createElement("option"),k.setAttribute("value",c.key),mxUtils.write(k,c.title),A.appendChild(k);var C=function(){A.value="custom";for(var K=0;K<z.length;K++){var M=z[K];null!=M.format&&("a4"==M.key?826==g.width?(g=mxRectangle.fromRectangle(g),g.width=827):826==g.height&&(g=mxRectangle.fromRectangle(g),g.height=827):"a5"==M.key&&(584==g.width?(g=mxRectangle.fromRectangle(g),g.width=-583):584==g.height&&(g=mxRectangle.fromRectangle(g),g.height=583)),g.width==M.format.width&&g.height==M.format.height?(A.value=M.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):g.width==M.format.height&&g.height==M.format.width&&(A.value=M.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==A.value?-(P.value=Editor.toUnit(g.width,U.value),Q.value=Editor.toUnit(g.height,U.value),v.setAttribute("checked","checked"),A.value="custom",G.style.display="none",F.style.display=""):(G.style.display="",F.style.display="none")};C();b.appendChild(A);mxUtils.br(b);b.appendChild(G);b.appendChild(F);var H=function(K,M){K=B[A.value];null!=K.format?(P.value=Editor.toUnit(p.checked?K.format.height:K.format.width,U.value),Q.value=Editor.toUnit(p.checked?K.format.width:K.format.height,U.value),F.style.display="none",-G.style.display=""):(G.style.display="none",F.style.display="");K=parseFloat(P.value);if(isNaN(K)||0>=K)P.value=Editor.toUnit(g.width,U.value);K=parseFloat(Q.value);if(isNaN(K)||0>=K)Q.value=Editor.toUnit(g.height,U.value);K=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(P.value),U.value)),Math.floor(Editor.fromUnit(parseFloat(Q.value),U.value)));M||K.width==g.width&&K.height==g.height||(g=K,null!=m&&m(g))};mxEvent.addListener(e,"click",function(K){v.checked=!0;H(K);mxEvent.consume(K)});-mxEvent.addListener(T,"click",function(K){p.checked=!0;H(K);mxEvent.consume(K)});mxEvent.addListener(P,"blur",H);mxEvent.addListener(P,"click",H);mxEvent.addListener(Q,"blur",H);mxEvent.addListener(Q,"click",H);mxEvent.addListener(p,"change",H);mxEvent.addListener(v,"change",H);mxEvent.addListener(A,"change",function(K){H(K,"custom"==A.value);mxEvent.consume(K)});mxEvent.addListener(U,"change",function(K){P.value=Editor.toUnit(Editor.fromUnit(P.value,Editor.pageSizeUnit),U.value);Q.value=Editor.toUnit(Editor.fromUnit(Q.value,-Editor.pageSizeUnit),U.value);Editor.pageSizeUnit=U.value;H(K,!0);mxEvent.consume(K)});H(null,!0);return{set:function(K){g=K;C(null,null,!0)},get:function(){return g},widthInput:P,heightInput:Q}};+A.style.padding="2px";A.style.width="210px";var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.marginLeft="4px";G.style.width="210px";G.style.height="24px";v.style.marginRight="6px";G.appendChild(v);e=document.createElement("span");e.style.maxWidth="100px";mxUtils.write(e,mxResources.get("portrait"));G.appendChild(e);p.style.marginLeft="10px";p.style.marginRight="6px";G.appendChild(p);var S=document.createElement("span");S.style.width="100px";mxUtils.write(S,mxResources.get("landscape"));+G.appendChild(S);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.marginLeft="4px";F.style.fontSize="12px";F.style.width="210px";F.style.height="24px";var P=document.createElement("input");P.setAttribute("size","7");P.setAttribute("title",mxResources.get("width"));P.style.textAlign="right";F.appendChild(P);mxUtils.write(F," x ");var Q=document.createElement("input");Q.setAttribute("size","7");Q.setAttribute("title",mxResources.get("height"));Q.style.textAlign="right";F.appendChild(Q);+var T=document.createElement("select");T.style.marginLeft="4px";T.style.maxWidth="78px";T.style.width="78px";for(var c=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],f=0;f<c.length;f++){var k=document.createElement("option");k.setAttribute("value",c[f].unit);mxUtils.write(k,c[f].label);T.appendChild(k)}T.value=Editor.pageSizeUnit;F.appendChild(T);G.style.display=+"none";F.style.display="none";var B={},z=PageSetupDialog.getFormats();for(f=0;f<z.length;f++)c=z[f],B[c.key]=c,k=document.createElement("option"),k.setAttribute("value",c.key),mxUtils.write(k,c.title),A.appendChild(k);var C=function(){A.value="custom";for(var L=0;L<z.length;L++){var J=z[L];null!=J.format&&("a4"==J.key?826==g.width?(g=mxRectangle.fromRectangle(g),g.width=827):826==g.height&&(g=mxRectangle.fromRectangle(g),g.height=827):"a5"==J.key&&(584==g.width?(g=mxRectangle.fromRectangle(g),g.width=+583):584==g.height&&(g=mxRectangle.fromRectangle(g),g.height=583)),g.width==J.format.width&&g.height==J.format.height?(A.value=J.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):g.width==J.format.height&&g.height==J.format.width&&(A.value=J.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==A.value?+(P.value=Editor.toUnit(g.width,T.value),Q.value=Editor.toUnit(g.height,T.value),v.setAttribute("checked","checked"),A.value="custom",G.style.display="none",F.style.display=""):(G.style.display="",F.style.display="none")};C();b.appendChild(A);mxUtils.br(b);b.appendChild(G);b.appendChild(F);var I=function(L,J){L=B[A.value];null!=L.format?(P.value=Editor.toUnit(p.checked?L.format.height:L.format.width,T.value),Q.value=Editor.toUnit(p.checked?L.format.width:L.format.height,T.value),F.style.display="none",+G.style.display=""):(G.style.display="none",F.style.display="");L=parseFloat(P.value);if(isNaN(L)||0>=L)P.value=Editor.toUnit(g.width,T.value);L=parseFloat(Q.value);if(isNaN(L)||0>=L)Q.value=Editor.toUnit(g.height,T.value);L=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(P.value),T.value)),Math.floor(Editor.fromUnit(parseFloat(Q.value),T.value)));J||L.width==g.width&&L.height==g.height||(g=L,null!=m&&m(g))};mxEvent.addListener(e,"click",function(L){v.checked=!0;I(L);mxEvent.consume(L)});+mxEvent.addListener(S,"click",function(L){p.checked=!0;I(L);mxEvent.consume(L)});mxEvent.addListener(P,"blur",I);mxEvent.addListener(P,"click",I);mxEvent.addListener(Q,"blur",I);mxEvent.addListener(Q,"click",I);mxEvent.addListener(p,"change",I);mxEvent.addListener(v,"change",I);mxEvent.addListener(A,"change",function(L){I(L,"custom"==A.value);mxEvent.consume(L)});mxEvent.addListener(T,"change",function(L){P.value=Editor.toUnit(Editor.fromUnit(P.value,Editor.pageSizeUnit),T.value);Q.value=Editor.toUnit(Editor.fromUnit(Q.value,+Editor.pageSizeUnit),T.value);Editor.pageSizeUnit=T.value;I(L,!0);mxEvent.consume(L)});I(null,!0);return{set:function(L){g=L;C(null,null,!0)},get:function(){return g},widthInput:P,heightInput:Q}};PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1E3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"b4",title:"B4 (250 mm x 353 mm)",format:new mxRectangle(0,0,980,1390)},{key:"b5",title:"B5 (176 mm x 250 mm)",format:new mxRectangle(0,0,690,980)},{key:"16-9",title:"16:9 (1600 x 900)",format:new mxRectangle(0,0,900,1600)},{key:"16-10",title:"16:10 (1920 x 1200)",format:new mxRectangle(0,0,1200,1920)},{key:"4-3",title:"4:3 (1600 x 1200)",format:new mxRectangle(0,0,1200,1600)},{key:"custom",title:mxResources.get("custom"),format:null}]};-var FilenameDialog=function(b,e,g,m,v,p,A,G,T,F,P){T=null!=T?T:!0;var Q=document.createElement("div"),U=document.createElement("div");U.style.width="100%";U.style.display="grid";U.style.gap="5px 8px";U.style.gridAutoColumns="auto 1fr";U.style.boxSizing="border-box";U.style.padding="3px";var c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.justifyContent="flex-end";c.style.minWidth="0";var f=document.createElement("div");f.style.display="inline-block";-f.style.textOverflow="ellipsis";f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.fontSize="10pt";f.style.padding="2px 0";f.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(f,(v||mxResources.get("filename"))+":");c.appendChild(f);U.appendChild(c);var k=document.createElement("input");k.setAttribute("value",e||"");k.style.flexGrow="1";var B=mxUtils.button(g,function(){if(null==p||p(k.value))T&&b.hideDialog(),m(k.value)});B.className="geBtn gePrimaryBtn";this.init=function(){if(null!=-v||null==A)if(null!=P?Editor.selectFilename(k):(k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var z=U.parentNode;if(null!=z){var C=null;mxEvent.addListener(z,"dragleave",function(H){null!=C&&(C.style.backgroundColor="",C=null);H.stopPropagation();H.preventDefault()});mxEvent.addListener(z,"dragover",mxUtils.bind(this,function(H){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=k,C.style.backgroundColor=-"#ebf2f9");H.stopPropagation();H.preventDefault()}));mxEvent.addListener(z,"drop",mxUtils.bind(this,function(H){null!=C&&(C.style.backgroundColor="",C=null);0<=mxUtils.indexOf(H.dataTransfer.types,"text/uri-list")&&(k.value=decodeURIComponent(H.dataTransfer.getData("text/uri-list")),B.click());H.stopPropagation();H.preventDefault()}))}}};c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.gap="4px";c.style.whiteSpace="nowrap";c.appendChild(k);U.appendChild(c);-null==v&&null!=A||null==P||null==b.editor.diagramFileTypes||(c=document.createElement("div"),c.style.display="inline-flex",c.style.alignItems="center",c.style.textOverflow="ellipsis",c.style.justifyContent="flex-end",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("type")+":"),U.appendChild(c),c=document.createElement("div"),c.style.display="inline-flex",c.style.alignItems="center",c.style.whiteSpace="nowrap",U.appendChild(c),e=FilenameDialog.createFileTypes(b,k,b.editor.diagramFileTypes),-e.style.width="100%",c.appendChild(e));null!=A&&U.appendChild(A);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=P?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");c=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=F&&F()});c.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));-b.editor.cancelFirst&&row.appendChild(c);mxEvent.addListener(k,"keypress",function(z){13==z.keyCode&&B.click()});row.appendChild(B);b.editor.cancelFirst||row.appendChild(c);U.appendChild(row);Q.appendChild(U);this.container=Q};FilenameDialog.filenameHelpLink=null;+var FilenameDialog=function(b,e,g,m,v,p,A,G,S,F,P){S=null!=S?S:!0;var Q=document.createElement("div"),T=document.createElement("div");T.style.width="100%";T.style.display="grid";T.style.gap="5px 8px";T.style.gridAutoColumns="auto 1fr";T.style.boxSizing="border-box";T.style.padding="3px";var c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.justifyContent="flex-end";c.style.minWidth="0";var f=document.createElement("div");f.style.display="inline-block";+f.style.textOverflow="ellipsis";f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.fontSize="10pt";f.style.padding="2px 0";f.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(f,(v||mxResources.get("filename"))+":");c.appendChild(f);T.appendChild(c);var k=document.createElement("input");k.setAttribute("value",e||"");k.style.flexGrow="1";var B=mxUtils.button(g,function(){if(null==p||p(k.value))S&&b.hideDialog(),m(k.value)});B.className="geBtn gePrimaryBtn";this.init=function(){if(null!=+v||null==A)if(null!=P?Editor.selectFilename(k):(k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var z=T.parentNode;if(null!=z){var C=null;mxEvent.addListener(z,"dragleave",function(I){null!=C&&(C.style.backgroundColor="",C=null);I.stopPropagation();I.preventDefault()});mxEvent.addListener(z,"dragover",mxUtils.bind(this,function(I){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=k,C.style.backgroundColor=+"#ebf2f9");I.stopPropagation();I.preventDefault()}));mxEvent.addListener(z,"drop",mxUtils.bind(this,function(I){null!=C&&(C.style.backgroundColor="",C=null);0<=mxUtils.indexOf(I.dataTransfer.types,"text/uri-list")&&(k.value=decodeURIComponent(I.dataTransfer.getData("text/uri-list")),B.click());I.stopPropagation();I.preventDefault()}))}}};c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.gap="4px";c.style.whiteSpace="nowrap";c.appendChild(k);T.appendChild(c);+null==v&&null!=A||null==P||null==b.editor.diagramFileTypes||(c=document.createElement("div"),c.style.display="inline-flex",c.style.alignItems="center",c.style.textOverflow="ellipsis",c.style.justifyContent="flex-end",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("type")+":"),T.appendChild(c),c=document.createElement("div"),c.style.display="inline-flex",c.style.alignItems="center",c.style.whiteSpace="nowrap",T.appendChild(c),e=FilenameDialog.createFileTypes(b,k,b.editor.diagramFileTypes),+e.style.width="100%",c.appendChild(e));null!=A&&T.appendChild(A);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=P?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");c=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=F&&F()});c.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));+b.editor.cancelFirst&&row.appendChild(c);mxEvent.addListener(k,"keypress",function(z){13==z.keyCode&&B.click()});row.appendChild(B);b.editor.cancelFirst||row.appendChild(c);T.appendChild(row);Q.appendChild(T);this.container=Q};FilenameDialog.filenameHelpLink=null;FilenameDialog.createFileTypes=function(b,e,g){var m=document.createElement("select");for(b=0;b<g.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(g[b].description)+" (."+g[b].extension+")");m.appendChild(v)}mxEvent.addListener(m,"change",function(p){p=g[m.value].extension;var A=e.value.lastIndexOf(".drawio.");A=0<A?A:e.value.lastIndexOf(".");"drawio"!=p&&(p="drawio."+p);e.value=0<A?e.value.substring(0,A+1)+p:e.value+"."+p;"createEvent"in-document?(p=document.createEvent("HTMLEvents"),p.initEvent("change",!1,!0),e.dispatchEvent(p)):e.fireEvent("onchange")});b=function(p){p=e.value.toLowerCase();for(var A=0,G=0;G<g.length;G++){var T=g[G].extension,F=null;"drawio"!=T&&(F=T,T=".drawio."+T);if(p.substring(p.length-T.length-1)=="."+T||null!=F&&p.substring(p.length-F.length-1)=="."+F){A=G;break}}m.value=A};mxEvent.addListener(e,"change",b);mxEvent.addListener(e,"keyup",b);b();return m};-var WrapperWindow=function(b,e,g,m,v,p,A){var G=b.createSidebarContainer();A(G);this.window=new mxWindow(e,G,g,m,v,p,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);mxClient.IS_SF&&(this.window.div.onselectstart=mxUtils.bind(this,function(T){null==T&&(T=window.event);return null!=T&&b.isSelectionAllowed(T)}))};-(function(){mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph;if(null!=A.container&&!A.transparentBackground){if(A.pageVisible){var G=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var T=A.container.firstChild;null!=T&&T.nodeType!=mxConstants.NODETYPE_ELEMENT;)T=T.nextSibling;null!=T&&(this.backgroundPageShape=this.createBackgroundPageShape(G),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,-this.backgroundPageShape.init(A.container),T.style.position="absolute",A.container.insertBefore(this.backgroundPageShape.node,T),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(F){A.dblClick(F)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){null!=+document?(p=document.createEvent("HTMLEvents"),p.initEvent("change",!1,!0),e.dispatchEvent(p)):e.fireEvent("onchange")});b=function(p){p=e.value.toLowerCase();for(var A=0,G=0;G<g.length;G++){var S=g[G].extension,F=null;"drawio"!=S&&(F=S,S=".drawio."+S);if(p.substring(p.length-S.length-1)=="."+S||null!=F&&p.substring(p.length-F.length-1)=="."+F){A=G;break}}m.value=A};mxEvent.addListener(e,"change",b);mxEvent.addListener(e,"keyup",b);b();return m};+var WrapperWindow=function(b,e,g,m,v,p,A){var G=b.createSidebarContainer();A(G);this.window=new mxWindow(e,G,g,m,v,p,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);mxClient.IS_SF&&(this.window.div.onselectstart=mxUtils.bind(this,function(S){null==S&&(S=window.event);return null!=S&&b.isSelectionAllowed(S)}))};+(function(){mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph;if(null!=A.container&&!A.transparentBackground){if(A.pageVisible){var G=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var S=A.container.firstChild;null!=S&&S.nodeType!=mxConstants.NODETYPE_ELEMENT;)S=S.nextSibling;null!=S&&(this.backgroundPageShape=this.createBackgroundPageShape(G),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,+this.backgroundPageShape.init(A.container),S.style.position="absolute",A.container.insertBefore(this.backgroundPageShape.node,S),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(F){A.dblClick(F)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){null!=A.tooltipHandler&&A.tooltipHandler.isHideOnHover()&&A.tooltipHandler.hide();A.isMouseDown&&!mxEvent.isConsumed(F)&&A.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(F))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=G,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};-mxGraphView.prototype.validateBackgroundStyles=function(A,G,T){var F=this.graph;A=null!=A?A:1;var P=mxUtils.getLightDarkColor(null==F.background||F.background==mxConstants.NONE?F.defaultPageBackgroundColor:F.background).cssText,Q=mxUtils.getLightDarkColor(F.defaultPageBorderColor).cssText,U=null!=P&&this.gridColor!=P.toLowerCase()?this.gridColor:"#ffffff",c="none",f="";if(F.isGridEnabled()||F.gridVisible){f=10;mxClient.IS_SVG?(c=unescape(encodeURIComponent(this.createSvgGrid(U,A))),c=window.btoa?-btoa(c):Base64.encode(c,!0),c="url(data:image/svg+xml;base64,"+c+")",f=F.gridSize*this.scale*this.gridSteps*A):c="url("+this.gridImage+")";var k=U=0;G=null!=G?G-this.translate.x*this.scale:0;T=null!=T?T-this.translate.y*this.scale:0;var B=F.gridSize*this.scale*this.gridSteps,z=G%B;B=T%B;null!=F.view.backgroundPageShape&&(k=this.getBackgroundPageBounds(),U=1+k.x,k=1+k.y);f=-Math.round(f-mxUtils.mod(this.translate.x*this.scale-U+G,f)+z*A)+"px "+-Math.round(f-mxUtils.mod(this.translate.y*this.scale--k+T,f)+B*A)+"px"}A=F.view.canvas;null!=A.ownerSVGElement&&(A=A.ownerSVGElement);U=!Editor.isDarkMode()&&F.enableDiagramBackground;null!=F.view.backgroundPageShape?(F.view.backgroundPageShape.node.style.backgroundPosition=f,F.view.backgroundPageShape.node.style.backgroundImage=c,F.view.backgroundPageShape.node.style.backgroundColor=P,F.view.backgroundPageShape.node.style.borderColor=Q,F.view.backgroundPageShape.node.style.colorScheme="none"==F.getAdaptiveColors()?"light":"",F.container.classList.add("geDiagramBackdrop"),-A.style.backgroundImage="none",A.style.backgroundColor="",F.container.style.backgroundColor=U?F.diagramBackgroundColor:""):(F.container.classList.remove("geDiagramBackdrop"),A.style.backgroundPosition=f,A.style.backgroundImage=c,!U||null!=F.background&&F.background!=mxConstants.NONE?A.style.backgroundColor=P:(A.style.backgroundColor=F.diagramBackgroundColor,F.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(A,G){for(var T=this.graph.gridSize*this.scale*(null!=G?G:-1);T<this.minGridSize;)T*=2;G=this.gridSteps*T;for(var F=[],P=1;P<this.gridSteps;P++){var Q=P*T;F.push("M 0 "+Q+" L "+G+" "+Q+" M "+Q+" 0 L "+Q+" "+G)}A=mxUtils.getLightDarkColor(A);T="color-scheme: light dark;";mxClient.IS_SF&&(T="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+T+'" width="'+G+'" height="'+G+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+G+'" height="'+G+'" patternUnits="userSpaceOnUse"><path d="'+-F.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" opacity="0.2" stroke-width="1"/><path d="M '+G+" 0 L 0 0 0 "+G+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){b.apply(this,arguments);if(null!=this.shiftPreview1){var T=this.view.canvas;null!=-T.ownerSVGElement&&(T=T.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+A,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+G,F))+"px";T.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(A,G,T){var F=this.view.scale,P=this.view.translate,Q=this.pageFormat,U=F*this.pageScale,c=this.view.getBackgroundPageBounds();G=c.width;T=c.height;var f=new mxRectangle(F*P.x,F*-P.y,Q.width*U,Q.height*U),k=(A=A&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.ceil(T/f.height)-1:0,B=A?Math.ceil(G/f.width)-1:0,z=c.x+G,C=c.y+T;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<B&&(this.verticalPageBreaks=[]);A=mxUtils.bind(this,function(H){if(null!=H){for(var K=H==this.horizontalPageBreaks?k:B,M=0;M<=K;M++){var O=H==this.horizontalPageBreaks?[new mxPoint(Math.round(c.x),Math.round(c.y+(M+1)*f.height)),new mxPoint(Math.round(z),-Math.round(c.y+(M+1)*f.height))]:[new mxPoint(Math.round(c.x+(M+1)*f.width),Math.round(c.y)),new mxPoint(Math.round(c.x+(M+1)*f.width),Math.round(C))];null!=H[M]?(H[M].points=O,H[M].redraw()):(O=new mxPolyline(O,this.pageBreakColor),O.dialect=this.dialect,O.isDashed=this.pageBreakDashed,O.pointerEvents=!1,O.init(this.view.backgroundPane),O.redraw(),H[M]=O)}for(M=K;M<H.length;M++)null!=H[M]&&H[M].destroy();H.splice(K,H.length-K)}});A(this.horizontalPageBreaks);A(this.verticalPageBreaks)};var e=mxGraphHandler.prototype.shouldRemoveCellsFromParent;-mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(A,G,T){for(var F=0;F<G.length;F++){if(this.graph.isTableCell(G[F])||this.graph.isTableRow(G[F]))return!1;if(this.graph.getModel().isVertex(G[F])){var P=this.graph.getCellGeometry(G[F]);if(null!=P&&P.relative)return!1}}return e.apply(this,arguments)};var g=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var A=g.apply(this,arguments);A.intersects=mxUtils.bind(this,function(G,T){return this.isConnecting()?-!0:mxCellMarker.prototype.intersects.apply(A,arguments)});return A};mxGraphView.prototype.createBackgroundPageShape=function(A){return new mxRectangleShape(A,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var A=this.getGraphBounds(),G=0<A.width?A.x/this.scale-this.translate.x:0,T=0<A.height?A.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,P=this.graph.pageScale,Q=F.width*P;F=F.height*P;P=Math.floor(Math.min(0,G)/Q);var U=Math.floor(Math.min(0,-T)/F);return new mxRectangle(this.scale*(this.translate.x+P*Q),this.scale*(this.translate.y+U*F),this.scale*(Math.ceil(Math.max(1,G+A.width/this.scale)/Q)-P)*Q,this.scale*(Math.ceil(Math.max(1,T+A.height/this.scale)/F)-U)*F)};var m=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){m.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=-A+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(A,G,T,F,P,Q){var U=v.apply(this,arguments);null==Q||Q||mxEvent.addListener(U,"mousedown",function(c){mxEvent.consume(c)});return U};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(A,G,T){var F=this.graph.model.getParent(A);if(G){var P=this.graph.model.isEdge(A)?null:this.graph.getCellGeometry(A);-P=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(A)&&(null!=P&&P.relative||!this.graph.isContainer(F)||this.graph.isPart(A))}else if(P=p.apply(this,arguments),this.graph.isTableCell(A)||this.graph.isTableRow(A))P=F,this.graph.isTable(P)||(P=this.graph.model.getParent(P)),P=!this.graph.selectionCellsHandler.isHandled(P)||this.graph.isCellSelected(P)&&this.graph.isToggleEvent(T.getEvent())||this.graph.isCellSelected(A)&&!this.graph.isToggleEvent(T.getEvent())||this.graph.isTableCell(A)&&-this.graph.isCellSelected(F);return P};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(A){A=A.getCell();for(var G=this.graph.getModel(),T=G.getParent(A),F=this.graph.view.getState(T),P=this.graph.isCellSelected(A);null!=F&&(G.isVertex(T)||G.isEdge(T));){var Q=this.graph.isCellSelected(T);P=P||Q;if(Q||!P&&(this.graph.isTableCell(A)||this.graph.isTableRow(A)))A=T;T=G.getParent(T)}return A}})();EditorUi=function(b,e,g){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=e||document.body;var m=this,v=this.editor.graph;v.lightbox=g;var p=v.getGraphBounds;v.getGraphBounds=function(){var S=p.apply(this,arguments),ca=this.backgroundImage;if(null!=ca&&null!=ca.width&&null!=ca.height){var ma=this.view.translate,la=this.view.scale;S=mxRectangle.fromRectangle(S);S.add(new mxRectangle((ma.x+ca.x)*la,(ma.y+ca.y)*la,ca.width*la,ca.height*la))}return S};v.useCssTransforms&&-(this.lazyZoomDelay=0);mxPopupMenu.prototype.submenuImage=Graph.createSvgImage(10,10,'<path d="M3,1L8,5L3,9Z" fill="light-dark(#3F3F3F, #C0C0C0)"/>').src;Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="light-dark(#3F3F3F, #C0C0C0)"/>').src;this.selectionStateListener=mxUtils.bind(this,function(S,ca){this.clearSelectionState()});-v.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);v.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);v.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){this.footerHeight=0;v.isEnabled=function(){return!1};v.panningHandler.isForcePanningEvent=function(S){for(var ca=-S.getSource();null!=ca&&ca!=v.container;){if("foreignObject"===ca.nodeName||"text"===ca.nodeName)return!1;ca=ca.parentNode}return!mxEvent.isPopupTrigger(S.getEvent())};var A=v.panningHandler.start;v.panningHandler.start=function(){A.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var G=!1,T=!1;this.setDefaultStyle=function(S){try{v.getModel().isEdge(S)?T=v.pasteEdgeStyle=!1:G=!1;var ca=v.getCellStyle(S,!1),ma=[],la=[],-Z;for(Z in ca)ma.push(ca[Z]),la.push(Z);v.getModel().isEdge(S)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",la,"values",ma,"cells",[S],"force",!0));v.getModel().isEdge(S)?T=v.pasteEdgeStyle=!0:G=!0}catch(da){this.handleError(da)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);G=T=v.pasteEdgeStyle=!1;this.fireEvent(new mxEventObject("styleChanged",-"keys",[],"values",[],"cells",[]))};v.addListener("cellsInserted",function(S,ca){v.pasteCellStyles(v.includeDescendants(ca.getProperty("cells")))});v.addListener("textInserted",function(S,ca){v.pasteCellStyles(ca.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var F=mxUtils.bind(this,function(S){null==S&&(S=window.event);return v.isEditing()||null!=S&&this.isSelectionAllowed(S)});this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=-F,this.menubarContainer.onmousedown=F,this.toolbarContainer.onselectstart=F,this.toolbarContainer.onmousedown=F,this.diagramContainer.onselectstart=F,this.diagramContainer.onmousedown=F,this.sidebarContainer.onselectstart=F,this.sidebarContainer.onmousedown=F,this.formatContainer.onselectstart=F,this.formatContainer.onmousedown=F,this.footerContainer.onselectstart=F,this.footerContainer.onmousedown=F,null!=this.tabContainer&&(this.tabContainer.onselectstart=F),mxClient.IS_IOS&&(e=function(){var S=-null;if(/iP(hone|od|ad)/.test(navigator.platform)){var ca=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{S=[parseInt(ca[1],10),parseInt(ca[2],10),parseInt(ca[3]||0,10)]}catch(ma){}}return S}(),null!=e&&16<=e[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect",-"none"),mxUtils.setPrefixedStyle(this.footerContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?(e=function(S){if(null!=S){var ca=mxEvent.getSource(S);if("A"==ca.nodeName)for(;null!=ca;){if("geHint"==ca.className)return!0;ca=ca.parentNode}}return F(S)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,+mxGraphView.prototype.validateBackgroundStyles=function(A,G,S){var F=this.graph;A=null!=A?A:1;var P=mxUtils.getLightDarkColor(null==F.background||F.background==mxConstants.NONE?F.defaultPageBackgroundColor:F.background).cssText,Q=mxUtils.getLightDarkColor(F.defaultPageBorderColor).cssText,T=null!=P&&this.gridColor!=P.toLowerCase()?this.gridColor:"#ffffff",c="none",f="";if(F.isGridEnabled()||F.gridVisible){f=10;mxClient.IS_SVG?(c=unescape(encodeURIComponent(this.createSvgGrid(T,A))),c=window.btoa?+btoa(c):Base64.encode(c,!0),c="url(data:image/svg+xml;base64,"+c+")",f=F.gridSize*this.scale*this.gridSteps*A):c="url("+this.gridImage+")";var k=T=0;G=null!=G?G-this.translate.x*this.scale:0;S=null!=S?S-this.translate.y*this.scale:0;var B=F.gridSize*this.scale*this.gridSteps,z=G%B;B=S%B;null!=F.view.backgroundPageShape&&(k=this.getBackgroundPageBounds(),T=1+k.x,k=1+k.y);f=-Math.round(f-mxUtils.mod(this.translate.x*this.scale-T+G,f)+z*A)+"px "+-Math.round(f-mxUtils.mod(this.translate.y*this.scale-+k+S,f)+B*A)+"px"}A=F.view.canvas;null!=A.ownerSVGElement&&(A=A.ownerSVGElement);T=!Editor.isDarkMode()&&F.enableDiagramBackground;null!=F.view.backgroundPageShape?(F.view.backgroundPageShape.node.style.backgroundPosition=f,F.view.backgroundPageShape.node.style.backgroundImage=c,F.view.backgroundPageShape.node.style.backgroundColor=P,F.view.backgroundPageShape.node.style.borderColor=Q,F.view.backgroundPageShape.node.style.colorScheme="none"==F.getAdaptiveColors()?"light":"",F.container.classList.add("geDiagramBackdrop"),+A.style.backgroundImage="none",A.style.backgroundColor="",F.container.style.backgroundColor=T?F.diagramBackgroundColor:""):(F.container.classList.remove("geDiagramBackdrop"),A.style.backgroundPosition=f,A.style.backgroundImage=c,!T||null!=F.background&&F.background!=mxConstants.NONE?A.style.backgroundColor=P:(A.style.backgroundColor=F.diagramBackgroundColor,F.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(A,G){for(var S=this.graph.gridSize*this.scale*(null!=G?G:+1);S<this.minGridSize;)S*=2;G=this.gridSteps*S;for(var F=[],P=1;P<this.gridSteps;P++){var Q=P*S;F.push("M 0 "+Q+" L "+G+" "+Q+" M "+Q+" 0 L "+Q+" "+G)}A=mxUtils.getLightDarkColor(A);S="color-scheme: light dark;";mxClient.IS_SF&&(S="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+S+'" width="'+G+'" height="'+G+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+G+'" height="'+G+'" patternUnits="userSpaceOnUse"><path d="'++F.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" opacity="0.2" stroke-width="1"/><path d="M '+G+" 0 L 0 0 0 "+G+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){b.apply(this,arguments);if(null!=this.shiftPreview1){var S=this.view.canvas;null!=+S.ownerSVGElement&&(S=S.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+A,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+G,F))+"px";S.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(A,G,S){var F=this.view.scale,P=this.view.translate,Q=this.pageFormat,T=F*this.pageScale,c=this.view.getBackgroundPageBounds();G=c.width;S=c.height;var f=new mxRectangle(F*P.x,F*+P.y,Q.width*T,Q.height*T),k=(A=A&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.ceil(S/f.height)-1:0,B=A?Math.ceil(G/f.width)-1:0,z=c.x+G,C=c.y+S;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<B&&(this.verticalPageBreaks=[]);A=mxUtils.bind(this,function(I){if(null!=I){for(var L=I==this.horizontalPageBreaks?k:B,J=0;J<=L;J++){var O=I==this.horizontalPageBreaks?[new mxPoint(Math.round(c.x),Math.round(c.y+(J+1)*f.height)),new mxPoint(Math.round(z),+Math.round(c.y+(J+1)*f.height))]:[new mxPoint(Math.round(c.x+(J+1)*f.width),Math.round(c.y)),new mxPoint(Math.round(c.x+(J+1)*f.width),Math.round(C))];null!=I[J]?(I[J].points=O,I[J].redraw()):(O=new mxPolyline(O,this.pageBreakColor),O.dialect=this.dialect,O.isDashed=this.pageBreakDashed,O.pointerEvents=!1,O.init(this.view.backgroundPane),O.redraw(),I[J]=O)}for(J=L;J<I.length;J++)null!=I[J]&&I[J].destroy();I.splice(L,I.length-L)}});A(this.horizontalPageBreaks);A(this.verticalPageBreaks)};var e=mxGraphHandler.prototype.shouldRemoveCellsFromParent;+mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(A,G,S){for(var F=0;F<G.length;F++){if(this.graph.isTableCell(G[F])||this.graph.isTableRow(G[F]))return!1;if(this.graph.getModel().isVertex(G[F])){var P=this.graph.getCellGeometry(G[F]);if(null!=P&&P.relative)return!1}}return e.apply(this,arguments)};var g=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var A=g.apply(this,arguments);A.intersects=mxUtils.bind(this,function(G,S){return this.isConnecting()?+!0:mxCellMarker.prototype.intersects.apply(A,arguments)});return A};mxGraphView.prototype.createBackgroundPageShape=function(A){return new mxRectangleShape(A,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var A=this.getGraphBounds(),G=0<A.width?A.x/this.scale-this.translate.x:0,S=0<A.height?A.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,P=this.graph.pageScale,Q=F.width*P;F=F.height*P;P=Math.floor(Math.min(0,G)/Q);var T=Math.floor(Math.min(0,+S)/F);return new mxRectangle(this.scale*(this.translate.x+P*Q),this.scale*(this.translate.y+T*F),this.scale*(Math.ceil(Math.max(1,G+A.width/this.scale)/Q)-P)*Q,this.scale*(Math.ceil(Math.max(1,S+A.height/this.scale)/F)-T)*F)};var m=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){m.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=+A+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(A,G,S,F,P,Q){var T=v.apply(this,arguments);null==Q||Q||mxEvent.addListener(T,"mousedown",function(c){mxEvent.consume(c)});return T};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(A,G,S){var F=this.graph.model.getParent(A);if(G){var P=this.graph.model.isEdge(A)?null:this.graph.getCellGeometry(A);+P=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(A)&&(null!=P&&P.relative||!this.graph.isContainer(F)||this.graph.isPart(A))}else if(P=p.apply(this,arguments),this.graph.isTableCell(A)||this.graph.isTableRow(A))P=F,this.graph.isTable(P)||(P=this.graph.model.getParent(P)),P=!this.graph.selectionCellsHandler.isHandled(P)||this.graph.isCellSelected(P)&&this.graph.isToggleEvent(S.getEvent())||this.graph.isCellSelected(A)&&!this.graph.isToggleEvent(S.getEvent())||this.graph.isTableCell(A)&&+this.graph.isCellSelected(F);return P};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(A){A=A.getCell();for(var G=this.graph.getModel(),S=G.getParent(A),F=this.graph.view.getState(S),P=this.graph.isCellSelected(A);null!=F&&(G.isVertex(S)||G.isEdge(S));){var Q=this.graph.isCellSelected(S);P=P||Q;if(Q||!P&&(this.graph.isTableCell(A)||this.graph.isTableRow(A)))A=S;S=G.getParent(S)}return A}})();EditorUi=function(b,e,g){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=e||document.body;var m=this,v=this.editor.graph;v.lightbox=g;var p=v.getGraphBounds;v.getGraphBounds=function(){var V=p.apply(this,arguments),ba=this.backgroundImage;if(null!=ba&&null!=ba.width&&null!=ba.height){var ma=this.view.translate,la=this.view.scale;V=mxRectangle.fromRectangle(V);V.add(new mxRectangle((ma.x+ba.x)*la,(ma.y+ba.y)*la,ba.width*la,ba.height*la))}return V};v.useCssTransforms&&+(this.lazyZoomDelay=0);mxPopupMenu.prototype.submenuImage=Graph.createSvgImage(10,10,'<path d="M3,1L8,5L3,9Z" fill="light-dark(#3F3F3F, #C0C0C0)"/>').src;Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="light-dark(#3F3F3F, #C0C0C0)"/>').src;this.selectionStateListener=mxUtils.bind(this,function(V,ba){this.clearSelectionState()});+v.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);v.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);v.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){this.footerHeight=0;v.isEnabled=function(){return!1};v.panningHandler.isForcePanningEvent=function(V){for(var ba=+V.getSource();null!=ba&&ba!=v.container;){if("foreignObject"===ba.nodeName||"text"===ba.nodeName)return!1;ba=ba.parentNode}return!mxEvent.isPopupTrigger(V.getEvent())};var A=v.panningHandler.start;v.panningHandler.start=function(){A.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var G=!1,S=!1;this.setDefaultStyle=function(V){try{v.getModel().isEdge(V)?S=v.pasteEdgeStyle=!1:G=!1;var ba=v.getCellStyle(V,!1),ma=[],la=[],+Z;for(Z in ba)ma.push(ba[Z]),la.push(Z);v.getModel().isEdge(V)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",la,"values",ma,"cells",[V],"force",!0));v.getModel().isEdge(V)?S=v.pasteEdgeStyle=!0:G=!0}catch(ea){this.handleError(ea)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);G=S=v.pasteEdgeStyle=!1;this.fireEvent(new mxEventObject("styleChanged",+"keys",[],"values",[],"cells",[]))};v.addListener("cellsInserted",function(V,ba){v.pasteCellStyles(v.includeDescendants(ba.getProperty("cells")))});v.addListener("textInserted",function(V,ba){v.pasteCellStyles(ba.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var F=mxUtils.bind(this,function(V){null==V&&(V=window.event);return v.isEditing()||null!=V&&this.isSelectionAllowed(V)});this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=+F,this.menubarContainer.onmousedown=F,this.toolbarContainer.onselectstart=F,this.toolbarContainer.onmousedown=F,this.diagramContainer.onselectstart=F,this.diagramContainer.onmousedown=F,this.sidebarContainer.onselectstart=F,this.sidebarContainer.onmousedown=F,this.formatContainer.onselectstart=F,this.formatContainer.onmousedown=F,this.footerContainer.onselectstart=F,this.footerContainer.onmousedown=F,null!=this.tabContainer&&(this.tabContainer.onselectstart=F),mxClient.IS_IOS&&(e=function(){var V=+null;if(/iP(hone|od|ad)/.test(navigator.platform)){var ba=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{V=[parseInt(ba[1],10),parseInt(ba[2],10),parseInt(ba[3]||0,10)]}catch(ma){}}return V}(),null!=e&&16<=e[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect",+"none"),mxUtils.setPrefixedStyle(this.footerContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?(e=function(V){if(null!=V){var ba=mxEvent.getSource(V);if("A"==ba.nodeName)for(;null!=ba;){if("geHint"==ba.className)return!0;ba=ba.parentNode}}return F(V)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",e):this.diagramContainer.oncontextmenu=e):v.panningHandler.usePopupTrigger=!1;v.init(this.diagramContainer);mxClient.IS_SVG&&null!=v.view.getDrawPane()&&(e=v.view.getDrawPane().ownerSVGElement,null!=e&&(e.style.position="absolute"));this.hoverIcons=this.createHoverIcons();if(null!=v.graphHandler){var P=v.graphHandler.start;v.graphHandler.start=function(){null!=m.hoverIcons&&m.hoverIcons.reset();P.apply(this,arguments)}}mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,-function(S){var ca=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(S)-ca.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(S)-ca.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var Q=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(S,ca){return m.isSpaceDown()||Q.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(S){16==S.which?-this.shiftDown=!0:32!=S.which||v.isEditing()?mxEvent.isConsumed(S)||27!=S.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),v.container.style.cursor="move",v.isEditing()||mxEvent.getSource(S)!=v.container||mxEvent.consume(S))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(S){v.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var U=v.panningHandler.isForcePanningEvent;-v.panningHandler.isForcePanningEvent=function(S){return U.apply(this,arguments)||m.isSpaceDown()||mxEvent.isMouseEvent(S.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(S.getEvent()))&&(!mxEvent.isControlDown(S.getEvent())&&mxEvent.isRightMouseButton(S.getEvent())||mxEvent.isMiddleMouseButton(S.getEvent()))};var c=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(S){return c.apply(this,arguments)||13==S.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(S)||mxClient.IS_MAC&&-mxEvent.isMetaDown(S)||mxClient.IS_SF&&mxEvent.isShiftDown(S))};var f=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return m.isSpaceDown()||f.apply(this,arguments)};var k=!1,B=null,z=null,C=null,H=mxUtils.bind(this,function(){if(null!=this.toolbar&&k!=v.cellEditor.isContentEditing()){for(var S=this.toolbar.container.firstChild,ca=[];null!=S;){var ma=S.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,S)&&(S.parentNode.removeChild(S),ca.push(S));S=ma}S=this.toolbar.fontMenu;ma=this.toolbar.sizeMenu;-if(null==C)this.toolbar.createTextToolbar();else{for(var la=0;la<C.length;la++)this.toolbar.container.appendChild(C[la]);this.toolbar.fontMenu=B;this.toolbar.sizeMenu=z}k=v.cellEditor.isContentEditing();B=S;z=ma;C=ca}}),K=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){K.apply(this,arguments);H();if(v.cellEditor.isContentEditing()){var S=!1,ca=function(){S||(S=!0,window.setTimeout(function(){var ma=v.getSelectedEditingElement();null!=ma&&(ma=mxUtils.getCurrentStyle(ma),null!=ma&&null!=-m.toolbar&&(m.toolbar.setFontName(mxUtils.getCssFontFamily(ma.fontFamily)),m.toolbar.setFontSize(parseInt(ma.fontSize))));S=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",ca);mxEvent.addListener(v.cellEditor.textarea,"touchend",ca);mxEvent.addListener(v.cellEditor.textarea,"mouseup",ca);mxEvent.addListener(v.cellEditor.textarea,"keyup",ca);ca()}};var M=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(S,ca){try{M.apply(this,arguments),H()}catch(ma){m.handleError(ma)}};v.container.setAttribute("tabindex",-"0");v.container.style.cursor="default";if(window.self===window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(S){}var O=v.fireMouseEvent;v.fireMouseEvent=function(S,ca,ma){try{S==mxEvent.MOUSE_DOWN&&this.container.focus(),O.apply(this,arguments)}catch(la){m.handleError(la)}};var ea=v.foldCells;v.foldCells=function(S,ca,ma,la,Z){try{ea.apply(this,arguments)}catch(da){m.handleError(da)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,-function(S,ca,ma){this.menus.createPopupMenu(S,ca,ma)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(S){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(S,ca){var ma=[ca.getProperty("cell")];ca.getProperty("terminalInserted")&&(ma.push(ca.getProperty("terminal")),window.setTimeout(function(){null!=m.hoverIcons&&m.hoverIcons.update(v.view.getState(ma[ma.length--1]))},0));v.pasteCellStyles(ma)});this.addListener("styleChanged",mxUtils.bind(this,function(S,ca){S=ca.getProperty("force");(this.updateDefaultStyle||S)&&v.copyCellStyles(ca.getProperty("cells"),ca.getProperty("keys"),ca.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,G,T);null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&+function(V){var ba=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(V)-ba.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(V)-ba.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var Q=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(V,ba){return m.isSpaceDown()||Q.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(V){16==V.which?+this.shiftDown=!0:32!=V.which||v.isEditing()?mxEvent.isConsumed(V)||27!=V.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),v.container.style.cursor="move",v.isEditing()||mxEvent.getSource(V)!=v.container||mxEvent.consume(V))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(V){v.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var T=v.panningHandler.isForcePanningEvent;+v.panningHandler.isForcePanningEvent=function(V){return T.apply(this,arguments)||m.isSpaceDown()||mxEvent.isMouseEvent(V.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(V.getEvent()))&&(!mxEvent.isControlDown(V.getEvent())&&mxEvent.isRightMouseButton(V.getEvent())||mxEvent.isMiddleMouseButton(V.getEvent()))};var c=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(V){return c.apply(this,arguments)||13==V.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(V)||mxClient.IS_MAC&&+mxEvent.isMetaDown(V)||mxClient.IS_SF&&mxEvent.isShiftDown(V))};var f=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return m.isSpaceDown()||f.apply(this,arguments)};var k=!1,B=null,z=null,C=null,I=mxUtils.bind(this,function(){if(null!=this.toolbar&&k!=v.cellEditor.isContentEditing()){for(var V=this.toolbar.container.firstChild,ba=[];null!=V;){var ma=V.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,V)&&(V.parentNode.removeChild(V),ba.push(V));V=ma}V=this.toolbar.fontMenu;ma=this.toolbar.sizeMenu;+if(null==C)this.toolbar.createTextToolbar();else{for(var la=0;la<C.length;la++)this.toolbar.container.appendChild(C[la]);this.toolbar.fontMenu=B;this.toolbar.sizeMenu=z}k=v.cellEditor.isContentEditing();B=V;z=ma;C=ba}}),L=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){L.apply(this,arguments);I();if(v.cellEditor.isContentEditing()){var V=!1,ba=function(){V||(V=!0,window.setTimeout(function(){var ma=v.getSelectedEditingElement();null!=ma&&(ma=mxUtils.getCurrentStyle(ma),null!=ma&&null!=+m.toolbar&&(m.toolbar.setFontName(mxUtils.getCssFontFamily(ma.fontFamily)),m.toolbar.setFontSize(parseInt(ma.fontSize))));V=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",ba);mxEvent.addListener(v.cellEditor.textarea,"touchend",ba);mxEvent.addListener(v.cellEditor.textarea,"mouseup",ba);mxEvent.addListener(v.cellEditor.textarea,"keyup",ba);ba()}};var J=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(V,ba){try{J.apply(this,arguments),I()}catch(ma){m.handleError(ma)}};v.container.setAttribute("tabindex",+"0");v.container.style.cursor="default";if(window.self===window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(V){}var O=v.fireMouseEvent;v.fireMouseEvent=function(V,ba,ma){try{V==mxEvent.MOUSE_DOWN&&this.container.focus(),O.apply(this,arguments)}catch(la){m.handleError(la)}};var da=v.foldCells;v.foldCells=function(V,ba,ma,la,Z){try{da.apply(this,arguments)}catch(ea){m.handleError(ea)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,+function(V,ba,ma){this.menus.createPopupMenu(V,ba,ma)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(V){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(V,ba){var ma=[ba.getProperty("cell")];ba.getProperty("terminalInserted")&&(ma.push(ba.getProperty("terminal")),window.setTimeout(function(){null!=m.hoverIcons&&m.hoverIcons.update(v.view.getState(ma[ma.length-+1]))},0));v.pasteCellStyles(ma)});this.addListener("styleChanged",mxUtils.bind(this,function(V,ba){V=ba.getProperty("force");(this.updateDefaultStyle||V)&&v.copyCellStyles(ba.getProperty("cells"),ba.getProperty("keys"),ba.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,G,S);null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==v.currentEdgeStyle.edgeStyle&&"1"==v.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==v.currentEdgeStyle.edgeStyle||"none"==v.currentEdgeStyle.edgeStyle||null==v.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==v.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==v.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==v.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==v.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==v.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==v.currentEdgeStyle.shape?"geSprite geSprite-linkedge":"flexArrow"==v.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==v.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":-"geSprite geSprite-connection"))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var S=v.currentVertexStyle.fontFamily||"Helvetica",ca=String(v.currentVertexStyle.fontSize||"12"),ma=v.getView().getState(v.getSelectionCell());null!=ma&&(S=ma.style[mxConstants.STYLE_FONTFAMILY]||S,ca=ma.style[mxConstants.STYLE_FONTSIZE]||ca,10<S.length&&(S=S.substring(0,8)+"..."));this.toolbar.setFontName(S);this.toolbar.setFontSize(ca)}),v.getSelectionModel().addListener(mxEvent.CHANGE,b),v.getModel().addListener(mxEvent.CHANGE,-b));v.addListener(mxEvent.CELLS_ADDED,function(S,ca){S=ca.getProperty("cells");ca=ca.getProperty("parent");null!=ca&&v.getModel().isLayer(ca)&&!v.isCellVisible(ca)&&null!=S&&0<S.length&&v.getModel().setVisible(ca,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&!v.isSelectionEmpty()){var S=v.getLayerForCells(v.getSelectionCells());null!=S&&v.setDefaultParent(S)}});this.gestureHandler=mxUtils.bind(this,function(S){null!=this.currentMenu&&mxEvent.getSource(S)!=+"geSprite geSprite-connection"))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var V=v.currentVertexStyle.fontFamily||"Helvetica",ba=String(v.currentVertexStyle.fontSize||"12"),ma=v.getView().getState(v.getSelectionCell());null!=ma&&(V=ma.style[mxConstants.STYLE_FONTFAMILY]||V,ba=ma.style[mxConstants.STYLE_FONTSIZE]||ba,10<V.length&&(V=V.substring(0,8)+"..."));this.toolbar.setFontName(V);this.toolbar.setFontSize(ba)}),v.getSelectionModel().addListener(mxEvent.CHANGE,b),v.getModel().addListener(mxEvent.CHANGE,+b));v.addListener(mxEvent.CELLS_ADDED,function(V,ba){V=ba.getProperty("cells");ba=ba.getProperty("parent");null!=ba&&v.getModel().isLayer(ba)&&!v.isCellVisible(ba)&&null!=V&&0<V.length&&v.getModel().setVisible(ba,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&!v.isSelectionEmpty()){var V=v.getLayerForCells(v.getSelectionCells());null!=V&&v.setDefaultParent(V)}});this.gestureHandler=mxUtils.bind(this,function(V){null!=this.currentMenu&&mxEvent.getSource(V)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var fa=null;this.resizeHandler=mxUtils.bind(this,function(){null!=fa&&window.clearTimeout(fa);fa=window.setTimeout(mxUtils.bind(this,function(){fa=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));v.addListener("gridSizeChanged",mxUtils.bind(this,function(){v.isGridEnabled()&&v.view.validateBackground()}));this.editor.resetGraph()}this.init();v.standalone||this.open()};EditorUi.compactUi=!0;-EditorUi.parsePng=function(b,e,g){function m(G,T){var F=p;p+=T;return G.substring(F,p)}function v(G){G=m(G,4);return G.charCodeAt(3)+(G.charCodeAt(2)<<8)+(G.charCodeAt(1)<<16)+(G.charCodeAt(0)<<24)}var p=0;if(m(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(m(b,4),"IHDR"!=m(b,4))null!=g&&g();else{m(b,17);do{g=v(b);var A=m(b,4);if(null!=e&&e(p-8,A,g))break;value=m(b,g);m(b,4);if("IEND"==A)break}while(g)}};mxUtils.extend(EditorUi,mxEventSource);+EditorUi.parsePng=function(b,e,g){function m(G,S){var F=p;p+=S;return G.substring(F,p)}function v(G){G=m(G,4);return G.charCodeAt(3)+(G.charCodeAt(2)<<8)+(G.charCodeAt(1)<<16)+(G.charCodeAt(0)<<24)}var p=0;if(m(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(m(b,4),"IHDR"!=m(b,4))null!=g&&g();else{m(b,17);do{g=v(b);var A=m(b,4);if(null!=e&&e(p-8,A,g))break;value=m(b,g);m(b,4);if("IEND"==A)break}while(g)}};mxUtils.extend(EditorUi,mxEventSource);EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=38;EditorUi.prototype.footerHeight=28;EditorUi.prototype.defaultSidebarWidth=Math.min(screen.width/2,"large"!=urlParams["sidebar-entries"]?212:240);EditorUi.prototype.hsplitPosition=screen.width<=Editor.smallScreenWidth?0:EditorUi.prototype.defaultSidebarWidth;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!1;EditorUi.prototype.spaceDown=!1;EditorUi.prototype.shiftDown=!1;EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(b.container,"scroll",mxUtils.bind(this,function(){b.tooltipHandler.hide();null!=b.connectionHandler&&null!=b.connectionHandler.constraintHandler&&b.connectionHandler.constraintHandler.reset()}));b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){b.tooltipHandler.hide();var m=b.getRubberband();null!=m&&m.cancel()}));mxEvent.addListener(b.container,@@ -2043,30 +2043,30 @@ EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"arguments);g.updateActionStates()};b.showLinkDialog=mxUtils.bind(g,g.showLinkDialog);b.editLink=g.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,e=b.getSelectionCells(),g=this.initSelectionState(),m=!0,v=0;v<e.length;v++){var p=b.getCurrentCellStyle(e[v]);"0"!=mxUtils.getValue(p,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(g,e[v],e,m),m=!1)}this.updateSelectionStateForTableCells(g);return g};EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,html:!0,rounded:!0,autoSize:!1,image:!1,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,unlocked:this.editor.graph.isEnabled(),connections:!1}};-EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var e=mxUtils.sortCells(b.cells),g=this.editor.graph.model,m=g.getParent(e[0]),v=g.getParent(m);if(null!=m&&null!=v){for(var p=m.getIndex(e[0]),A=v.getIndex(m),G=null,T=1,F=1,P=0,Q=A<v.getChildCount()-1?g.getChildAt(g.getChildAt(v,A+1),p):null;P<e.length-1;){var U=e[++P];null==Q||Q!=U||null!=G&&T!=G||(G=T,T=0,F++,m=g.getParent(Q),Q=A+F<v.getChildCount()?g.getChildAt(g.getChildAt(v,A+F),p):null);var c=this.editor.graph.view.getState(U);-if(U==g.getChildAt(m,p+T)&&null!=c&&1==mxUtils.getValue(c.style,"colspan",1)&&1==mxUtils.getValue(c.style,"rowspan",1))T++;else break}P==F*T-1&&(b.mergeCell=e[0],b.colspan=T,b.rowspan=F)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)};+EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var e=mxUtils.sortCells(b.cells),g=this.editor.graph.model,m=g.getParent(e[0]),v=g.getParent(m);if(null!=m&&null!=v){for(var p=m.getIndex(e[0]),A=v.getIndex(m),G=null,S=1,F=1,P=0,Q=A<v.getChildCount()-1?g.getChildAt(g.getChildAt(v,A+1),p):null;P<e.length-1;){var T=e[++P];null==Q||Q!=T||null!=G&&S!=G||(G=S,S=0,F++,m=g.getParent(Q),Q=A+F<v.getChildCount()?g.getChildAt(g.getChildAt(v,A+F),p):null);var c=this.editor.graph.view.getState(T);+if(T==g.getChildAt(m,p+S)&&null!=c&&1==mxUtils.getValue(c.style,"colspan",1)&&1==mxUtils.getValue(c.style,"rowspan",1))S++;else break}P==F*S-1&&(b.mergeCell=e[0],b.colspan=S,b.rowspan=F)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)};EditorUi.prototype.createTimeout=function(b,e,g){var m=!0,v=null,p=mxUtils.bind(this,function(G){v.clear()&&(m=!1,G=null!=G?G:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,e,g)})},null!=g?g(G):this.handleError(G))}),A=window.setTimeout(p,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(A);return m},isAlive:function(){return m}};null!=e&&this.tryAndHandle(mxUtils.bind(this,function(){e(v)}),p);return v};EditorUi.prototype.tryAndHandle=function(b,e){try{b()}catch(g){null!=e?e(g):this.handleError(g)}};-EditorUi.prototype.removeUserDefinedDarkColors=function(b,e,g){var m=this.editor.graph;b=null!=b?b:m.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");m.model.beginUpdate();try{for(var A=0;A<b.length;A++)if(m.model.isEdge(b[A])||m.model.isVertex(b[A])){var G=m.getCellStyle(b[A],!1);if(null!=G)for(var T=0;T<v.length;T++)try{var F=G[v[T]];if(mxUtils.isLightDarkColor(F)){var P=mxUtils.getLightDarkColor(F);m.setCellStyles(v[T],P.light,[b[A]])}}catch(U){}e&&m.isHtmlLabel(b[A])&&-"0"!=mxUtils.getValue(G,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(m.getLabel(b[A])),Graph.addLightDarkColors(p,null,null,function(U,c,f){return mxUtils.isLightDarkColor(f)?(f=mxUtils.getLightDarkColor(f),U.style.setProperty(c,f.light),!0):!1})&&m.cellLabelChanged(b[A],p.innerHTML))}if(g&&mxUtils.isLightDarkColor(m.background)){P=mxUtils.getLightDarkColor(m.background);var Q=new ChangePageSetup(this,P.light);Q.ignoreImage=!0;m.model.execute(Q)}}finally{m.model.endUpdate()}return b};+EditorUi.prototype.removeUserDefinedDarkColors=function(b,e,g){var m=this.editor.graph;b=null!=b?b:m.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");m.model.beginUpdate();try{for(var A=0;A<b.length;A++)if(m.model.isEdge(b[A])||m.model.isVertex(b[A])){var G=m.getCellStyle(b[A],!1);if(null!=G)for(var S=0;S<v.length;S++)try{var F=G[v[S]];if(mxUtils.isLightDarkColor(F)){var P=mxUtils.getLightDarkColor(F);m.setCellStyles(v[S],P.light,[b[A]])}}catch(T){}e&&m.isHtmlLabel(b[A])&&+"0"!=mxUtils.getValue(G,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(m.getLabel(b[A])),Graph.addLightDarkColors(p,null,null,function(T,c,f){return mxUtils.isLightDarkColor(f)?(f=mxUtils.getLightDarkColor(f),T.style.setProperty(c,f.light),!0):!1})&&m.cellLabelChanged(b[A],p.innerHTML))}if(g&&mxUtils.isLightDarkColor(m.background)){P=mxUtils.getLightDarkColor(m.background);var Q=new ChangePageSetup(this,P.light);Q.ignoreImage=!0;m.model.execute(Q)}}finally{m.model.endUpdate()}return b};EditorUi.prototype.updateSelectionStateForCell=function(b,e,g,m){g=this.editor.graph;b.cells.push(e);if(g.getModel().isVertex(e)){b.connections=0<g.model.getEdgeCount(e);b.unlocked=b.unlocked&&!g.isCellLocked(e);b.resizable=b.resizable&&g.isCellResizable(e);b.rotatable=b.rotatable&&g.isCellRotatable(e);b.movable=b.movable&&g.isCellMovable(e)&&!g.isTableRow(e)&&!g.isTableCell(e);b.swimlane=b.swimlane||g.isSwimlane(e);b.table=b.table||g.isTable(e);b.cell=b.cell||g.isTableCell(e);b.row=b.row||g.isTableRow(e);b.vertices.push(e);var v=g.getCellGeometry(e);if(null!=v&&(0<v.width?null==b.width?b.width=v.width:b.width!=v.width&&(b.width=""):b.containsLabel=!0,0<v.height?null==b.height?b.height=v.height:b.height!=v.height&&(b.height=""):b.containsLabel=!0,!v.relative||null!=v.offset)){var p=v.relative?v.offset.x:v.x;v=v.relative?v.offset.y:v.y;null==b.x?b.x=p:b.x!=p&&(b.x="");null==b.y?b.y=v:b.y!=v&&(b.y="")}}else g.getModel().isEdge(e)&&(b.edges.push(e),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=!1);p=g.view.getState(e);null!=p&&(b.html=b.html&&g.isHtmlLabel(e),b.autoSize=b.autoSize||g.isAutoSizeState(p),b.glass=b.glass&&g.isGlassState(p),b.rounded=b.rounded&&g.isRoundedState(p),b.lineJumps=b.lineJumps&&g.isLineJumpState(p),b.image=b.image||g.isImageState(p),b.shadow=b.shadow&&g.isShadowState(p),b.fill=b.fill&&g.isFillState(p),b.gradient=b.fill&&g.isGradientState(p),b.stroke=b.stroke&&g.isStrokeState(p),e=mxUtils.getValue(p.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||"image"==e,g.mergeStyle(p.style,b.style,m))};-EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,e=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(T,F){"mouseDown"==F.getProperty("eventName")&&e.hideShapePicker()}));var g=mxUtils.bind(this,function(){e.hideShapePicker(!0)});b.addListener("wheel",g);b.addListener(mxEvent.ESCAPE,g);b.view.addListener(mxEvent.SCALE,g);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,g);b.getSelectionModel().addListener(mxEvent.CHANGE,g);var m=b.popupMenuHandler.isMenuShowing;-b.popupMenuHandler.isMenuShowing=function(){return m.apply(this,arguments)||null!=e.shapePicker||null!=e.currentMenu};var v=b.dblClick;b.dblClick=function(T,F){if(this.isEnabled())if(null!=F||null==e.sidebar||mxEvent.isShiftDown(T)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var P=mxUtils.convertPoint(this.container,mxEvent.getClientX(T),mxEvent.getClientY(T));mxEvent.consume(T);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(P.x,P.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",-g);var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){e.hideShapePicker();p.apply(this,arguments)};var A=this.hoverIcons.execute;this.hoverIcons.execute=function(T,F,P){var Q=P.getEvent();this.graph.isCloneEvent(Q)||mxEvent.isShiftDown(Q)?A.apply(this,arguments):this.graph.connectVertex(T.cell,F,this.graph.defaultEdgeLength,Q,null,null,mxUtils.bind(this,function(U,c,f){var k=b.getCompositeParent(T.cell);U=b.getCellGeometry(k);for(P.consume();null!=k&&b.model.isVertex(k)&&null!=U&&U.relative;)cell=-k,k=b.model.getParent(cell),U=b.getCellGeometry(k);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(P.getGraphX(),P.getGraphY(),k,mxUtils.bind(this,function(B){f(B);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(B))}),F)}),30)}),mxUtils.bind(this,function(U){this.graph.selectCellsForConnectVertex(U,Q,this)}))};var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(T,F){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var P=-F.getProperty("arrow"),Q=F.getProperty("direction"),U=F.getProperty("event");P=P.getBoundingClientRect();var c=mxUtils.getOffset(b.container),f=b.container.scrollLeft+P.x-c.x;c=b.container.scrollTop+P.y-c.y;var k=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),B=e.showShapePicker(f,c,k,mxUtils.bind(this,function(z){null!=z&&b.connectVertex(k,Q,b.defaultEdgeLength,U,!0,!1,function(C,H,K){K(z);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(z))},-function(C){b.selectCellsForConnectVertex(C)},U,this.hoverIcons)}),Q,!0);null!=B&&(this.centerShapePicker(B,P,f,c,Q),mxUtils.setOpacity(B,30),mxEvent.addListener(B,"mouseenter",function(){mxUtils.setOpacity(B,100)}),mxEvent.addListener(B,"mouseleave",function(){e.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(T,F){null!=G&&window.clearTimeout(G)}))}};+EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,e=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(S,F){"mouseDown"==F.getProperty("eventName")&&e.hideShapePicker()}));var g=mxUtils.bind(this,function(){e.hideShapePicker(!0)});b.addListener("wheel",g);b.addListener(mxEvent.ESCAPE,g);b.view.addListener(mxEvent.SCALE,g);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,g);b.getSelectionModel().addListener(mxEvent.CHANGE,g);var m=b.popupMenuHandler.isMenuShowing;+b.popupMenuHandler.isMenuShowing=function(){return m.apply(this,arguments)||null!=e.shapePicker||null!=e.currentMenu};var v=b.dblClick;b.dblClick=function(S,F){if(this.isEnabled())if(null!=F||null==e.sidebar||mxEvent.isShiftDown(S)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var P=mxUtils.convertPoint(this.container,mxEvent.getClientX(S),mxEvent.getClientY(S));mxEvent.consume(S);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(P.x,P.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",+g);var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){e.hideShapePicker();p.apply(this,arguments)};var A=this.hoverIcons.execute;this.hoverIcons.execute=function(S,F,P){var Q=P.getEvent();this.graph.isCloneEvent(Q)||mxEvent.isShiftDown(Q)?A.apply(this,arguments):this.graph.connectVertex(S.cell,F,this.graph.defaultEdgeLength,Q,null,null,mxUtils.bind(this,function(T,c,f){var k=b.getCompositeParent(S.cell);T=b.getCellGeometry(k);for(P.consume();null!=k&&b.model.isVertex(k)&&null!=T&&T.relative;)cell=+k,k=b.model.getParent(cell),T=b.getCellGeometry(k);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(P.getGraphX(),P.getGraphY(),k,mxUtils.bind(this,function(B){f(B);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(B))}),F)}),30)}),mxUtils.bind(this,function(T){this.graph.selectCellsForConnectVertex(T,Q,this)}))};var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(S,F){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var P=+F.getProperty("arrow"),Q=F.getProperty("direction"),T=F.getProperty("event");P=P.getBoundingClientRect();var c=mxUtils.getOffset(b.container),f=b.container.scrollLeft+P.x-c.x;c=b.container.scrollTop+P.y-c.y;var k=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),B=e.showShapePicker(f,c,k,mxUtils.bind(this,function(z){null!=z&&b.connectVertex(k,Q,b.defaultEdgeLength,T,!0,!1,function(C,I,L){L(z);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(z))},+function(C){b.selectCellsForConnectVertex(C)},T,this.hoverIcons)}),Q,!0);null!=B&&(this.centerShapePicker(B,P,f,c,Q),mxUtils.setOpacity(B,30),mxEvent.addListener(B,"mouseenter",function(){mxUtils.setOpacity(B,100)}),mxEvent.addListener(B,"mouseleave",function(){e.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(S,F){null!=G&&window.clearTimeout(G)}))}};EditorUi.prototype.centerShapePicker=function(b,e,g,m,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var p=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(g-=p.width/2-10,m-=p.height+6):v==mxConstants.DIRECTION_SOUTH?(g-=p.width/2-10,m+=e.height+6):v==mxConstants.DIRECTION_WEST?(g-=p.width+6,m-=p.height/2-10):v==mxConstants.DIRECTION_EAST&&(g+=e.width+6,m-=p.height/2-10);b.style.left=g+"px";b.style.top=m+"px"};-EditorUi.prototype.showShapePicker=function(b,e,g,m,v,p,A,G,T){var F=null;this.editor.graph.freehand.isDrawing()||(G=G||null==g,F=this.createShapePicker(b,e,g,m,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(g,p,G),p,A,G,T),null!=F&&(null==this.hoverIcons||p||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=m,this.shapePicker=F));return F};-EditorUi.prototype.createShapePicker=function(b,e,g,m,v,p,A,G,T,F,P){P=null!=P?P:!0;var Q=this.editor.graph,U=null;T=null!=T?T:function(k){k=k[0];var B=0,z=0,C=k.geometry;null!=C&&(Q.model.isEdge(k)&&(k=C.getTerminalPoint(!1),C=new mxRectangle(0,0,k.x,k.y)),B=C.width/2,z=C.height/2);return new mxPoint(Q.snap(Math.round(b/Q.view.scale)-Q.view.translate.x-B),Q.snap(Math.round(e/Q.view.scale)-Q.view.translate.y-z))};if(null!=A&&0<A.length){var c=this;Q=this.editor.graph;U=document.createElement("div");-v=Q.view.getState(g);var f=null==g||null!=v&&Q.isTransparentState(v)?null:Q.copyStyle(g);v=6>A.length?35*A.length:140;U.className="geToolbarContainer geSidebarContainer geShapePicker";U.setAttribute("title",mxResources.get("sidebarTooltip"));U.style.left=Math.round(b)+"px";U.style.top=Math.round(e)+"px";U.style.width=v+"px";mxClient.IS_POINTER&&(U.style.touchAction="none");G||mxUtils.setPrefixedStyle(U.style,"transform","translate(-22px,-22px)");Q.container.appendChild(U);v=mxUtils.bind(this,function(k){var B=-document.createElement("a");B.className="geItem";B.style.display="inline-block";B.style.position="relative";B.style.overflow="hidden";B.style.cursor="pointer";B.style.width="30px";B.style.height="30px";B.style.padding="1px";U.appendChild(B);null!=f&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(f,[k]):this.sidebar.graph.pasteCellStyles([k],Q.currentVertexStyle,Q.currentEdgeStyle);var z=k.geometry;Q.model.isEdge(k)&&(z=z.getTerminalPoint(!1),z=new mxRectangle(0,0,z.x,z.y));null!=z&&B.appendChild(this.sidebar.createVertexTemplateFromCells([k],-z.width,z.height,"",!0,!1,null,!1,mxUtils.bind(this,function(C){if(!mxEvent.isShiftDown(C)||null==g&&Q.isSelectionEmpty()){var H=Q.cloneCell(k);if(null!=m)m(H);else{var K=T([H]);Q.model.isEdge(H)?H.geometry.translate(K.x,K.y):(H.geometry.x=K.x,H.geometry.y=K.y);Q.model.beginUpdate();try{Q.addCell(H),Q.model.isVertex(H)&&Q.isAutoSizeCell(H)&&Q.updateCellSize(H)}finally{Q.model.endUpdate()}Q.setSelectionCell(H);Q.scrollCellToVisible(H);P&&Q.startEditing(H);null!=c.hoverIcons&&c.hoverIcons.update(Q.view.getState(H))}}else H=-Q.getEditableCells(null!=g?[g]:Q.getSelectionCells()),Q.updateShapes(k,H);null!=p&&p(C);mxEvent.consume(C)}),25,25,null,null,g))});for(F=0;F<(G?Math.min(A.length,4):A.length);F++)v(A[F]);A=U.offsetTop+U.clientHeight-(Q.container.scrollTop+Q.container.offsetHeight);0<A&&(U.style.top=Math.max(Q.container.scrollTop+22,e-A)+"px");A=U.offsetLeft+U.clientWidth-(Q.container.scrollLeft+Q.container.offsetWidth);0<A&&(U.style.left=Math.max(Q.container.scrollLeft+22,b-A)+"px")}return U};-EditorUi.prototype.getCellsForShapePicker=function(b,e,g){var m=this.editor.graph,v=mxUtils.bind(this,function(p,A,G,T){return m.createVertex(null,null,T||"",0,0,A||120,G||60,p,!1)});e=mxUtils.bind(this,function(p,A,G){p=new mxCell(G||"",new mxGeometry(0,0,m.defaultEdgeLength+20,0),p);p.geometry.setTerminalPoint(new mxPoint(0,0),!0);p.geometry.setTerminalPoint(new mxPoint(p.geometry.width,null!=A?A:0),!1);p.geometry.points=null!=A?[new mxPoint(p.geometry.width/2,A)]:[];p.geometry.relative=!0;p.edge=+EditorUi.prototype.showShapePicker=function(b,e,g,m,v,p,A,G,S){var F=null;this.editor.graph.freehand.isDrawing()||(G=G||null==g,F=this.createShapePicker(b,e,g,m,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(g,p,G),p,A,G,S),null!=F&&(null==this.hoverIcons||p||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=m,this.shapePicker=F));return F};+EditorUi.prototype.createShapePicker=function(b,e,g,m,v,p,A,G,S,F,P){P=null!=P?P:!0;var Q=this.editor.graph,T=null;S=null!=S?S:function(k){k=k[0];var B=0,z=0,C=k.geometry;null!=C&&(Q.model.isEdge(k)&&(k=C.getTerminalPoint(!1),C=new mxRectangle(0,0,k.x,k.y)),B=C.width/2,z=C.height/2);return new mxPoint(Q.snap(Math.round(b/Q.view.scale)-Q.view.translate.x-B),Q.snap(Math.round(e/Q.view.scale)-Q.view.translate.y-z))};if(null!=A&&0<A.length){var c=this;Q=this.editor.graph;T=document.createElement("div");+v=Q.view.getState(g);var f=null==g||null!=v&&Q.isTransparentState(v)?null:Q.copyStyle(g);v=6>A.length?35*A.length:140;T.className="geToolbarContainer geSidebarContainer geShapePicker";T.setAttribute("title",mxResources.get("sidebarTooltip"));T.style.left=Math.round(b)+"px";T.style.top=Math.round(e)+"px";T.style.width=v+"px";mxClient.IS_POINTER&&(T.style.touchAction="none");G||mxUtils.setPrefixedStyle(T.style,"transform","translate(-22px,-22px)");Q.container.appendChild(T);v=mxUtils.bind(this,function(k){var B=+document.createElement("a");B.className="geItem";B.style.display="inline-block";B.style.position="relative";B.style.overflow="hidden";B.style.cursor="pointer";B.style.width="30px";B.style.height="30px";B.style.padding="1px";T.appendChild(B);null!=f&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(f,[k]):this.sidebar.graph.pasteCellStyles([k],Q.currentVertexStyle,Q.currentEdgeStyle);var z=k.geometry;Q.model.isEdge(k)&&(z=z.getTerminalPoint(!1),z=new mxRectangle(0,0,z.x,z.y));null!=z&&B.appendChild(this.sidebar.createVertexTemplateFromCells([k],+z.width,z.height,"",!0,!1,null,!1,mxUtils.bind(this,function(C){if(!mxEvent.isShiftDown(C)||null==g&&Q.isSelectionEmpty()){var I=Q.cloneCell(k);if(null!=m)m(I);else{var L=S([I]);Q.model.isEdge(I)?I.geometry.translate(L.x,L.y):(I.geometry.x=L.x,I.geometry.y=L.y);Q.model.beginUpdate();try{Q.addCell(I),Q.model.isVertex(I)&&Q.isAutoSizeCell(I)&&Q.updateCellSize(I)}finally{Q.model.endUpdate()}Q.setSelectionCell(I);Q.scrollCellToVisible(I);P&&Q.startEditing(I);null!=c.hoverIcons&&c.hoverIcons.update(Q.view.getState(I))}}else I=+Q.getEditableCells(null!=g?[g]:Q.getSelectionCells()),Q.updateShapes(k,I);null!=p&&p(C);mxEvent.consume(C)}),25,25,null,null,g))});for(F=0;F<(G?Math.min(A.length,4):A.length);F++)v(A[F]);A=T.offsetTop+T.clientHeight-(Q.container.scrollTop+Q.container.offsetHeight);0<A&&(T.style.top=Math.max(Q.container.scrollTop+22,e-A)+"px");A=T.offsetLeft+T.clientWidth-(Q.container.scrollLeft+Q.container.offsetWidth);0<A&&(T.style.left=Math.max(Q.container.scrollLeft+22,b-A)+"px")}return T};+EditorUi.prototype.getCellsForShapePicker=function(b,e,g){var m=this.editor.graph,v=mxUtils.bind(this,function(p,A,G,S){return m.createVertex(null,null,S||"",0,0,A||120,G||60,p,!1)});e=mxUtils.bind(this,function(p,A,G){p=new mxCell(G||"",new mxGeometry(0,0,m.defaultEdgeLength+20,0),p);p.geometry.setTerminalPoint(new mxPoint(0,0),!0);p.geometry.setTerminalPoint(new mxPoint(p.geometry.width,null!=A?A:0),!1);p.geometry.points=null!=A?[new mxPoint(p.geometry.width/2,A)]:[];p.geometry.relative=!0;p.edge=!0;return p});if(null!=b)try{b=m.cloneCell(b),m.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(p){b=null}null==b&&(b=v(m.appendFontSize("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;",m.vertexFontSize),40,20,"Text"),m.model.isVertex(b)&&m.isAutoSizeCell(b)&&Graph.createOffscreenGraph(m.getStylesheet()).updateCellSize(b));b=[b,v("whiteSpace=wrap;html=1;"),v("ellipse;whiteSpace=wrap;html=1;",80,80),v("rhombus;whiteSpace=wrap;html=1;",80,80),v("rounded=1;whiteSpace=wrap;html=1;"),v("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),v("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),v("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),v("triangle;whiteSpace=wrap;html=1;",60,80),v("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),v("shape=tape;whiteSpace=wrap;html=1;",120,100),v("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),v("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),v("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];g&&(b=b.concat([e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),@@ -2082,47 +2082,47 @@ b==mxConstants.ARROW_BLOCK_THIN?g="1"!=e?Format.blockThinMarkerImage.src:Format."box"==b?g=Format.boxMarkerImage.src:"halfCircle"==b?g=Format.halfCircleMarkerImage.src:"openAsync"==b?g=Format.openAsyncFilledMarkerImage.src:"async"==b?g="1"!=e?Format.asyncMarkerImage.src:Format.asyncFilledMarkerImage.src:"dash"==b?g=Format.dashMarkerImage.src:"baseDash"==b?g=Format.baseDashMarkerImage.src:"cross"==b?g=Format.crossMarkerImage.src:"circle"==b?g=Format.circleMarkerImage.src:"circlePlus"==b?g=Format.circlePlusMarkerImage.src:"ERone"==b?g=Format.EROneMarkerImage.src:"ERmandOne"==b?g=Format.ERmandOneMarkerImage.src:"ERmany"==b?g=Format.ERmanyMarkerImage.src:"ERoneToMany"==b?g=Format.ERoneToManyMarkerImage.src:"ERzeroToOne"==b?g=Format.ERzeroToOneMarkerImage.src:"ERzeroToMany"==b&&(g=Format.ERzeroToManyMarkerImage.src);return g};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,e=this.actions.get("paste"),g=this.actions.get("pasteHere");e.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(!mxClient.IS_FF&&null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));g.setEnabled(e.isEnabled())};-EditorUi.prototype.initClipboard=function(){var b=this,e=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var A=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{A=A||p.getSelectionCells();A=p.getExportableCells(p.model.getTopmostCells(A));for(var G={},T=p.createCellLookup(A),F=p.cloneCells(A,null,G),P=new mxGraphModel,Q=P.getChildAt(P.getRoot(),-0),U=0;U<F.length;U++){P.add(Q,F[U]);var c=p.view.getState(A[U]);if(null!=c){var f=p.getCellGeometry(F[U]);null!=f&&f.relative&&!P.isEdge(A[U])&&null==T[mxObjectIdentity.get(P.getParent(A[U]))]&&(f.offset=null,f.relative=!1,f.x=c.x/c.view.scale-c.view.translate.x,f.y=c.y/c.view.scale-c.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(G,T),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}b.updatePasteActionStates();return A};var g=mxClipboard.paste;mxClipboard.paste=function(p){var A=+EditorUi.prototype.initClipboard=function(){var b=this,e=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var A=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{A=A||p.getSelectionCells();A=p.getExportableCells(p.model.getTopmostCells(A));for(var G={},S=p.createCellLookup(A),F=p.cloneCells(A,null,G),P=new mxGraphModel,Q=P.getChildAt(P.getRoot(),+0),T=0;T<F.length;T++){P.add(Q,F[T]);var c=p.view.getState(A[T]);if(null!=c){var f=p.getCellGeometry(F[T]);null!=f&&f.relative&&!P.isEdge(A[T])&&null==S[mxObjectIdentity.get(P.getParent(A[T]))]&&(f.offset=null,f.relative=!1,f.x=c.x/c.view.scale-c.view.translate.x,f.y=c.y/c.view.scale-c.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(G,S),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}b.updatePasteActionStates();return A};var g=mxClipboard.paste;mxClipboard.paste=function(p){var A=null;p.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):A=g.apply(this,arguments);b.updatePasteActionStates();return A};var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(p,A){v.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;-EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var J=this.graph.getPageLayout(),W=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+J.x*W.width),this.scale*(this.translate.y+J.y*W.height),this.scale*J.width*W.width,-this.scale*J.height*W.height)};b.getPreferredPageSize=function(J,W,Y){J=this.getPageLayout();W=this.getPageSize();return new mxRectangle(0,0,J.width*W.width,J.height*W.height)};var e=null,g=this;if(this.editor.isChromelessView()){this.chromelessResize=e=mxUtils.bind(this,function(J,W,Y,ba){if(null!=b.container&&!b.isViewer()){Y=null!=Y?Y:0;ba=null!=ba?ba:0;var ja=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),oa=mxUtils.hasScrollbars(b.container),qa=b.view.translate,ra=b.view.scale,-xa=mxRectangle.fromRectangle(ja);xa.x=xa.x/ra-qa.x;xa.y=xa.y/ra-qa.y;xa.width/=ra;xa.height/=ra;qa=b.container.scrollTop;var Ba=b.container.scrollLeft,ya=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)ya+=3;var Da=b.container.offsetWidth-ya;ya=b.container.offsetHeight-ya;J=J?Math.max(.3,Math.min(W||1,Da/xa.width)):ra;W=(Da-J*xa.width)/2/J;var La=0==this.lightboxVerticalDivider?0:(ya-J*xa.height)/this.lightboxVerticalDivider/J;oa&&(W=Math.max(W,0),La=Math.max(La,-0));if(oa||ja.width<Da||ja.height<ya)b.view.scaleAndTranslate(J,Math.floor(W-xa.x),Math.floor(La-xa.y)),b.container.scrollTop=qa*J/ra,b.container.scrollLeft=Ba*J/ra;else if(0!=Y||0!=ba)ja=b.view.translate,b.view.setTranslate(Math.floor(ja.x+Y/ra),Math.floor(ja.y+ba/ra))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var m=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",m);this.destroyFunctions.push(function(){mxEvent.removeListener(window,-"resize",m)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(J){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(J){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position=+EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var K=this.graph.getPageLayout(),W=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+K.x*W.width),this.scale*(this.translate.y+K.y*W.height),this.scale*K.width*W.width,+this.scale*K.height*W.height)};b.getPreferredPageSize=function(K,W,Y){K=this.getPageLayout();W=this.getPageSize();return new mxRectangle(0,0,K.width*W.width,K.height*W.height)};var e=null,g=this;if(this.editor.isChromelessView()){this.chromelessResize=e=mxUtils.bind(this,function(K,W,Y,ca){if(null!=b.container&&!b.isViewer()){Y=null!=Y?Y:0;ca=null!=ca?ca:0;var ja=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),oa=mxUtils.hasScrollbars(b.container),qa=b.view.translate,ra=b.view.scale,+xa=mxRectangle.fromRectangle(ja);xa.x=xa.x/ra-qa.x;xa.y=xa.y/ra-qa.y;xa.width/=ra;xa.height/=ra;qa=b.container.scrollTop;var Ba=b.container.scrollLeft,ya=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)ya+=3;var Da=b.container.offsetWidth-ya;ya=b.container.offsetHeight-ya;K=K?Math.max(.3,Math.min(W||1,Da/xa.width)):ra;W=(Da-K*xa.width)/2/K;var La=0==this.lightboxVerticalDivider?0:(ya-K*xa.height)/this.lightboxVerticalDivider/K;oa&&(W=Math.max(W,0),La=Math.max(La,+0));if(oa||ja.width<Da||ja.height<ya)b.view.scaleAndTranslate(K,Math.floor(W-xa.x),Math.floor(La-xa.y)),b.container.scrollTop=qa*K/ra,b.container.scrollLeft=Ba*K/ra;else if(0!=Y||0!=ca)ja=b.view.translate,b.view.setTranslate(Math.floor(ja.x+Y/ra),Math.floor(ja.y+ca/ra))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var m=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",m);this.destroyFunctions.push(function(){mxEvent.removeListener(window,+"resize",m)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(K){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(K){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";mxClient.IS_IE||mxClient.IS_IE11?(this.chromelessToolbar.style.backgroundColor="#ffffff",this.chromelessToolbar.style.border="3px solid black"):this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,-"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var p=mxUtils.bind(this,function(){var J=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=J?parseInt(J["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var A=0;p=mxUtils.bind(this,function(J,W,Y){A++;-var ba=document.createElement("span");ba.style.paddingLeft="8px";ba.style.paddingRight="8px";ba.style.cursor="pointer";mxEvent.addListener(ba,"click",J);null!=Y&&ba.setAttribute("title",Y);J=document.createElement("img");J.setAttribute("border","0");J.setAttribute("src",W);J.style.width="36px";J.style.filter="invert(100%)";ba.appendChild(J);this.chromelessToolbar.appendChild(ba);return ba});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&p(mxUtils.bind(this,function(J){window.location.href=-G;mxEvent.consume(J)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var T=p(mxUtils.bind(this,function(J){this.actions.get("previousPage").funct();mxEvent.consume(J)}),Editor.previousImage,mxResources.get("previousPage")),F=document.createElement("div");F.style.fontFamily=Editor.defaultHtmlFont;F.style.display="inline-block";F.style.verticalAlign="top";F.style.fontWeight="bold";F.style.marginTop="8px";F.style.fontSize="14px";F.style.cursor="default";F.style.color=-mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(F);var P=p(mxUtils.bind(this,function(J){this.actions.get("nextPage").funct();mxEvent.consume(J)}),Editor.nextImage,mxResources.get("nextPage")),Q=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){F.innerText="";var J=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(F,J+1+" / "+this.pages.length);F.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());-T.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(J-1,this.pages.length)].getName());P.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(J+1,this.pages.length)].getName())}});T.style.paddingLeft="0px";T.style.paddingRight="4px";P.style.paddingLeft="4px";P.style.paddingRight="0px";var U=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(P.style.display="",T.style.display="",F.style.display="inline-block"):-(P.style.display="none",T.style.display="none",F.style.display="none");Q()});if(null!=this.menus){var c=this.menus.get("pages");null!=c&&mxEvent.addListener(F,"click",mxUtils.bind(this,function(J){var W=new mxPopupMenu(c.funct);W.div.className+=" geMenubarMenu";W.smartSeparators=!0;W.showDisabled=!0;W.autoExpand=!0;W.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(W,arguments);W.destroy()});var Y=mxUtils.getOffset(F);W.popup(Y.x,Y.y+F.offsetHeight,null,J);mxEvent.addListener(W.div,-"mouseleave",mxUtils.bind(this,function(){W.hideMenu()}))}))}this.editor.addListener("resetGraphView",U);this.editor.addListener("pageSelected",Q)}p(mxUtils.bind(this,function(J){this.actions.get("zoomOut").funct();mxEvent.consume(J)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(J){this.actions.get("zoomIn").funct();mxEvent.consume(J)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(J){b.isLightboxView()?-(1==b.view.scale?this.lightboxFit():b.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(J)}),Editor.zoomFitImage,mxResources.get("fit"));var f=null,k=null,B=mxUtils.bind(this,function(J){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);f=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);f=null;k=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";k=null}),-600)}),J||200)}),z=mxUtils.bind(this,function(J){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,J||30)});if("1"==urlParams.layers){this.layersDialog=null;var C=p(mxUtils.bind(this,function(J){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&+"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var p=mxUtils.bind(this,function(){var K=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=K?parseInt(K["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var A=0;p=mxUtils.bind(this,function(K,W,Y){A++;+var ca=document.createElement("span");ca.style.paddingLeft="8px";ca.style.paddingRight="8px";ca.style.cursor="pointer";mxEvent.addListener(ca,"click",K);null!=Y&&ca.setAttribute("title",Y);K=document.createElement("img");K.setAttribute("border","0");K.setAttribute("src",W);K.style.width="36px";K.style.filter="invert(100%)";ca.appendChild(K);this.chromelessToolbar.appendChild(ca);return ca});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&p(mxUtils.bind(this,function(K){window.location.href=+G;mxEvent.consume(K)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var S=p(mxUtils.bind(this,function(K){this.actions.get("previousPage").funct();mxEvent.consume(K)}),Editor.previousImage,mxResources.get("previousPage")),F=document.createElement("div");F.style.fontFamily=Editor.defaultHtmlFont;F.style.display="inline-block";F.style.verticalAlign="top";F.style.fontWeight="bold";F.style.marginTop="8px";F.style.fontSize="14px";F.style.cursor="default";F.style.color=+mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(F);var P=p(mxUtils.bind(this,function(K){this.actions.get("nextPage").funct();mxEvent.consume(K)}),Editor.nextImage,mxResources.get("nextPage")),Q=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){F.innerText="";var K=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(F,K+1+" / "+this.pages.length);F.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());+S.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(K-1,this.pages.length)].getName());P.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(K+1,this.pages.length)].getName())}});S.style.paddingLeft="0px";S.style.paddingRight="4px";P.style.paddingLeft="4px";P.style.paddingRight="0px";var T=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(P.style.display="",S.style.display="",F.style.display="inline-block"):+(P.style.display="none",S.style.display="none",F.style.display="none");Q()});if(null!=this.menus){var c=this.menus.get("pages");null!=c&&mxEvent.addListener(F,"click",mxUtils.bind(this,function(K){var W=new mxPopupMenu(c.funct);W.div.className+=" geMenubarMenu";W.smartSeparators=!0;W.showDisabled=!0;W.autoExpand=!0;W.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(W,arguments);W.destroy()});var Y=mxUtils.getOffset(F);W.popup(Y.x,Y.y+F.offsetHeight,null,K);mxEvent.addListener(W.div,+"mouseleave",mxUtils.bind(this,function(){W.hideMenu()}))}))}this.editor.addListener("resetGraphView",T);this.editor.addListener("pageSelected",Q)}p(mxUtils.bind(this,function(K){this.actions.get("zoomOut").funct();mxEvent.consume(K)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(K){this.actions.get("zoomIn").funct();mxEvent.consume(K)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(K){b.isLightboxView()?+(1==b.view.scale?this.lightboxFit():b.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(K)}),Editor.zoomFitImage,mxResources.get("fit"));var f=null,k=null,B=mxUtils.bind(this,function(K){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);f=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);f=null;k=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";k=null}),+600)}),K||200)}),z=mxUtils.bind(this,function(K){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,K||30)});if("1"==urlParams.layers){this.layersDialog=null;var C=p(mxUtils.bind(this,function(K){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&this.chromelessResize()}),!0);mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var W=C.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily=Editor.defaultHtmlFont;this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.left=W.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";mxClient.IS_IE||mxClient.IS_IE11?(this.layersDialog.style.backgroundColor="#ffffff",this.layersDialog.style.border="2px solid black",this.layersDialog.style.color="#000000"):(this.layersDialog.style.backgroundColor="#000000",this.layersDialog.style.color="#ffffff",mxUtils.setOpacity(this.layersDialog,80));W=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=-W.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(J)}),Editor.layersImage,mxResources.get("layers")),H=b.getModel();H.addListener(mxEvent.CHANGE,function(){C.style.display=1<H.getChildCount(H.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(J){null!=this.editor.editButtonFunc?-this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(J)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(U=0;U<this.lightboxToolbarActions.length;U++){var K=this.lightboxToolbarActions[U];K.elem=p(K.fn,K.icon,K.tooltip)}if(null!=v.refreshBtn){var M=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(J){null!=-M?window.location.href=M:window.location.reload();mxEvent.consume(J)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(J){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(J)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=-document.body))&&p(mxUtils.bind(this,function(J){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(J))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(J){mxEvent.isTouchEvent(J)||-(mxEvent.isShiftDown(J)||z(30),B())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(J){mxEvent.consume(J)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(J){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(J)?B():z(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(J){mxEvent.isShiftDown(J)?B():z(100);mxEvent.consume(J)}));mxEvent.addListener(this.chromelessToolbar,-"mouseleave",mxUtils.bind(this,function(J){mxEvent.isTouchEvent(J)||z(30)}));var O=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(J,W){this.startX=W.getGraphX();this.startY=W.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(J,W){},mouseUp:function(J,W){mxEvent.isTouchEvent(W.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<O&&Math.abs(this.scrollTop-b.container.scrollTop)<O&&-Math.abs(this.startX-W.getGraphX())<O&&Math.abs(this.startY-W.getGraphY())<O&&(0<parseFloat(g.chromelessToolbar.style.opacity||0)?B():z(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ea=b.view.validate,fa=new mxPoint,S=!1,ca=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=g.currentPage&&ca!=g.currentPage){ca=g.currentPage;S=!0;var J=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==-J&&(J=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));J=b.getPageLayout(J,fa,1);var W=b.getDefaultTranslate(J);this.x0=J.x;this.y0=J.y;if(W.x!=this.translate.x||W.y!=this.translate.y)this.invalidate(),this.translate.x=W.x,this.translate.y=W.y}W=b.getPagePadding();var Y=b.getPageSize();J=W.x-(this.x0||0)*Y.width;W=W.y-(this.y0||0)*Y.height;if(this.translate.x!=J||this.translate.y!=W)this.invalidate(),this.translate.x=J,this.translate.y=W}ea.apply(this,arguments)};-if(!b.isViewer()){var ma=b.sizeDidChange;b.sizeDidChange=function(){var J=S;S=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var W=this.getPageLayout(),Y=this.getDefaultTranslate(W),ba=this.view.translate.x,ja=this.view.translate.y;if(Y.x!=ba||Y.y!=ja){this.view.x0=W.x;this.view.y0=W.y;this.autoTranslate=!0;this.view.setTranslate(Y.x,Y.y);this.autoTranslate=!1;J||(this.container.scrollLeft+=Math.round((Y.x-ba)*this.view.scale),this.container.scrollTop+=-Math.round((Y.y-ja)*this.view.scale));return}}ma.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var la=b.view.getBackgroundPane(),Z=b.view.getDrawPane();b.cumulativeZoomFactor=1;var da=null,aa=null,l=null,t=null,I=null,V=function(J){null!=da&&window.clearTimeout(da);0<=J&&window.setTimeout(function(){if(!b.isMouseDown||t)da=window.setTimeout(mxUtils.bind(this,function(){b.isFastZoomEnabled()&&(null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&+W.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(K)}),Editor.layersImage,mxResources.get("layers")),I=b.getModel();I.addListener(mxEvent.CHANGE,function(){C.style.display=1<I.getChildCount(I.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(K){null!=this.editor.editButtonFunc?+this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(K)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(T=0;T<this.lightboxToolbarActions.length;T++){var L=this.lightboxToolbarActions[T];L.elem=p(L.fn,L.icon,L.tooltip)}if(null!=v.refreshBtn){var J=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(K){null!=+J?window.location.href=J:window.location.reload();mxEvent.consume(K)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(K){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(K)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=+document.body))&&p(mxUtils.bind(this,function(K){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(K))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(K){mxEvent.isTouchEvent(K)||+(mxEvent.isShiftDown(K)||z(30),B())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(K){mxEvent.consume(K)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(K){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(K)?B():z(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(K){mxEvent.isShiftDown(K)?B():z(100);mxEvent.consume(K)}));mxEvent.addListener(this.chromelessToolbar,+"mouseleave",mxUtils.bind(this,function(K){mxEvent.isTouchEvent(K)||z(30)}));var O=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(K,W){this.startX=W.getGraphX();this.startY=W.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(K,W){},mouseUp:function(K,W){mxEvent.isTouchEvent(W.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<O&&Math.abs(this.scrollTop-b.container.scrollTop)<O&&+Math.abs(this.startX-W.getGraphX())<O&&Math.abs(this.startY-W.getGraphY())<O&&(0<parseFloat(g.chromelessToolbar.style.opacity||0)?B():z(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var da=b.view.validate,fa=new mxPoint,V=!1,ba=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=g.currentPage&&ba!=g.currentPage){ba=g.currentPage;V=!0;var K=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==+K&&(K=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));K=b.getPageLayout(K,fa,1);var W=b.getDefaultTranslate(K);this.x0=K.x;this.y0=K.y;if(W.x!=this.translate.x||W.y!=this.translate.y)this.invalidate(),this.translate.x=W.x,this.translate.y=W.y}W=b.getPagePadding();var Y=b.getPageSize();K=W.x-(this.x0||0)*Y.width;W=W.y-(this.y0||0)*Y.height;if(this.translate.x!=K||this.translate.y!=W)this.invalidate(),this.translate.x=K,this.translate.y=W}da.apply(this,arguments)};+if(!b.isViewer()){var ma=b.sizeDidChange;b.sizeDidChange=function(){var K=V;V=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var W=this.getPageLayout(),Y=this.getDefaultTranslate(W),ca=this.view.translate.x,ja=this.view.translate.y;if(Y.x!=ca||Y.y!=ja){this.view.x0=W.x;this.view.y0=W.y;this.autoTranslate=!0;this.view.setTranslate(Y.x,Y.y);this.autoTranslate=!1;K||(this.container.scrollLeft+=Math.round((Y.x-ca)*this.view.scale),this.container.scrollTop+=+Math.round((Y.y-ja)*this.view.scale));return}}ma.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var la=b.view.getBackgroundPane(),Z=b.view.getDrawPane();b.cumulativeZoomFactor=1;var ea=null,aa=null,l=null,t=null,H=null,U=function(K){null!=ea&&window.clearTimeout(ea);0<=K&&window.setTimeout(function(){if(!b.isMouseDown||t)ea=window.setTimeout(mxUtils.bind(this,function(){b.isFastZoomEnabled()&&(null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform",null)),Z.style.transformOrigin="",la.style.transformOrigin="",mxClient.IS_SF?(Z.style.transform="scale(1)",la.style.transform="scale(1)",window.setTimeout(function(){Z.style.transform="";la.style.transform=""},0)):(Z.style.transform="",la.style.transform=""),b.view.getDecoratorPane().style.opacity="",b.view.getOverlayPane().style.opacity=-"");var W=new mxPoint(b.container.scrollLeft,b.container.scrollTop),Y=mxUtils.getOffset(b.container),ba=b.view.scale,ja=0,oa=0;null!=aa&&(ja=b.container.offsetWidth/2-aa.x+Y.x,oa=b.container.offsetHeight/2-aa.y+Y.y);b.zoom(b.cumulativeZoomFactor,null,b.isFastZoomEnabled()?20:null);b.view.scale!=ba&&(null!=l&&(ja+=W.x-l.x,oa+=W.y-l.y),null!=e&&g.chromelessResize(!1,null,ja*(b.cumulativeZoomFactor-1),oa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==ja&&0==oa||(b.container.scrollLeft-=-ja*(b.cumulativeZoomFactor-1),b.container.scrollTop-=oa*(b.cumulativeZoomFactor-1)));null!=I&&Z.setAttribute("filter",I);b.cumulativeZoomFactor=1;I=t=aa=l=da=null}),null!=J?J:b.isFastZoomEnabled()?g.wheelZoomDelay:g.lazyZoomDelay)},0)};b.lazyZoom=function(J,W,Y,ba){ba=null!=ba?ba:this.zoomFactor;(W=W||!b.scrollbars)&&(aa=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/2));J?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=-(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ba,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=ba,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,-160))/this.view.scale;if(b.isFastZoomEnabled()){null==I&&""!=Z.getAttribute("filter")&&(I=Z.getAttribute("filter"),Z.removeAttribute("filter"));l=new mxPoint(b.container.scrollLeft,b.container.scrollTop);J=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/(20*this.view.scale);ba=W||null==aa?b.container.scrollLeft+b.container.clientWidth/2:aa.x+b.container.scrollLeft-b.container.offsetLeft;var ja=W||null==aa?b.container.scrollTop+b.container.clientHeight/2:aa.y+b.container.scrollTop--b.container.offsetTop;Z.style.transformOrigin=ba+"px "+ja+"px";Z.style.transform="scale("+J+")";la.style.transformOrigin=ba+"px "+ja+"px";la.style.transform="scale("+J+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ba=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ba.style,"transform-origin",(W||null==aa?b.container.clientWidth/2+b.container.scrollLeft-ba.offsetLeft+"px":aa.x+b.container.scrollLeft-ba.offsetLeft-b.container.offsetLeft+"px")+" "+(W||null==aa?-b.container.clientHeight/2+b.container.scrollTop-ba.offsetTop+"px":aa.y+b.container.scrollTop-ba.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ba.style,"transform","scale("+J+")")):b.view.validateBackgroundStyles(J,ba,ja);b.view.getDecoratorPane().style.opacity="0";b.view.getOverlayPane().style.opacity="0";null!=g.hoverIcons&&g.hoverIcons.reset();b.fireEvent(new mxEventObject("zoomPreview","factor",J))}V(b.isFastZoomEnabled()?Y:0)};mxEvent.addGestureListeners(b.container,function(J){null!=-da&&window.clearTimeout(da)},null,function(J){1!=b.cumulativeZoomFactor&&V(0)});mxEvent.addListener(b.container,"scroll",function(J){null==da||b.isMouseDown||1==b.cumulativeZoomFactor||V(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(J,W,Y,ba,ja){b.fireEvent(new mxEventObject("wheel"));if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!Y&&b.isScrollWheelEvent(J))Y=b.view.getTranslate(),ba=40/b.view.scale,mxEvent.isShiftDown(J)?b.view.setTranslate(Y.x+(W?-ba:ba),Y.y):b.view.setTranslate(Y.x,-Y.y+(W?ba:-ba));else if(Y||b.isZoomWheelEvent(J))for(var oa=mxEvent.getSource(J);null!=oa;){if(oa==b.container)return b.tooltipHandler.hideTooltip(),aa=null!=ba&&null!=ja?new mxPoint(ba,ja):new mxPoint(mxEvent.getClientX(J),mxEvent.getClientY(J)),t=Y,Y=b.zoomFactor,ba=null,J.ctrlKey&&null!=J.deltaY&&40>Math.abs(J.deltaY)&&Math.round(J.deltaY)!=J.deltaY?Y=1+Math.abs(J.deltaY)/20*(Y-1):null!=J.movementY&&"pointermove"==J.type&&(Y=1+Math.max(1,Math.abs(J.movementY))/20*(Y-1),ba=-1),b.lazyZoom(W,null,-ba,Y),mxEvent.consume(J),!1;oa=oa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(J){b.cumulativeZoomFactor=J.scale;b.lazyZoom(0<J.scale,!0);mxEvent.consume(J)}};EditorUi.prototype.addChromelessToolbarItems=function(b){b(mxUtils.bind(this,function(e){this.actions.get("print").funct();mxEvent.consume(e)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};+"");var W=new mxPoint(b.container.scrollLeft,b.container.scrollTop),Y=mxUtils.getOffset(b.container),ca=b.view.scale,ja=0,oa=0;null!=aa&&(ja=b.container.offsetWidth/2-aa.x+Y.x,oa=b.container.offsetHeight/2-aa.y+Y.y);b.zoom(b.cumulativeZoomFactor,null,b.isFastZoomEnabled()?20:null);b.view.scale!=ca&&(null!=l&&(ja+=W.x-l.x,oa+=W.y-l.y),null!=e&&g.chromelessResize(!1,null,ja*(b.cumulativeZoomFactor-1),oa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==ja&&0==oa||(b.container.scrollLeft-=+ja*(b.cumulativeZoomFactor-1),b.container.scrollTop-=oa*(b.cumulativeZoomFactor-1)));null!=H&&Z.setAttribute("filter",H);b.cumulativeZoomFactor=1;H=t=aa=l=ea=null}),null!=K?K:b.isFastZoomEnabled()?g.wheelZoomDelay:g.lazyZoomDelay)},0)};b.lazyZoom=function(K,W,Y,ca){ca=null!=ca?ca:this.zoomFactor;(W=W||!b.scrollbars)&&(aa=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/2));K?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=+(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ca,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=ca,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,+160))/this.view.scale;if(b.isFastZoomEnabled()){null==H&&""!=Z.getAttribute("filter")&&(H=Z.getAttribute("filter"),Z.removeAttribute("filter"));l=new mxPoint(b.container.scrollLeft,b.container.scrollTop);K=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/(20*this.view.scale);ca=W||null==aa?b.container.scrollLeft+b.container.clientWidth/2:aa.x+b.container.scrollLeft-b.container.offsetLeft;var ja=W||null==aa?b.container.scrollTop+b.container.clientHeight/2:aa.y+b.container.scrollTop-+b.container.offsetTop;Z.style.transformOrigin=ca+"px "+ja+"px";Z.style.transform="scale("+K+")";la.style.transformOrigin=ca+"px "+ja+"px";la.style.transform="scale("+K+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ca=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ca.style,"transform-origin",(W||null==aa?b.container.clientWidth/2+b.container.scrollLeft-ca.offsetLeft+"px":aa.x+b.container.scrollLeft-ca.offsetLeft-b.container.offsetLeft+"px")+" "+(W||null==aa?+b.container.clientHeight/2+b.container.scrollTop-ca.offsetTop+"px":aa.y+b.container.scrollTop-ca.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ca.style,"transform","scale("+K+")")):b.view.validateBackgroundStyles(K,ca,ja);b.view.getDecoratorPane().style.opacity="0";b.view.getOverlayPane().style.opacity="0";null!=g.hoverIcons&&g.hoverIcons.reset();b.fireEvent(new mxEventObject("zoomPreview","factor",K))}U(b.isFastZoomEnabled()?Y:0)};mxEvent.addGestureListeners(b.container,function(K){null!=+ea&&window.clearTimeout(ea)},null,function(K){1!=b.cumulativeZoomFactor&&U(0)});mxEvent.addListener(b.container,"scroll",function(K){null==ea||b.isMouseDown||1==b.cumulativeZoomFactor||U(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(K,W,Y,ca,ja){b.fireEvent(new mxEventObject("wheel"));if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!Y&&b.isScrollWheelEvent(K))Y=b.view.getTranslate(),ca=40/b.view.scale,mxEvent.isShiftDown(K)?b.view.setTranslate(Y.x+(W?-ca:ca),Y.y):b.view.setTranslate(Y.x,+Y.y+(W?ca:-ca));else if(Y||b.isZoomWheelEvent(K))for(var oa=mxEvent.getSource(K);null!=oa;){if(oa==b.container)return b.tooltipHandler.hideTooltip(),aa=null!=ca&&null!=ja?new mxPoint(ca,ja):new mxPoint(mxEvent.getClientX(K),mxEvent.getClientY(K)),t=Y,Y=b.zoomFactor,ca=null,K.ctrlKey&&null!=K.deltaY&&40>Math.abs(K.deltaY)&&Math.round(K.deltaY)!=K.deltaY?Y=1+Math.abs(K.deltaY)/20*(Y-1):null!=K.movementY&&"pointermove"==K.type&&(Y=1+Math.max(1,Math.abs(K.movementY))/20*(Y-1),ca=-1),b.lazyZoom(W,null,+ca,Y),mxEvent.consume(K),!1;oa=oa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(K){b.cumulativeZoomFactor=K.scale;b.lazyZoom(0<K.scale,!0);mxEvent.consume(K)}};EditorUi.prototype.addChromelessToolbarItems=function(b){b(mxUtils.bind(this,function(e){this.actions.get("print").funct();mxEvent.consume(e)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};EditorUi.prototype.createTemporaryGraph=function(b){return Graph.createOffscreenGraph(b)};EditorUi.prototype.addChromelessClickHandler=function(){var b=urlParams.highlight;null!=b&&0<b.length&&(b="#"+b);this.editor.graph.addClickHandler(b)};EditorUi.prototype.toggleFormatPanel=function(b){b=null!=b?b:0==this.formatWidth;null!=this.format&&(this.formatWidth=b?240:0,this.formatContainer.style.width=this.formatWidth+"px",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged")))};EditorUi.prototype.isFormatPanelVisible=function(){return 0<this.formatWidth};EditorUi.prototype.lightboxFit=function(b){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var e=urlParams.border,g=60;null!=e&&(g=parseInt(e));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(g,null,null,null,null,null,b);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var b=this.editor.graph.getModel();return 1==b.getChildCount(b.root)&&0==b.getChildCount(b.getChildAt(b.root,0))};EditorUi.prototype.isSelectionAllowed=function(b){return"SELECT"==mxEvent.getSource(b).nodeName||"INPUT"==mxEvent.getSource(b).nodeName&&mxUtils.isAncestorNode(this.formatContainer,mxEvent.getSource(b))};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})};@@ -2143,7 +2143,7 @@ e.scrollTop=Math.floor(Math.max(0,g.y-Math.max(20,(e.clientHeight-m)/4)))}else{gEditorUi.prototype.setPageVisible=function(b){var e=this.editor.graph,g=mxUtils.hasScrollbars(e.container),m=0,v=0;g&&(m=e.view.translate.x*e.view.scale-e.container.scrollLeft,v=e.view.translate.y*e.view.scale-e.container.scrollTop);e.pageVisible=b;e.pageBreaksVisible=b;e.preferPageSize=b;e.view.validateBackground();if(g){var p=e.getSelectionCells();e.clearSelection();e.setSelectionCells(p)}e.sizeDidChange();g&&(e.container.scrollLeft=e.view.translate.x*e.view.scale-m,e.container.scrollTop=e.view.translate.y*e.view.scale-v);e.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};EditorUi.prototype.installResizeHandler=function(b,e,g){e&&(b.window.setSize=function(v,p){if(!this.minimized){var A=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;v=Math.min(v,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.getX());p=Math.min(p,A-this.getY())}mxWindow.prototype.setSize.apply(this,arguments)});b.window.setLocation=function(v,p){var A=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,-G=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,T=parseInt(this.div.style.width),F=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,A-T));p=Math.max(0,Math.min(p,G-F));this.getX()==v&&this.getY()==p||mxWindow.prototype.setLocation.apply(this,arguments);e&&!this.minimized&&this.setSize(T,F)};var m=mxUtils.bind(this,function(){var v=b.window.getX(),p=b.window.getY();b.window.setLocation(v,p)});mxEvent.addListener(window,"resize",m);b.destroy=function(){mxEvent.removeListener(window,+G=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,S=parseInt(this.div.style.width),F=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,A-S));p=Math.max(0,Math.min(p,G-F));this.getX()==v&&this.getY()==p||mxWindow.prototype.setLocation.apply(this,arguments);e&&!this.minimized&&this.setSize(S,F)};var m=mxUtils.bind(this,function(){var v=b.window.getX(),p=b.window.getY();b.window.setLocation(v,p)});mxEvent.addListener(window,"resize",m);b.destroy=function(){mxEvent.removeListener(window,"resize",m);b.window.destroy();null!=g&&g()}};function ChangeGridColor(b,e){this.ui=b;this.color=e}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);mxCodecRegistry.register(b)})();function ChangePageSetup(b,e,g,m,v){this.ui=b;this.previousColor=this.color=e;this.previousImage=this.image=g;this.previousFormat=this.format=m;this.previousPageScale=this.pageScale=v;this.ignoreImage=this.ignoreColor=!1}ChangePageSetup.prototype.execute=function(){var b=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var e=b.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=e}if(!this.ignoreImage){this.image=this.previousImage;e=b.backgroundImage;var g=this.previousImage;null!=g&&Graph.isPageLink(g.src)&&(g=this.ui.createImageForPageLink(g.src,this.ui.currentPage));this.ui.setBackgroundImage(g);this.previousImage=e}null!=this.previousFormat&&(this.format=this.previousFormat,@@ -2179,22 +2179,22 @@ EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=Grap"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(g,100);mxUtils.setPrefixedStyle(g.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(g.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(g.style,"transform","scaleX(0)");mxUtils.setOpacity(g,0);window.setTimeout(mxUtils.bind(this,function(){null!=g.parentNode&&g.parentNode.removeChild(g)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(b[e])};EditorUi.prototype.createStatusDiv=function(b){var e=document.createElement("div");e.style.textOverflow="ellipsis";e.style.display="inline-block";e.style.whiteSpace="nowrap";e.style.overflow="hidden";e.style.minWidth="0";e.setAttribute("title",b);e.innerHTML=Graph.sanitizeHtml(b);return e};EditorUi.prototype.createToolbar=function(b){return new Toolbar(this,b)};EditorUi.prototype.createSidebar=function(b){return new Sidebar(this,b)};EditorUi.prototype.createFormat=function(b){return new Format(this,b)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};EditorUi.prototype.createDiv=function(b){var e=document.createElement("div");e.className=b;return e};-EditorUi.prototype.addSplitHandler=function(b,e,g,m){function v(Q){if(null!=A){var U=new mxPoint(mxEvent.getClientX(Q),mxEvent.getClientY(Q));m(Math.max(0,G+(e?U.x-A.x:A.y-U.y)-g));mxEvent.consume(Q);G!=P()&&(T=!0,F=null)}}function p(Q){v(Q);A=G=null}var A=null,G=null,T=!0,F=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var P=mxUtils.bind(this,function(){var Q=parseInt(e?b.style.left:b.style.bottom);e||(Q=Q+g-this.footerHeight);return Q});mxEvent.addGestureListeners(b,function(Q){A=new mxPoint(mxEvent.getClientX(Q),-mxEvent.getClientY(Q));G=P();T=!1;mxEvent.consume(Q)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(Q){if(!T&&this.hsplitClickEnabled){var U=null!=F?F-g:0;F=P();m(U);mxEvent.consume(Q)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};+EditorUi.prototype.addSplitHandler=function(b,e,g,m){function v(Q){if(null!=A){var T=new mxPoint(mxEvent.getClientX(Q),mxEvent.getClientY(Q));m(Math.max(0,G+(e?T.x-A.x:A.y-T.y)-g));mxEvent.consume(Q);G!=P()&&(S=!0,F=null)}}function p(Q){v(Q);A=G=null}var A=null,G=null,S=!0,F=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var P=mxUtils.bind(this,function(){var Q=parseInt(e?b.style.left:b.style.bottom);e||(Q=Q+g-this.footerHeight);return Q});mxEvent.addGestureListeners(b,function(Q){A=new mxPoint(mxEvent.getClientX(Q),+mxEvent.getClientY(Q));G=P();S=!1;mxEvent.consume(Q)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(Q){if(!S&&this.hsplitClickEnabled){var T=null!=F?F-g:0;F=P();m(T);mxEvent.consume(Q)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};EditorUi.prototype.prompt=function(b,e,g){b=new FilenameDialog(this,e,mxResources.get("apply"),function(m){g(parseFloat(m))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};EditorUi.prototype.handleError=function(b,e,g,m,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=e){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var p=mxResources.get("ok");e=null!=e?e:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(e,v,p,g,null,null,null,null,null,null,null,null,m?g:null)}else null!=g&&g()};-EditorUi.prototype.showError=function(b,e,g,m,v,p,A,G,T,F,P,Q,U){b=new ErrorDialog(this,b,e,g||mxResources.get("ok"),m,v,p,A,Q,G,T);e=Math.ceil(null!=e?e.length/50:1);this.showDialog(b.container,F||340,P||100+20*e,!0,!1,U);b.init()};EditorUi.prototype.showDialog=function(b,e,g,m,v,p,A,G,T,F){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,e,g,m,v,p,A,G,T,F);this.dialogs.push(this.dialog)};+EditorUi.prototype.showError=function(b,e,g,m,v,p,A,G,S,F,P,Q,T){b=new ErrorDialog(this,b,e,g||mxResources.get("ok"),m,v,p,A,Q,G,S);e=Math.ceil(null!=e?e.length/50:1);this.showDialog(b.container,F||340,P||100+20*e,!0,!1,T);b.init()};EditorUi.prototype.showDialog=function(b,e,g,m,v,p,A,G,S,F){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,e,g,m,v,p,A,G,S,F);this.dialogs.push(this.dialog)};EditorUi.prototype.hideDialog=function(b,e,g){var m=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var v=this.dialogs.length-1;0<=v;v--)if(!this.dialogs[v].closing){m=this.dialogs[v];break}null==m||null!=g&&g!=this.dialog.container.firstChild||(m.closing=!0,0==m.close(b,e)?delete m.closing:(delete m.closing,b=mxUtils.lastIndexOf(this.dialogs,m),0<=b&&this.dialogs.splice(b,1),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog","dialog",m)),null==this.dialog&&null!=this.editor.graph.container&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){null==this.editor||null!=this.dialogs&&0!=this.dialogs.length||(this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?this.editor.graph.cellEditor.textarea.focus():(mxUtils.clearSelection(),this.editor.graph.container.focus()))}),0)))};EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var e=b.getSelectionCells(),g=new mxDictionary,m=[],v=0;v<e.length;v++){var p=b.isTableCell(e[v])?b.model.getParent(e[v]):e[v];null==p||g.get(p)||(g.put(p,!0),m.push(p))}b.setSelectionCells(b.duplicateCells(m,!1))}catch(A){this.handleError(A)}};-EditorUi.prototype.pickColor=function(b,e,g,m,v){var p=this.editor.graph,A=p.cellEditor.saveSelection(),G=(v?240:290)+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,b,function(T){p.cellEditor.restoreSelection(A);e(T)},function(){p.cellEditor.restoreSelection(A)},g,m,v);this.showDialog(b.container,230,G,!0,!1);b.init()};+EditorUi.prototype.pickColor=function(b,e,g,m,v){var p=this.editor.graph,A=p.cellEditor.saveSelection(),G=(v?240:290)+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,b,function(S){p.cellEditor.restoreSelection(A);e(S)},function(){p.cellEditor.restoreSelection(A)},g,m,v);this.showDialog(b.container,230,G,!0,!1);b.init()};EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};-EditorUi.prototype.base64ToBlob=function(b,e){e=e||"";b=atob(b);for(var g=b.length,m=Math.ceil(g/1024),v=Array(m),p=0;p<m;++p){for(var A=1024*p,G=Math.min(A+1024,g),T=Array(G-A),F=0;A<G;++F,++A)T[F]=b[A].charCodeAt(0);v[p]=new Uint8Array(T)}return new Blob(v,{type:e})};+EditorUi.prototype.base64ToBlob=function(b,e){e=e||"";b=atob(b);for(var g=b.length,m=Math.ceil(g/1024),v=Array(m),p=0;p<m;++p){for(var A=1024*p,G=Math.min(A+1024,g),S=Array(G-A),F=0;A<G;++F,++A)S[F]=b[A].charCodeAt(0);v[p]=new Uint8Array(S)}return new Blob(v,{type:e})};EditorUi.prototype.writeImageToClipboard=function(b,e,g,m){var v=this.base64ToBlob(b.substring(b.indexOf(",")+1),"image/png");b=new ClipboardItem({"image/png":v,"text/html":new Blob(['<img src="'+b+'" width="'+e+'" height="'+g+'">'],{type:"text/html"})});navigator.clipboard.write([b])["catch"](m)};EditorUi.prototype.writeHtmlToClipboard=function(b,e){b=new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(b)],{type:"text/plain"}),"text/html":new Blob([b],{type:"text/html"})});navigator.clipboard.write([b])["catch"](e)};EditorUi.prototype.writeTextToClipboard=function(b,e){navigator.clipboard.writeText(b)["catch"](e)};EditorUi.prototype.extractGraphModelFromHtml=function(b){var e=null;try{var g=b.indexOf("<mxGraphModel ");if(0<=g){var m=b.lastIndexOf("</mxGraphModel>");m>g&&(e=b.substring(g,m+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(v){}return e};EditorUi.prototype.readGraphModelFromClipboard=function(b){this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(e){null!=e?b(e):this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(g){if(null!=g){var m=decodeURIComponent(g);this.isCompatibleString(m)&&(g=m)}b(g)}),"text")}),"html")};EditorUi.prototype.readGraphModelFromClipboardWithType=function(b,e){navigator.clipboard.read().then(mxUtils.bind(this,function(g){if(null!=g&&0<g.length&&"html"==e&&0<=mxUtils.indexOf(g[0].types,"text/html"))g[0].getType("text/html").then(mxUtils.bind(this,function(m){m.text().then(mxUtils.bind(this,function(v){try{var p=this.parseHtmlData(v),A="text/plain"!=p.getAttribute("data-type")?p.innerHTML:mxUtils.trim(null==p.innerText?mxUtils.getTextContent(p):p.innerText);try{var G=A.lastIndexOf("%3E");-0<=G&&G<A.length-3&&(A=A.substring(0,G+3))}catch(P){}try{var T=p.getElementsByTagName("span"),F=null!=T&&0<T.length?mxUtils.trim(decodeURIComponent(T[0].textContent)):decodeURIComponent(A);this.isCompatibleString(F)&&(A=F)}catch(P){}}catch(P){}b(this.isCompatibleString(A)?A:null)}))["catch"](function(v){b(null)})}))["catch"](function(m){b(null)});else if(null!=g&&0<g.length&&"text"==e&&0<=mxUtils.indexOf(g[0].types,"text/plain"))g[0].getType("text/plain").then(function(m){m.text().then(function(v){b(v)})["catch"](function(){b(null)})})["catch"](function(){b(null)});+0<=G&&G<A.length-3&&(A=A.substring(0,G+3))}catch(P){}try{var S=p.getElementsByTagName("span"),F=null!=S&&0<S.length?mxUtils.trim(decodeURIComponent(S[0].textContent)):decodeURIComponent(A);this.isCompatibleString(F)&&(A=F)}catch(P){}}catch(P){}b(this.isCompatibleString(A)?A:null)}))["catch"](function(v){b(null)})}))["catch"](function(m){b(null)});else if(null!=g&&0<g.length&&"text"==e&&0<=mxUtils.indexOf(g[0].types,"text/plain"))g[0].getType("text/plain").then(function(m){m.text().then(function(v){b(v)})["catch"](function(){b(null)})})["catch"](function(){b(null)});else b(null)}))["catch"](function(g){b(null)})};EditorUi.prototype.parseHtmlData=function(b){var e=null;if(null!=b&&0<b.length){var g="<meta "==b.substring(0,6);e=document.createElement("div");e.innerHTML=(g?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(b);asHtml=!0;b=e.getElementsByTagName("style");if(null!=b)for(;0<b.length;)b[0].parentNode.removeChild(b[0]);null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=e.firstChild.nextSibling&&e.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==e.firstChild.nodeName&&"A"==e.firstChild.nextSibling.nodeName&&null==e.firstChild.nextSibling.nextSibling&&(b=null==e.firstChild.nextSibling.innerText?mxUtils.getTextContent(e.firstChild.nextSibling):e.firstChild.nextSibling.innerText,b==e.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(e,b),asHtml=!1));g=g&&null!=e.firstChild?e.firstChild.nextSibling:e.firstChild;null!=g&&null==g.nextSibling&&g.nodeType==mxConstants.NODETYPE_ELEMENT&&"IMG"==g.nodeName?(b=g.getAttribute("src"),null!=b&&(Editor.isPngDataUrl(b)&&@@ -2210,14 +2210,14 @@ EditorUi.prototype.showDataDialog=function(b){null!=b&&"undefined"!==typeof windEditorUi.prototype.showBackgroundImageDialog=function(b,e){b=null!=b?b:mxUtils.bind(this,function(m){m=new ChangePageSetup(this,null,m);m.ignoreColor=!0;this.editor.graph.model.execute(m)});var g=mxUtils.prompt(mxResources.get("backgroundImage"),null!=e?e.src:"");null!=g&&0<g.length?(e=new Image,e.onload=function(){b(new mxImage(g,e.width,e.height),!1)},e.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},e.src=g):b(null)};EditorUi.prototype.setBackgroundImage=function(b){this.editor.graph.setBackgroundImage(b);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(b,e,g){mxUtils.confirm(b)?null!=e&&e():null!=g&&g()};EditorUi.prototype.createOutline=function(b){var e=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){e.update(!1)});return e};EditorUi.prototype.altShiftActions={65:"connectionArrows",82:"clearWaypoints",76:"editLink",79:"connectionPoints",81:"editConnectionPoints",84:"editTooltip",86:"pasteSize",70:"copySize",66:"copyData",69:"pasteData"};EditorUi.prototype.ctrlAltShiftActions={70:"bringForward",66:"sendBackward"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};-EditorUi.prototype.createKeyHandler=function(b){function e(Q,U,c){if(!m.isSelectionEmpty()&&m.isEnabled()){U=null!=U?U:1;var f=m.getCompositeParents(m.getSelectionCells()),k=0<f.length?f[0]:null;if(null!=k)if(c){m.getModel().beginUpdate();try{for(k=0;k<f.length;k++)if(m.getModel().isVertex(f[k])&&m.isCellResizable(f[k])){var B=m.getCellGeometry(f[k]);null!=B&&(B=B.clone(),37==Q?B.width=Math.max(0,B.width-U):38==Q?B.height=Math.max(0,B.height-U):39==Q?B.width+=U:40==Q&&(B.height+=U),m.getModel().setGeometry(f[k],-B))}}finally{m.getModel().endUpdate()}}else{B=m.model.getParent(k);var z=m.getView().scale;c=null;1==m.getSelectionCount()&&m.model.isVertex(k)&&null!=m.layoutManager&&!m.isCellLocked(k)&&(c=m.layoutManager.getLayout(B));if(null!=c&&c.constructor==mxStackLayout)U=B.getIndex(k),37==Q||38==Q?m.model.add(B,k,Math.max(0,U-1)):(39==Q||40==Q)&&m.model.add(B,k,Math.min(m.model.getChildCount(B),U+1));else{var C=m.graphHandler;null!=C&&(null==C.first&&C.start(k,0,0,m.getMovableCells(f)),null!=C.first&&(k=-f=0,37==Q?f=-U:38==Q?k=-U:39==Q?f=U:40==Q&&(k=U),C.currentDx+=f*z,C.currentDy+=k*z,C.checkPreview(),C.updatePreview()),null!=A&&window.clearTimeout(A),A=window.setTimeout(function(){if(null!=C.first){var H=C.roundLength(C.currentDx/z),K=C.roundLength(C.currentDy/z);C.moveCells(C.cells,H,K);C.reset()}},400))}}}}var g=this,m=this.editor.graph,v=new mxKeyHandler(m),p=v.isEventIgnored;v.isEventIgnored=function(Q){return!(mxEvent.isShiftDown(Q)&&9==Q.keyCode)&&(!this.isControlDown(Q)||mxEvent.isShiftDown(Q)||+EditorUi.prototype.createKeyHandler=function(b){function e(Q,T,c){if(!m.isSelectionEmpty()&&m.isEnabled()){T=null!=T?T:1;var f=m.getCompositeParents(m.getSelectionCells()),k=0<f.length?f[0]:null;if(null!=k)if(c){m.getModel().beginUpdate();try{for(k=0;k<f.length;k++)if(m.getModel().isVertex(f[k])&&m.isCellResizable(f[k])){var B=m.getCellGeometry(f[k]);null!=B&&(B=B.clone(),37==Q?B.width=Math.max(0,B.width-T):38==Q?B.height=Math.max(0,B.height-T):39==Q?B.width+=T:40==Q&&(B.height+=T),m.getModel().setGeometry(f[k],+B))}}finally{m.getModel().endUpdate()}}else{B=m.model.getParent(k);var z=m.getView().scale;c=null;1==m.getSelectionCount()&&m.model.isVertex(k)&&null!=m.layoutManager&&!m.isCellLocked(k)&&(c=m.layoutManager.getLayout(B));if(null!=c&&c.constructor==mxStackLayout)T=B.getIndex(k),37==Q||38==Q?m.model.add(B,k,Math.max(0,T-1)):(39==Q||40==Q)&&m.model.add(B,k,Math.min(m.model.getChildCount(B),T+1));else{var C=m.graphHandler;null!=C&&(null==C.first&&C.start(k,0,0,m.getMovableCells(f)),null!=C.first&&(k=+f=0,37==Q?f=-T:38==Q?k=-T:39==Q?f=T:40==Q&&(k=T),C.currentDx+=f*z,C.currentDy+=k*z,C.checkPreview(),C.updatePreview()),null!=A&&window.clearTimeout(A),A=window.setTimeout(function(){if(null!=C.first){var I=C.roundLength(C.currentDx/z),L=C.roundLength(C.currentDy/z);C.moveCells(C.cells,I,L);C.reset()}},400))}}}}var g=this,m=this.editor.graph,v=new mxKeyHandler(m),p=v.isEventIgnored;v.isEventIgnored=function(Q){return!(mxEvent.isShiftDown(Q)&&9==Q.keyCode)&&(!this.isControlDown(Q)||mxEvent.isShiftDown(Q)||90!=Q.keyCode&&89!=Q.keyCode&&188!=Q.keyCode&&190!=Q.keyCode&&85!=Q.keyCode)&&(66!=Q.keyCode&&73!=Q.keyCode||!this.isControlDown(Q)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=Q.keyCode&&107!=Q.keyCode||!this.isControlDown(Q)&&!mxEvent.isShiftDown(Q)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&p.apply(this,arguments)};v.isEnabledForEvent=function(Q){return!mxEvent.isConsumed(Q)&&this.isGraphEvent(Q)&&this.isEnabled()&&(null==-g.dialogs||0==g.dialogs.length)};v.isControlDown=function(Q){return mxEvent.isControlDown(Q)||mxClient.IS_MAC&&Q.metaKey};var A=null,G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},T=v.getFunction;mxKeyHandler.prototype.getFunction=function(Q){if(m.isEnabled()){var U=null;mxEvent.isShiftDown(Q)&&this.isControlDown(Q)&&mxEvent.isAltDown(Q)?U=g.actions.get(g.ctrlAltShiftActions[Q.keyCode]):mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)?-U=g.actions.get(g.altShiftActions[Q.keyCode]):this.isControlDown(Q)&&mxEvent.isAltDown(Q)&&(U=g.actions.get(g.ctrlAltActions[Q.keyCode]));if(null!=U)return U.funct;if(null!=G[Q.keyCode]&&!m.isSelectionEmpty())if(!this.isControlDown(Q)&&mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)){if(m.model.isVertex(m.getSelectionCell()))return function(){var c=m.connectVertex(m.getSelectionCell(),G[Q.keyCode],m.defaultEdgeLength,Q,!0);null!=c&&0<c.length&&(1==c.length&&m.model.isEdge(c[0])?m.setSelectionCell(m.model.getTerminal(c[0],-!1)):m.setSelectionCell(c[c.length-1]),m.scrollCellToVisible(m.getSelectionCell()),null!=g.hoverIcons&&g.hoverIcons.update(m.view.getState(m.getSelectionCell())))}}else return this.isControlDown(Q)?function(){e(Q.keyCode,mxEvent.isShiftDown(Q)?m.gridSize:null,!0)}:function(){e(Q.keyCode,mxEvent.isShiftDown(Q)?m.gridSize:null)}}return T.apply(this,arguments)};v.bindAction=mxUtils.bind(this,function(Q,U,c,f){var k=this.actions.get(c);null!=k&&(c=function(){k.isEnabled()&&k.funct.apply(this,arguments)},-U?f?v.bindControlShiftKey(Q,c):v.bindControlKey(Q,c):f?v.bindShiftKey(Q,c):v.bindKey(Q,c))});var F=this,P=v.escape;v.escape=function(Q){P.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){m.exitGroup()});v.bindControlShiftKey(35,function(){m.enterGroup()});v.bindShiftKey(36,function(){m.home()});v.bindKey(35,function(){m.refresh()});v.bindAction(80,!0,"print");v.bindAction(107,!0,"zoomIn");v.bindAction(109,!0,"zoomOut");v.bindAction(61,!0,"zoomIn");v.bindAction(187,!0,+g.dialogs||0==g.dialogs.length)};v.isControlDown=function(Q){return mxEvent.isControlDown(Q)||mxClient.IS_MAC&&Q.metaKey};var A=null,G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},S=v.getFunction;mxKeyHandler.prototype.getFunction=function(Q){if(m.isEnabled()){var T=null;mxEvent.isShiftDown(Q)&&this.isControlDown(Q)&&mxEvent.isAltDown(Q)?T=g.actions.get(g.ctrlAltShiftActions[Q.keyCode]):mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)?+T=g.actions.get(g.altShiftActions[Q.keyCode]):this.isControlDown(Q)&&mxEvent.isAltDown(Q)&&(T=g.actions.get(g.ctrlAltActions[Q.keyCode]));if(null!=T)return T.funct;if(null!=G[Q.keyCode]&&!m.isSelectionEmpty())if(!this.isControlDown(Q)&&mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)){if(m.model.isVertex(m.getSelectionCell()))return function(){var c=m.connectVertex(m.getSelectionCell(),G[Q.keyCode],m.defaultEdgeLength,Q,!0);null!=c&&0<c.length&&(1==c.length&&m.model.isEdge(c[0])?m.setSelectionCell(m.model.getTerminal(c[0],+!1)):m.setSelectionCell(c[c.length-1]),m.scrollCellToVisible(m.getSelectionCell()),null!=g.hoverIcons&&g.hoverIcons.update(m.view.getState(m.getSelectionCell())))}}else return this.isControlDown(Q)?function(){e(Q.keyCode,mxEvent.isShiftDown(Q)?m.gridSize:null,!0)}:function(){e(Q.keyCode,mxEvent.isShiftDown(Q)?m.gridSize:null)}}return S.apply(this,arguments)};v.bindAction=mxUtils.bind(this,function(Q,T,c,f){var k=this.actions.get(c);null!=k&&(c=function(){k.isEnabled()&&k.funct.apply(this,arguments)},+T?f?v.bindControlShiftKey(Q,c):v.bindControlKey(Q,c):f?v.bindShiftKey(Q,c):v.bindKey(Q,c))});var F=this,P=v.escape;v.escape=function(Q){P.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){m.exitGroup()});v.bindControlShiftKey(35,function(){m.enterGroup()});v.bindShiftKey(36,function(){m.home()});v.bindKey(35,function(){m.refresh()});v.bindAction(80,!0,"print");v.bindAction(107,!0,"zoomIn");v.bindAction(109,!0,"zoomOut");v.bindAction(61,!0,"zoomIn");v.bindAction(187,!0,"zoomIn");v.bindAction(222,!0,"zoomIn");v.bindAction(173,!0,"zoomOut");v.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)v.bindAction(79,!0,"outline",!0),v.bindControlKey(36,function(){m.isEnabled()&&m.foldCells(!0)}),v.bindControlKey(35,function(){m.isEnabled()&&m.foldCells(!1)}),v.bindControlKey(13,function(){F.ctrlEnter()}),v.bindAction(8,!1,"delete"),v.bindAction(8,!0,"deleteAll"),v.bindAction(8,!1,"deleteLabels",!0),v.bindAction(46,!1,"delete"),v.bindAction(46,!0,"deleteAll"),v.bindAction(46,!1,"deleteLabels",!0),v.bindAction(36,!1,"resetView"),v.bindAction(72,!0,"fitWindow",!0),v.bindAction(74,!0,"fitPage"),v.bindAction(74,!0,"fitTwoPages",!0),v.bindAction(48,!0,"customZoom"),v.bindAction(82,!0,"turn"),v.bindAction(82,!0,"clearDefaultStyle",!0),v.bindAction(83,!0,"save"),v.bindAction(83,!0,"saveAs",!0),v.bindAction(65,!0,"selectAll"),v.bindAction(65,!0,"selectNone",!0),v.bindAction(73,!0,"selectVertices",!0),v.bindAction(69,!0,"selectEdges",!0),v.bindAction(69,!0,"editStyle"),v.bindAction(66,!0,"bold"),v.bindAction(66,!0,"toBack",!0),v.bindAction(70,!0,"toFront",!0),v.bindAction(68,!0,"duplicate"),v.bindAction(68,!0,"setAsDefaultStyle",!0),v.bindAction(90,!0,"undo"),v.bindAction(90,!0,"redo",!0),v.bindAction(89,!0,"redo"),v.bindAction(89,!0,"autosize",!0),v.bindAction(88,!0,"cut"),v.bindAction(67,!0,"copy"),v.bindAction(86,!0,"paste"),v.bindAction(71,!0,"group"),v.bindAction(77,!0,"editData"),v.bindAction(71,!0,"grid",!0),v.bindAction(73,!0,"italic"),v.bindAction(76,@@ -2230,42 +2230,42 @@ null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gnull}var e=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.layersDialog];for(b=0;b<e.length;b++)null!=e[b]&&null!=e[b].parentNode&&e[b].parentNode.removeChild(e[b])};(function(){var b=[["nbsp","160"],["shy","173"]],e=mxUtils.parseXml;mxUtils.parseXml=function(m){for(var v=0;v<b.length;v++)m=m.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return e(m)};var g=mxUtils.getSizeForString;mxUtils.getSizeForString=function(m,v,p,A){return g(Graph.sanitizeHtml(m),v,p,A)}})();Date.prototype.toISOString||function(){function b(e){e=String(e);1===e.length&&(e="0"+e);return e}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();Date.now||(Date.now=function(){return(new Date).getTime()});Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,e=function(m){return"function"===typeof m||"[object Function]"===b.call(m)},g=Math.pow(2,53)-1;return function(m){var v=Object(m);if(null==m)throw new TypeError("Array.from requires an array-like object - not null or undefined");var p=1<arguments.length?arguments[1]:void 0,A;if("undefined"!==typeof p){if(!e(p))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(A=-arguments[2])}var G=Number(v.length);G=isNaN(G)?0:0!==G&&isFinite(G)?(0<G?1:-1)*Math.floor(Math.abs(G)):G;G=Math.min(Math.max(G,0),g);for(var T=e(this)?Object(new this(G)):Array(G),F=0,P;F<G;)P=v[F],T[F]=p?"undefined"===typeof A?p(P,F):p.call(A,P,F):P,F+=1;T.length=G;return T}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");+arguments[2])}var G=Number(v.length);G=isNaN(G)?0:0!==G&&isFinite(G)?(0<G?1:-1)*Math.floor(Math.abs(G)):G;G=Math.min(Math.max(G,0),g);for(var S=e(this)?Object(new this(G)):Array(G),F=0,P;F<G;)P=v[F],S[F]=p?"undefined"===typeof A?p(P,F):p.call(A,P,F):P,F+=1;S.length=G;return S}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var b=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===b||"en-ca"===b||"es-mx"===b?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.defaultGridColor="#d0d0d0";mxGraphView.prototype.defaultDarkGridColor="#424242";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(b){this.unit!=b&&(this.unit=b,this.graph.refresh(),this.fireEvent(new mxEventObject("unitChanged","unit",b)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(b,e,g){return null};mxImageShape.prototype.getImageDataUri=function(){var b=String(this.image);if("data:image/svg+xml;base64,"==b.substring(0,26)&&null!=this.style&&"1"==mxUtils.getValue(this.style,"clipSvg","0")){if(null==this.clippedSvg||this.clippedImage!=b)this.clippedSvg=Graph.clipSvgDataUri(b,!0),this.clippedImage=b;b=this.clippedSvg}return b};(function(){var b=mxResources.get;mxResources.get=function(e,g,m){null==m&&(m=e);return b.apply(this,[e,g,m])}})();Graph=function(b,e,g,m,v,p){mxGraph.call(this,b,e,g,m);this.themes=v||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=p?p:!1;b=this.baseUrl;e=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<e&&(e=b.indexOf("/",e+2),0<e&&(this.domainUrl=b.substring(0,e)),e=b.lastIndexOf("/"),0<e&&(this.domainPathUrl=b.substring(0,e+1)));this.isHtmlLabel=function(aa){aa=this.getCurrentCellStyle(aa);-return null!=aa?"1"==aa.html||"wrap"==aa[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var A=null,G=null,T=null,F=null,P=!1,Q=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(aa,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){aa=l.getProperty("event");var t=aa.getState();l=this.view.scale;if(!mxEvent.isAltDown(aa.getEvent())&&null!=t&&(Q=this.isCellSelected(t.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(aa.getEvent()))){var I=-this.selectionCellsHandler.getHandler(t.cell);if(null==I||null==I.getHandleForEvent(aa)){var V=new mxRectangle(aa.getGraphX()-1,aa.getGraphY()-1),J=mxEvent.isTouchEvent(aa.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;I=J+2;V.grow(J);if(this.isTableCell(t.cell)&&this.isCellMovable(t.cell)&&!this.isCellSelected(t.cell)&&!(mxUtils.contains(t,aa.getGraphX()-I,aa.getGraphY()-I)&&mxUtils.contains(t,aa.getGraphX()-I,aa.getGraphY()+I)&&mxUtils.contains(t,aa.getGraphX()+-I,aa.getGraphY()+I)&&mxUtils.contains(t,aa.getGraphX()+I,aa.getGraphY()-I))){var W=this.model.getParent(t.cell);I=this.model.getParent(W);if(!this.isCellSelected(I)){J*=l;var Y=2*J;if(this.model.getChildAt(I,0)!=W&&mxUtils.intersects(V,new mxRectangle(t.x,t.y-J,t.width,Y))||this.model.getChildAt(W,0)!=t.cell&&mxUtils.intersects(V,new mxRectangle(t.x-J,t.y,Y,t.height))||mxUtils.intersects(V,new mxRectangle(t.x,t.y+t.height-J,t.width,Y))||mxUtils.intersects(V,new mxRectangle(t.x+t.width-J,t.y,Y,t.height)))W=-this.selectionCellsHandler.isHandled(I),this.selectCellForEvent(I,aa.getEvent()),I=this.selectionCellsHandler.getHandler(I),null!=I&&(J=I.getHandleForEvent(aa),null!=J&&(I.start(aa.getGraphX(),aa.getGraphY(),J),I.blockDelayedSelection=!W,aa.consume()))}}for(;!aa.isConsumed()&&null!=t&&(this.isTableCell(t.cell)||this.isTableRow(t.cell)||this.isTable(t.cell));)this.isSwimlane(t.cell)&&this.isCellMovable(t.cell)&&(I=this.getActualStartSize(t.cell),(0<I.x||0<I.width)&&mxUtils.intersects(V,new mxRectangle(t.x+-(I.x-I.width-1)*l+(0==I.x?t.width:0),t.y,1,t.height))||(0<I.y||0<I.height)&&mxUtils.intersects(V,new mxRectangle(t.x,t.y+(I.y-I.height-1)*l+(0==I.y?t.height:0),t.width,1)))&&(this.selectCellForEvent(t.cell,aa.getEvent()),I=this.selectionCellsHandler.getHandler(t.cell),null!=I&&null!=I.customHandles&&(J=mxEvent.CUSTOM_HANDLE-I.customHandles.length+1,I.start(aa.getGraphX(),aa.getGraphY(),J),aa.consume())),t=this.view.getState(this.model.getParent(t.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,-mxUtils.bind(this,function(aa,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){aa=l.getProperty("event");var t=aa.getState();mxEvent.isAltDown(aa.getEvent())||mxEvent.isControlDown(l)||mxEvent.isShiftDown(l)||Q||null==t||!this.model.isEdge(t.cell)||(A=new mxPoint(aa.getGraphX(),aa.getGraphY()),P=this.isCellSelected(t.cell),T=t,G=aa,null!=t.text&&null!=t.text.boundingBox&&mxUtils.contains(t.text.boundingBox,aa.getGraphX(),aa.getGraphY())?F=mxEvent.LABEL_HANDLE:(l=this.selectionCellsHandler.getHandler(t.cell),-null!=l&&null!=l.bends&&0<l.bends.length&&(F=l.getHandleForEvent(aa))))}}));this.addMouseListener({mouseDown:function(aa,l){},mouseMove:mxUtils.bind(this,function(aa,l){aa=this.selectionCellsHandler.handlers.map;for(var t in aa)if(null!=aa[t].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(l.getEvent())){var I=this.tolerance;if(null!=A&&null!=T&&null!=G){if(t=T,null!=F||Math.abs(A.x-l.getGraphX())>I||Math.abs(A.y-l.getGraphY())>I){var V=null;mxEvent.isShiftDown(l.getEvent())||-(V=this.selectionCellsHandler.getHandler(t.cell));if(null!=V&&null!=V.bends&&0<V.bends.length){V.redrawHandles();var J=null!=F?F:V.getHandleForEvent(G),W=this.view.getEdgeStyle(t),Y=W==mxEdgeStyle.EntityRelation;I=t.absolutePoints;P||(J=F);J!=mxEvent.LABEL_HANDLE&&null!=I&&(J=F,null==J&&(aa=new mxRectangle(A.x,A.y),aa.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(aa,I[0].x,I[0].y)?J=0:mxUtils.contains(aa,I[I.length-1].x,I[I.length-1].y)?J=V.bends.length-1:null!=I&&(null==W&&null==-J||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&(null!=W&&(2==I.length||3==I.length&&(0==Math.round(I[0].x-I[1].x)&&0==Math.round(I[1].x-I[2].x)||0==Math.round(I[0].y-I[1].y)&&0==Math.round(I[1].y-I[2].y)))?J=2:(J=mxUtils.findNearestSegment(t,A.x,A.y),J=null==W?mxEvent.VIRTUAL_HANDLE-J:J+1))),null==J&&(J=mxEvent.VIRTUAL_HANDLE));aa=J==mxEvent.LABEL_HANDLE||0==J||J==V.bends.length-1;if(!Y&&(null!=t.visibleSourceState||null!=t.visibleTargetState)||aa)V.start(l.getGraphX(),l.getGraphX(),-J),l.consume(),this.graphHandler.reset()}null!=V&&(this.selectionCellsHandler.isHandlerActive(V)?this.isCellSelected(t.cell)||(this.selectionCellsHandler.handlers.put(t.cell,V),this.selectCellForEvent(t.cell,l.getEvent())):this.isCellSelected(t.cell)||V.destroy());P=!1;A=G=T=F=null}}else if(t=l.getState(),null!=t&&this.isCellEditable(t.cell)){aa=this.model.getParent(t.cell);V=null;if(this.model.isEdge(t.cell)&&!this.isCellSelected(t.cell)&&!mxEvent.isAltDown(l.getEvent())&&!mxEvent.isShiftDown(l.getEvent())&&-!this.isAncestorSelected(t.cell)&&(this.isSwimlane(aa)||this.model.isLayer(aa)||this.getCurrentRoot()==aa)){if(aa=new mxRectangle(l.getGraphX(),l.getGraphY()),aa.grow(mxEdgeHandler.prototype.handleImage.width/2),I=t.absolutePoints,null!=I)null!=t.text&&null!=t.text.boundingBox&&mxUtils.contains(t.text.boundingBox,l.getGraphX(),l.getGraphY())?V="move":mxUtils.contains(aa,I[0].x,I[0].y)||mxUtils.contains(aa,I[I.length-1].x,I[I.length-1].y)?V="pointer":(W=this.view.getEdgeStyle(t),W==mxEdgeStyle.EntityRelation||-null==t.visibleSourceState&&null==t.visibleTargetState||(V="crosshair",W!=mxEdgeStyle.SegmentConnector&&W!=mxEdgeStyle.OrthConnector))||(l=mxUtils.findNearestSegment(t,l.getGraphX(),l.getGraphY()),l<I.length-1&&0<=l&&(V=0==Math.round(I[l].x-I[l+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(l.getEvent())){I=mxShape.prototype.svgStrokeTolerance/2;aa=new mxRectangle(l.getGraphX(),l.getGraphY());aa.grow(I);if(this.isTableCell(t.cell)&&this.isCellMovable(t.cell)&&(l=this.model.getParent(t.cell),-I=this.model.getParent(l),!this.isCellSelected(I)))if(mxUtils.intersects(aa,new mxRectangle(t.x,t.y-2,t.width,4))&&this.model.getChildAt(I,0)!=l||mxUtils.intersects(aa,new mxRectangle(t.x,t.y+t.height-2,t.width,4)))V="row-resize";else if(mxUtils.intersects(aa,new mxRectangle(t.x-2,t.y,4,t.height))&&this.model.getChildAt(l,0)!=t.cell||mxUtils.intersects(aa,new mxRectangle(t.x+t.width-2,t.y,4,t.height)))V="col-resize";for(l=t;null==V&&null!=l&&(this.isTableCell(l.cell)||this.isTableRow(l.cell)||this.isTable(l.cell));)this.isSwimlane(l.cell)&&-this.isCellMovable(l.cell)&&(I=this.getActualStartSize(l.cell),J=this.view.scale,(0<I.x||0<I.width)&&mxUtils.intersects(aa,new mxRectangle(l.x+(I.x-I.width-1)*J+(0==I.x?l.width*J:0),l.y,1,l.height))?V="col-resize":(0<I.y||0<I.height)&&mxUtils.intersects(aa,new mxRectangle(l.x,l.y+(I.y-I.height-1)*J+(0==I.y?l.height:0),l.width,1))&&(V="row-resize")),l=this.view.getState(this.model.getParent(l.cell))}null!=V&&t.setCursor(V)}}}),mouseUp:mxUtils.bind(this,function(aa,l){F=A=G=T=null})})}this.cellRenderer.minSvgStrokeWidth=-.1;var U=document.createElement("div");this.cellRenderer.getLabelValue=function(aa){var l=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);aa.view.graph.isHtmlLabel(aa.cell)&&("0"==mxUtils.getValue(aa.style,"html","0")?l=mxUtils.htmlEntities(l,!1):(aa.lastLabelValue!=l&&(aa.lastLabelValue=l,aa.lastSanitizedLabelValue=Graph.sanitizeHtml(l),U.innerHTML=aa.lastSanitizedLabelValue,Graph.addLightDarkColors(U,null,"simple"==aa.view.graph.getAdaptiveColors())&&(aa.lastSanitizedLabelValue=U.innerHTML)),+return null!=aa?"1"==aa.html||"wrap"==aa[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var A=null,G=null,S=null,F=null,P=!1,Q=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(aa,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){aa=l.getProperty("event");var t=aa.getState();l=this.view.scale;if(!mxEvent.isAltDown(aa.getEvent())&&null!=t&&(Q=this.isCellSelected(t.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(aa.getEvent()))){var H=+this.selectionCellsHandler.getHandler(t.cell);if(null==H||null==H.getHandleForEvent(aa)){var U=new mxRectangle(aa.getGraphX()-1,aa.getGraphY()-1),K=mxEvent.isTouchEvent(aa.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;H=K+2;U.grow(K);if(this.isTableCell(t.cell)&&this.isCellMovable(t.cell)&&!this.isCellSelected(t.cell)&&!(mxUtils.contains(t,aa.getGraphX()-H,aa.getGraphY()-H)&&mxUtils.contains(t,aa.getGraphX()-H,aa.getGraphY()+H)&&mxUtils.contains(t,aa.getGraphX()++H,aa.getGraphY()+H)&&mxUtils.contains(t,aa.getGraphX()+H,aa.getGraphY()-H))){var W=this.model.getParent(t.cell);H=this.model.getParent(W);if(!this.isCellSelected(H)){K*=l;var Y=2*K;if(this.model.getChildAt(H,0)!=W&&mxUtils.intersects(U,new mxRectangle(t.x,t.y-K,t.width,Y))||this.model.getChildAt(W,0)!=t.cell&&mxUtils.intersects(U,new mxRectangle(t.x-K,t.y,Y,t.height))||mxUtils.intersects(U,new mxRectangle(t.x,t.y+t.height-K,t.width,Y))||mxUtils.intersects(U,new mxRectangle(t.x+t.width-K,t.y,Y,t.height)))W=+this.selectionCellsHandler.isHandled(H),this.selectCellForEvent(H,aa.getEvent()),H=this.selectionCellsHandler.getHandler(H),null!=H&&(K=H.getHandleForEvent(aa),null!=K&&(H.start(aa.getGraphX(),aa.getGraphY(),K),H.blockDelayedSelection=!W,aa.consume()))}}for(;!aa.isConsumed()&&null!=t&&(this.isTableCell(t.cell)||this.isTableRow(t.cell)||this.isTable(t.cell));)this.isSwimlane(t.cell)&&this.isCellMovable(t.cell)&&(H=this.getActualStartSize(t.cell),(0<H.x||0<H.width)&&mxUtils.intersects(U,new mxRectangle(t.x++(H.x-H.width-1)*l+(0==H.x?t.width:0),t.y,1,t.height))||(0<H.y||0<H.height)&&mxUtils.intersects(U,new mxRectangle(t.x,t.y+(H.y-H.height-1)*l+(0==H.y?t.height:0),t.width,1)))&&(this.selectCellForEvent(t.cell,aa.getEvent()),H=this.selectionCellsHandler.getHandler(t.cell),null!=H&&null!=H.customHandles&&(K=mxEvent.CUSTOM_HANDLE-H.customHandles.length+1,H.start(aa.getGraphX(),aa.getGraphY(),K),aa.consume())),t=this.view.getState(this.model.getParent(t.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,+mxUtils.bind(this,function(aa,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){aa=l.getProperty("event");var t=aa.getState();mxEvent.isAltDown(aa.getEvent())||mxEvent.isControlDown(l)||mxEvent.isShiftDown(l)||Q||null==t||!this.model.isEdge(t.cell)||(A=new mxPoint(aa.getGraphX(),aa.getGraphY()),P=this.isCellSelected(t.cell),S=t,G=aa,null!=t.text&&null!=t.text.boundingBox&&mxUtils.contains(t.text.boundingBox,aa.getGraphX(),aa.getGraphY())?F=mxEvent.LABEL_HANDLE:(l=this.selectionCellsHandler.getHandler(t.cell),+null!=l&&null!=l.bends&&0<l.bends.length&&(F=l.getHandleForEvent(aa))))}}));this.addMouseListener({mouseDown:function(aa,l){},mouseMove:mxUtils.bind(this,function(aa,l){aa=this.selectionCellsHandler.handlers.map;for(var t in aa)if(null!=aa[t].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(l.getEvent())){var H=this.tolerance;if(null!=A&&null!=S&&null!=G){if(t=S,null!=F||Math.abs(A.x-l.getGraphX())>H||Math.abs(A.y-l.getGraphY())>H){var U=null;mxEvent.isShiftDown(l.getEvent())||+(U=this.selectionCellsHandler.getHandler(t.cell));if(null!=U&&null!=U.bends&&0<U.bends.length){U.redrawHandles();var K=null!=F?F:U.getHandleForEvent(G),W=this.view.getEdgeStyle(t),Y=W==mxEdgeStyle.EntityRelation;H=t.absolutePoints;P||(K=F);K!=mxEvent.LABEL_HANDLE&&null!=H&&(K=F,null==K&&(aa=new mxRectangle(A.x,A.y),aa.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(aa,H[0].x,H[0].y)?K=0:mxUtils.contains(aa,H[H.length-1].x,H[H.length-1].y)?K=U.bends.length-1:null!=H&&(null==W&&null==+K||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&(null!=W&&(2==H.length||3==H.length&&(0==Math.round(H[0].x-H[1].x)&&0==Math.round(H[1].x-H[2].x)||0==Math.round(H[0].y-H[1].y)&&0==Math.round(H[1].y-H[2].y)))?K=2:(K=mxUtils.findNearestSegment(t,A.x,A.y),K=null==W?mxEvent.VIRTUAL_HANDLE-K:K+1))),null==K&&(K=mxEvent.VIRTUAL_HANDLE));aa=K==mxEvent.LABEL_HANDLE||0==K||K==U.bends.length-1;if(!Y&&(null!=t.visibleSourceState||null!=t.visibleTargetState)||aa)U.start(l.getGraphX(),l.getGraphX(),+K),l.consume(),this.graphHandler.reset()}null!=U&&(this.selectionCellsHandler.isHandlerActive(U)?this.isCellSelected(t.cell)||(this.selectionCellsHandler.handlers.put(t.cell,U),this.selectCellForEvent(t.cell,l.getEvent())):this.isCellSelected(t.cell)||U.destroy());P=!1;A=G=S=F=null}}else if(t=l.getState(),null!=t&&this.isCellEditable(t.cell)){aa=this.model.getParent(t.cell);U=null;if(this.model.isEdge(t.cell)&&!this.isCellSelected(t.cell)&&!mxEvent.isAltDown(l.getEvent())&&!mxEvent.isShiftDown(l.getEvent())&&+!this.isAncestorSelected(t.cell)&&(this.isSwimlane(aa)||this.model.isLayer(aa)||this.getCurrentRoot()==aa)){if(aa=new mxRectangle(l.getGraphX(),l.getGraphY()),aa.grow(mxEdgeHandler.prototype.handleImage.width/2),H=t.absolutePoints,null!=H)null!=t.text&&null!=t.text.boundingBox&&mxUtils.contains(t.text.boundingBox,l.getGraphX(),l.getGraphY())?U="move":mxUtils.contains(aa,H[0].x,H[0].y)||mxUtils.contains(aa,H[H.length-1].x,H[H.length-1].y)?U="pointer":(W=this.view.getEdgeStyle(t),W==mxEdgeStyle.EntityRelation||+null==t.visibleSourceState&&null==t.visibleTargetState||(U="crosshair",W!=mxEdgeStyle.SegmentConnector&&W!=mxEdgeStyle.OrthConnector))||(l=mxUtils.findNearestSegment(t,l.getGraphX(),l.getGraphY()),l<H.length-1&&0<=l&&(U=0==Math.round(H[l].x-H[l+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(l.getEvent())){H=mxShape.prototype.svgStrokeTolerance/2;aa=new mxRectangle(l.getGraphX(),l.getGraphY());aa.grow(H);if(this.isTableCell(t.cell)&&this.isCellMovable(t.cell)&&(l=this.model.getParent(t.cell),+H=this.model.getParent(l),!this.isCellSelected(H)))if(mxUtils.intersects(aa,new mxRectangle(t.x,t.y-2,t.width,4))&&this.model.getChildAt(H,0)!=l||mxUtils.intersects(aa,new mxRectangle(t.x,t.y+t.height-2,t.width,4)))U="row-resize";else if(mxUtils.intersects(aa,new mxRectangle(t.x-2,t.y,4,t.height))&&this.model.getChildAt(l,0)!=t.cell||mxUtils.intersects(aa,new mxRectangle(t.x+t.width-2,t.y,4,t.height)))U="col-resize";for(l=t;null==U&&null!=l&&(this.isTableCell(l.cell)||this.isTableRow(l.cell)||this.isTable(l.cell));)this.isSwimlane(l.cell)&&+this.isCellMovable(l.cell)&&(H=this.getActualStartSize(l.cell),K=this.view.scale,(0<H.x||0<H.width)&&mxUtils.intersects(aa,new mxRectangle(l.x+(H.x-H.width-1)*K+(0==H.x?l.width*K:0),l.y,1,l.height))?U="col-resize":(0<H.y||0<H.height)&&mxUtils.intersects(aa,new mxRectangle(l.x,l.y+(H.y-H.height-1)*K+(0==H.y?l.height:0),l.width,1))&&(U="row-resize")),l=this.view.getState(this.model.getParent(l.cell))}null!=U&&t.setCursor(U)}}}),mouseUp:mxUtils.bind(this,function(aa,l){F=A=G=S=null})})}this.cellRenderer.minSvgStrokeWidth=+.1;var T=document.createElement("div");this.cellRenderer.getLabelValue=function(aa){var l=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);aa.view.graph.isHtmlLabel(aa.cell)&&("0"==mxUtils.getValue(aa.style,"html","0")?l=mxUtils.htmlEntities(l,!1):(aa.lastLabelValue!=l&&(aa.lastLabelValue=l,aa.lastSanitizedLabelValue=Graph.sanitizeHtml(l),T.innerHTML=aa.lastSanitizedLabelValue,Graph.addLightDarkColors(T,null,"simple"==aa.view.graph.getAdaptiveColors())&&(aa.lastSanitizedLabelValue=T.innerHTML)),l=aa.lastSanitizedLabelValue));return l};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(aa,-l){return!1};this.alternateEdgeStyle="vertical";null==m&&this.loadStylesheet();var c=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var aa=c.apply(this,arguments);if(this.graph.pageVisible){var l=[],t=this.graph.pageFormat,I=this.graph.pageScale,V=t.width*I;t=t.height*I;I=this.graph.view.translate;for(var J=this.graph.view.scale,W=this.graph.getPageLayout(),Y=0;Y<W.width;Y++)l.push(new mxRectangle(((W.x+Y)*V+I.x)*J,(W.y*t+I.y)*J,V*J,t*J));for(Y=1;Y<W.height;Y++)l.push(new mxRectangle((W.x*-V+I.x)*J,((W.y+Y)*t+I.y)*J,V*J,t*J));aa=l.concat(aa)}return aa};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(aa,l){return null==aa.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(aa){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var f=this.graphHandler.getCells;this.graphHandler.getCells=-function(aa){for(var l=f.apply(this,arguments),t=new mxDictionary,I=[],V=0;V<l.length;V++){var J=this.graph.isTableCell(aa)&&this.graph.isTableCell(l[V])&&this.graph.isCellSelected(l[V])?this.graph.model.getParent(l[V]):this.graph.isTableRow(aa)&&this.graph.isTableRow(l[V])&&this.graph.isCellSelected(l[V])?l[V]:this.graph.getCompositeParent(l[V]);null==J||t.get(J)||(t.put(J,!0),I.push(J))}return I};var k=this.graphHandler.start;this.graphHandler.start=function(aa,l,t,I){var V=!1;this.graph.isTableCell(aa)&&-(this.graph.isCellSelected(aa)?V=!0:aa=this.graph.model.getParent(aa));V||this.graph.isTableRow(aa)&&this.graph.isCellSelected(aa)||(aa=this.graph.getCompositeParent(aa));k.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(aa,l){l=this.graph.getCompositeParent(l);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(aa,l,t,I,V,J){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=I&&-this.graph.applyNewEdgeStyle(I,[W]);return W};var B=new mxRubberband(this);this.getRubberband=function(){return B};var z=(new Date).getTime(),C=0,H=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var aa=this.currentState;H.apply(this,arguments);aa!=this.currentState?(z=(new Date).getTime(),C=0):C=(new Date).getTime()-z};var K=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(aa){return mxEvent.isShiftDown(aa.getEvent())&&-mxEvent.isAltDown(aa.getEvent())?!1:null!=this.currentState&&aa.getState()==this.currentState&&2E3<C||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&K.apply(this,arguments)};var M=this.isToggleEvent;this.isToggleEvent=function(aa){return M.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(aa)};var O=B.isForceRubberbandEvent;B.isForceRubberbandEvent=function(aa){return O.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(aa.getEvent())||-mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==aa.getState()&&mxEvent.isTouchEvent(aa.getEvent())};var ea=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(ea=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=ea)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=-function(aa){return mxEvent.isMouseEvent(aa.getEvent())};var fa=this.click;this.click=function(aa){var l=null==aa.state&&null!=aa.sourceState&&this.isCellLocked(this.getLayerForCell(aa.sourceState.cell));if(this.isEnabled()&&!l||aa.isConsumed())return fa.apply(this,arguments);var t=l?aa.sourceState.cell:aa.getCell();if(null!=t){var I=this.getClickableLinkForCell(t);null!=I?this.isCustomLink(I)?this.customLinkClicked(I,t):this.openLink(I):l&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=-function(aa){return aa.sourceState};var S=this.tooltipHandler.show;this.tooltipHandler.show=function(){S.apply(this,arguments);if(null!=this.div)for(var aa=this.div.getElementsByTagName("a"),l=0;l<aa.length;l++)null!=aa[l].getAttribute("href")&&null==aa[l].getAttribute("target")&&aa[l].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(aa){return aa.sourceState};this.getCursorForMouseEvent=function(aa){var l=null==aa.state&&null!=aa.sourceState&&this.isCellLocked(aa.sourceState.cell);-return this.getCursorForCell(l?aa.sourceState.cell:aa.getCell())};var ca=this.getCursorForCell;this.getCursorForCell=function(aa){if(!this.isEnabled()||this.isCellLocked(aa)){if(null!=this.getClickableLinkForCell(aa))return"pointer";if(this.isCellLocked(aa))return"default"}return ca.apply(this,arguments)};this.selectRegion=function(aa,l){var t=mxEvent.isAltDown(l)?aa:null;aa=this.getCells(aa.x,aa.y,aa.width,aa.height,null,null,t,null,!0);if(this.isToggleEvent(l))for(t=0;t<aa.length;t++)this.selectCellForEvent(aa[t],+l){return!1};this.alternateEdgeStyle="vertical";null==m&&this.loadStylesheet();var c=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var aa=c.apply(this,arguments);if(this.graph.pageVisible){var l=[],t=this.graph.pageFormat,H=this.graph.pageScale,U=t.width*H;t=t.height*H;H=this.graph.view.translate;for(var K=this.graph.view.scale,W=this.graph.getPageLayout(),Y=0;Y<W.width;Y++)l.push(new mxRectangle(((W.x+Y)*U+H.x)*K,(W.y*t+H.y)*K,U*K,t*K));for(Y=1;Y<W.height;Y++)l.push(new mxRectangle((W.x*+U+H.x)*K,((W.y+Y)*t+H.y)*K,U*K,t*K));aa=l.concat(aa)}return aa};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(aa,l){return null==aa.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(aa){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var f=this.graphHandler.getCells;this.graphHandler.getCells=+function(aa){for(var l=f.apply(this,arguments),t=new mxDictionary,H=[],U=0;U<l.length;U++){var K=this.graph.isTableCell(aa)&&this.graph.isTableCell(l[U])&&this.graph.isCellSelected(l[U])?this.graph.model.getParent(l[U]):this.graph.isTableRow(aa)&&this.graph.isTableRow(l[U])&&this.graph.isCellSelected(l[U])?l[U]:this.graph.getCompositeParent(l[U]);null==K||t.get(K)||(t.put(K,!0),H.push(K))}return H};var k=this.graphHandler.start;this.graphHandler.start=function(aa,l,t,H){var U=!1;this.graph.isTableCell(aa)&&+(this.graph.isCellSelected(aa)?U=!0:aa=this.graph.model.getParent(aa));U||this.graph.isTableRow(aa)&&this.graph.isCellSelected(aa)||(aa=this.graph.getCompositeParent(aa));k.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(aa,l){l=this.graph.getCompositeParent(l);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(aa,l,t,H,U,K){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=H&&+this.graph.applyNewEdgeStyle(H,[W]);return W};var B=new mxRubberband(this);this.getRubberband=function(){return B};var z=(new Date).getTime(),C=0,I=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var aa=this.currentState;I.apply(this,arguments);aa!=this.currentState?(z=(new Date).getTime(),C=0):C=(new Date).getTime()-z};var L=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(aa){return mxEvent.isShiftDown(aa.getEvent())&&+mxEvent.isAltDown(aa.getEvent())?!1:null!=this.currentState&&aa.getState()==this.currentState&&2E3<C||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&L.apply(this,arguments)};var J=this.isToggleEvent;this.isToggleEvent=function(aa){return J.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(aa)};var O=B.isForceRubberbandEvent;B.isForceRubberbandEvent=function(aa){return O.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(aa.getEvent())||+mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==aa.getState()&&mxEvent.isTouchEvent(aa.getEvent())};var da=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(da=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=da)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=+function(aa){return mxEvent.isMouseEvent(aa.getEvent())};var fa=this.click;this.click=function(aa){var l=null==aa.state&&null!=aa.sourceState&&this.isCellLocked(this.getLayerForCell(aa.sourceState.cell));if(this.isEnabled()&&!l||aa.isConsumed())return fa.apply(this,arguments);var t=l?aa.sourceState.cell:aa.getCell();if(null!=t){var H=this.getClickableLinkForCell(t);null!=H?this.isCustomLink(H)?this.customLinkClicked(H,t):this.openLink(H):l&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=+function(aa){return aa.sourceState};var V=this.tooltipHandler.show;this.tooltipHandler.show=function(){V.apply(this,arguments);if(null!=this.div)for(var aa=this.div.getElementsByTagName("a"),l=0;l<aa.length;l++)null!=aa[l].getAttribute("href")&&null==aa[l].getAttribute("target")&&aa[l].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(aa){return aa.sourceState};this.getCursorForMouseEvent=function(aa){var l=null==aa.state&&null!=aa.sourceState&&this.isCellLocked(aa.sourceState.cell);+return this.getCursorForCell(l?aa.sourceState.cell:aa.getCell())};var ba=this.getCursorForCell;this.getCursorForCell=function(aa){if(!this.isEnabled()||this.isCellLocked(aa)){if(null!=this.getClickableLinkForCell(aa))return"pointer";if(this.isCellLocked(aa))return"default"}return ba.apply(this,arguments)};this.selectRegion=function(aa,l){var t=mxEvent.isAltDown(l)?aa:null;aa=this.getCells(aa.x,aa.y,aa.width,aa.height,null,null,t,null,!0);if(this.isToggleEvent(l))for(t=0;t<aa.length;t++)this.selectCellForEvent(aa[t],l);else this.selectCellsForEvent(aa,l);return aa};var ma=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(aa,l,t){return this.graph.isCellSelected(aa)?!1:ma.apply(this,arguments)};var la=this.updateMouseEvent;this.updateMouseEvent=function(aa){aa=la.apply(this,arguments);null!=aa.state&&this.isCellLocked(this.getLayerForCell(aa.getCell()))&&(null==this.getLinkForCell(aa.getCell())?aa.state=this.view.getState(this.getCellAt(aa.getGraphX(),aa.getGraphY(),-null,null,null,mxUtils.bind(this,function(l,t,I){return aa.state==l||this.isCellLocked(this.getLayerForCell(l.cell))&&null==this.getLinkForCell(l.cell)}))):aa.state=null);return aa};var Z=this.isCellSelectable;this.isCellSelectable=function(aa){return Z.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(aa))};this.isCellLocked=function(aa){for(;null!=aa;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(aa),"locked","0"))return!0;aa=this.model.getParent(aa)}return!1};var da=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,-mxUtils.bind(this,function(aa,l){"mouseDown"==l.getProperty("eventName")&&(aa=l.getProperty("event").getState(),da=null==aa||this.isSelectionEmpty()||this.isCellSelected(aa.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(aa,l){if(!mxEvent.isMultiTouchEvent(l)){aa=l.getProperty("event");var t=l.getProperty("cell");null==t?(aa=mxUtils.convertPoint(this.container,mxEvent.getClientX(aa),mxEvent.getClientY(aa)),B.start(aa.x,aa.y)):null!=da?this.addSelectionCells(da):-1<this.getSelectionCount()&&this.isCellSelected(t)&&this.removeSelectionCell(t);da=null;l.consume()}}));this.connectionHandler.selectCells=function(aa,l){this.graph.setSelectionCell(l||aa)};this.connectionHandler.constraintHandler.isStateIgnored=function(aa,l){var t=aa.view.graph;return l&&(t.isCellSelected(aa.cell)||t.isTableRow(aa.cell)&&t.selectionCellsHandler.isHandled(t.model.getParent(aa.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var aa=this.connectionHandler.constraintHandler;+null,null,null,mxUtils.bind(this,function(l,t,H){return aa.state==l||this.isCellLocked(this.getLayerForCell(l.cell))&&null==this.getLinkForCell(l.cell)}))):aa.state=null);return aa};var Z=this.isCellSelectable;this.isCellSelectable=function(aa){return Z.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(aa))};this.isCellLocked=function(aa){for(;null!=aa;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(aa),"locked","0"))return!0;aa=this.model.getParent(aa)}return!1};var ea=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,+mxUtils.bind(this,function(aa,l){"mouseDown"==l.getProperty("eventName")&&(aa=l.getProperty("event").getState(),ea=null==aa||this.isSelectionEmpty()||this.isCellSelected(aa.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(aa,l){if(!mxEvent.isMultiTouchEvent(l)){aa=l.getProperty("event");var t=l.getProperty("cell");null==t?(aa=mxUtils.convertPoint(this.container,mxEvent.getClientX(aa),mxEvent.getClientY(aa)),B.start(aa.x,aa.y)):null!=ea?this.addSelectionCells(ea):+1<this.getSelectionCount()&&this.isCellSelected(t)&&this.removeSelectionCell(t);ea=null;l.consume()}}));this.connectionHandler.selectCells=function(aa,l){this.graph.setSelectionCell(l||aa)};this.connectionHandler.constraintHandler.isStateIgnored=function(aa,l){var t=aa.view.graph;return l&&(t.isCellSelected(aa.cell)||t.isTableRow(aa.cell)&&t.selectionCellsHandler.isHandled(t.model.getParent(aa.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var aa=this.connectionHandler.constraintHandler;null!=aa.currentFocus&&aa.isStateIgnored(aa.currentFocus,!0)&&(aa.currentFocus=null,aa.constraints=null,aa.destroyIcons());aa.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch()}this.currentTranslate=new mxPoint(0,0)};Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.translateDiagram="1"==urlParams["translate-diagram"];Graph.diagramLanguage=null!=urlParams["diagram-language"]?urlParams["diagram-language"]:mxClient.language;Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;Graph.zoomWheel=!1;Graph.selectParentLayer=!1;Graph.minTableColumnWidth=20;Graph.minTableRowHeight=20;Graph.foreignObjectWarningText="Text is not SVG - cannot display";Graph.foreignObjectWarningLink="https://www.drawio.com/doc/faq/svg-export-text-problems";Graph.xmlDeclaration='<?xml version="1.0" encoding="UTF-8"?>';Graph.svgDoctype='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';Graph.svgFileComment="\x3c!-- Do not edit this file with editors other than draw.io --\x3e";@@ -2279,35 +2279,35 @@ Graph.createSvgImage=function(b,e,g,m,v){g=unescape(encodeURIComponent(Graph.svgGraph.getSvgFromDataUri=function(b){return null!=b&&"data:image/svg"==b.substring(0,14)?Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+decodeURIComponent(escape(atob(b.substring(b.indexOf(",")+1)))):null};Graph.createSvgNode=function(b,e,g,m,v){var p=mxUtils.createXmlDocument(),A=null!=p.createElementNS?p.createElementNS(mxConstants.NS_SVG,"svg"):p.createElement("svg");null!=v&&A.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==p.createElementNS?(A.setAttribute("xmlns",mxConstants.NS_SVG),A.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):A.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);A.setAttribute("version","1.1");A.setAttribute("width",g+"px");A.setAttribute("height",m+"px");A.setAttribute("viewBox",b+" "+e+" "+g+" "+m);p.appendChild(A);return A};-Graph.htmlToPng=function(b,e,g,m,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var A=document.createElement("canvas");A.width=e*p;A.height=g*p;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var F=A.getContext("2d");F.scale(p,p);F.drawImage(G,0,0);m(A.toDataURL())}catch(P){m(null)}});var T=mxUtils.createXmlDocument();T=null!=T.createElementNS?T.createElementNS(mxConstants.NS_SVG,"svg"):T.createElement("svg");b=(new mxSvgCanvas2D(T)).convertHtml(b);G.onerror=+Graph.htmlToPng=function(b,e,g,m,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var A=document.createElement("canvas");A.width=e*p;A.height=g*p;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var F=A.getContext("2d");F.scale(p,p);F.drawImage(G,0,0);m(A.toDataURL())}catch(P){m(null)}});var S=mxUtils.createXmlDocument();S=null!=S.createElementNS?S.createElementNS(mxConstants.NS_SVG,"svg"):S.createElement("svg");b=(new mxSvgCanvas2D(S)).convertHtml(b);G.onerror=function(F){m(null)};G.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+g+'">'+(""!=v?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+v+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};-Graph.addLightDarkColors=function(b,e,g,m){function v(U,c,f){return null!=m?m(U,c,f):mxUtils.isValidColor(f)?(null==T&&null!=e&&(T={}),null!=T&&(T[c]=U.style.getPropertyValue(c)),f=mxUtils.getLightDarkColor(f,null,null,g),U.style.setProperty(c,f.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),A=!1,G=0;G<p.length;G++)if(p[G]!=b){for(var T=null,F=0;F<p[G].style.length;F++){var P=p[G].style.item(F),Q=p[G].style.getPropertyValue(P);A=v(p[G],P,Q)||A}"FONT"==p[G].nodeName&&""==p[G].style.getPropertyValue("color")&&-(Q=p[G].getAttribute("color"),A=v(p[G],"color",Q)||A);null!=e&&null!=T&&p[G].setAttribute(e,JSON.stringify(T))}return A};Graph.removeLightDarkColors=function(b,e){b=b.getElementsByTagName("*");for(var g=!1,m=0;m<b.length;m++)try{var v=b[m].getAttribute(e);if(null!=v){b[m].removeAttribute(e);var p=JSON.parse(v),A;for(A in p){var G=p[A];""==G?(b[m].style[A]=null,""==b[m].getAttribute("style")&&b[m].removeAttribute("style")):b[m].style[A]=G;g=!0}}}catch(T){}return g};-Graph.setTextColor=function(b,e,g){for(var m=g?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=g?"color":"background-color",p=b.getElementsByTagName("*"),A=[],G=0;G<p.length;G++)A.push({node:p[G],value:p[G].style[v]});document.execCommand(g?"forecolor":"backcolor",!1,m);b=b.getElementsByTagName("*");for(G=0;G<b.length;G++){if(G<A.length&&A[G].node==b[G]&&A[G].value!=b[G].style[v]&&""==b[G].style[v])try{if(p=b[G].getAttribute(Graph.backupStyleAttribute),null!=p){var T=JSON.parse(p);T[v]=-"";b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(T))}}catch(F){}if(g&&b[G].getAttribute("color")==m||b[G].style[v]==m){g&&b[G].getAttribute("color")==m&&b[G].removeAttribute("color");b[G].style[v]=e!=mxConstants.NONE?mxUtils.getLightDarkColor(e).cssText:null;try{p=b[G].getAttribute(Graph.backupStyleAttribute),T=null!=p?JSON.parse(p):{},T[v]=e!=mxConstants.NONE?e:"",b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(T))}catch(F){}if(g&&mxClient.IS_FF){e=b[G];g=e.firstChild;if(null!=+Graph.addLightDarkColors=function(b,e,g,m){function v(T,c,f){return null!=m?m(T,c,f):mxUtils.isValidColor(f)?(null==S&&null!=e&&(S={}),null!=S&&(S[c]=T.style.getPropertyValue(c)),f=mxUtils.getLightDarkColor(f,null,null,g),T.style.setProperty(c,f.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),A=!1,G=0;G<p.length;G++)if(p[G]!=b){for(var S=null,F=0;F<p[G].style.length;F++){var P=p[G].style.item(F),Q=p[G].style.getPropertyValue(P);A=v(p[G],P,Q)||A}"FONT"==p[G].nodeName&&""==p[G].style.getPropertyValue("color")&&+(Q=p[G].getAttribute("color"),A=v(p[G],"color",Q)||A);null!=e&&null!=S&&p[G].setAttribute(e,JSON.stringify(S))}return A};Graph.removeLightDarkColors=function(b,e){b=b.getElementsByTagName("*");for(var g=!1,m=0;m<b.length;m++)try{var v=b[m].getAttribute(e);if(null!=v){b[m].removeAttribute(e);var p=JSON.parse(v),A;for(A in p){var G=p[A];""==G?(b[m].style[A]=null,""==b[m].getAttribute("style")&&b[m].removeAttribute("style")):b[m].style[A]=G;g=!0}}}catch(S){}return g};+Graph.setTextColor=function(b,e,g){for(var m=g?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=g?"color":"background-color",p=b.getElementsByTagName("*"),A=[],G=0;G<p.length;G++)A.push({node:p[G],value:p[G].style[v]});document.execCommand(g?"forecolor":"backcolor",!1,m);b=b.getElementsByTagName("*");for(G=0;G<b.length;G++){if(G<A.length&&A[G].node==b[G]&&A[G].value!=b[G].style[v]&&""==b[G].style[v])try{if(p=b[G].getAttribute(Graph.backupStyleAttribute),null!=p){var S=JSON.parse(p);S[v]=+"";b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}}catch(F){}if(g&&b[G].getAttribute("color")==m||b[G].style[v]==m){g&&b[G].getAttribute("color")==m&&b[G].removeAttribute("color");b[G].style[v]=e!=mxConstants.NONE?mxUtils.getLightDarkColor(e).cssText:null;try{p=b[G].getAttribute(Graph.backupStyleAttribute),S=null!=p?JSON.parse(p):{},S[v]=e!=mxConstants.NONE?e:"",b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}catch(F){}if(g&&mxClient.IS_FF){e=b[G];g=e.firstChild;if(null!=g&&"A"==g.nodeName&&null==g.nextSibling&&null!=g.firstChild){e.parentNode.insertBefore(g,e);for(m=g.firstChild;null!=m;)v=m.nextSibling,e.appendChild(m),m=v;g.appendChild(e)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=b.charCodeAt(g);return e};Graph.bytesToString=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=String.fromCharCode(b[g]);return e.join("")};Graph.base64EncodeUnicode=function(b){return btoa(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(e,g){return String.fromCharCode(parseInt(g,16))}))};Graph.base64DecodeUnicode=function(b){return decodeURIComponent(Array.prototype.map.call(atob(b),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))};Graph.compressNode=function(b,e){b=mxUtils.getXml(b);return Graph.compress(e?b:Graph.zapGremlins(b))};Graph.arrayBufferToString=function(b){var e="";b=new Uint8Array(b);for(var g=b.byteLength,m=0;m<g;m++)e+=String.fromCharCode(b[m]);return e};Graph.stringToArrayBuffer=function(b){return Uint8Array.from(b,function(e){return e.charCodeAt(0)})};Graph.arrayBufferIndexOfString=function(b,e,g){var m=e.charCodeAt(0),v=1,p=-1;for(g=g||0;g<b.byteLength;g++)if(b[g]==m){p=g;break}for(g=p+1;-1<p&&g<b.byteLength&&g<p+e.length-1;g++){if(b[g]!=e.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,e,p+1);v++}return v==e.length-1?p:-1};Graph.compress=function(b,e){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=e?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};Graph.decompress=function(b,e,g){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));e=decodeURIComponent(e?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return g?e:Graph.zapGremlins(e)};Graph.fadeNodes=function(b,e,g,m,v){v=null!=v?v:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,e);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+v+"ms ease-in-out");Graph.setOpacityForNodes(b,g);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=m&&m()},v)},0)};-Graph.exploreFromCell=function(b,e,g){pageSize=null!=g&&null!=g.pageSize?g.pageSize:8;minSize=null!=g&&null!=g.minSize?g.minSize:180;(function(m,v){function p(P,Q){if(P.getModel().isVertex(Q)){var U=P.container.scrollWidth/2,c=P.container.scrollHeight/2;P.rootCell=Q.referenceCell||Q;P.getModel().beginUpdate();try{for(var f=Q.referenceCell||Q,k=m.model.getCell(f.sourceCellId),B=m.getEdges(k,null,!0,!0,!1,!0),z=[],C=0;C<B.length;C++)null!=B[C].getTerminal(!0)&&null!=B[C].getTerminal(!1)&&m.isCellVisible(B[C])&&-!m.isEdgeIgnored(B[C])&&m.isCellVisible(B[C].getTerminal(!0))&&m.isCellVisible(B[C].getTerminal(!1))&&m.isCellVisible(m.getLayerForCell(B[C]))&&z.push(B[C]);z=B=z;if(null!=Q.startIndex||0<pageSize&&B.length>pageSize){var H=Q.startIndex||0;z=B.slice(Math.max(0,H),Math.min(B.length,H+pageSize))}z=m.getOpposites(z,k).concat(z);var K=P.cloneCells(z);for(C=0;C<z.length;C++)if(K[C].sourceCellId=z[C].id,P.model.isEdge(K[C]))for(K[C].geometry.x=0,K[C].geometry.y=0,K[C].geometry.points=null,K[C].setStyle(K[C].getStyle()+-";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffc0;textOpacity=100;"),K[C].setTerminal(f,null==K[C].getTerminal(!0)),k=0;k<K[C].getChildCount();k++){var M=K[C].getChildAt(k);null!=M.geometry&&M.geometry.relative&&(M.setStyle(M.getStyle()+";labelBackgroundColor=#ffffffc0;textOpacity=100;"),M.geometry.offset=new mxPoint(0,0),M.geometry.y=0,M.geometry.x=.5>M.geometry.x?-.8:.5<M.geometry.x?.8:0)}if(0<Q.startIndex){var O=P.createVertex(null,null,mxResources.get("previousPage")+-" ("+Math.ceil((Q.startIndex||0)/pageSize)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");O.referenceCell=f;O.startIndex=Math.max(0,(Q.startIndex||0)-pageSize);K.splice(0,0,O)}if(B.length>(Q.startIndex||0)+pageSize){var ea=P.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((Q.startIndex||0)/pageSize)+2)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ea.referenceCell=-f;ea.startIndex=(Q.startIndex||0)+pageSize;K.splice(0,0,ea)}for(var fa in P.getModel().cells){var S=P.getModel().getCell(fa);S!=P.rootCell&&!P.getModel().isAncestor(P.rootCell,S)&&P.getModel().isVertex(S)&&P.removeCells([S])}P.addCells(K);var ca=P.getModel().getGeometry(P.rootCell);null!=ca&&(ca=ca.clone(),ca.x=U-ca.width/2,ca.y=c-ca.height/3,P.getModel().setGeometry(P.rootCell,ca));Q=[];for(fa in P.getModel().cells)S=P.getModel().getCell(fa),S!=P.rootCell&&P.getModel().isVertex(S)&&P.getModel().getParent(S)==-P.getDefaultParent()&&(Q.push(S),ca=P.getModel().getGeometry(S),null!=ca&&(ca.x=U-ca.width/2,ca.y=c-ca.height/2));var ma=Q.length,la=2*Math.PI/ma,Z=Math.max(minSize,Math.min(P.container.scrollWidth/2.5-80,P.container.scrollHeight/2.5-80));for(U=0;U<ma;U++)ca=P.getModel().getGeometry(Q[U]),null!=ca&&(ca=ca.clone(),ca.x+=Z*Math.sin(U*la),ca.y+=Z*Math.cos(U*la),P.getModel().setGeometry(Q[U],ca))}finally{P.getModel().endUpdate()}}}var A=document.createElement("div");A.style.position="absolute";A.style.display=-"block";A.style.background=Editor.isDarkMode()?Editor.darkColor:"#ffffff";A.style.width="100%";A.style.height="100%";A.style.left="0px";A.style.top="0px";A.style.zIndex=2;var G=document.createElement("img");G.setAttribute("src",Editor.closeBlackImage);G.style.position="absolute";G.style.cursor="pointer";G.style.right="10px";G.style.top="10px";A.appendChild(G);var T=document.createElement("div");T.style.position="absolute";T.style.cursor="pointer";T.style.right="38px";T.style.top="14px";T.style.textAlign=-"right";T.style.verticalAlign="top";mxUtils.write(T,mxResources.get("close"));A.appendChild(T);document.body.appendChild(A);var F=function(P){27==P.keyCode&&G.click()};mxEvent.addListener(document,"keydown",F);(function(P){if(mxClient.isBrowserSupported()){var Q=new Graph(P);Q.keepEdgesInBackground=!0;Q.isCellResizable=function(){return!1};Q.isCellRotatable=function(){return!1};Q.getCursorForCell=function(z){return this.model.isVertex(z)?"pointer":null};Q.getFoldingImage=function(){return null};var U=-function(){mxEvent.removeListener(document,"keydown",F);P.parentNode.removeChild(P);m.scrollCellToVisible(v)};mxEvent.addListener(G,"click",U);mxEvent.addListener(T,"click",U);Q.setEnabled(!1);var c=Q.click;Q.click=function(z){var C=z.getCell(),H=null!=C?null!=C.referenceCell?C.referenceCell:C:null;null!=C&&Q.rootCell!=C&&0<Q.getEdges(H).length?p(Q,C):c.apply(this,arguments)};U=Q.container.scrollWidth/2;var f=Q.container.scrollHeight/3;Q.model.beginUpdate();var k=Q.importCells([v])[0];k.sourceCellId=-v.id;k.geometry.x=U-k.geometry.width/2;k.geometry.y=f-k.geometry.height/2;Q.model.endUpdate();var B=!1;Q.getModel().addListener(mxEvent.CHANGE,function(z,C){B||(z=C.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,Q.labelsVisible=!1,B=!0,mxEffects.animateChanges(Q,z,function(){var H=new mxParallelEdgeLayout(Q);H.spacing=60;var K=H.layout;H.layout=function(M){H.spacing=Math.min(60,Math.max(30,60-5*M.length));K.apply(this,arguments)};H.execute(Q.getDefaultParent());mxText.prototype.enableBoundingBox=+Graph.exploreFromCell=function(b,e,g){pageSize=null!=g&&null!=g.pageSize?g.pageSize:8;minSize=null!=g&&null!=g.minSize?g.minSize:180;(function(m,v){function p(P,Q){if(P.getModel().isVertex(Q)){var T=P.container.scrollWidth/2,c=P.container.scrollHeight/2;P.rootCell=Q.referenceCell||Q;P.getModel().beginUpdate();try{for(var f=Q.referenceCell||Q,k=m.model.getCell(f.sourceCellId),B=m.getEdges(k,null,!0,!0,!1,!0),z=[],C=0;C<B.length;C++)null!=B[C].getTerminal(!0)&&null!=B[C].getTerminal(!1)&&m.isCellVisible(B[C])&&+!m.isEdgeIgnored(B[C])&&m.isCellVisible(B[C].getTerminal(!0))&&m.isCellVisible(B[C].getTerminal(!1))&&m.isCellVisible(m.getLayerForCell(B[C]))&&z.push(B[C]);z=B=z;if(null!=Q.startIndex||0<pageSize&&B.length>pageSize){var I=Q.startIndex||0;z=B.slice(Math.max(0,I),Math.min(B.length,I+pageSize))}z=m.getOpposites(z,k).concat(z);var L=P.cloneCells(z);for(C=0;C<z.length;C++)if(L[C].sourceCellId=z[C].id,P.model.isEdge(L[C]))for(L[C].geometry.x=0,L[C].geometry.y=0,L[C].geometry.points=null,L[C].setStyle(L[C].getStyle()++";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffc0;textOpacity=100;"),L[C].setTerminal(f,null==L[C].getTerminal(!0)),k=0;k<L[C].getChildCount();k++){var J=L[C].getChildAt(k);null!=J.geometry&&J.geometry.relative&&(J.setStyle(J.getStyle()+";labelBackgroundColor=#ffffffc0;textOpacity=100;"),J.geometry.offset=new mxPoint(0,0),J.geometry.y=0,J.geometry.x=.5>J.geometry.x?-.8:.5<J.geometry.x?.8:0)}if(0<Q.startIndex){var O=P.createVertex(null,null,mxResources.get("previousPage")++" ("+Math.ceil((Q.startIndex||0)/pageSize)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");O.referenceCell=f;O.startIndex=Math.max(0,(Q.startIndex||0)-pageSize);L.splice(0,0,O)}if(B.length>(Q.startIndex||0)+pageSize){var da=P.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((Q.startIndex||0)/pageSize)+2)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");da.referenceCell=+f;da.startIndex=(Q.startIndex||0)+pageSize;L.splice(0,0,da)}for(var fa in P.getModel().cells){var V=P.getModel().getCell(fa);V!=P.rootCell&&!P.getModel().isAncestor(P.rootCell,V)&&P.getModel().isVertex(V)&&P.removeCells([V])}P.addCells(L);var ba=P.getModel().getGeometry(P.rootCell);null!=ba&&(ba=ba.clone(),ba.x=T-ba.width/2,ba.y=c-ba.height/3,P.getModel().setGeometry(P.rootCell,ba));Q=[];for(fa in P.getModel().cells)V=P.getModel().getCell(fa),V!=P.rootCell&&P.getModel().isVertex(V)&&P.getModel().getParent(V)==+P.getDefaultParent()&&(Q.push(V),ba=P.getModel().getGeometry(V),null!=ba&&(ba.x=T-ba.width/2,ba.y=c-ba.height/2));var ma=Q.length,la=2*Math.PI/ma,Z=Math.max(minSize,Math.min(P.container.scrollWidth/2.5-80,P.container.scrollHeight/2.5-80));for(T=0;T<ma;T++)ba=P.getModel().getGeometry(Q[T]),null!=ba&&(ba=ba.clone(),ba.x+=Z*Math.sin(T*la),ba.y+=Z*Math.cos(T*la),P.getModel().setGeometry(Q[T],ba))}finally{P.getModel().endUpdate()}}}var A=document.createElement("div");A.style.position="absolute";A.style.display=+"block";A.style.background=Editor.isDarkMode()?Editor.darkColor:"#ffffff";A.style.width="100%";A.style.height="100%";A.style.left="0px";A.style.top="0px";A.style.zIndex=2;var G=document.createElement("img");G.setAttribute("src",Editor.closeBlackImage);G.style.position="absolute";G.style.cursor="pointer";G.style.right="10px";G.style.top="10px";A.appendChild(G);var S=document.createElement("div");S.style.position="absolute";S.style.cursor="pointer";S.style.right="38px";S.style.top="14px";S.style.textAlign=+"right";S.style.verticalAlign="top";mxUtils.write(S,mxResources.get("close"));A.appendChild(S);document.body.appendChild(A);var F=function(P){27==P.keyCode&&G.click()};mxEvent.addListener(document,"keydown",F);(function(P){if(mxClient.isBrowserSupported()){var Q=new Graph(P);Q.keepEdgesInBackground=!0;Q.isCellResizable=function(){return!1};Q.isCellRotatable=function(){return!1};Q.getCursorForCell=function(z){return this.model.isVertex(z)?"pointer":null};Q.getFoldingImage=function(){return null};var T=+function(){mxEvent.removeListener(document,"keydown",F);P.parentNode.removeChild(P);m.scrollCellToVisible(v)};mxEvent.addListener(G,"click",T);mxEvent.addListener(S,"click",T);Q.setEnabled(!1);var c=Q.click;Q.click=function(z){var C=z.getCell(),I=null!=C?null!=C.referenceCell?C.referenceCell:C:null;null!=C&&Q.rootCell!=C&&0<Q.getEdges(I).length?p(Q,C):c.apply(this,arguments)};T=Q.container.scrollWidth/2;var f=Q.container.scrollHeight/3;Q.model.beginUpdate();var k=Q.importCells([v])[0];k.sourceCellId=+v.id;k.geometry.x=T-k.geometry.width/2;k.geometry.y=f-k.geometry.height/2;Q.model.endUpdate();var B=!1;Q.getModel().addListener(mxEvent.CHANGE,function(z,C){B||(z=C.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,Q.labelsVisible=!1,B=!0,mxEffects.animateChanges(Q,z,function(){var I=new mxParallelEdgeLayout(Q);I.spacing=60;var L=I.layout;I.layout=function(J){I.spacing=Math.min(60,Math.max(30,60-5*J.length));L.apply(this,arguments)};I.execute(Q.getDefaultParent());mxText.prototype.enableBoundingBox=!0;Q.labelsVisible=!0;Q.tooltipHandler.hide();Q.refresh();B=!1}))});p(Q,k)}else mxUtils.error("Browser is not supported!",200,!1)})(A)})(b,e)};Graph.removeKeys=function(b,e){for(var g in b)e(g)&&delete b[g]};Graph.setTransitionForNodes=function(b,e){for(var g=0;g<b.length;g++)mxUtils.setPrefixedStyle(b[g].style,"transition",e)};Graph.setOpacityForNodes=function(b,e){for(var g=0;g<b.length;g++)b[g].style.opacity=e};Graph.removePasteFormatting=function(b,e){for(;null!=b;){null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild,!0);var g=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style){"#000000"==b.style.color&&(b.style.color="");if("SPAN"==b.nodeName&&"Apple-tab-span"==b.className){var m=Graph.createTabNode(4);b.parentNode.replaceChild(m,b);b=m}if("P"==b.nodeName&&"p1"==b.className){for(;null!=b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);null!=g&&"P"==g.nodeName&&"p1"==g.className&&b.parentNode.insertBefore(b.ownerDocument.createElement("br"),b);b.parentNode.removeChild(b)}!e&&null!=b.innerHTML&&0<=b.innerHTML.indexOf("\t")&&(m=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,m.outerHTML))}b=g}};Graph.createTabNode=function(b){var e="\t";if(null!=b)for(e="";0<b;)e+=" ",b--;b=document.createElement("span");b.style.whiteSpace="pre";b.appendChild(document.createTextNode(e));return b};Graph.sanitizeHtml=function(b,e){return Graph.domPurify(b,!1)};Graph.sanitizeLink=function(b){if(null==b)return null;var e=document.createElement("a");e.setAttribute("href",b);Graph.sanitizeNode(e);return e.getAttribute("href")};Graph.sanitizeNode=function(b){return Graph.domPurify(b,!0)};DOMPurify.addHook("afterSanitizeAttributes",function(b){"use"==b.nodeName&&(null!=b.getAttribute("xlink:href")&&!b.getAttribute("xlink:href").startsWith("#")||null!=b.getAttribute("href")&&!b.getAttribute("href").startsWith("#"))&&b.remove()});Graph.domPurify=function(b,e){window.DOM_PURIFY_CONFIG.IN_PLACE=e;return DOMPurify.sanitize(b,window.DOM_PURIFY_CONFIG)};Graph.clipSvgDataUri=function(b,e){if(!mxClient.IS_IE&&!mxClient.IS_IE11&&null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var g=document.createElement("div");g.style.position="absolute";g.style.visibility="hidden";var m=decodeURIComponent(escape(atob(b.substring(26)))),v=m.indexOf("<svg");if(0<=v){g.innerHTML=Graph.sanitizeHtml(m.substring(v));var p=g.getElementsByTagName("svg");if(0<p.length){if(e||null!=p[0].getAttribute("preserveAspectRatio")){document.body.appendChild(g);try{m=e=-1;var A=p[0].getAttribute("width"),G=p[0].getAttribute("height");A=null!=A&&"%"!=A.charAt(A.length-1)?parseFloat(A):NaN;G=null!=G&&"%"!=G.charAt(G.length-1)?parseFloat(G):NaN;var T=p[0].getAttribute("viewBox");v=null;if(null!=T&&!isNaN(A)&&!isNaN(G)){var F=T.split(" ");4<=T.length&&(e=parseFloat(F[2])/A,m=parseFloat(F[3])/G,v=new mxRectangle(parseFloat(F[0]),parseFloat(F[1]),parseFloat(F[2]),parseFloat(F[3])))}var P=p[0].getBBox();0<P.width&&0<P.height&&(null==v||P.width*P.height<v.width*v.height*+1;var A=p[0].getAttribute("width"),G=p[0].getAttribute("height");A=null!=A&&"%"!=A.charAt(A.length-1)?parseFloat(A):NaN;G=null!=G&&"%"!=G.charAt(G.length-1)?parseFloat(G):NaN;var S=p[0].getAttribute("viewBox");v=null;if(null!=S&&!isNaN(A)&&!isNaN(G)){var F=S.split(" ");4<=S.length&&(e=parseFloat(F[2])/A,m=parseFloat(F[3])/G,v=new mxRectangle(parseFloat(F[0]),parseFloat(F[1]),parseFloat(F[2]),parseFloat(F[3])))}var P=p[0].getBBox();0<P.width&&0<P.height&&(null==v||P.width*P.height<v.width*v.height*.7)&&(g.getElementsByTagName("svg")[0].setAttribute("viewBox",P.x+" "+P.y+" "+P.width+" "+P.height),g.getElementsByTagName("svg")[0].setAttribute("width",P.width/e),g.getElementsByTagName("svg")[0].setAttribute("height",P.height/m))}catch(Q){}finally{document.body.removeChild(g)}}b=Editor.createSvgDataUri(mxUtils.getXml(p[0]))}}}catch(Q){}return b};Graph.createRemoveIcon=function(b,e){var g=document.createElement("img");g.setAttribute("src",Dialog.prototype.clearImage);g.setAttribute("title",b);g.setAttribute("width","13");g.setAttribute("height","10");g.style.marginLeft="4px";g.style.marginBottom="-1px";g.style.cursor="pointer";mxEvent.addListener(g,"click",e);return g};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};Graph.rewritePageLinks=function(b,e){function g(v,p){var A=v.getAttribute(p);if(null!=A){Graph.isPageLink(A)&&(A="#"+A.substring(A.indexOf(":")+1));var G=p;e&&"xlink:href"==p&&(v.removeAttribute(p),G="href");v.setAttribute(G,A)}}b=b.getElementsByTagName("a");if(null!=b)for(var m=0;m<b.length;m++)g(b[m],"href"),g(b[m],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};@@ -2316,32 +2316,32 @@ Graph.prototype.diagramBackgroundColor="#f0f0f0";Graph.prototype.enableDiagramBaGraph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;Graph.prototype.selectParentAfterDelete=!1;Graph.prototype.defaultEdgeLength=80;Graph.prototype.immediateHandling=!0;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}^ ^\"^ '^=^;]+)%","g");Graph.prototype.absoluteUrlPattern=RegExp("^(?:[a-z]+:)?//","i");Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=null!=urlParams.base?mxUtils.removeJavascriptProtocol(decodeURIComponent(urlParams.base)):(window!=window.top?document.referrer:document.location.toString()).split("#")[0];Graph.prototype.editAfterInsert=!1;Graph.prototype.builtInProperties=["label","tooltip","placeholders","placeholder"];Graph.prototype.standalone=!1;Graph.prototype.enableFlowAnimation=!1;Graph.prototype.roundableShapes="label rectangle internalStorage corner parallelogram swimlane triangle trapezoid ext step tee process link rhombus offPageConnector loopLimit hexagon manualInput card curlyBracket singleArrow callout doubleArrow flexArrow umlLifeline".split(" ");Graph.prototype.vertexFontSize=null;Graph.prototype.edgeFontSize=null;Graph.prototype.adaptiveColors="auto";-Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(g,m){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=g.view.graph.tolerance,p=!0,A=null,G=mxUtils.bind(this,function(P){p=!0;A=new mxPoint(mxEvent.getClientX(P),mxEvent.getClientY(P))}),T=mxUtils.bind(this,function(P){p=p&&null!=A&&Math.abs(A.x-mxEvent.getClientX(P))<v&&Math.abs(A.y-mxEvent.getClientY(P))<v}),F=mxUtils.bind(this,function(P){if(p)for(var Q=mxEvent.getSource(P);null!=-Q&&Q!=m.node;){if("a"==Q.nodeName.toLowerCase()){g.view.graph.labelLinkClicked(g,Q,P);break}Q=Q.parentNode}});mxEvent.addGestureListeners(m.node,G,T,F);mxEvent.addListener(m.node,"click",function(P){mxEvent.consume(P)})};if(null!=this.tooltipHandler){var e=this.tooltipHandler.init;this.tooltipHandler.init=function(){e.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(g){var m=mxEvent.getSource(g);"A"==m.nodeName&&(m=m.getAttribute("href"),null!=+Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(g,m){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=g.view.graph.tolerance,p=!0,A=null,G=mxUtils.bind(this,function(P){p=!0;A=new mxPoint(mxEvent.getClientX(P),mxEvent.getClientY(P))}),S=mxUtils.bind(this,function(P){p=p&&null!=A&&Math.abs(A.x-mxEvent.getClientX(P))<v&&Math.abs(A.y-mxEvent.getClientY(P))<v}),F=mxUtils.bind(this,function(P){if(p)for(var Q=mxEvent.getSource(P);null!=+Q&&Q!=m.node;){if("a"==Q.nodeName.toLowerCase()){g.view.graph.labelLinkClicked(g,Q,P);break}Q=Q.parentNode}});mxEvent.addGestureListeners(m.node,G,S,F);mxEvent.addListener(m.node,"click",function(P){mxEvent.consume(P)})};if(null!=this.tooltipHandler){var e=this.tooltipHandler.init;this.tooltipHandler.init=function(){e.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(g){var m=mxEvent.getSource(g);"A"==m.nodeName&&(m=m.getAttribute("href"),null!=m&&this.graph.isCustomLink(m)&&(mxEvent.isTouchEvent(g)||!mxEvent.isPopupTrigger(g))&&this.graph.customLinkClicked(m)&&mxEvent.consume(g))}))}}this.initLayoutManager()};(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.isFillState=function(A){return!this.isSpecialColor(A.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(A.style,"lineShape",null)&&(this.model.isVertex(A.cell)||"arrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"wire"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"filledEdge"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"flexArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"mxgraph.arrows2.wedgeArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isGradientState=function(A){return this.isFillState(A)&&"wire"!=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)};Graph.prototype.isStrokeState=function(A){return!0};Graph.prototype.isSpecialColor=function(A){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],A)};Graph.prototype.isGlassState=function(A){A=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return"label"==A||"rectangle"==A||"internalStorage"==A||"ext"==A||"umlLifeline"==A||"swimlane"==A||"process"==A};Graph.prototype.isRoundedState=function(A){return null!=A.shape?A.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(A){var G=mxUtils.getValue(A.style,-mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(A.style,mxConstants.STYLE_CURVED,!1)&&("connector"==G||"filledEdge"==G||"wire"==G)};Graph.prototype.isAutoSizeState=function(A){return"1"==mxUtils.getValue(A.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(A){return null!=mxUtils.getValue(A.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(A){return!0};Graph.prototype.getVerticesAndEdges=function(A,G){A=null!=A?A:!0;G=null!=G?G:!0;var T=this.model;-return T.filterDescendants(function(F){return A&&T.isVertex(F)||G&&T.isEdge(F)},T.getRoot())};Graph.prototype.applyNewEdgeStyle=function(A,G,T){A=this.getCellStyle(A).newEdgeStyle;if(null!=A){this.model.beginUpdate();try{var F=JSON.parse(A),P;for(P in F)this.setCellStyles(P,F[P],G),"edgeStyle"==P&&"elbowEdgeStyle"==F[P]&&null!=T&&this.setCellStyles("elbow",T==mxConstants.DIRECTION_SOUTH||T==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",G)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=-function(A){for(var G={},T=0;T<A.length;T++){var F=this.view.getState(A[T]);null!=F&&this.mergeStyle(F.style,G,0==T)}return G};Graph.prototype.mergeStyle=function(A,G,T){if(null!=A){var F={},P;for(P in A){var Q=A[P];null!=Q&&(F[P]=!0,null==G[P]&&T?G[P]=Q:G[P]!=Q&&delete G[P])}for(P in G)F[P]||delete G[P]}};Graph.prototype.getStartEditingCell=function(A,G){G=this.getCellStyle(A);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&-0<this.model.getChildCount(A)&&(A=this.model.getChildAt(A,0),G=this.getCellStyle(A),G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&0<this.model.getChildCount(A))for(G=0;G<this.model.getChildCount(A);G++){var T=this.model.getChildAt(A,G);if(this.isCellEditable(T)){A=T;break}}return A};Graph.prototype.copyStyle=function(A){return this.getCellStyle(A,!1)};Graph.prototype.pasteStyle=function(A,G,T,F){null!=A&&(F||-(T=null!=T?T:Graph.cellStyles,Graph.removeKeys(A,function(P){return 0>mxUtils.indexOf(T,P)})),this.updateCellStyles(A,G))};Graph.prototype.copyCellStyles=function(A,G,T,F,P,Q,U){var c=!1,f=!1;if(0<A.length)for(var k=0;k<A.length&&(c=this.getModel().isVertex(A[k])||c,!(f=this.getModel().isEdge(A[k])||f)||!c);k++);else f=c=!0;c=c&&!Q;f=f&&!U;for(k=0;k<G.length;k++)if(A=0<=mxUtils.indexOf(Graph.textStyles,G[k]),"strokeColor"!=G[k]||null!=T[k]&&"none"!=T[k])if(0<=mxUtils.indexOf(Graph.cellStyles,G[k])||-"shape"==G[k])if("shape"!=G[k]&&(c||A)&&(null==T[k]?delete F[G[k]]:F[G[k]]=T[k]),f||A)null==T[k]?delete P[G[k]]:P[G[k]]=T[k]};Graph.prototype.includeDescendants=function(A){for(var G=[],T=0;T<A.length;T++)G=G.concat(this.model.getDescendants(A[T]));return G};Graph.prototype.pasteCellStyles=function(A,G,T,F,P){G=null!=G?G:this.currentVertexStyle;T=null!=T?T:this.currentEdgeStyle;P=null!=P?P:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var Q=0;Q<A.length;Q++){var U=A[Q],c=this.model.getStyle(U),-f=!1;null!=U.style&&(pairs=U.style.split(";"),f=f||0<=mxUtils.indexOf(pairs,"text"));if(f)var k=Graph.textStyles;else if(k=Graph.cellStyles.slice(),!F)for(var B=null!=c?c.split(";"):[],z=0;z<B.length;z++){var C=B[z],H=C.indexOf("=");if(0<=H){var K=C.substring(0,H),M=mxUtils.indexOf(k,K);0<=M&&k.splice(M,1);for(f=0;f<Graph.cellStyleGroups.length;f++){var O=Graph.cellStyleGroups[f];if(0<=mxUtils.indexOf(O,K))for(var ea=0;ea<O.length;ea++){var fa=mxUtils.indexOf(k,O[ea]);0<=fa&&k.splice(fa,1)}}}}var S=-this.model.isEdge(U);f=S?T:G;for(z=0;z<k.length;z++){K=k[z];var ca=f[K];null!=ca&&("edgeStyle"!=K||P)&&(S||!S&&0>mxUtils.indexOf(Graph.edgeStyles,K))&&(c=mxUtils.setStyle(c,K,ca),"fontFamily"==K&&null==f.fontSource&&(c=mxUtils.setStyle(c,"fontSource",null)),S&&"rounded"==K&&"1"==ca&&null==f.curved&&(c=mxUtils.setStyle(c,"curved",null)))}Editor.simpleLabels&&(c=mxUtils.setStyle(mxUtils.setStyle(c,"html",null),"whiteSpace",null));this.model.setStyle(U,c)}}finally{this.model.endUpdate()}return A};Graph.prototype.updateCellStyles=-function(A,G){this.model.beginUpdate();try{for(var T=0;T<G.length;T++)if(this.model.isVertex(G[T])||this.model.isEdge(G[T])){var F=this.getCellStyle(G[T],!1),P=F[mxConstants.STYLE_PERIMETER],Q=!1;for(c in A){var U=A[c];if(F[c]!=U){if(c==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[c]&&"umlLifeline"!=U){Q=!0;var c="participant"}this.setCellStyles(c,U,[G[T]])}}Q&&this.setCellStyles(mxConstants.STYLE_PERIMETER,P,[G[T]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=-urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(A,G,T,F,P,Q){this.useCssTransforms&&(A=A/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=-function(A,G,T,F,P,Q){F=null!=F?F:!0;P=null!=P?P:!0;null==T&&(T=this.getCurrentRoot(),null==T&&(T=this.getModel().getRoot()));if(null!=T)for(var U=this.model.getChildCount(T)-1;0<=U;U--){var c=this.model.getChildAt(T,U),f=this.getScaledCellAt(A,G,c,F,P,Q);if(null!=f)return f;if(this.isCellVisible(c)&&(P&&this.model.isEdge(c)||F&&this.model.isVertex(c))&&(f=this.view.getState(c),null!=f&&(null==Q||!Q(f,A,G))&&this.intersects(f,A,G)))return c}return null};Graph.prototype.isRecursiveVertexResize=function(A){return!this.isSwimlane(A.cell)&&+mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(A.style,mxConstants.STYLE_CURVED,!1)&&("connector"==G||"filledEdge"==G||"wire"==G)};Graph.prototype.isAutoSizeState=function(A){return"1"==mxUtils.getValue(A.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(A){return null!=mxUtils.getValue(A.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(A){return!0};Graph.prototype.getVerticesAndEdges=function(A,G){A=null!=A?A:!0;G=null!=G?G:!0;var S=this.model;+return S.filterDescendants(function(F){return A&&S.isVertex(F)||G&&S.isEdge(F)},S.getRoot())};Graph.prototype.applyNewEdgeStyle=function(A,G,S){A=this.getCellStyle(A).newEdgeStyle;if(null!=A){this.model.beginUpdate();try{var F=JSON.parse(A),P;for(P in F)this.setCellStyles(P,F[P],G),"edgeStyle"==P&&"elbowEdgeStyle"==F[P]&&null!=S&&this.setCellStyles("elbow",S==mxConstants.DIRECTION_SOUTH||S==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",G)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=+function(A){for(var G={},S=0;S<A.length;S++){var F=this.view.getState(A[S]);null!=F&&this.mergeStyle(F.style,G,0==S)}return G};Graph.prototype.mergeStyle=function(A,G,S){if(null!=A){var F={},P;for(P in A){var Q=A[P];null!=Q&&(F[P]=!0,null==G[P]&&S?G[P]=Q:G[P]!=Q&&delete G[P])}for(P in G)F[P]||delete G[P]}};Graph.prototype.getStartEditingCell=function(A,G){G=this.getCellStyle(A);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&+0<this.model.getChildCount(A)&&(A=this.model.getChildAt(A,0),G=this.getCellStyle(A),G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&0<this.model.getChildCount(A))for(G=0;G<this.model.getChildCount(A);G++){var S=this.model.getChildAt(A,G);if(this.isCellEditable(S)){A=S;break}}return A};Graph.prototype.copyStyle=function(A){return this.getCellStyle(A,!1)};Graph.prototype.pasteStyle=function(A,G,S,F){null!=A&&(F||+(S=null!=S?S:Graph.cellStyles,Graph.removeKeys(A,function(P){return 0>mxUtils.indexOf(S,P)})),this.updateCellStyles(A,G))};Graph.prototype.copyCellStyles=function(A,G,S,F,P,Q,T){var c=!1,f=!1;if(0<A.length)for(var k=0;k<A.length&&(c=this.getModel().isVertex(A[k])||c,!(f=this.getModel().isEdge(A[k])||f)||!c);k++);else f=c=!0;c=c&&!Q;f=f&&!T;for(k=0;k<G.length;k++)if(A=0<=mxUtils.indexOf(Graph.textStyles,G[k]),"strokeColor"!=G[k]||null!=S[k]&&"none"!=S[k])if(0<=mxUtils.indexOf(Graph.cellStyles,G[k])||+"shape"==G[k])if("shape"!=G[k]&&(c||A)&&(null==S[k]?delete F[G[k]]:F[G[k]]=S[k]),f||A)null==S[k]?delete P[G[k]]:P[G[k]]=S[k]};Graph.prototype.includeDescendants=function(A){for(var G=[],S=0;S<A.length;S++)G=G.concat(this.model.getDescendants(A[S]));return G};Graph.prototype.pasteCellStyles=function(A,G,S,F,P){G=null!=G?G:this.currentVertexStyle;S=null!=S?S:this.currentEdgeStyle;P=null!=P?P:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var Q=0;Q<A.length;Q++){var T=A[Q],c=this.model.getStyle(T),+f=!1;null!=T.style&&(pairs=T.style.split(";"),f=f||0<=mxUtils.indexOf(pairs,"text"));if(f)var k=Graph.textStyles;else if(k=Graph.cellStyles.slice(),!F)for(var B=null!=c?c.split(";"):[],z=0;z<B.length;z++){var C=B[z],I=C.indexOf("=");if(0<=I){var L=C.substring(0,I),J=mxUtils.indexOf(k,L);0<=J&&k.splice(J,1);for(f=0;f<Graph.cellStyleGroups.length;f++){var O=Graph.cellStyleGroups[f];if(0<=mxUtils.indexOf(O,L))for(var da=0;da<O.length;da++){var fa=mxUtils.indexOf(k,O[da]);0<=fa&&k.splice(fa,1)}}}}var V=+this.model.isEdge(T);f=V?S:G;for(z=0;z<k.length;z++){L=k[z];var ba=f[L];null!=ba&&("edgeStyle"!=L||P)&&(V||!V&&0>mxUtils.indexOf(Graph.edgeStyles,L))&&(c=mxUtils.setStyle(c,L,ba),"fontFamily"==L&&null==f.fontSource&&(c=mxUtils.setStyle(c,"fontSource",null)),V&&"rounded"==L&&"1"==ba&&null==f.curved&&(c=mxUtils.setStyle(c,"curved",null)))}Editor.simpleLabels&&(c=mxUtils.setStyle(mxUtils.setStyle(c,"html",null),"whiteSpace",null));this.model.setStyle(T,c)}}finally{this.model.endUpdate()}return A};Graph.prototype.updateCellStyles=+function(A,G){this.model.beginUpdate();try{for(var S=0;S<G.length;S++)if(this.model.isVertex(G[S])||this.model.isEdge(G[S])){var F=this.getCellStyle(G[S],!1),P=F[mxConstants.STYLE_PERIMETER],Q=!1;for(c in A){var T=A[c];if(F[c]!=T){if(c==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[c]&&"umlLifeline"!=T){Q=!0;var c="participant"}this.setCellStyles(c,T,[G[S]])}}Q&&this.setCellStyles(mxConstants.STYLE_PERIMETER,P,[G[S]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=+urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(A,G,S,F,P,Q){this.useCssTransforms&&(A=A/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=+function(A,G,S,F,P,Q){F=null!=F?F:!0;P=null!=P?P:!0;null==S&&(S=this.getCurrentRoot(),null==S&&(S=this.getModel().getRoot()));if(null!=S)for(var T=this.model.getChildCount(S)-1;0<=T;T--){var c=this.model.getChildAt(S,T),f=this.getScaledCellAt(A,G,c,F,P,Q);if(null!=f)return f;if(this.isCellVisible(c)&&(P&&this.model.isEdge(c)||F&&this.model.isVertex(c))&&(f=this.view.getState(c),null!=f&&(null==Q||!Q(f,A,G))&&this.intersects(f,A,G)))return c}return null};Graph.prototype.isRecursiveVertexResize=function(A){return!this.isSwimlane(A.cell)&&0<this.model.getChildCount(A.cell)&&!this.isCellCollapsed(A.cell)&&"1"==mxUtils.getValue(A.style,"recursiveResize","1")&&null==mxUtils.getValue(A.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(A){for(var G=this.getCellGeometry(A);null!=G&&G.relative;)A=this.getModel().getParent(A),G=this.getCellGeometry(A);return A};Graph.prototype.isPart=function(A){return"1"==mxUtils.getValue(this.getCurrentCellStyle(A),"part","0")||this.isTableCell(A)||this.isTableRow(A)};Graph.prototype.getCompositeParents=-function(A){for(var G=new mxDictionary,T=[],F=0;F<A.length;F++){var P=this.getCompositeParent(A[F]);this.isTableCell(P)&&(P=this.graph.model.getParent(P));this.isTableRow(P)&&(P=this.graph.model.getParent(P));null==P||G.get(P)||(G.put(P,!0),T.push(P))}return T};Graph.prototype.getReferenceTerminal=function(A){if(null!=A){var G=this.getCellGeometry(A);null!=G&&G.relative&&(A=this.model.getParent(A))}null!=A&&this.model.isEdge(A)&&(A=this.model.getParent(A));null!=A&&(A=this.getCompositeParent(A));-return A};Graph.prototype.getCompositeParent=function(A){for(;this.isPart(A);){var G=this.model.getParent(A);if(!this.model.isVertex(G))break;A=G}return A};Graph.prototype.filterSelectionCells=function(A){var G=this.getSelectionCells();if(null!=A){for(var T=[],F=0;F<G.length;F++)A(G[F])||T.push(G[F]);G=T}return G};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(A){if(this.useCssTransforms){var G=this.currentScale,T=this.currentTranslate;A=new mxRectangle((A.x+-2*T.x)*G-T.x,(A.y+2*T.y)*G-T.y,A.width*G,A.height*G)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(A){A=this.strokeWidth;this.graph.useCssTransforms&&(A/=this.graph.currentScale);return A};mxGraphView.prototype.getGraphBounds=function(){var A=this.graphBounds;if(this.graph.useCssTransforms){var G=this.graph.currentTranslate,T=this.graph.currentScale;A=new mxRectangle((A.x+G.x)*T,(A.y+G.y)*T,A.width*T,A.height*T)}return A};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?+function(A){for(var G=new mxDictionary,S=[],F=0;F<A.length;F++){var P=this.getCompositeParent(A[F]);this.isTableCell(P)&&(P=this.graph.model.getParent(P));this.isTableRow(P)&&(P=this.graph.model.getParent(P));null==P||G.get(P)||(G.put(P,!0),S.push(P))}return S};Graph.prototype.getReferenceTerminal=function(A){if(null!=A){var G=this.getCellGeometry(A);null!=G&&G.relative&&(A=this.model.getParent(A))}null!=A&&this.model.isEdge(A)&&(A=this.model.getParent(A));null!=A&&(A=this.getCompositeParent(A));+return A};Graph.prototype.getCompositeParent=function(A){for(;this.isPart(A);){var G=this.model.getParent(A);if(!this.model.isVertex(G))break;A=G}return A};Graph.prototype.filterSelectionCells=function(A){var G=this.getSelectionCells();if(null!=A){for(var S=[],F=0;F<G.length;F++)A(G[F])||S.push(G[F]);G=S}return G};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(A){if(this.useCssTransforms){var G=this.currentScale,S=this.currentTranslate;A=new mxRectangle((A.x++2*S.x)*G-S.x,(A.y+2*S.y)*G-S.y,A.width*G,A.height*G)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(A){A=this.strokeWidth;this.graph.useCssTransforms&&(A/=this.graph.currentScale);return A};mxGraphView.prototype.getGraphBounds=function(){var A=this.graphBounds;if(this.graph.useCssTransforms){var G=this.graph.currentTranslate,S=this.graph.currentScale;A=new mxRectangle((A.x+G.x)*S,(A.y+G.y)*S,A.width*S,A.height*S)}return A};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var e=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(A){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0);e.apply(this,arguments);this.graph.useCssTransforms&&(this.graph.updateCssTransform(),this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,-this.translate.y=this.graph.currentTranslate.y)};var g=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(A){A=g.apply(this,arguments);for(var G=[],T=0;T<A.length;T++)this.isTableRow(A[T])||this.isTableCell(A[T])||G.push(A[T]);return G};var m=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(A){A=m.apply(this,arguments);for(var G=[],T=0;T<A.length;T++)this.isTable(A[T])||this.isTableRow(A[T])||this.isTableCell(A[T])||G.push(A[T]);return G};-Graph.prototype.updateCssTransform=function(){var A=this.view.getDrawPane();if(null!=A)if(A=A.parentNode,this.useCssTransforms){var G=A.getAttribute("transform");A.setAttribute("transformOrigin","0 0");var T=Math.round(100*this.currentScale)/100;A.setAttribute("transform","scale("+T+","+T+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");G!=A.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",-A.getAttribute("transform"))}else A.removeAttribute("transformOrigin"),A.removeAttribute("transform")};var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph.useCssTransforms,G=this.scale,T=this.translate;A&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);A&&(this.scale=G,this.translate=T)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(A,-G,T){var F=this.useCssTransforms,P=this.view.scale,Q=this.view.translate;F&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);F&&(this.view.scale=P,this.view.translate=Q,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};+this.translate.y=this.graph.currentTranslate.y)};var g=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(A){A=g.apply(this,arguments);for(var G=[],S=0;S<A.length;S++)this.isTableRow(A[S])||this.isTableCell(A[S])||G.push(A[S]);return G};var m=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(A){A=m.apply(this,arguments);for(var G=[],S=0;S<A.length;S++)this.isTable(A[S])||this.isTableRow(A[S])||this.isTableCell(A[S])||G.push(A[S]);return G};+Graph.prototype.updateCssTransform=function(){var A=this.view.getDrawPane();if(null!=A)if(A=A.parentNode,this.useCssTransforms){var G=A.getAttribute("transform");A.setAttribute("transformOrigin","0 0");var S=Math.round(100*this.currentScale)/100;A.setAttribute("transform","scale("+S+","+S+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");G!=A.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",+A.getAttribute("transform"))}else A.removeAttribute("transformOrigin"),A.removeAttribute("transform")};var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph.useCssTransforms,G=this.scale,S=this.translate;A&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);A&&(this.scale=G,this.translate=S)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(A,+G,S){var F=this.useCssTransforms,P=this.view.scale,Q=this.view.translate;F&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);F&&(this.view.scale=P,this.view.translate=Q,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};Graph.prototype.labelLinkClicked=function(b,e,g){var m=e.getAttribute("href");m!=Graph.sanitizeLink(m)&&Graph.sanitizeNode(e);if(null!=m&&!this.isCustomLink(m)&&(mxEvent.isLeftMouseButton(g)&&!mxEvent.isPopupTrigger(g)||mxEvent.isTouchEvent(g))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(m)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(m),b);mxEvent.consume(g)}};Graph.prototype.openLink=function(b,e,g){var m=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==e&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==b.charAt(this.baseUrl.length)&&"_top"==e&&window==window.top){var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=v}else m=window.open(b,null!=e?e:"_blank",g?null:"noopener,noreferrer"),null==m||g||(m.opener=null)}catch(p){}return m};Graph.prototype.getLinkTitle=function(b){return b.substring(b.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(b){return"data:"==b.substring(0,5)};Graph.prototype.customLinkClicked=function(b,e){return!1};Graph.prototype.isExternalProtocol=function(b){return"mailto:"===b.substring(0,7)};Graph.prototype.isBlankLink=function(b){return!this.isExternalProtocol(b)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(b)&&b.substring(0,this.domainUrl.length)!==this.domainUrl)};@@ -2356,7 +2356,7 @@ Graph.prototype.createLayouts=function(b){for(var e=[],g=0;g<b.length;g++)if(0<=Graph.prototype.getDataForCells=function(b,e){for(var g=[],m=0;m<b.length;m++){var v={};v.id=b[m].id;var p=null!=b[m].value?b[m].value.attributes:null;this.isReplacePlaceholders(b[m])&&e&&(v.value=this.getLabel(b[m]));if(null!=p)for(var A=0;A<p.length;A++)v[p[A].nodeName]=p[A].nodeValue;else v.label=this.convertValueToString(b[m]);g.push(v)}return g};Graph.prototype.getNodesForCells=function(b){for(var e=[],g=0;g<b.length;g++){var m=this.view.getState(b[g]);if(null!=m){for(var v=this.cellRenderer.getShapesForState(m),p=0;p<v.length;p++)null!=v[p]&&null!=v[p].node&&e.push(v[p].node);null!=m.control&&null!=m.control.node&&e.push(m.control.node)}}return e};Graph.prototype.createWipeAnimations=function(b,e){for(var g=[],m=0;m<b.length;m++){var v=this.view.getState(b[m]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?g.push(this.createEdgeWipeAnimation(v,e)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&g.push(this.createVertexWipeAnimation(v,e)))}return g};-Graph.prototype.createEdgeWipeAnimation=function(b,e){var g=b.absolutePoints.slice(),m=b.segments,v=b.length,p=g.length;return{execute:mxUtils.bind(this,function(A,G){if(null!=b.shape){var T=[g[0]];G=A/G;e||(G=1-G);for(var F=v*G,P=1;P<p;P++)if(F<=m[P-1]){T.push(new mxPoint(g[P-1].x+(g[P].x-g[P-1].x)*F/m[P-1],g[P-1].y+(g[P].y-g[P-1].y)*F/m[P-1]));break}else F-=m[P-1],T.push(g[P]);b.shape.points=T;b.shape.redraw();0==A&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=+Graph.prototype.createEdgeWipeAnimation=function(b,e){var g=b.absolutePoints.slice(),m=b.segments,v=b.length,p=g.length;return{execute:mxUtils.bind(this,function(A,G){if(null!=b.shape){var S=[g[0]];G=A/G;e||(G=1-G);for(var F=v*G,P=1;P<p;P++)if(F<=m[P-1]){S.push(new mxPoint(g[P-1].x+(g[P].x-g[P-1].x)*F/m[P-1],g[P-1].y+(g[P].y-g[P-1].y)*F/m[P-1]));break}else F-=m[P-1],S.push(g[P]);b.shape.points=S;b.shape.redraw();0==A&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=G)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.createVertexWipeAnimation=function(b,e){var g=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(m,v){null!=b.shape&&(v=m/v,e||(v=1-v),b.shape.bounds=new mxRectangle(g.x,g.y,g.width*v,g.height),b.shape.redraw(),0==m&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=v))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.executeAnimations=function(b,e,g,m){g=null!=g?g:30;m=null!=m?m:30;var v=null,p=0,A=mxUtils.bind(this,function(){if(p==g||this.stoppingCustomActions){window.clearInterval(v);for(var G=0;G<b.length;G++)b[G].stop();null!=e&&e()}else for(G=0;G<b.length;G++)b[G].execute(p,g);p++});v=window.setInterval(A,m);A()};@@ -2371,17 +2371,17 @@ Graph.prototype.isLabelMovable=function(b){var e=this.getCurrentCellStyle(b);retGraph.prototype.getClickableLinkForCell=function(b){do{var e=this.getLinkForCell(b);if(null!=e)return e;b=this.model.getParent(b)}while(null!=b);return null};Graph.prototype.getGlobalVariable=function(b){var e=null;"date"==b?e=(new Date).toLocaleDateString():"time"==b?e=(new Date).toLocaleTimeString():"timestamp"==b?e=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),e=this.formatDate(new Date,b));return e};Graph.prototype.formatDate=function(b,e,g){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var m=this.dateFormatCache,v=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,p=/[^-+\dA-Z]/g,A=function(z,C){z=String(z);for(C=C||2;z.length<C;)z="0"+z;return z};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||-/\d/.test(b)||(e=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");e=String(m.masks[e]||e||m.masks["default"]);"UTC:"==e.slice(0,4)&&(e=e.slice(4),g=!0);var G=g?"getUTC":"get",T=b[G+"Date"](),F=b[G+"Day"](),P=b[G+"Month"](),Q=b[G+"FullYear"](),U=b[G+"Hours"](),c=b[G+"Minutes"](),f=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var k=g?0:b.getTimezoneOffset(),B={d:T,dd:A(T),ddd:m.i18n.dayNames[F],dddd:m.i18n.dayNames[F+7],m:P+1,mm:A(P+1),mmm:m.i18n.monthNames[P],mmmm:m.i18n.monthNames[P+-12],yy:String(Q).slice(2),yyyy:Q,h:U%12||12,hh:A(U%12||12),H:U,HH:A(U),M:c,MM:A(c),s:f,ss:A(f),l:A(G,3),L:A(99<G?Math.round(G/10):G),t:12>U?"a":"p",tt:12>U?"am":"pm",T:12>U?"A":"P",TT:12>U?"AM":"PM",Z:g?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<k?"-":"+")+A(100*Math.floor(Math.abs(k)/60)+Math.abs(k)%60,4),S:["th","st","nd","rd"][3<T%10?0:(10!=T%100-T%10)*T%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(z){return z in B?B[z]:z.slice(1,+/\d/.test(b)||(e=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");e=String(m.masks[e]||e||m.masks["default"]);"UTC:"==e.slice(0,4)&&(e=e.slice(4),g=!0);var G=g?"getUTC":"get",S=b[G+"Date"](),F=b[G+"Day"](),P=b[G+"Month"](),Q=b[G+"FullYear"](),T=b[G+"Hours"](),c=b[G+"Minutes"](),f=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var k=g?0:b.getTimezoneOffset(),B={d:S,dd:A(S),ddd:m.i18n.dayNames[F],dddd:m.i18n.dayNames[F+7],m:P+1,mm:A(P+1),mmm:m.i18n.monthNames[P],mmmm:m.i18n.monthNames[P++12],yy:String(Q).slice(2),yyyy:Q,h:T%12||12,hh:A(T%12||12),H:T,HH:A(T),M:c,MM:A(c),s:f,ss:A(f),l:A(G,3),L:A(99<G?Math.round(G/10):G),t:12>T?"a":"p",tt:12>T?"am":"pm",T:12>T?"A":"P",TT:12>T?"AM":"PM",Z:g?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<k?"-":"+")+A(100*Math.floor(Math.abs(k)/60)+Math.abs(k)%60,4),S:["th","st","nd","rd"][3<S%10?0:(10!=S%100-S%10)*S%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(z){return z in B?B[z]:z.slice(1,z.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var e=null;if(0<b.length){e=this.getLayerForCell(b[0]);for(var g=1;g<b.length;g++)if(!this.model.isAncestor(e,b[g])){e=null;break}}return e};-Graph.prototype.createLayersDialog=function(b,e){var g=document.createElement("div");g.style.position="absolute";for(var m=this.getModel(),v=m.getChildCount(m.root),p=0;p<v;p++)mxUtils.bind(this,function(A){function G(){m.isVisible(A)?(P.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(F,75)):(P.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(F,25))}var T=this.convertValueToString(A)||mxResources.get("background")||"Background",F=document.createElement("div");F.style.overflow=-"hidden";F.style.textOverflow="ellipsis";F.style.padding="2px";F.style.whiteSpace="nowrap";F.style.cursor="pointer";F.setAttribute("title",mxResources.get(m.isVisible(A)?"hideIt":"show",[T]));var P=document.createElement("img");P.setAttribute("draggable","false");P.setAttribute("align","absmiddle");P.setAttribute("border","0");P.style.position="relative";P.style.width="16px";P.style.padding="0px 6px 0 4px";e&&(P.style.filter="invert(100%)",P.style.top="-2px");F.appendChild(P);mxUtils.write(F,T);g.appendChild(F);+Graph.prototype.createLayersDialog=function(b,e){var g=document.createElement("div");g.style.position="absolute";for(var m=this.getModel(),v=m.getChildCount(m.root),p=0;p<v;p++)mxUtils.bind(this,function(A){function G(){m.isVisible(A)?(P.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(F,75)):(P.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(F,25))}var S=this.convertValueToString(A)||mxResources.get("background")||"Background",F=document.createElement("div");F.style.overflow=+"hidden";F.style.textOverflow="ellipsis";F.style.padding="2px";F.style.whiteSpace="nowrap";F.style.cursor="pointer";F.setAttribute("title",mxResources.get(m.isVisible(A)?"hideIt":"show",[S]));var P=document.createElement("img");P.setAttribute("draggable","false");P.setAttribute("align","absmiddle");P.setAttribute("border","0");P.style.position="relative";P.style.width="16px";P.style.padding="0px 6px 0 4px";e&&(P.style.filter="invert(100%)",P.style.top="-2px");F.appendChild(P);mxUtils.write(F,S);g.appendChild(F);mxEvent.addListener(F,"click",function(){m.setVisible(A,!m.isVisible(A));G();null!=b&&b(A)});G()})(m.getChildAt(m.root,p));return g};-Graph.prototype.replacePlaceholders=function(b,e,g,m){m=[];if(null!=e){for(var v=0;match=this.placeholderPattern.exec(e);){var p=match[0];if(2<p.length&&"%label%"!=p&&"%tooltip%"!=p){var A=null;if(match.index>v&&"%"==e.charAt(match.index-1))A=p.substring(1);else{var G=p.substring(1,p.length-1),T={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==G)A=b.id;else if("width"===G.substring(0,5)&&this.model.isVertex(b)){var F=this.getCellGeometry(b);-null!=F&&(A=F.width,5<G.length&&(A=Editor.toUnit(A,T[G.substring(6)])))}else if("height"==G.substring(0,6)&&this.model.isVertex(b))F=this.getCellGeometry(b),null!=F&&(A=F.height,6<G.length&&(A=Editor.toUnit(A,T[G.substring(7)])));else if("length"==G.substring(0,6)){for(F=b;null!=F&&!this.model.isEdge(F);)F=this.model.getParent(F);F=this.view.getState(F);null!=F&&(A=Math.round(F.length/this.view.scale),6<G.length&&(A=Editor.toUnit(A,T[G.substring(7)])))}else if(0>G.indexOf("{"))for(T=b;null==A&&null!=-T;)null!=T.value&&"object"==typeof T.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(A=T.getAttribute(G+"_"+Graph.diagramLanguage)),null==A&&(A=T.hasAttribute(G)?null!=T.getAttribute(G)?T.getAttribute(G):"":null)),T=this.model.getParent(T);null==A&&(A=this.getGlobalVariable(G));null==A&&null!=g&&(A=g[G])}m.push(e.substring(v,match.index)+(null!=A?A:p));v=match.index+p.length}}m.push(e.substring(v))}return m.join("")};+Graph.prototype.replacePlaceholders=function(b,e,g,m){m=[];if(null!=e){for(var v=0;match=this.placeholderPattern.exec(e);){var p=match[0];if(2<p.length&&"%label%"!=p&&"%tooltip%"!=p){var A=null;if(match.index>v&&"%"==e.charAt(match.index-1))A=p.substring(1);else{var G=p.substring(1,p.length-1),S={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==G)A=b.id;else if("width"===G.substring(0,5)&&this.model.isVertex(b)){var F=this.getCellGeometry(b);+null!=F&&(A=F.width,5<G.length&&(A=Editor.toUnit(A,S[G.substring(6)])))}else if("height"==G.substring(0,6)&&this.model.isVertex(b))F=this.getCellGeometry(b),null!=F&&(A=F.height,6<G.length&&(A=Editor.toUnit(A,S[G.substring(7)])));else if("length"==G.substring(0,6)){for(F=b;null!=F&&!this.model.isEdge(F);)F=this.model.getParent(F);F=this.view.getState(F);null!=F&&(A=Math.round(F.length/this.view.scale),6<G.length&&(A=Editor.toUnit(A,S[G.substring(7)])))}else if(0>G.indexOf("{"))for(S=b;null==A&&null!=+S;)null!=S.value&&"object"==typeof S.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(A=S.getAttribute(G+"_"+Graph.diagramLanguage)),null==A&&(A=S.hasAttribute(G)?null!=S.getAttribute(G)?S.getAttribute(G):"":null)),S=this.model.getParent(S);null==A&&(A=this.getGlobalVariable(G));null==A&&null!=g&&(A=g[G])}m.push(e.substring(v,match.index)+(null!=A?A:p));v=match.index+p.length}}m.push(e.substring(v))}return m.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var e=[],g=0;g<b.length;g++){var m=this.model.getCell(b[g].id);null!=m&&e.push(m)}this.setSelectionCells(e)}else this.clearSelection()};Graph.prototype.selectCellForEvent=function(b,e){mxEvent.isShiftDown(e)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,arguments)};-Graph.prototype.selectTableRange=function(b,e){var g=!1;if(this.isTableCell(b)&&this.isTableCell(e)){var m=this.model.getParent(b),v=this.model.getParent(m),p=this.model.getParent(e);if(v==this.model.getParent(p)){b=m.getIndex(b);m=v.getIndex(m);var A=p.getIndex(e),G=v.getIndex(p);p=Math.max(m,G);e=Math.min(b,A);b=Math.max(b,A);A=[];for(m=Math.min(m,G);m<=p;m++){G=this.model.getChildAt(v,m);for(var T=e;T<=b;T++)A.push(this.model.getChildAt(G,T))}0<A.length&&(1<A.length||1<this.getSelectionCount()||+Graph.prototype.selectTableRange=function(b,e){var g=!1;if(this.isTableCell(b)&&this.isTableCell(e)){var m=this.model.getParent(b),v=this.model.getParent(m),p=this.model.getParent(e);if(v==this.model.getParent(p)){b=m.getIndex(b);m=v.getIndex(m);var A=p.getIndex(e),G=v.getIndex(p);p=Math.max(m,G);e=Math.min(b,A);b=Math.max(b,A);A=[];for(m=Math.min(m,G);m<=p;m++){G=this.model.getChildAt(v,m);for(var S=e;S<=b;S++)A.push(this.model.getChildAt(G,S))}0<A.length&&(1<A.length||1<this.getSelectionCount()||!this.isCellSelected(A[0]))&&(this.setSelectionCells(A),g=!0)}}return g};Graph.prototype.snapCellsToGrid=function(b,e){this.getModel().beginUpdate();try{for(var g=0;g<b.length;g++){var m=b[g],v=this.getCellGeometry(m);if(null!=v){v=v.clone();if(this.getModel().isVertex(m))v.x=Math.round(v.x/e)*e,v.y=Math.round(v.y/e)*e,v.width=Math.round(v.width/e)*e,v.height=Math.round(v.height/e)*e;else if(this.getModel().isEdge(m)&&null!=v.points)for(var p=0;p<v.points.length;p++)v.points[p].x=Math.round(v.points[p].x/e)*e,v.points[p].y=Math.round(v.points[p].y/e)*e;this.getModel().setGeometry(m,v)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var e=this.model.getChildCount(b);0<=e;e--)this.model.remove(this.model.getChildAt(b,e))}finally{this.model.endUpdate()}};@@ -2389,13 +2389,13 @@ Graph.prototype.updateShapes=function(b,e,g){this.model.beginUpdate();try{var m=this.model.isEdge(b)&&this.model.isEdge(e[p]))if(g){var A=this.model.getStyle(e[p]);if(null!=A){var G=A.split(";");0<G.length&&0>G[0].indexOf("=")&&(G=G.slice(1));this.model.setStyle(e[p],G.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[e[p]]);this.setCellStyles("points",null,[e[p]]);this.pasteStyle(v,[e[p]],null,!0)}else v=this.copyStyle(e[p]),this.model.setStyle(e[p],m),this.pasteStyle(v,[e[p]]);"1"==mxUtils.getValue(this.getCellStyle(e[p],!1),"composite","0")&&this.removeChildCells(e[p])}}finally{this.model.endUpdate()}};Graph.prototype.selectCellsForConnectVertex=function(b,e,g){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=g&&(mxEvent.isTouchEvent(e)?g.update(g.getState(this.view.getState(b[1]))):g.reset())):this.setSelectionCells(b)};Graph.prototype.isCloneConnectSource=function(b){var e=null;null!=this.layoutManager&&(e=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=e&&e.constructor==mxStackLayout};Graph.prototype.insertEdgeBeforeCell=function(b,e){for(var g=e;null!=g.parent&&null!=g.geometry&&g.geometry.relative&&g.parent!=b.parent;)g=this.model.getParent(g);null!=g&&null!=g.parent&&g.parent==b.parent&&(e=g.parent.getIndex(g),this.model.add(g.parent,b,e))};-Graph.prototype.connectVertex=function(b,e,g,m,v,p,A,G){p=p?p:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var T=this.isCloneConnectSource(b),F=T?b:this.getCompositeParent(b),P=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(F.geometry.x,F.geometry.y);e==mxConstants.DIRECTION_NORTH?(P.x+=F.geometry.width/2,P.y-=g):e==-mxConstants.DIRECTION_SOUTH?(P.x+=F.geometry.width/2,P.y+=F.geometry.height+g):(P.x=e==mxConstants.DIRECTION_WEST?P.x-g:P.x+(F.geometry.width+g),P.y+=F.geometry.height/2);var Q=this.view.getState(this.model.getParent(b));g=this.view.scale;var U=this.view.translate;F=U.x*g;U=U.y*g;null!=Q&&this.model.isVertex(Q.cell)&&(F=Q.x,U=Q.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(P.x+=b.parent.geometry.x,P.y+=b.parent.geometry.y);p=p?null:(new mxRectangle(F+P.x*g,U+P.y*g)).grow(40*g);p=null!=p?+Graph.prototype.connectVertex=function(b,e,g,m,v,p,A,G){p=p?p:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var S=this.isCloneConnectSource(b),F=S?b:this.getCompositeParent(b),P=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(F.geometry.x,F.geometry.y);e==mxConstants.DIRECTION_NORTH?(P.x+=F.geometry.width/2,P.y-=g):e==+mxConstants.DIRECTION_SOUTH?(P.x+=F.geometry.width/2,P.y+=F.geometry.height+g):(P.x=e==mxConstants.DIRECTION_WEST?P.x-g:P.x+(F.geometry.width+g),P.y+=F.geometry.height/2);var Q=this.view.getState(this.model.getParent(b));g=this.view.scale;var T=this.view.translate;F=T.x*g;T=T.y*g;null!=Q&&this.model.isVertex(Q.cell)&&(F=Q.x,T=Q.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(P.x+=b.parent.geometry.x,P.y+=b.parent.geometry.y);p=p?null:(new mxRectangle(F+P.x*g,T+P.y*g)).grow(40*g);p=null!=p?this.getCells(0,0,0,0,null,null,p,null,!0):null;Q=this.view.getState(b);var c=null,f=null;if(null!=p){p=p.reverse();for(var k=0;k<p.length;k++)if(!this.isCellLocked(p[k])&&!this.model.isEdge(p[k])&&p[k]!=b)if(!this.model.isAncestor(b,p[k])&&this.isContainer(p[k])&&(null==c||p[k]==this.model.getParent(b)))c=p[k];else if(null==f&&this.isCellConnectable(p[k])&&!this.model.isAncestor(p[k],b)&&!this.isSwimlane(p[k])){var B=this.view.getState(p[k]);null==Q||null==B||mxUtils.intersects(Q,B)||(f=p[k])}}var z=-!mxEvent.isShiftDown(m)||mxEvent.isControlDown(m)||v;z&&("1"!=urlParams.sketch||v)&&(e==mxConstants.DIRECTION_NORTH?P.y-=b.geometry.height/2:e==mxConstants.DIRECTION_SOUTH?P.y+=b.geometry.height/2:P.x=e==mxConstants.DIRECTION_WEST?P.x-b.geometry.width/2:P.x+b.geometry.width/2);var C=[],H=f;f=c;v=mxUtils.bind(this,function(K){if(null==A||null!=K||null==f&&T){this.model.beginUpdate();try{if(null==H&&z){var M=this.getAbsoluteParent(null!=K?K:b);M=T?b:this.getCompositeParent(M);H=null!=K?K:this.duplicateCells([M],-!1)[0];null!=K&&this.addCells([H],this.model.getParent(b),null,null,null,!0);var O=this.getCellGeometry(H);null!=O&&(null!=K&&"1"==urlParams.sketch&&(e==mxConstants.DIRECTION_NORTH?P.y-=O.height/2:e==mxConstants.DIRECTION_SOUTH?P.y+=O.height/2:P.x=e==mxConstants.DIRECTION_WEST?P.x-O.width/2:P.x+O.width/2),O.x=P.x-O.width/2,O.y=P.y-O.height/2);null!=c?(this.addCells([H],c,null,null,null,!0),f=null):z&&!T&&this.addCells([H],this.getDefaultParent(),null,null,null,!0)}var ea=mxEvent.isControlDown(m)&&-mxEvent.isShiftDown(m)&&z||null==f&&T?null:this.insertEdge(this.model.getParent(b),null,"",b,H,this.createCurrentEdgeStyle());null!=ea&&(C.push(ea),this.applyNewEdgeStyle(b,[ea],e),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ea,b));if(null==f&&null!=H&&null!=b.parent&&T&&e==mxConstants.DIRECTION_WEST){var fa=b.parent.getIndex(b);this.model.add(b.parent,H,fa)}null==f&&null!=H&&C.push(H);null==H&&null!=ea&&ea.geometry.setTerminalPoint(P,!1);null!=ea&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[ea]))}finally{this.model.endUpdate()}}if(null!=G)G(C);else return C});if(null==A||null!=H||!z||null==f&&T)return v(H);A(F+P.x*g,U+P.y*g,v)};+!mxEvent.isShiftDown(m)||mxEvent.isControlDown(m)||v;z&&("1"!=urlParams.sketch||v)&&(e==mxConstants.DIRECTION_NORTH?P.y-=b.geometry.height/2:e==mxConstants.DIRECTION_SOUTH?P.y+=b.geometry.height/2:P.x=e==mxConstants.DIRECTION_WEST?P.x-b.geometry.width/2:P.x+b.geometry.width/2);var C=[],I=f;f=c;v=mxUtils.bind(this,function(L){if(null==A||null!=L||null==f&&S){this.model.beginUpdate();try{if(null==I&&z){var J=this.getAbsoluteParent(null!=L?L:b);J=S?b:this.getCompositeParent(J);I=null!=L?L:this.duplicateCells([J],+!1)[0];null!=L&&this.addCells([I],this.model.getParent(b),null,null,null,!0);var O=this.getCellGeometry(I);null!=O&&(null!=L&&"1"==urlParams.sketch&&(e==mxConstants.DIRECTION_NORTH?P.y-=O.height/2:e==mxConstants.DIRECTION_SOUTH?P.y+=O.height/2:P.x=e==mxConstants.DIRECTION_WEST?P.x-O.width/2:P.x+O.width/2),O.x=P.x-O.width/2,O.y=P.y-O.height/2);null!=c?(this.addCells([I],c,null,null,null,!0),f=null):z&&!S&&this.addCells([I],this.getDefaultParent(),null,null,null,!0)}var da=mxEvent.isControlDown(m)&&+mxEvent.isShiftDown(m)&&z||null==f&&S?null:this.insertEdge(this.model.getParent(b),null,"",b,I,this.createCurrentEdgeStyle());null!=da&&(C.push(da),this.applyNewEdgeStyle(b,[da],e),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(da,b));if(null==f&&null!=I&&null!=b.parent&&S&&e==mxConstants.DIRECTION_WEST){var fa=b.parent.getIndex(b);this.model.add(b.parent,I,fa)}null==f&&null!=I&&C.push(I);null==I&&null!=da&&da.geometry.setTerminalPoint(P,!1);null!=da&&this.fireEvent(new mxEventObject("cellsInserted",+"cells",[da]))}finally{this.model.endUpdate()}}if(null!=G)G(C);else return C});if(null==A||null!=I||!z||null==f&&S)return v(I);A(F+P.x*g,T+P.y*g,v)};Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var e=document.createElement("div"),g=[],m,v=0;v<b.length;v++)if(m=b[v],this.model.isVertex(m)||this.model.isEdge(m))this.isHtmlLabel(m)?(e.innerHTML=Graph.sanitizeHtml(this.getLabel(m)),m=mxUtils.extractTextWithWhitespace([e])):m=this.getLabel(m),m=mxUtils.trim(m.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<m.length&&g.push(m);return g.join(" ")};Graph.prototype.convertValueToString=function(b){var e=this.model.getValue(b);if(null!=e&&"object"==typeof e){var g=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){e=b.getAttribute("placeholder");for(var m=b;null==g&&null!=m;)null!=m.value&&"object"==typeof m.value&&(g=m.hasAttribute(e)?null!=m.getAttribute(e)?m.getAttribute(e):"":null),m=this.model.getParent(m)}else g=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(g=e.getAttribute("label_"+Graph.diagramLanguage)),null==g&&(g=e.getAttribute("label")||"");return g||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(b){return null!=b&&null!=b.text&&null!=b.text.node?b.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(b,e){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),e||(b=mxUtils.removeJavascriptProtocol(b)),b):null};@@ -2406,8 +2406,8 @@ mxConstants.STYLE_IMAGE_BACKGROUND,b);this.replaceDefaultColor(e,mxConstants.STYGraph.prototype.getDefaultColor=function(b,e,g){e="default"+e.charAt(0).toUpperCase()+e.substring(1);"invert"==b[e]&&(b=mxUtils.getLightDarkColor(g),g="light-dark("+b.dark+", "+b.light+")");return g};Graph.prototype.setAdaptiveColors=function(b){this.adaptiveColors="default"==b?null:b;"1"==urlParams.embedInline?null!=this.container&&(this.container.style.colorScheme="none"==this.getAdaptiveColors()?"light":""):(b=this.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.colorScheme="none"==this.getAdaptiveColors()?"light":""))};Graph.prototype.getAdaptiveColors=function(){return null!=this.adaptiveColors?this.adaptiveColors:Graph.defaultAdaptiveColors};Graph.prototype.updateAlternateBounds=function(b,e,g){if(null!=b&&null!=e&&null!=this.layoutManager&&null!=e.alternateBounds){var m=this.layoutManager.getLayout(this.model.getParent(b));null!=m&&m.constructor==mxStackLayout&&(m.horizontal?e.alternateBounds.height=0:e.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(b,e){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(e.style,"moveCells","0")};-Graph.prototype.foldCells=function(b,e,g,m,v){e=null!=e?e:!1;null==g&&(g=this.getFoldableCells(this.getSelectionCells(),b));if(null!=g){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var p=0;p<g.length;p++){var A=this.view.getState(g[p]),G=this.getCellGeometry(g[p]);if(null!=A&&null!=G){var T=0,F=0;if(G.alternateBounds)T=G.width-G.alternateBounds.width,F=G.height-G.alternateBounds.height;else{var P=this.useCssTransforms?1:this.view.scale;-T=Math.round(G.width-A.width/P);F=Math.round(G.height-A.height/P)}if(0!=F||0!=T){var Q=this.model.getParent(g[p]),U=this.layoutManager.getLayout(Q);null==U?null!=v&&this.isMoveCellsEvent(v,A)&&this.moveSiblings(A,Q,T,F):null!=v&&mxEvent.isAltDown(v)||U.constructor!=mxStackLayout||U.resizeLast||this.resizeParentStacks(Q,U,T,F)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(g)}};+Graph.prototype.foldCells=function(b,e,g,m,v){e=null!=e?e:!1;null==g&&(g=this.getFoldableCells(this.getSelectionCells(),b));if(null!=g){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var p=0;p<g.length;p++){var A=this.view.getState(g[p]),G=this.getCellGeometry(g[p]);if(null!=A&&null!=G){var S=0,F=0;if(G.alternateBounds)S=G.width-G.alternateBounds.width,F=G.height-G.alternateBounds.height;else{var P=this.useCssTransforms?1:this.view.scale;+S=Math.round(G.width-A.width/P);F=Math.round(G.height-A.height/P)}if(0!=F||0!=S){var Q=this.model.getParent(g[p]),T=this.layoutManager.getLayout(Q);null==T?null!=v&&this.isMoveCellsEvent(v,A)&&this.moveSiblings(A,Q,S,F):null!=v&&mxEvent.isAltDown(v)||T.constructor!=mxStackLayout||T.resizeLast||this.resizeParentStacks(Q,T,S,F)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(g)}};Graph.prototype.moveSiblings=function(b,e,g,m){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,e,!0,!0);for(e=0;e<v.length;e++)if(v[e]!=b.cell){var p=this.view.getState(v[e]),A=this.getCellGeometry(v[e]);null!=p&&null!=A&&(A=A.clone(),A.translate(Math.round(g*Math.max(0,Math.min(1,(p.x-b.x)/b.width))),Math.round(m*Math.max(0,Math.min(1,(p.y-b.y)/b.height)))),this.model.setGeometry(v[e],A))}}finally{this.model.endUpdate()}};Graph.prototype.resizeParentStacks=function(b,e,g,m){if(null!=this.layoutManager&&null!=e&&e.constructor==mxStackLayout&&!e.resizeLast){this.model.beginUpdate();try{for(var v=e.horizontal;null!=b&&null!=e&&e.constructor==mxStackLayout&&e.horizontal==v&&!e.resizeLast;){var p=this.getCellGeometry(b),A=this.view.getState(b);null!=A&&null!=p&&(p=p.clone(),e.horizontal?p.width+=g+Math.min(0,A.width/this.view.scale-p.width):p.height+=m+Math.min(0,A.height/this.view.scale-p.height),this.model.setGeometry(b,p));b=this.model.getParent(b);e=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var e=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=e.container:"1"==e.container};Graph.prototype.isCellConnectable=function(b){var e=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=e.connectable?"0"!=e.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};@@ -2449,10 +2449,10 @@ HoverIcons.prototype.click=function(b,e,g){var m=g.getEvent(),v=g.getGraphX(),p=HoverIcons.prototype.execute=function(b,e,g){g=g.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,e,this.graph.defaultEdgeLength,g,this.graph.isCloneEvent(g),this.graph.isCloneEvent(g)),g,this)};HoverIcons.prototype.reset=function(b){null!=b&&!b||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null;this.fireEvent(new mxEventObject("reset"))};HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var b=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(b=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));b.grow(this.graph.tolerance);b.grow(this.arrowSpacing);var e=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(e=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var g=null;null!=e&&(b.x-=e.horizontalOffset/2,b.y-=e.verticalOffset/2,b.width+=e.horizontalOffset,b.height+=e.verticalOffset,null!=e.rotationShape&&null!=e.rotationShape.node&&"hidden"!=e.rotationShape.node.style.visibility&&"none"!=e.rotationShape.node.style.display&&null!=e.rotationShape.boundingBox&&-(g=e.rotationShape.boundingBox));e=mxUtils.bind(this,function(G,T,F){if(null!=g){var P=new mxRectangle(T,F,G.clientWidth,G.clientHeight);mxUtils.intersects(P,g)&&(G==this.arrowUp?F-=P.y+P.height-g.y:G==this.arrowRight?T+=g.x+g.width-P.x:G==this.arrowDown?F+=g.y+g.height-P.y:G==this.arrowLeft&&(T-=P.x+P.width-g.x))}G.style.left=T+"px";G.style.top=F+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});e(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-+(g=e.rotationShape.boundingBox));e=mxUtils.bind(this,function(G,S,F){if(null!=g){var P=new mxRectangle(S,F,G.clientWidth,G.clientHeight);mxUtils.intersects(P,g)&&(G==this.arrowUp?F-=P.y+P.height-g.y:G==this.arrowRight?S+=g.x+g.width-P.x:G==this.arrowDown?F+=g.y+g.height-P.y:G==this.arrowLeft&&(S-=P.x+P.width-g.x))}G.style.left=S+"px";G.style.top=F+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});e(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-this.triangleUp.height-this.tolerance));e(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));e(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));e(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){e=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());-var m=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=e&&e==m&&m==v&&v==b&&(b=v=m=e=null);var p=this.graph.getCellGeometry(this.currentState.cell),A=mxUtils.bind(this,function(G,T){var F=this.graph.model.isVertex(G)&&this.graph.getCellGeometry(G);null==G||this.graph.model.isAncestor(G,-this.currentState.cell)||this.graph.isSwimlane(G)||!(null==F||null==p||F.height<3*p.height&&F.width<3*p.width)?T.style.visibility="visible":T.style.visibility="hidden"});A(e,this.arrowRight);A(m,this.arrowLeft);A(v,this.arrowUp);A(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),+var m=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=e&&e==m&&m==v&&v==b&&(b=v=m=e=null);var p=this.graph.getCellGeometry(this.currentState.cell),A=mxUtils.bind(this,function(G,S){var F=this.graph.model.isVertex(G)&&this.graph.getCellGeometry(G);null==G||this.graph.model.isAncestor(G,+this.currentState.cell)||this.graph.isSwimlane(G)||!(null==F||null==p||F.height<3*p.height&&F.width<3*p.width)?S.style.visibility="visible":S.style.visibility="hidden"});A(e,this.arrowRight);A(m,this.arrowLeft);A(v,this.arrowUp);A(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};HoverIcons.prototype.computeBoundingBox=function(){var b=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(e){null!=e.parentNode&&(e=new mxRectangle(e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight),null==b?b=e:b.add(e))});return b};HoverIcons.prototype.getState=function(b){if(null!=b)if(b=b.cell,this.graph.getModel().contains(b)){if(this.graph.getModel().isVertex(b)&&!this.graph.isCellConnectable(b)){var e=this.graph.getModel().getParent(b);this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(b=e)}if(this.graph.isCellLocked(b)||this.graph.model.isEdge(b))b=null;b=this.graph.view.getState(b);null!=b&&null==b.style&&(b=null)}else b=null;return b};@@ -2462,43 +2462,43 @@ b||null==this.bbox||null==e||null==g||!mxUtils.contains(this.bbox,e,g))&&(null!=HoverIcons.prototype.setCurrentState=function(b){"eastwest"!=b.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=b};Graph.prototype.removeTextStyleForCell=function(b,e){var g=this.getCurrentCellStyle(b),m=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(g,"html","0")){var v=this.convertValueToString(b);"0"!=mxUtils.getValue(g,"nl2Br","1")&&(v=v.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));v=Editor.convertHtmlToText(v);this.cellLabelChanged(b,v);m=!0}e&&(this.setCellStyles("fontSource",null,[b]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return m};Graph.prototype.createParent=function(b,e,g,m,v){b=this.cloneCell(b);for(var p=0;p<g;p++){var A=this.cloneCell(e),G=this.getCellGeometry(A);null!=G&&(G.x+=p*m,G.y+=p*v);b.insert(A)}return b};-Graph.prototype.createTable=function(b,e,g,m,v,p,A,G,T){g=null!=g?g:60;m=null!=m?m:40;p=null!=p?p:30;G=null!=G?G:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";T=null!=T?T:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,-null,null!=v?v:"",0,0,e*g,b*m+(null!=v?p:0),null!=A?A:"shape=table;startSize="+(null!=v?p:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,e*g,m,G),this.createVertex(null,null,"",0,0,g,m,T),e,g,0),b,0,m)};+Graph.prototype.createTable=function(b,e,g,m,v,p,A,G,S){g=null!=g?g:60;m=null!=m?m:40;p=null!=p?p:30;G=null!=G?G:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";S=null!=S?S:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,+null,null!=v?v:"",0,0,e*g,b*m+(null!=v?p:0),null!=A?A:"shape=table;startSize="+(null!=v?p:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,e*g,m,G),this.createVertex(null,null,"",0,0,g,m,S),e,g,0),b,0,m)};Graph.prototype.setTableValues=function(b,e,g){for(var m=this.model.getChildCells(b,!0),v=0;v<m.length;v++)if(null!=g&&(m[v].value=g[v]),null!=e)for(var p=this.model.getChildCells(m[v],!0),A=0;A<p.length;A++)null!=e[v][A]&&(p[A].value=e[v][A]);return b};-Graph.prototype.createCrossFunctionalSwimlane=function(b,e,g,m,v,p,A,G,T){g=null!=g?g:120;m=null!=m?m:120;A=null!=A?A:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";G=null!=G?G:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";-T=null!=T?T:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,e*g,b*m,null!=p?p:"shape=table;childLayout=tableLayout;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");p=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=p;v.geometry.height+=-p;A=this.createVertex(null,null,"",0,p,e*g+p,m,A);v.insert(this.createParent(A,this.createVertex(null,null,"",p,0,g,m,G),e,g,0));return 1<b?(A.geometry.y=m+p,this.createParent(v,this.createParent(A,this.createVertex(null,null,"",p,0,g,m,T),e,g,0),b-1,0,m)):v};-Graph.prototype.visitTableCells=function(b,e){var g=null,m=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<m.length;v++){for(var p=this.getActualStartSize(m[v],!0),A=this.model.getChildCells(m[v],!0),G=this.getCellStyle(m[v],!0),T=null,F=[],P=0;P<A.length;P++){var Q=this.getCellGeometry(A[P]),U={cell:A[P],rospan:1,colspan:1,row:v,col:P,geo:Q};Q=null!=Q.alternateBounds?Q.alternateBounds:Q;U.point=new mxPoint(Q.width+(null!=T?T.point.x:b.x+p.x),Q.height+(null!=g&&null!=-g[0]?g[0].point.y:b.y+p.y));U.actual=U;null!=g&&null!=g[P]&&1<g[P].rowspan?(U.rowspan=g[P].rowspan-1,U.colspan=g[P].colspan,U.actual=g[P].actual):null!=T&&1<T.colspan?(U.rowspan=T.rowspan,U.colspan=T.colspan-1,U.actual=T.actual):(T=this.getCurrentCellStyle(A[P],!0),null!=T&&(U.rowspan=parseInt(T.rowspan||1),U.colspan=parseInt(T.colspan||1)));T=1==mxUtils.getValue(G,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(G,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;e(U,A.length,-m.length,b.x+(T?p.x:0),b.y+(T?p.y:0));F.push(U);T=U}g=F}};Graph.prototype.getTableLines=function(b,e,g){var m=[],v=[];(e||g)&&this.visitTableCells(b,mxUtils.bind(this,function(p,A,G,T,F){e&&p.row<G-1&&(null==m[p.row]&&(m[p.row]=[new mxPoint(T,p.point.y)]),1<p.rowspan&&m[p.row].push(null),m[p.row].push(p.point));g&&p.col<A-1&&(null==v[p.col]&&(v[p.col]=[new mxPoint(p.point.x,F)]),1<p.colspan&&v[p.col].push(null),v[p.col].push(p.point))}));return m.concat(v)};+Graph.prototype.createCrossFunctionalSwimlane=function(b,e,g,m,v,p,A,G,S){g=null!=g?g:120;m=null!=m?m:120;A=null!=A?A:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";G=null!=G?G:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";+S=null!=S?S:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,e*g,b*m,null!=p?p:"shape=table;childLayout=tableLayout;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");p=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=p;v.geometry.height+=+p;A=this.createVertex(null,null,"",0,p,e*g+p,m,A);v.insert(this.createParent(A,this.createVertex(null,null,"",p,0,g,m,G),e,g,0));return 1<b?(A.geometry.y=m+p,this.createParent(v,this.createParent(A,this.createVertex(null,null,"",p,0,g,m,S),e,g,0),b-1,0,m)):v};+Graph.prototype.visitTableCells=function(b,e){var g=null,m=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<m.length;v++){for(var p=this.getActualStartSize(m[v],!0),A=this.model.getChildCells(m[v],!0),G=this.getCellStyle(m[v],!0),S=null,F=[],P=0;P<A.length;P++){var Q=this.getCellGeometry(A[P]),T={cell:A[P],rospan:1,colspan:1,row:v,col:P,geo:Q};Q=null!=Q.alternateBounds?Q.alternateBounds:Q;T.point=new mxPoint(Q.width+(null!=S?S.point.x:b.x+p.x),Q.height+(null!=g&&null!=+g[0]?g[0].point.y:b.y+p.y));T.actual=T;null!=g&&null!=g[P]&&1<g[P].rowspan?(T.rowspan=g[P].rowspan-1,T.colspan=g[P].colspan,T.actual=g[P].actual):null!=S&&1<S.colspan?(T.rowspan=S.rowspan,T.colspan=S.colspan-1,T.actual=S.actual):(S=this.getCurrentCellStyle(A[P],!0),null!=S&&(T.rowspan=parseInt(S.rowspan||1),T.colspan=parseInt(S.colspan||1)));S=1==mxUtils.getValue(G,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(G,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;e(T,A.length,+m.length,b.x+(S?p.x:0),b.y+(S?p.y:0));F.push(T);S=T}g=F}};Graph.prototype.getTableLines=function(b,e,g){var m=[],v=[];(e||g)&&this.visitTableCells(b,mxUtils.bind(this,function(p,A,G,S,F){e&&p.row<G-1&&(null==m[p.row]&&(m[p.row]=[new mxPoint(S,p.point.y)]),1<p.rowspan&&m[p.row].push(null),m[p.row].push(p.point));g&&p.col<A-1&&(null==v[p.col]&&(v[p.col]=[new mxPoint(p.point.x,F)]),1<p.colspan&&v[p.col].push(null),v[p.col].push(p.point))}));return m.concat(v)};Graph.prototype.isTableCell=function(b){return this.model.isVertex(b)&&this.isTableRow(this.model.getParent(b))};Graph.prototype.isTableRow=function(b){return this.model.isVertex(b)&&this.isTable(this.model.getParent(b))};Graph.prototype.isTable=function(b){b=this.getCellStyle(b);return null!=b&&"tableLayout"==b.childLayout};Graph.prototype.isStack=function(b){b=this.getCellStyle(b);return null!=b&&"stackLayout"==b.childLayout};Graph.prototype.isStackChild=function(b){return this.model.isVertex(b)&&this.isStack(this.model.getParent(b))};-Graph.prototype.setTableRowHeight=function(b,e,g){g=null!=g?g:!0;var m=this.getModel();m.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=e;m.setGeometry(b,v);var p=m.getParent(b),A=m.getChildCells(p,!0);if(!g){var G=mxUtils.indexOf(A,b);if(G<A.length-1){var T=A[G+1],F=this.getCellGeometry(T);null!=F&&(F=F.clone(),F.y+=e,F.height-=e,m.setGeometry(T,F))}}var P=this.getCellGeometry(p);null!=P&&(g||(g=b==A[A.length-1]),g&&(P=P.clone(),P.height+=e,m.setGeometry(p,P)))}}finally{m.endUpdate()}};-Graph.prototype.setTableColumnWidth=function(b,e,g){g=null!=g?g:!1;var m=this.getModel(),v=m.getParent(b),p=m.getParent(v),A=m.getChildCells(v,!0);b=mxUtils.indexOf(A,b);var G=b==A.length-1;m.beginUpdate();try{for(var T=m.getChildCells(p,!0),F=0;F<T.length;F++){v=T[F];A=m.getChildCells(v,!0);var P=A[b],Q=this.getCellGeometry(P);null!=Q&&(Q=Q.clone(),Q.width+=e,null!=Q.alternateBounds&&(Q.alternateBounds.width+=e),m.setGeometry(P,Q));b<A.length-1&&(P=A[b+1],Q=this.getCellGeometry(P),null!=Q&&(Q=Q.clone(),-Q.x+=e,g||(Q.width-=e,null!=Q.alternateBounds&&(Q.alternateBounds.width-=e)),m.setGeometry(P,Q)))}if(G||g){var U=this.getCellGeometry(p);null!=U&&(U=U.clone(),U.width+=e,m.setGeometry(p,U))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{m.endUpdate()}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};+Graph.prototype.setTableRowHeight=function(b,e,g){g=null!=g?g:!0;var m=this.getModel();m.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=e;m.setGeometry(b,v);var p=m.getParent(b),A=m.getChildCells(p,!0);if(!g){var G=mxUtils.indexOf(A,b);if(G<A.length-1){var S=A[G+1],F=this.getCellGeometry(S);null!=F&&(F=F.clone(),F.y+=e,F.height-=e,m.setGeometry(S,F))}}var P=this.getCellGeometry(p);null!=P&&(g||(g=b==A[A.length-1]),g&&(P=P.clone(),P.height+=e,m.setGeometry(p,P)))}}finally{m.endUpdate()}};+Graph.prototype.setTableColumnWidth=function(b,e,g){g=null!=g?g:!1;var m=this.getModel(),v=m.getParent(b),p=m.getParent(v),A=m.getChildCells(v,!0);b=mxUtils.indexOf(A,b);var G=b==A.length-1;m.beginUpdate();try{for(var S=m.getChildCells(p,!0),F=0;F<S.length;F++){v=S[F];A=m.getChildCells(v,!0);var P=A[b],Q=this.getCellGeometry(P);null!=Q&&(Q=Q.clone(),Q.width+=e,null!=Q.alternateBounds&&(Q.alternateBounds.width+=e),m.setGeometry(P,Q));b<A.length-1&&(P=A[b+1],Q=this.getCellGeometry(P),null!=Q&&(Q=Q.clone(),+Q.x+=e,g||(Q.width-=e,null!=Q.alternateBounds&&(Q.alternateBounds.width-=e)),m.setGeometry(P,Q)))}if(G||g){var T=this.getCellGeometry(p);null!=T&&(T=T.clone(),T.width+=e,m.setGeometry(p,T))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{m.endUpdate()}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};TableLayout.prototype.isVertexIgnored=function(b){return!this.graph.getModel().isVertex(b)||!this.graph.isCellVisible(b)};TableLayout.prototype.getSize=function(b,e){for(var g=0,m=0;m<b.length;m++)if(!this.isVertexIgnored(b[m])){var v=this.graph.getCellGeometry(b[m]);null!=v&&(g+=e?v.width:v.height)}return g};TableLayout.prototype.getRowLayout=function(b,e){var g=this.graph.model.getChildCells(b,!0),m=this.graph.getActualStartSize(b,!0);b=this.getSize(g,!0);e=e-m.x-m.width;var v=[];m=m.x;for(var p=0;p<g.length;p++){var A=this.graph.getCellGeometry(g[p]);null!=A&&(m+=(null!=A.alternateBounds?A.alternateBounds.width:A.width)*e/b,v.push(Math.round(m)))}return v};-TableLayout.prototype.layoutRow=function(b,e,g,m){var v=this.graph.getModel(),p=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var A=b.x,G=0;null!=e&&(e=e.slice(),e.splice(0,0,b.x));for(var T=0;T<p.length;T++){var F=this.graph.getCellGeometry(p[T]);null!=F&&(F=F.clone(),F.y=b.y,F.height=g-b.y-b.height,null!=e?(F.x=e[T],F.width=e[T+1]-F.x,T==p.length-1&&T<e.length-2&&(F.width=m-F.x-b.x-b.width)):(F.x=A,A+=F.width,T==p.length-1?F.width=m-b.x-b.width-G:G+=F.width),F.alternateBounds=new mxRectangle(0,-0,F.width,F.height),v.setGeometry(p[T],F))}return G};-TableLayout.prototype.execute=function(b){if(null!=b){var e=this.graph.getActualStartSize(b,!0),g=this.graph.getCellGeometry(b),m=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(m,"resizeLastRow","0"),p="1"==mxUtils.getValue(m,"resizeLast","0");m="1"==mxUtils.getValue(m,"fixedRows","0");var A=this.graph.getModel(),G=0;A.beginUpdate();try{for(var T=g.height-e.y-e.height,F=g.width-e.x-e.width,P=A.getChildCells(b,!0),Q=0;Q<P.length;Q++)A.setVisible(P[Q],!0);var U=this.getSize(P,!1);if(0<T&&0<F&&0<-P.length&&0<U){if(v){var c=this.graph.getCellGeometry(P[P.length-1]);null!=c&&(c=c.clone(),c.height=T-U+c.height,A.setGeometry(P[P.length-1],c))}var f=p?null:this.getRowLayout(P[0],F),k=[],B=e.y;for(Q=0;Q<P.length;Q++)c=this.graph.getCellGeometry(P[Q]),null!=c&&(c=c.clone(),c.x=e.x,c.width=F,c.y=Math.round(B),B=v||m?B+c.height:B+c.height/U*T,c.height=Math.round(B)-c.y,A.setGeometry(P[Q],c)),G=Math.max(G,this.layoutRow(P[Q],f,c.height,F,k));m&&T<U&&(g=g.clone(),g.height=B+e.height,A.setGeometry(b,+TableLayout.prototype.layoutRow=function(b,e,g,m){var v=this.graph.getModel(),p=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var A=b.x,G=0;null!=e&&(e=e.slice(),e.splice(0,0,b.x));for(var S=0;S<p.length;S++){var F=this.graph.getCellGeometry(p[S]);null!=F&&(F=F.clone(),F.y=b.y,F.height=g-b.y-b.height,null!=e?(F.x=e[S],F.width=e[S+1]-F.x,S==p.length-1&&S<e.length-2&&(F.width=m-F.x-b.x-b.width)):(F.x=A,A+=F.width,S==p.length-1?F.width=m-b.x-b.width-G:G+=F.width),F.alternateBounds=new mxRectangle(0,+0,F.width,F.height),v.setGeometry(p[S],F))}return G};+TableLayout.prototype.execute=function(b){if(null!=b){var e=this.graph.getActualStartSize(b,!0),g=this.graph.getCellGeometry(b),m=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(m,"resizeLastRow","0"),p="1"==mxUtils.getValue(m,"resizeLast","0");m="1"==mxUtils.getValue(m,"fixedRows","0");var A=this.graph.getModel(),G=0;A.beginUpdate();try{for(var S=g.height-e.y-e.height,F=g.width-e.x-e.width,P=A.getChildCells(b,!0),Q=0;Q<P.length;Q++)A.setVisible(P[Q],!0);var T=this.getSize(P,!1);if(0<S&&0<F&&0<+P.length&&0<T){if(v){var c=this.graph.getCellGeometry(P[P.length-1]);null!=c&&(c=c.clone(),c.height=S-T+c.height,A.setGeometry(P[P.length-1],c))}var f=p?null:this.getRowLayout(P[0],F),k=[],B=e.y;for(Q=0;Q<P.length;Q++)c=this.graph.getCellGeometry(P[Q]),null!=c&&(c=c.clone(),c.x=e.x,c.width=F,c.y=Math.round(B),B=v||m?B+c.height:B+c.height/T*S,c.height=Math.round(B)-c.y,A.setGeometry(P[Q],c)),G=Math.max(G,this.layoutRow(P[Q],f,c.height,F,k));m&&S<T&&(g=g.clone(),g.height=B+e.height,A.setGeometry(b,g));p&&F<G+Graph.minTableColumnWidth&&(g=g.clone(),g.width=G+e.width+e.x+Graph.minTableColumnWidth,A.setGeometry(b,g));this.graph.visitTableCells(b,mxUtils.bind(this,function(z){A.setVisible(z.cell,z.actual.cell==z.cell);if(z.actual.cell!=z.cell){if(z.actual.row==z.row){var C=null!=z.geo.alternateBounds?z.geo.alternateBounds:z.geo;z.actual.geo.width+=C.width}z.actual.col==z.col&&(C=null!=z.geo.alternateBounds?z.geo.alternateBounds:z.geo,z.actual.geo.height+=C.height)}}))}else for(Q=0;Q<P.length;Q++)A.setVisible(P[Q],!1)}finally{A.endUpdate()}}};-(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var e=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(Q,U){U=null!=U?U:!0;var c=this.getState(Q);null!=c&&U&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&!c.invalid&&this.updateLineJumps(c)&&this.graph.cellRenderer.redraw(c,!1,this.isRendering());c=e.apply(this,-arguments);null!=c&&U&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(c);return c};mxShape.prototype.isFlowAnimationEnabled=function(){return null!=this.state&&this.state.view.graph.enableFlowAnimation&&this.state.view.graph.model.isEdge(this.state.cell)&&"1"==mxUtils.getValue(this.state.style,"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(){var Q=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=-Q)for(var U=0;U<Q.length;U++)if("hidden"!=Q[U].getAttribute("visibility"))return Q[U];return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,this.state.view.scale,this.state.view.graph.addFlowAnimationStyle())};var g=mxShape.prototype.paint;mxShape.prototype.paint=function(Q){g.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var m=mxShape.prototype.createSvgCanvas;-mxShape.prototype.createSvgCanvas=function(Q){Q=m.apply(this,arguments);null!=this.state&&(Q.adaptiveColors=this.state.view.graph.getAdaptiveColors());return Q};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(Q,U){return v.apply(this,arguments)||null!=Q.routedPoints&&null!=U.routedPoints&&!mxUtils.equalPoints(U.routedPoints,Q.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(Q){p.apply(this,arguments);-this.graph.model.isEdge(Q.cell)&&1!=Q.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(Q)};mxGraphView.prototype.updateLineJumps=function(Q){var U=Q.absolutePoints;if(Graph.lineJumpsEnabled){var c=null!=Q.routedPoints,f=null;if(null!=U&&null!=this.validEdges&&"none"!==mxUtils.getValue(Q.style,"jumpStyle","none")){var k=function(Z,da,aa){var l=new mxPoint(da,aa);l.type=Z;f.push(l);l=null!=Q.routedPoints?Q.routedPoints[f.length-1]:null;return null==l||l.type!=Z||l.x!=da||l.y!=aa},B=.5*this.scale;-c=!1;f=[];for(var z=0;z<U.length-1;z++){for(var C=U[z+1],H=U[z],K=[],M=U[z+2];z<U.length-2&&mxUtils.ptSegDistSq(H.x,H.y,M.x,M.y,C.x,C.y)<1*this.scale*this.scale;)C=M,z++,M=U[z+2];c=k(0,H.x,H.y)||c;for(var O=0;O<this.validEdges.length;O++){var ea=this.validEdges[O],fa=ea.absolutePoints;if(null!=fa&&mxUtils.intersects(Q,ea)&&"1"!=ea.style.noJump){var S=null;for(ea=0;ea<fa.length-1;ea++){var ca=fa[ea+1],ma=fa[ea];for(M=fa[ea+2];ea<fa.length-2&&mxUtils.ptSegDistSq(ma.x,ma.y,M.x,M.y,ca.x,ca.y)<1*this.scale*-this.scale;)ca=M,ea++,M=fa[ea+2];var la=mxUtils.intersection(H.x,H.y,C.x,C.y,ma.x,ma.y,ca.x,ca.y);if(null!=la&&(Math.abs(la.x-H.x)>B||Math.abs(la.y-H.y)>B)&&(Math.abs(la.x-C.x)>B||Math.abs(la.y-C.y)>B)&&(null==S||mxUtils.ptLineDist(H.x,H.y,C.x,C.y,S.x,S.y)>B||mxUtils.ptLineDist(H.x,H.y,C.x,C.y,ma.x,ma.y)>B)&&(null==M||mxUtils.ptLineDist(H.x,H.y,C.x,C.y,M.x,M.y)>B||mxUtils.ptLineDist(H.x,H.y,C.x,C.y,ca.x,ca.y)>B)){M=la.x-H.x;S=la.y-H.y;la={distSq:M*M+S*S,x:la.x,y:la.y};for(M=0;M<K.length;M++)if(K[M].distSq>-la.distSq){K.splice(M,0,la);la=null;break}null==la||0!=K.length&&K[K.length-1].x===la.x&&K[K.length-1].y===la.y||K.push(la)}S=ma}}}for(ea=0;ea<K.length;ea++)c=k(1,K[ea].x,K[ea].y)||c}la=U[U.length-1];c=k(0,la.x,la.y)||c}Q.routedPoints=f;return c}return!1};var A=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(Q,U,c){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)A.apply(this,-arguments);else{var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,k=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,B=mxUtils.getValue(this.style,"jumpStyle","none"),z=!0,C=null,H=null,K=[],M=null;Q.begin();for(var O=0;O<this.state.routedPoints.length;O++){var ea=this.state.routedPoints[O],fa=new mxPoint(ea.x/this.scale,ea.y/this.scale);0==O?fa=U[0]:O==this.state.routedPoints.length-1&&(fa=U[U.length-1]);var S=!1;-if(null!=C&&1==ea.type){var ca=this.state.routedPoints[O+1];ea=ca.x/this.scale-fa.x;ca=ca.y/this.scale-fa.y;ea=ea*ea+ca*ca;null==M&&(M=new mxPoint(fa.x-C.x,fa.y-C.y),H=Math.sqrt(M.x*M.x+M.y*M.y),0<H?(M.x=M.x*k/H,M.y=M.y*k/H):M=null);ea>k*k&&0<H&&(ea=C.x-fa.x,ca=C.y-fa.y,ea=ea*ea+ca*ca,ea>k*k&&(S=new mxPoint(fa.x-M.x,fa.y-M.y),ea=new mxPoint(fa.x+M.x,fa.y+M.y),K.push(S),this.addPoints(Q,K,c,f,!1,null,z),K=0>Math.round(M.x)||0==Math.round(M.x)&&0>=Math.round(M.y)?1:-1,z=!1,"sharp"==B?(Q.lineTo(S.x--M.y*K,S.y+M.x*K),Q.lineTo(ea.x-M.y*K,ea.y+M.x*K),Q.lineTo(ea.x,ea.y)):"line"==B?(Q.moveTo(S.x+M.y*K,S.y-M.x*K),Q.lineTo(S.x-M.y*K,S.y+M.x*K),Q.moveTo(ea.x-M.y*K,ea.y+M.x*K),Q.lineTo(ea.x+M.y*K,ea.y-M.x*K),Q.moveTo(ea.x,ea.y)):"arc"==B?(K*=1.3,Q.curveTo(S.x-M.y*K,S.y+M.x*K,ea.x-M.y*K,ea.y+M.x*K,ea.x,ea.y)):(Q.moveTo(ea.x,ea.y),z=!0),K=[ea],S=!0))}else M=null;S||(K.push(fa),C=fa)}this.addPoints(Q,K,c,f,!1,null,z);Q.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=-function(Q,U,c,f){return null!=U&&"centerPerimeter"==U.style[mxConstants.STYLE_PERIMETER]?new mxPoint(U.getCenterX(),U.getCenterY()):G.apply(this,arguments)};var T=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(Q,U,c,f){if(null==U||null==Q||"1"!=U.style.snapToPoint&&"1"!=Q.style.snapToPoint)T.apply(this,arguments);else{U=this.getTerminalPort(Q,U,f);var k=this.getNextPoint(Q,c,f),B=this.graph.isOrthogonal(Q),z=mxUtils.toRadians(Number(U.style[mxConstants.STYLE_ROTATION]||-"0")),C=new mxPoint(U.getCenterX(),U.getCenterY());if(0!=z){var H=Math.cos(-z),K=Math.sin(-z);k=mxUtils.getRotatedPoint(k,H,K,C)}H=parseFloat(Q.style[mxConstants.STYLE_PERIMETER_SPACING]||0);H+=parseFloat(Q.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(U,k,0==z&&B,H);0!=z&&(H=Math.cos(z),K=Math.sin(z),k=mxUtils.getRotatedPoint(k,H,K,C));Q.setAbsoluteTerminalPoint(this.snapToAnchorPoint(Q,U,c,f,k),f)}};mxGraphView.prototype.snapToAnchorPoint=-function(Q,U,c,f,k){if(null!=U&&null!=Q){Q=this.graph.getAllConnectionConstraints(U);f=c=null;if(null!=Q)for(var B=0;B<Q.length;B++){var z=this.graph.getConnectionPoint(U,Q[B]);if(null!=z){var C=(z.x-k.x)*(z.x-k.x)+(z.y-k.y)*(z.y-k.y);if(null==f||C<f)c=z,f=C}}null!=c&&(k=c)}return k};var F=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(Q,U,c){var f=F.apply(this,arguments);"1"==Q.getAttribute("placeholders")&&null!=c.state&&(f=c.state.view.graph.replacePlaceholders(c.state.cell,-f));return f};var P=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(Q){if(null!=Q.style&&"undefined"!==typeof pako){var U=mxUtils.getValue(Q.style,mxConstants.STYLE_SHAPE,null);if(null!=U&&"string"===typeof U&&"stencil("==U.substring(0,8))try{var c=U.substring(8,U.length-1),f=mxUtils.parseXml(Graph.decompress(c));return new mxShape(new mxStencil(f.documentElement))}catch(k){null!=window.console&&console.log("Error in shape: "+k)}}return P.apply(this,arguments)}})();+(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var e=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(Q,T){T=null!=T?T:!0;var c=this.getState(Q);null!=c&&T&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&!c.invalid&&this.updateLineJumps(c)&&this.graph.cellRenderer.redraw(c,!1,this.isRendering());c=e.apply(this,+arguments);null!=c&&T&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(c);return c};mxShape.prototype.isFlowAnimationEnabled=function(){return null!=this.state&&this.state.view.graph.enableFlowAnimation&&this.state.view.graph.model.isEdge(this.state.cell)&&"1"==mxUtils.getValue(this.state.style,"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(){var Q=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=+Q)for(var T=0;T<Q.length;T++)if("hidden"!=Q[T].getAttribute("visibility"))return Q[T];return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,this.state.view.scale,this.state.view.graph.addFlowAnimationStyle())};var g=mxShape.prototype.paint;mxShape.prototype.paint=function(Q){g.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var m=mxShape.prototype.createSvgCanvas;+mxShape.prototype.createSvgCanvas=function(Q){Q=m.apply(this,arguments);null!=this.state&&(Q.adaptiveColors=this.state.view.graph.getAdaptiveColors());return Q};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(Q,T){return v.apply(this,arguments)||null!=Q.routedPoints&&null!=T.routedPoints&&!mxUtils.equalPoints(T.routedPoints,Q.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(Q){p.apply(this,arguments);+this.graph.model.isEdge(Q.cell)&&1!=Q.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(Q)};mxGraphView.prototype.updateLineJumps=function(Q){var T=Q.absolutePoints;if(Graph.lineJumpsEnabled){var c=null!=Q.routedPoints,f=null;if(null!=T&&null!=this.validEdges&&"none"!==mxUtils.getValue(Q.style,"jumpStyle","none")){var k=function(Z,ea,aa){var l=new mxPoint(ea,aa);l.type=Z;f.push(l);l=null!=Q.routedPoints?Q.routedPoints[f.length-1]:null;return null==l||l.type!=Z||l.x!=ea||l.y!=aa},B=.5*this.scale;+c=!1;f=[];for(var z=0;z<T.length-1;z++){for(var C=T[z+1],I=T[z],L=[],J=T[z+2];z<T.length-2&&mxUtils.ptSegDistSq(I.x,I.y,J.x,J.y,C.x,C.y)<1*this.scale*this.scale;)C=J,z++,J=T[z+2];c=k(0,I.x,I.y)||c;for(var O=0;O<this.validEdges.length;O++){var da=this.validEdges[O],fa=da.absolutePoints;if(null!=fa&&mxUtils.intersects(Q,da)&&"1"!=da.style.noJump){var V=null;for(da=0;da<fa.length-1;da++){var ba=fa[da+1],ma=fa[da];for(J=fa[da+2];da<fa.length-2&&mxUtils.ptSegDistSq(ma.x,ma.y,J.x,J.y,ba.x,ba.y)<1*this.scale*+this.scale;)ba=J,da++,J=fa[da+2];var la=mxUtils.intersection(I.x,I.y,C.x,C.y,ma.x,ma.y,ba.x,ba.y);if(null!=la&&(Math.abs(la.x-I.x)>B||Math.abs(la.y-I.y)>B)&&(Math.abs(la.x-C.x)>B||Math.abs(la.y-C.y)>B)&&(null==V||mxUtils.ptLineDist(I.x,I.y,C.x,C.y,V.x,V.y)>B||mxUtils.ptLineDist(I.x,I.y,C.x,C.y,ma.x,ma.y)>B)&&(null==J||mxUtils.ptLineDist(I.x,I.y,C.x,C.y,J.x,J.y)>B||mxUtils.ptLineDist(I.x,I.y,C.x,C.y,ba.x,ba.y)>B)){J=la.x-I.x;V=la.y-I.y;la={distSq:J*J+V*V,x:la.x,y:la.y};for(J=0;J<L.length;J++)if(L[J].distSq>+la.distSq){L.splice(J,0,la);la=null;break}null==la||0!=L.length&&L[L.length-1].x===la.x&&L[L.length-1].y===la.y||L.push(la)}V=ma}}}for(da=0;da<L.length;da++)c=k(1,L[da].x,L[da].y)||c}la=T[T.length-1];c=k(0,la.x,la.y)||c}Q.routedPoints=f;return c}return!1};var A=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(Q,T,c){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)A.apply(this,+arguments);else{var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,k=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,B=mxUtils.getValue(this.style,"jumpStyle","none"),z=!0,C=null,I=null,L=[],J=null;Q.begin();for(var O=0;O<this.state.routedPoints.length;O++){var da=this.state.routedPoints[O],fa=new mxPoint(da.x/this.scale,da.y/this.scale);0==O?fa=T[0]:O==this.state.routedPoints.length-1&&(fa=T[T.length-1]);var V=!1;+if(null!=C&&1==da.type){var ba=this.state.routedPoints[O+1];da=ba.x/this.scale-fa.x;ba=ba.y/this.scale-fa.y;da=da*da+ba*ba;null==J&&(J=new mxPoint(fa.x-C.x,fa.y-C.y),I=Math.sqrt(J.x*J.x+J.y*J.y),0<I?(J.x=J.x*k/I,J.y=J.y*k/I):J=null);da>k*k&&0<I&&(da=C.x-fa.x,ba=C.y-fa.y,da=da*da+ba*ba,da>k*k&&(V=new mxPoint(fa.x-J.x,fa.y-J.y),da=new mxPoint(fa.x+J.x,fa.y+J.y),L.push(V),this.addPoints(Q,L,c,f,!1,null,z),L=0>Math.round(J.x)||0==Math.round(J.x)&&0>=Math.round(J.y)?1:-1,z=!1,"sharp"==B?(Q.lineTo(V.x-+J.y*L,V.y+J.x*L),Q.lineTo(da.x-J.y*L,da.y+J.x*L),Q.lineTo(da.x,da.y)):"line"==B?(Q.moveTo(V.x+J.y*L,V.y-J.x*L),Q.lineTo(V.x-J.y*L,V.y+J.x*L),Q.moveTo(da.x-J.y*L,da.y+J.x*L),Q.lineTo(da.x+J.y*L,da.y-J.x*L),Q.moveTo(da.x,da.y)):"arc"==B?(L*=1.3,Q.curveTo(V.x-J.y*L,V.y+J.x*L,da.x-J.y*L,da.y+J.x*L,da.x,da.y)):(Q.moveTo(da.x,da.y),z=!0),L=[da],V=!0))}else J=null;V||(L.push(fa),C=fa)}this.addPoints(Q,L,c,f,!1,null,z);Q.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=+function(Q,T,c,f){return null!=T&&"centerPerimeter"==T.style[mxConstants.STYLE_PERIMETER]?new mxPoint(T.getCenterX(),T.getCenterY()):G.apply(this,arguments)};var S=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(Q,T,c,f){if(null==T||null==Q||"1"!=T.style.snapToPoint&&"1"!=Q.style.snapToPoint)S.apply(this,arguments);else{T=this.getTerminalPort(Q,T,f);var k=this.getNextPoint(Q,c,f),B=this.graph.isOrthogonal(Q),z=mxUtils.toRadians(Number(T.style[mxConstants.STYLE_ROTATION]||+"0")),C=new mxPoint(T.getCenterX(),T.getCenterY());if(0!=z){var I=Math.cos(-z),L=Math.sin(-z);k=mxUtils.getRotatedPoint(k,I,L,C)}I=parseFloat(Q.style[mxConstants.STYLE_PERIMETER_SPACING]||0);I+=parseFloat(Q.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(T,k,0==z&&B,I);0!=z&&(I=Math.cos(z),L=Math.sin(z),k=mxUtils.getRotatedPoint(k,I,L,C));Q.setAbsoluteTerminalPoint(this.snapToAnchorPoint(Q,T,c,f,k),f)}};mxGraphView.prototype.snapToAnchorPoint=+function(Q,T,c,f,k){if(null!=T&&null!=Q){Q=this.graph.getAllConnectionConstraints(T);f=c=null;if(null!=Q)for(var B=0;B<Q.length;B++){var z=this.graph.getConnectionPoint(T,Q[B]);if(null!=z){var C=(z.x-k.x)*(z.x-k.x)+(z.y-k.y)*(z.y-k.y);if(null==f||C<f)c=z,f=C}}null!=c&&(k=c)}return k};var F=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(Q,T,c){var f=F.apply(this,arguments);"1"==Q.getAttribute("placeholders")&&null!=c.state&&(f=c.state.view.graph.replacePlaceholders(c.state.cell,+f));return f};var P=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(Q){if(null!=Q.style&&"undefined"!==typeof pako){var T=mxUtils.getValue(Q.style,mxConstants.STYLE_SHAPE,null);if(null!=T&&"string"===typeof T&&"stencil("==T.substring(0,8))try{var c=T.substring(8,T.length-1),f=mxUtils.parseXml(Graph.decompress(c));return new mxShape(new mxStencil(f.documentElement))}catch(k){null!=window.console&&console.log("Error in shape: "+k)}}return P.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(b){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[b]};mxStencilRegistry.setFileLoaded=function(b){mxStencilRegistry.filesLoaded[b]=!0};mxStencilRegistry.getStencil=function(b){var e=mxStencilRegistry.stencils[b];if(null==e&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var g=mxStencilRegistry.getBasenameForStencil(b);if(null!=g){e=mxStencilRegistry.libraries[g];if(null!=e){if(null==mxStencilRegistry.packages[g]){for(var m=0;m<e.length;m++){var v=e[m];if(!mxStencilRegistry.isFileLoaded(v))if(mxStencilRegistry.setFileLoaded(v),".xml"==v.toLowerCase().substring(v.length-4,v.length))mxStencilRegistry.loadStencilSet(v,null);else if(".js"==v.toLowerCase().substring(v.length-3,v.length))try{if(mxStencilRegistry.allowEval){var p=mxUtils.load(v);null!=p&&200<=p.getStatus()&&299>=p.getStatus()&&eval.call(window,p.getText())}}catch(A){null!=window.console&&console.log("error in getStencil:",b,g,e,v,A)}}mxStencilRegistry.packages[g]=1}}else g=g.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+g+".xml",null);e=mxStencilRegistry.stencils[b]}}return e};@@ -2522,14 +2522,14 @@ N,R,X){N=null!=N?N:0;R=null!=R?R:0;var ia=new mxCodec(u.ownerDocument),ka=new mxka.getChildren(wa[0]);null!=ua&&(u=this.moveCells(ua,N,R,!1,this.getDefaultParent()),pa[ka.getChildAt(ka.root,0).getId()]=this.getDefaultParent().getId())}if(null!=u&&(this.createCellMapping(ia,ta,pa),this.updateCustomLinks(pa,u),X)){this.isGridEnabled()&&(N=this.snap(N),R=this.snap(R));var Ca=this.getBoundingBoxFromGeometry(u,!0);null!=Ca&&this.moveCells(u,N-Ca.x,R-Ca.y)}}finally{this.model.endUpdate()}}return u};Graph.prototype.encodeCells=function(u){for(var N={},R=this.cloneCells(u,null,N),X=new mxDictionary,ia=0;ia<u.length;ia++)X.put(u[ia],!0);var ka=new mxCodec,pa=new mxGraphModel,wa=pa.getChildAt(pa.getRoot(),0);for(ia=0;ia<R.length;ia++){pa.add(wa,R[ia]);var ta=this.view.getState(u[ia]);if(null!=ta){var ua=this.getCellGeometry(R[ia]);null!=ua&&ua.relative&&!this.model.isEdge(u[ia])&&null==X.get(this.model.getParent(u[ia]))&&(ua.offset=null,ua.relative=!1,ua.x=ta.x/ta.view.scale-ta.view.translate.x,ua.y=ta.y/ta.view.scale-ta.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(N,this.createCellLookup(u)),R);return ka.encode(pa)};Graph.prototype.isSwimlane=function(u,N){var R=null;null==u||this.model.isEdge(u)||this.model.getParent(u)==this.model.getRoot()||(R=this.getCurrentCellStyle(u,N)[mxConstants.STYLE_SHAPE]);return R==mxConstants.SHAPE_SWIMLANE||"table"==R||"tableRow"==R};var G=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(u){return null!=u&&G.apply(this,arguments)?this.isTableCell(u)||this.isTableRow(u)?this.isCellEditable(this.model.getParent(u)):-!0:!1};var T=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(u){return null!=u&&T.apply(this,arguments)?this.isTableCell(u)||this.isTableRow(u)?this.isCellMovable(this.model.getParent(u)):!0:!1};var F=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(u){var N=this.model.getParent(u);if(null!=N){var R=this.getCurrentCellStyle(N);if(null!=R.expand)return"0"!=R.expand}return F.apply(this,arguments)&&(null==N||!this.isTable(N))};var P=Graph.prototype.splitEdge;+!0:!1};var S=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(u){return null!=u&&S.apply(this,arguments)?this.isTableCell(u)||this.isTableRow(u)?this.isCellMovable(this.model.getParent(u)):!0:!1};var F=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(u){var N=this.model.getParent(u);if(null!=N){var R=this.getCurrentCellStyle(N);if(null!=R.expand)return"0"!=R.expand}return F.apply(this,arguments)&&(null==N||!this.isTable(N))};var P=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(u,N,R,X,ia,ka,pa,wa){null==wa&&(wa=this.model.getParent(u),this.isTable(wa)||this.isTableRow(wa))&&(wa=this.getCellAt(ka,pa,null,!0,!1));R=null;this.model.beginUpdate();try{R=P.apply(this,[u,N,R,X,ia,ka,pa,wa]);this.model.setValue(R,"");var ta=this.getChildCells(R,!0);for(N=0;N<ta.length;N++){var ua=this.getCellGeometry(ta[N]);null!=ua&&ua.relative&&0<ua.x&&this.model.remove(ta[N])}var Ca=this.getChildCells(u,!0);for(N=0;N<Ca.length;N++)ua=this.getCellGeometry(Ca[N]),null!=ua&&ua.relative&&0>=ua.x&&this.model.remove(Ca[N]);var Na=this.model.getTerminal(R,!1);if(null!=Na){var Ya=this.getCurrentCellStyle(Na);null!=Ya&&"1"==Ya.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[u]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[u]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[R]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[R]))}}finally{this.model.endUpdate()}return R};var Q=Graph.prototype.selectCell;Graph.prototype.selectCell=function(u,N,R){if(N||R)Q.apply(this,arguments);else{var X=this.getSelectionCell(),ia=null,ka=[],pa=mxUtils.bind(this,function(wa){if(null!=this.view.getState(wa)&&(this.model.isVertex(wa)||this.model.isEdge(wa)))if(ka.push(wa),wa==X)ia=ka.length-1;else if(u&&null==X&&0<ka.length||null!=ia&&u&&ka.length>ia||!u&&0<ia)return;for(var ta=0;ta<this.model.getChildCount(wa);ta++)pa(this.model.getChildAt(wa,ta))});pa(this.model.root);0<ka.length&&(ia=null!=ia?mxUtils.mod(ia+(u?1:-1),ka.length):0,this.setSelectionCell(ka[ia]))}};-Graph.prototype.swapShapes=function(u,N){if(this.model.isVertex(u)&&this.model.isVertex(N)&&2==this.getMovableCells([u,N]).length){var R=this.getCellGeometry(u),X=this.getCellGeometry(N);if(null!=R&&null!=X){var ia=R.clone(),ka=X.clone();this.model.beginUpdate();try{ia.x=X.getCenterX()-R.width/2,ia.y=X.getCenterY()-R.height/2,ka.x=R.getCenterX()-X.width/2,ka.y=R.getCenterY()-X.height/2,this.model.setGeometry(u,ia),this.model.setGeometry(N,ka)}finally{this.model.endUpdate()}}}};var U=Graph.prototype.moveCells;+Graph.prototype.swapShapes=function(u,N){if(this.model.isVertex(u)&&this.model.isVertex(N)&&2==this.getMovableCells([u,N]).length){var R=this.getCellGeometry(u),X=this.getCellGeometry(N);if(null!=R&&null!=X){var ia=R.clone(),ka=X.clone();this.model.beginUpdate();try{ia.x=X.getCenterX()-R.width/2,ia.y=X.getCenterY()-R.height/2,ka.x=R.getCenterX()-X.width/2,ka.y=R.getCenterY()-X.height/2,this.model.setGeometry(u,ia),this.model.setGeometry(N,ka)}finally{this.model.endUpdate()}}}};var T=Graph.prototype.moveCells;Graph.prototype.moveCells=function(u,N,R,X,ia,ka,pa){pa=null!=pa?pa:{};if(this.isTable(ia)){for(var wa=[],ta=0;ta<u.length;ta++)this.isTable(u[ta])?wa=wa.concat(this.model.getChildCells(u[ta],!0).reverse()):wa.push(u[ta]);u=wa}this.model.beginUpdate();try{wa=[];for(ta=0;ta<u.length;ta++)if(null!=ia&&this.isTableRow(u[ta])){var ua=this.model.getParent(u[ta]),Ca=this.getCellGeometry(u[ta]);this.isTable(ua)&&wa.push(ua);if(null!=ua&&null!=Ca&&this.isTable(ua)&&this.isTable(ia)&&(X||ua!=ia)){if(!X){var Na=this.getCellGeometry(ua);null!=Na&&(Na=Na.clone(),Na.height-=Ca.height,this.model.setGeometry(ua,Na))}Na=this.getCellGeometry(ia);null!=Na&&(Na=Na.clone(),Na.height+=Ca.height,this.model.setGeometry(ia,Na));var Ya=this.model.getChildCells(ia,!0);if(0<Ya.length){u[ta]=X?this.cloneCell(u[ta]):u[ta];var Za=this.model.getChildCells(u[ta],!0),ab=this.model.getChildCells(Ya[0],!0),Ra=ab.length-Za.length;if(0<Ra)for(var Oa=0;Oa<Ra;Oa++){var kb=this.cloneCell(Za[Za.length-1]);null!=kb&&(kb.value="",this.model.add(u[ta],-kb))}else if(0>Ra)for(Oa=0;Oa>Ra;Oa--)this.model.remove(Za[Za.length+Oa-1]);Za=this.model.getChildCells(u[ta],!0);for(Oa=0;Oa<ab.length;Oa++){var cb=this.getCellGeometry(ab[Oa]),$a=this.getCellGeometry(Za[Oa]);null!=cb&&null!=$a&&($a=$a.clone(),$a.width=cb.width,this.model.setGeometry(Za[Oa],$a))}}}}var fb=U.apply(this,arguments);for(ta=0;ta<wa.length;ta++)!X&&this.model.contains(wa[ta])&&0==this.model.getChildCount(wa[ta])&&this.model.remove(wa[ta]);X&&this.updateCustomLinks(this.createCellMapping(pa,+kb))}else if(0>Ra)for(Oa=0;Oa>Ra;Oa--)this.model.remove(Za[Za.length+Oa-1]);Za=this.model.getChildCells(u[ta],!0);for(Oa=0;Oa<ab.length;Oa++){var cb=this.getCellGeometry(ab[Oa]),$a=this.getCellGeometry(Za[Oa]);null!=cb&&null!=$a&&($a=$a.clone(),$a.width=cb.width,this.model.setGeometry(Za[Oa],$a))}}}}var fb=T.apply(this,arguments);for(ta=0;ta<wa.length;ta++)!X&&this.model.contains(wa[ta])&&0==this.model.getChildCount(wa[ta])&&this.model.remove(wa[ta]);X&&this.updateCustomLinks(this.createCellMapping(pa,this.createCellLookup(u)),fb)}finally{this.model.endUpdate()}return fb};var c=Graph.prototype.removeCells;Graph.prototype.removeCells=function(u,N){var R=[];this.model.beginUpdate();try{for(var X=0;X<u.length;X++)if(this.isTableCell(u[X])){var ia=this.model.getParent(u[X]),ka=this.model.getParent(ia);1==this.model.getChildCount(ia)&&1==this.model.getChildCount(ka)?0>mxUtils.indexOf(u,ka)&&0>mxUtils.indexOf(R,ka)&&R.push(ka):this.labelChanged(u[X],"")}else{if(this.isTableRow(u[X])&&(ka=this.model.getParent(u[X]),0>mxUtils.indexOf(u,ka)&&0>mxUtils.indexOf(R,ka))){for(var pa=this.model.getChildCells(ka,!0),wa=0,ta=0;ta<pa.length;ta++)0<=mxUtils.indexOf(u,pa[ta])&&wa++;wa==pa.length&&R.push(ka)}R.push(u[X])}R=c.apply(this,[R,N])}finally{this.model.endUpdate()}return R};Graph.prototype.updateCustomLinks=function(u,N,R){R=null!=R?R:new Graph;for(var X=0;X<N.length;X++)null!=N[X]&&R.updateCustomLinksForCell(u,N[X],R)};Graph.prototype.updateCustomLinksForCell=function(u,N){this.doUpdateCustomLinksForCell(u,N);for(var R=this.model.getChildCount(N),X=0;X<R;X++)this.updateCustomLinksForCell(u,this.model.getChildAt(N,X))};Graph.prototype.doUpdateCustomLinksForCell=function(u,N){};Graph.prototype.getAllConnectionConstraints=function(u,N){if(null!=u){N=mxUtils.getValue(u.style,"points",null);if(null!=N){u=[];try{var R=JSON.parse(N);for(N=0;N<R.length;N++){var X=R[N];u.push(new mxConnectionConstraint(new mxPoint(X[0],X[1]),2<X.length?"0"!=X[2]:!0,null,3<X.length?X[3]:0,4<X.length?X[4]:0))}}catch(ka){}return u}if(null!=@@ -2578,7 +2578,7 @@ ia.root=this.addCellData(X.cell,null!=wa.createElementNS?wa.createElementNS(mxConull!=ia?ia:!0;ka=null!=ka?ka:!0;pa=null!=pa?pa:!0;ua=null!=ua?ua:!1;var cb="page"==Ya?this.view.getBackgroundPageBounds():ka&&null==Oa||X||"diagram"==Ya?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),$a=this.backgroundImage,fb=this.view.translate,jb=this.view.scale;"diagram"==Ya&&null!=$a&&null!=$a.width&&null!=$a.height&&(cb=mxRectangle.fromRectangle(cb),cb.add(new mxRectangle((fb.x+$a.x)*jb,(fb.y+$a.y)*jb,$a.width*jb,$a.height*jb)));if(null==cb)throw Error(mxResources.get("drawingEmpty"));X=N/jb;var sb=Math.max(1,Math.ceil(cb.width*X)+2*R)+(ua&&0==R?5:0),Ab=Math.max(1,Math.ceil(cb.height*X)+2*R)+(ua&&0==R?5:0);ua=ia?-.5:0;var nb=mxUtils.getLightDarkColor(u),lb=Graph.createSvgNode(ua,ua,sb,Ab,nb),db=lb.ownerDocument;if(null!=u){var mb=mxUtils.createElementNs(db,mxConstants.NS_SVG,"rect");mb.setAttribute("fill",nb.light);mb.style.fill=nb.cssText;mb.setAttribute("width","100%");mb.setAttribute("height","100%");mb.setAttribute("x","0");mb.setAttribute("y","0");lb.appendChild(mb)}var ub=mxUtils.createElementNs(db,mxConstants.NS_SVG,"g");lb.appendChild(ub);var eb=this.createSvgCanvas(ub);eb.foOffset=ia?-.5:0;eb.textOffset=ia?-.5:0;eb.imageOffset=ia?-.5:0;eb.translate(Math.floor(R/N-cb.x/jb),Math.floor(R/N-cb.y/jb));eb.idPrefix="drawio-svg-"+Editor.guid();var ob=document.createElement("div"),tb=eb.getAlternateText;eb.getAlternateText=function(hb,Bb,rb,yb,zb,qb,Cb,d,n,y,q,x,D){if(null!=qb&&0<this.state.fontSize)try{mxUtils.isNode(qb)?qb=qb.innerText:(ob.innerHTML=qb,qb=mxUtils.extractTextWithWhitespace(ob.childNodes));-for(var E=Math.ceil(2*yb/this.state.fontSize),ha=[],L=0,va=0;(0==E||L<E)&&va<qb.length;){var na=qb.charCodeAt(va);if(10==na||13==na){if(0<L)break}else ha.push(qb.charAt(va)),255>na&&L++;va++}ha.length<qb.length&&1<qb.length-ha.length&&(qb=mxUtils.trim(ha.join(""))+"...");return qb}catch(Va){return tb.apply(this,arguments)}else return tb.apply(this,arguments)};null!=$a&&null!=$a.width&&null!=$a.height&&(u=jb/N,ua=new mxRectangle(($a.x+fb.x)*u,($a.y+fb.y)*u,$a.width*u,$a.height*u),mxUtils.intersects(cb,+for(var E=Math.ceil(2*yb/this.state.fontSize),ha=[],M=0,va=0;(0==E||M<E)&&va<qb.length;){var na=qb.charCodeAt(va);if(10==na||13==na){if(0<M)break}else ha.push(qb.charAt(va)),255>na&&M++;va++}ha.length<qb.length&&1<qb.length-ha.length&&(qb=mxUtils.trim(ha.join(""))+"...");return qb}catch(Va){return tb.apply(this,arguments)}else return tb.apply(this,arguments)};null!=$a&&null!=$a.width&&null!=$a.height&&(u=jb/N,ua=new mxRectangle(($a.x+fb.x)*u,($a.y+fb.y)*u,$a.width*u,$a.height*u),mxUtils.intersects(cb,ua)&&eb.image($a.x+fb.x,$a.y+fb.y,$a.width,$a.height,$a.src,!0));eb.scale(X);eb.textEnabled=pa;wa=null!=wa?wa:this.createSvgImageExport();var pb=wa.getLinkForCellState;wa.getLinkForCellState=function(hb,Bb){var rb=hb.view.graph.getAbsoluteUrl(pb.apply(this,arguments));return null==rb||hb.view.graph.isCustomLink(rb)?null:rb};wa.getLinkTargetForCellState=function(hb,Bb){return hb.view.graph.getLinkTargetForCell(hb.cell)};var wb=wa.drawCellState,vb=null,xb=mxUtils.bind(this,function(){if(null==vb){vb="ge-flow-animation-"+Editor.guid();var hb=null!=db.createElementNS?db.createElementNS(mxConstants.NS_SVG,"style"):db.createElement("style");hb.innerHTML=this.createFlowAnimationCss(vb);db.getElementsByTagName("defs")[0].appendChild(hb)}return vb});wa.drawCellState=function(hb,Bb){for(var rb=hb.view.graph,yb=null!=Oa?Oa.get(hb.cell):rb.isCellSelected(hb.cell),zb=rb.model.getParent(hb.cell);!(ka&&null==Oa||yb)&&null!=zb;)yb=null!=Oa?Oa.get(zb):rb.isCellSelected(zb),zb=rb.model.getParent(zb);if(null!=hb.shape)try{var qb=hb.shape.isFlowAnimationEnabled,Cb=hb.shape.addFlowAnimationToShape;hb.shape.isFlowAnimationEnabled=function(){return kb&&rb.model.isEdge(hb.cell)&&"1"==mxUtils.getValue(hb.style,"flowAnimation","0")};hb.shape.addFlowAnimationToShape=function(){rb.addFlowAnimationToNode(this.getFlowAnimationPath(),hb.style,N,xb())};if(ka&&null==Oa||yb)rb.view.redrawEnumerationState(hb),wb.apply(this,arguments),this.doDrawShape(hb.secondLabel,Bb)}finally{hb.shape.isFlowAnimationEnabled=qb,hb.shape.addFlowAnimationToShape=@@ -2618,23 +2618,23 @@ mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALICMath.round(ta)+"px";this.textarea.style.textDecoration=pa.join(" ");this.textarea.style.fontWeight=ia?"bold":"normal";this.textarea.style.fontStyle=ka?"italic":"";this.textarea.style.fontFamily=N;this.textarea.style.textAlign=X;this.textarea.style.padding="0px";this.textarea.innerHTML!=wa&&(this.textarea.innerHTML=wa,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors());this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var wa=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(wa=mxUtils.replaceTrailingNewlines(wa,"<div><br></div>"));wa=Graph.sanitizeHtml(N?wa.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):wa,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ta=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ta*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ta)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.width="";this.textarea.style.padding=-"2px";this.textarea.innerHTML!=wa&&(this.textarea.innerHTML=wa);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=R;this.resize()}};var H=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(u,N){if(null!=this.textarea)if(u=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=u){var R=u.view.scale;this.bounds=mxRectangle.fromRectangle(u);if(0==this.bounds.width&&+"2px";this.textarea.innerHTML!=wa&&(this.textarea.innerHTML=wa);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=R;this.resize()}};var I=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(u,N){if(null!=this.textarea)if(u=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=u){var R=u.view.scale;this.bounds=mxRectangle.fromRectangle(u);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*R;this.bounds.height=60*R;var X=null!=u.text?u.text.margin:null;null==X&&(X=mxUtils.getAlignmentAsPoint(mxUtils.getValue(u.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(u.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=X.x*this.bounds.width;this.bounds.y+=X.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/R)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/R)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/R)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*R);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/R)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*-R);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+R+","+R+")")}else this.textarea.style.height="",this.textarea.style.overflow="",H.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(u,N){if("0"==mxUtils.getValue(u.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);+R);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+R+","+R+")")}else this.textarea.style.height="",this.textarea.style.overflow="",I.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(u,N){if("0"==mxUtils.getValue(u.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var R=this.graph.getEditingValue(u.cell,N);"1"==mxUtils.getValue(u.style,"nl2Br","1")&&(R=R.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(R,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(u,N){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(u.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(u){if("0"==mxUtils.getValue(u.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var N=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(u.style,"nl2Br","1")?(N=N.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<N.length&&("<br/>"==N.substring(N.length-5)||"<br>"==N.substring(N.length-4))&&(N=N.substring(0,N.lastIndexOf("<br"))+"<div><br/></div>")):-N=N.replace(/\r\n/g,"").replace(/\n/g,"");return N};var K=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(u){this.codeViewMode&&this.toggleViewMode();K.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(u){}};var M=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(u,N){this.graph.getModel().beginUpdate();try{M.apply(this,arguments),""==N&&this.graph.isCellDeletable(u.cell)&&+N=N.replace(/\r\n/g,"").replace(/\n/g,"");return N};var L=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(u){this.codeViewMode&&this.toggleViewMode();L.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(u){}};var J=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(u,N){this.graph.getModel().beginUpdate();try{J.apply(this,arguments),""==N&&this.graph.isCellDeletable(u.cell)&&0==this.graph.model.getChildCount(u.cell)&&this.graph.isTransparentState(u)&&this.graph.removeCells([u.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(u){u=mxUtils.getValue(u.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);u==mxConstants.NONE&&(u=null);return u};mxCellEditor.prototype.getBorderColor=function(u){u=mxUtils.getValue(u.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);u==mxConstants.NONE&&(u=null);return u};mxCellEditor.prototype.getMinimumSize=function(u){var N=this.graph.getView().scale;return new mxRectangle(0,0,null==u.text?30:u.text.size*N+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(u,N){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(N.getEvent)};mxGraphView.prototype.formatUnitText=function(u){return u?e(u,this.unit):u};mxGraphHandler.prototype.updateHint=function(u){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var N=this.graph.view.translate,R=this.graph.view.scale;u=this.roundLength((this.bounds.x+this.currentDx)/R-N.x);N=this.roundLength((this.bounds.y+this.currentDy)/R-N.y);R=this.graph.view.unit;this.hint.innerHTML=e(u,R)+", "+e(N,R);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var O=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(u,N){O.apply(this,arguments);var R=this.graph.getCellStyle(u);if(null==R.childLayout){var X=this.graph.model.getParent(u),ia=null!=X?this.graph.getCellGeometry(X):null;if(null!=ia&&(R=this.graph.getCellStyle(X),"stackLayout"==R.childLayout)){var ka=-parseFloat(mxUtils.getValue(R,"stackBorder",mxStackLayout.prototype.border));R="1"==mxUtils.getValue(R,"horizontalStack","1");var pa=this.graph.getActualStartSize(X);ia=ia.clone();R?ia.height=N.height+pa.y+pa.height+2*ka:ia.width=N.width+pa.x+pa.width+2*ka;this.graph.model.setGeometry(X,ia)}}};var ea=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function u(wa){R.get(wa)||(R.put(wa,!0),ia.push(wa))}for(var N=ea.apply(this,-arguments),R=new mxDictionary,X=this.graph.model,ia=[],ka=0;ka<N.length;ka++){var pa=N[ka];this.graph.isTableCell(pa)?u(X.getParent(X.getParent(pa))):this.graph.isTableRow(pa)&&u(X.getParent(pa));u(pa)}return ia};var fa=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(u){return fa.apply(this,arguments)&&!mxEvent.isControlDown(u.getEvent())&&!mxEvent.isShiftDown(u.getEvent())};var S=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=-function(){return S.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var ca=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(u){var N=ca.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=1;return N};var ma=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=+parseFloat(mxUtils.getValue(R,"stackBorder",mxStackLayout.prototype.border));R="1"==mxUtils.getValue(R,"horizontalStack","1");var pa=this.graph.getActualStartSize(X);ia=ia.clone();R?ia.height=N.height+pa.y+pa.height+2*ka:ia.width=N.width+pa.x+pa.width+2*ka;this.graph.model.setGeometry(X,ia)}}};var da=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function u(wa){R.get(wa)||(R.put(wa,!0),ia.push(wa))}for(var N=da.apply(this,+arguments),R=new mxDictionary,X=this.graph.model,ia=[],ka=0;ka<N.length;ka++){var pa=N[ka];this.graph.isTableCell(pa)?u(X.getParent(X.getParent(pa))):this.graph.isTableRow(pa)&&u(X.getParent(pa));u(pa)}return ia};var fa=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(u){return fa.apply(this,arguments)&&!mxEvent.isControlDown(u.getEvent())&&!mxEvent.isShiftDown(u.getEvent())};var V=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=+function(){return V.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var ba=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(u){var N=ba.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=1;return N};var ma=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(u){var N=ma.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=1;return N};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var u=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+u.x/2,this.bounds.y+this.rotationHandleVSpacing-u.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(u,N){return this.graph.isRecursiveVertexResize(u)&&!mxEvent.isAltDown(N.getEvent())};mxVertexHandler.prototype.isCenteredEvent=function(u,N){return mxEvent.isControlDown(N.getEvent())||mxEvent.isMetaDown(N.getEvent())};var la=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return la.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?-this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var Z=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return Z.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var da=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(u){return u.tableHandle||da.apply(this,arguments)&&+this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var Z=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return Z.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var ea=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(u){return u.tableHandle||ea.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var u=0;this.graph.isTableRow(this.state.cell)?u=1:this.graph.isTableCell(this.state.cell)&&(u=2);return u};var aa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return aa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var l=null,t=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==l&&(l=mxCellRenderer.defaultShapes.tableLine);var u=t.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var N=function(ab,Ra,Oa){for(var kb=[],cb=0;cb<ab.length;cb++){var $a=ab[cb];kb.push(null==$a?null:new mxPoint((ta+$a.x+Ra)*ka,(ua+$a.y+Oa)*ka))}return kb},R=this,X=this.graph,ia=X.model,ka=X.view.scale,pa=this.state,wa=this.selectionBorder,ta=this.state.origin.x+X.view.translate.x,ua=this.state.origin.y+X.view.translate.y;null==u&&(u=[]);var Ca=X.view.getCellStates(ia.getChildCells(this.state.cell,!0));if(0<Ca.length){var Na=ia.getChildCells(Ca[0].cell,!0),Ya=X.getTableLines(this.state.cell,!1,!0),Za=X.getTableLines(this.state.cell,!0,!1);for(ia=0;ia<Ca.length;ia++)mxUtils.bind(this,function(ab){var Ra=Ca[ab],Oa=null;if(X.isCellMovable(Ra.cell)){Oa=ab<Ca.length-1?Ca[ab+1]:null;Oa=null!=Oa?X.getCellGeometry(Oa.cell):null;var kb=null!=Oa&&null!=Oa.alternateBounds?Oa.alternateBounds:@@ -2643,20 +2643,20 @@ X.getActualStartSize(pa.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=cb)X.setTableRowHeight(this.state.cell,cb,!$a);else if(!R.blockDelayedSelection){var jb=X.getCellAt(fb.getGraphX(),fb.getGraphY())||pa.cell;X.graphHandler.selectCellForEvent(jb,fb)}cb=0};Oa.reset=function(){cb=0}}u.push(Oa)})(ia);for(ia=0;ia<Na.length;ia++)mxUtils.bind(this,function(ab){var Ra=X.view.getState(Na[ab]),Oa=X.getCellGeometry(Na[ab]),kb=null!=Oa.alternateBounds?Oa.alternateBounds:Oa;null==Ra&&(Ra=new mxCellState(X.view,Na[ab],X.getCellStyle(Na[ab])),Ra.x=pa.x+Oa.x*ka,Ra.y=pa.y+Oa.y*ka,Ra.width=kb.width*ka,Ra.height=kb.height*ka,Ra.updateCachedBounds());Oa=ab<Na.length-1?Na[ab+1]:null;Oa=null!=Oa?X.getCellGeometry(Oa):null;var cb=null!=Oa&&null!=Oa.alternateBounds?Oa.alternateBounds:Oa;Oa=null!=Ya[ab]?new l(Ya[ab],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Oa.isDashed=wa.isDashed;Oa.svgStrokeTolerance++;Ra=new mxHandle(Ra,"col-resize",null,Oa);Ra.tableHandle=!0;var $a=0;Ra.shape.node.parentNode.insertBefore(Ra.shape.node,Ra.shape.node.parentNode.firstChild);Ra.redraw=function(){if(null!=this.shape){this.shape.stroke=0==$a?mxConstants.NONE:wa.stroke;if(this.shape.constructor==l)this.shape.line=N(Ya[ab],$a,0),this.shape.updateBoundsFromLine();else{var jb=X.getActualStartSize(pa.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(kb.width+$a)*ka;this.shape.bounds.y=pa.y+(ab==Na.length-1?0:jb.y*ka);this.shape.bounds.height=pa.height-(ab==Na.length-1?0:(jb.height+jb.y)*ka)}this.shape.redraw()}};var fb=!1;Ra.setPosition=function(jb,sb,Ab){$a=-Math.max(Graph.minTableColumnWidth-kb.width,sb.x-jb.x-kb.width);fb=mxEvent.isShiftDown(Ab.getEvent());null==cb||fb||($a=Math.min($a,cb.width-Graph.minTableColumnWidth))};Ra.execute=function(jb){if(0!=$a)X.setTableColumnWidth(this.state.cell,$a,fb);else if(!R.blockDelayedSelection){var sb=X.getCellAt(jb.getGraphX(),jb.getGraphY())||pa.cell;X.graphHandler.selectCellForEvent(sb,jb)}$a=0};Ra.positionChanged=function(){};Ra.reset=function(){$a=0};u.push(Ra)})(ia)}}return null!=u?u.reverse():null};var I=-mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(u){I.apply(this,arguments);if(null!=this.moveHandles)for(var N=0;N<this.moveHandles.length;N++)null!=this.moveHandles[N]&&(this.moveHandles[N].node.style.visibility=u?"":"hidden");if(null!=this.cornerHandles)for(N=0;N<this.cornerHandles.length;N++)this.cornerHandles[N].node.style.visibility=u?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&+Math.max(Graph.minTableColumnWidth-kb.width,sb.x-jb.x-kb.width);fb=mxEvent.isShiftDown(Ab.getEvent());null==cb||fb||($a=Math.min($a,cb.width-Graph.minTableColumnWidth))};Ra.execute=function(jb){if(0!=$a)X.setTableColumnWidth(this.state.cell,$a,fb);else if(!R.blockDelayedSelection){var sb=X.getCellAt(jb.getGraphX(),jb.getGraphY())||pa.cell;X.graphHandler.selectCellForEvent(sb,jb)}$a=0};Ra.positionChanged=function(){};Ra.reset=function(){$a=0};u.push(Ra)})(ia)}}return null!=u?u.reverse():null};var H=+mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(u){H.apply(this,arguments);if(null!=this.moveHandles)for(var N=0;N<this.moveHandles.length;N++)null!=this.moveHandles[N]&&(this.moveHandles[N].node.style.visibility=u?"":"hidden");if(null!=this.cornerHandles)for(N=0;N<this.cornerHandles.length;N++)this.cornerHandles[N].node.style.visibility=u?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var u=this.isMoveHandlesVisible();u&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():u||null==this.moveHandles||this.destroyMoveHandles();if(u&&null==this.moveHandles){for(u=0;u<this.moveHandles.length;u++)null!=this.moveHandles[u]&&this.moveHandles[u].parentNode.removeChild(this.moveHandles[u]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var u=this.graph,N=u.model,R=[],X=0;X<N.getChildCount(this.state.cell);X++)mxUtils.bind(this,function(ia){if(null!=ia&&N.isVertex(ia.cell)&&u.isCellMovable(ia.cell)){var ka=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ka=new mxImageShape(ka,this.rowHandleImage.src);ka.rowState=ia;ka.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ka.init(this.graph.getView().getOverlayPane());ka.node.style.cursor="move";mxEvent.addGestureListeners(ka.node,mxUtils.bind(this,function(pa){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(pa)&&this.graph.isCellSelected(ia.cell)||this.graph.selectCellForEvent(ia.cell,pa);mxEvent.isPopupTrigger(pa)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(pa),mxEvent.getClientY(pa),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(pa),this.graph.isMouseDown=!0);mxEvent.consume(pa)}),null,mxUtils.bind(this,function(pa){mxEvent.isPopupTrigger(pa)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(pa),mxEvent.getClientY(pa),ia.cell,pa),mxEvent.consume(pa))}));R.push(ka)}else R.push(null)})(this.graph.view.getState(N.getChildAt(this.state.cell,X)));return R};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var u=0;u<this.moveHandles.length;u++)null!=this.moveHandles[u]&&this.moveHandles[u].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=-function(){if(null!=this.cornerHandles){for(var u=0;u<this.cornerHandles.length;u++)null!=this.cornerHandles[u]&&null!=this.cornerHandles[u].node&&null!=this.cornerHandles[u].node.parentNode&&this.cornerHandles[u].node.parentNode.removeChild(this.cornerHandles[u].node);this.cornerHandles=null}};var V=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){V.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();+function(){if(null!=this.cornerHandles){for(var u=0;u<this.cornerHandles.length;u++)null!=this.cornerHandles[u]&&null!=this.cornerHandles[u].node&&null!=this.cornerHandles[u].node.parentNode&&this.cornerHandles[u].node.parentNode.removeChild(this.cornerHandles[u].node);this.cornerHandles=null}};var U=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){U.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(1==this.graph.getSelectionCount()&&this.graph.isCellMovable(this.state.cell)&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell))){this.cornerHandles=[];for(var u=0;4>u;u++){var N=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);N.dialect=mxConstants.DIALECT_SVG;N.init(this.graph.view.getOverlayPane());this.cornerHandles.push(N)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();-u=this.graph.getLinkForCell(this.state.cell);N=this.graph.getLinksForState(this.state);this.updateLinkHint(u,N)};var J=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var u=new mxPoint(0,0),N=this.tolerance,R=this.state.style.shape;null==mxCellRenderer.defaultShapes[R]&&mxStencilRegistry.getStencil(R);R=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!R&&null!=this.customHandles)for(var X=0;X<this.customHandles.length;X++)if(null!=+u=this.graph.getLinkForCell(this.state.cell);N=this.graph.getLinksForState(this.state);this.updateLinkHint(u,N)};var K=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var u=new mxPoint(0,0),N=this.tolerance,R=this.state.style.shape;null==mxCellRenderer.defaultShapes[R]&&mxStencilRegistry.getStencil(R);R=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!R&&null!=this.customHandles)for(var X=0;X<this.customHandles.length;X++)if(null!=this.customHandles[X]&&null!=this.customHandles[X].shape&&null!=this.customHandles[X].shape.bounds){var ia=this.customHandles[X].shape.bounds,ka=ia.getCenterX(),pa=ia.getCenterY();if(Math.abs(this.state.x-ka)<ia.width/2||Math.abs(this.state.y-pa)<ia.height/2||Math.abs(this.state.x+this.state.width-ka)<ia.width/2||Math.abs(this.state.y+this.state.height-pa)<ia.height/2){R=!0;break}}R&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(N/=2,this.graph.isTable(this.state.cell)&&(N+=7),u.x=-this.sizers[0].bounds.width+N,u.y=this.sizers[0].bounds.height+N):u=J.apply(this,arguments);return u};mxVertexHandler.prototype.updateHint=function(u){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{u=this.state.view.scale;var N=this.state.view.unit;this.hint.innerHTML=e(this.roundLength(this.bounds.width/u),N)+" x "+e(this.roundLength(this.bounds.height/+this.sizers[0].bounds.width+N,u.y=this.sizers[0].bounds.height+N):u=K.apply(this,arguments);return u};mxVertexHandler.prototype.updateHint=function(u){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{u=this.state.view.scale;var N=this.state.view.unit;this.hint.innerHTML=e(this.roundLength(this.bounds.width/u),N)+" x "+e(this.roundLength(this.bounds.height/u),N)}u=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==u&&(u=this.bounds);this.hint.style.left=u.x+Math.round((u.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=u.y+u.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var W=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){W.apply(this,arguments);var u=this.graph.getLinkForCell(this.state.cell),N=this.graph.getLinksForState(this.state);this.updateLinkHint(u,N)};var Y=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(u,N){Y.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};-var ba=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(u,N){ba.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(u,N,R){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var X=this.graph.view.translate,ia=this.graph.view.scale,ka=this.roundLength(N.x/ia-X.x);X=this.roundLength(N.y/ia-X.y);var pa=+var ca=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(u,N){ca.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(u,N,R){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var X=this.graph.view.translate,ia=this.graph.view.scale,ka=this.roundLength(N.x/ia-X.x);X=this.roundLength(N.y/ia-X.y);var pa=this.graph.view.unit;this.hint.innerHTML=e(ka,pa)+", "+e(X,pa);this.hint.style.visibility="visible";null!=R&&(R.view.updateEdgeBounds(R),this.hint.innerHTML+=" ("+(pa==mxConstants.POINTS?Math.round(R.length/ia):e(R.length/ia,pa))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(R=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*R.x)+"%, "+Math.round(100*R.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(u.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(u.getGraphY(),N.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.prototype.expandedImage=Graph.createSvgImage(9,9,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>');Graph.prototype.collapsedImage=Graph.createSvgImage(9,9,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>');mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=@@ -2699,14 +2699,14 @@ mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=ththis.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,N=null!=this.state.text?this.state.text.boundingBox:null,null==R&&(R=this.state),R=R.y+R.height,null!=N&&(R=Math.max(R,N.y+N.height)),this.linkHint.style.left=u.x+u.width/2+"px",this.linkHint.style.top=Math.round(R+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Wa=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Wa.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();null!=this.linkHint&&(null!=this.linkHint.parentNode&&this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Ia=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Ia.apply(this),null!=this.state&&null!=this.linkHint)){var u=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(u=new mxRectangle(u.x,u.y,u.width,u.height),u.add(this.state.text.bounds));this.linkHint.style.left=u.x+u.width/2+"px";this.linkHint.style.top=Math.round(u.y+u.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var Xa=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=-function(){Xa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Pa=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Pa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(d,n,y){mxShape.call(this);this.line=d;this.stroke=n;this.strokewidth=null!=y?y:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function g(){mxSwimlane.call(this)}function m(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function A(){mxActor.call(this)}function G(){mxCylinder.call(this)}function T(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function Q(){mxShape.call(this)}-function U(){mxShape.call(this)}function c(d,n,y,q){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=y;this.strokewidth=null!=q?q:1}function f(){mxActor.call(this)}function k(){mxCylinder.call(this)}function B(){mxCylinder.call(this)}function z(){mxActor.call(this)}function C(){mxActor.call(this)}function H(){mxActor.call(this)}function K(){mxActor.call(this)}function M(){mxActor.call(this)}function O(){mxActor.call(this)}function ea(){mxActor.call(this)}function fa(d,n){this.canvas=d;this.canvas.setLineJoin("round");+function(){Xa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Pa=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Pa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(d,n,y){mxShape.call(this);this.line=d;this.stroke=n;this.strokewidth=null!=y?y:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function g(){mxSwimlane.call(this)}function m(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function A(){mxActor.call(this)}function G(){mxCylinder.call(this)}function S(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function Q(){mxShape.call(this)}+function T(){mxShape.call(this)}function c(d,n,y,q){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=y;this.strokewidth=null!=q?q:1}function f(){mxActor.call(this)}function k(){mxCylinder.call(this)}function B(){mxCylinder.call(this)}function z(){mxActor.call(this)}function C(){mxActor.call(this)}function I(){mxActor.call(this)}function L(){mxActor.call(this)}function J(){mxActor.call(this)}function O(){mxActor.call(this)}function da(){mxActor.call(this)}function fa(d,n){this.canvas=d;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=n;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,fa.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,fa.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,fa.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,fa.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=-mxUtils.bind(this,fa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,fa.prototype.arcTo)}function S(){mxRectangleShape.call(this)}function ca(){mxRectangleShape.call(this)}function ma(){mxActor.call(this)}function la(){mxActor.call(this)}function Z(){mxActor.call(this)}function da(){mxRectangleShape.call(this)}function aa(){mxRectangleShape.call(this)}function l(){mxCylinder.call(this)}function t(){mxShape.call(this)}function I(){mxShape.call(this)}function V(){mxEllipse.call(this)}-function J(){mxShape.call(this)}function W(){mxShape.call(this)}function Y(){mxRectangleShape.call(this)}function ba(){mxShape.call(this)}function ja(){mxShape.call(this)}function oa(){mxShape.call(this)}function qa(){mxShape.call(this)}function ra(){mxShape.call(this)}function xa(){mxCylinder.call(this)}function Ba(){mxCylinder.call(this)}function ya(){mxRectangleShape.call(this)}function Da(){mxDoubleEllipse.call(this)}function La(){mxDoubleEllipse.call(this)}function sa(){mxArrowConnector.call(this);+mxUtils.bind(this,fa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,fa.prototype.arcTo)}function V(){mxRectangleShape.call(this)}function ba(){mxRectangleShape.call(this)}function ma(){mxActor.call(this)}function la(){mxActor.call(this)}function Z(){mxActor.call(this)}function ea(){mxRectangleShape.call(this)}function aa(){mxRectangleShape.call(this)}function l(){mxCylinder.call(this)}function t(){mxShape.call(this)}function H(){mxShape.call(this)}function U(){mxEllipse.call(this)}+function K(){mxShape.call(this)}function W(){mxShape.call(this)}function Y(){mxRectangleShape.call(this)}function ca(){mxShape.call(this)}function ja(){mxShape.call(this)}function oa(){mxShape.call(this)}function qa(){mxShape.call(this)}function ra(){mxShape.call(this)}function xa(){mxCylinder.call(this)}function Ba(){mxCylinder.call(this)}function ya(){mxRectangleShape.call(this)}function Da(){mxDoubleEllipse.call(this)}function La(){mxDoubleEllipse.call(this)}function sa(){mxArrowConnector.call(this);this.spacing=0}function Aa(){mxArrowConnector.call(this);this.spacing=0}function Ea(){mxActor.call(this)}function Ka(){mxRectangleShape.call(this)}function Ma(){mxActor.call(this)}function za(){mxActor.call(this)}function Wa(){mxActor.call(this)}function Ia(){mxActor.call(this)}function Xa(){mxActor.call(this)}function Pa(){mxActor.call(this)}function u(){mxActor.call(this)}function N(){mxActor.call(this)}function R(){mxActor.call(this)}function X(){mxActor.call(this)}function ia(){mxEllipse.call(this)}function ka(){mxEllipse.call(this)}function pa(){mxEllipse.call(this)}function wa(){mxRhombus.call(this)}function ta(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}function Ca(){mxEllipse.call(this)}function Na(){mxEllipse.call(this)}function Ya(){mxActor.call(this)}function Za(){mxActor.call(this)}function ab(){mxActor.call(this)}function Ra(d,n,y,q){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=y;this.strokewidth=null!=q?q:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=-!0;this.indent=2;this.rectOutline="single"}function Oa(){mxConnector.call(this)}function kb(d,n,y,q,x,D,E,ha,L,va){E+=L;var na=q.clone();q.x-=x*(2*E+L);q.y-=D*(2*E+L);x*=E+L;D*=E+L;return function(){d.ellipse(na.x-x-E,na.y-D-E,2*E,2*E);va?d.fillAndStroke():d.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var d=null;if(null!=this.line)for(var n=0;n<this.line.length;n++){var y=this.line[n];null!=y&&(y=new mxRectangle(y.x,y.y,this.strokewidth,this.strokewidth),null==+!0;this.indent=2;this.rectOutline="single"}function Oa(){mxConnector.call(this)}function kb(d,n,y,q,x,D,E,ha,M,va){E+=M;var na=q.clone();q.x-=x*(2*E+M);q.y-=D*(2*E+M);x*=E+M;D*=E+M;return function(){d.ellipse(na.x-x-E,na.y-D-E,2*E,2*E);va?d.fillAndStroke():d.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var d=null;if(null!=this.line)for(var n=0;n<this.line.length;n++){var y=this.line[n];null!=y&&(y=new mxRectangle(y.x,y.y,this.strokewidth,this.strokewidth),null==d?d=y:d.add(y))}this.bounds=null!=d?d:new mxRectangle};b.prototype.paintVertexShape=function(d,n,y,q,x){this.paintTableLine(d,this.line,0,0)};b.prototype.paintTableLine=function(d,n,y,q){if(null!=n){var x=null;d.begin();for(var D=0;D<n.length;D++){var E=n[D];null!=E&&(null==x?d.moveTo(E.x+y,E.y+q):null!=x&&d.lineTo(E.x+y,E.y+q));x=E}d.end();d.stroke()}};b.prototype.intersectsRectangle=function(d){var n=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var y=null,q=0;q<this.line.length&&!n;q++){var x=this.line[q];null!=x&&null!=y&&(n=mxUtils.rectangleIntersectsSegment(d,y,x));y=x}return n};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(e,mxSwimlane);e.prototype.getLabelBounds=function(d){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};e.prototype.paintVertexShape=function(d,n,y,q,x){var D=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,E=this.isHorizontal(),ha=this.getTitleSize();0==ha||this.outline?Ca.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),d.translate(-n,-y));D||this.outline||!(E&&ha<x||!E&&ha<q)||this.paintForeground(d,n,y,q,x)};e.prototype.paintForeground=function(d,n,y,q,x){if(null!=this.state){var D=this.flipH,E=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ha=D;D=E;E=ha}d.rotate(-this.getShapeRotation(),@@ -2717,80 +2717,80 @@ d.lineTo(D,D),d.close(),d.fill()),0!=ha&&(d.setFillAlpha(Math.abs(ha)),d.setFillm);var cb=Math.tan(mxUtils.toRadians(30)),$a=(.5-cb)/2;mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(v,mxConnector);v.prototype.paintEdgeShape=function(d,n){var y=this.createMarker(d,n,!0),q=this.createMarker(d,n,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);d.setShadow(!1);d.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);d.setStrokeColor(this.stroke);d.setFillColor(this.stroke);d.setDashed(!1);null!=y&&y();null!=q&&q()};mxCellRenderer.registerShape("wire",v);mxUtils.extend(p,mxCylinder);p.prototype.size=6;p.prototype.paintVertexShape=function(d,n,y,q,x){d.setFillColor(this.stroke);var D=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;d.ellipse(n+.5*(q-D),y+.5*(x-D),D,D);d.fill();d.setFillColor(mxConstants.NONE);d.rect(n,y,q,x);d.fill()};mxCellRenderer.registerShape("waypoint",p);mxUtils.extend(A,mxActor);A.prototype.size=20;A.prototype.redrawPath=function(d,n,y,q,x){n=Math.min(q,x/cb);d.translate((q-n)/2,(x-n)/2+n/4);d.moveTo(0,.25*n);d.lineTo(.5*n,n*$a);d.lineTo(n,.25*n);d.lineTo(.5*n,(.5-$a)*n);d.lineTo(0,.25*n);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(G,mxCylinder);G.prototype.size=20;G.prototype.redrawPath=function(d,n,y,q,x,D){n=Math.min(q,x/(.5+cb));D?(d.moveTo(0,.25*n),d.lineTo(.5*n,(.5-$a)*n),d.lineTo(n,.25*n),d.moveTo(.5*-n,(.5-$a)*n),d.lineTo(.5*n,(1-$a)*n)):(d.translate((q-n)/2,(x-n)/2),d.moveTo(0,.25*n),d.lineTo(.5*n,n*$a),d.lineTo(n,.25*n),d.lineTo(n,.75*n),d.lineTo(.5*n,(1-$a)*n),d.lineTo(0,.75*n),d.close());d.end()};mxCellRenderer.registerShape("isoCube",G);mxUtils.extend(T,mxCylinder);T.prototype.redrawPath=function(d,n,y,q,x,D){n=Math.min(x/2,Math.round(x/8)+this.strokewidth-1);if(D&&null!=this.fill||!D&&null==this.fill)d.moveTo(0,n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,-n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,-n);D||(d.moveTo(0,n),d.curveTo(0,-n/3,q,-n/3,q,n),d.lineTo(q,x-n),d.curveTo(q,x+n/3,0,x+n/3,0,x-n),d.close())};T.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",T);mxUtils.extend(F,mxCylinder);F.prototype.size=30;F.prototype.darkOpacity=+n,(.5-$a)*n),d.lineTo(.5*n,(1-$a)*n)):(d.translate((q-n)/2,(x-n)/2),d.moveTo(0,.25*n),d.lineTo(.5*n,n*$a),d.lineTo(n,.25*n),d.lineTo(n,.75*n),d.lineTo(.5*n,(1-$a)*n),d.lineTo(0,.75*n),d.close());d.end()};mxCellRenderer.registerShape("isoCube",G);mxUtils.extend(S,mxCylinder);S.prototype.redrawPath=function(d,n,y,q,x,D){n=Math.min(x/2,Math.round(x/8)+this.strokewidth-1);if(D&&null!=this.fill||!D&&null==this.fill)d.moveTo(0,n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,+n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,n),d.curveTo(0,2*n,q,2*n,q,n),D||(d.stroke(),d.begin()),d.translate(0,-n);D||(d.moveTo(0,n),d.curveTo(0,-n/3,q,-n/3,q,n),d.lineTo(q,x-n),d.curveTo(q,x+n/3,0,x+n/3,0,x-n),d.close())};S.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",S);mxUtils.extend(F,mxCylinder);F.prototype.size=30;F.prototype.darkOpacity=0;F.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(q,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));d.translate(n,y);d.begin();d.moveTo(0,0);d.lineTo(q-D,0);d.lineTo(q,D);d.lineTo(q,x);d.lineTo(0,x);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),d.begin(),d.moveTo(q-D,0),d.lineTo(q-D,D),d.lineTo(q,D),d.close(),d.fill()),d.begin(),d.moveTo(q-D,0),d.lineTo(q-D,D),d.lineTo(q,D),d.end(),d.stroke())};mxCellRenderer.registerShape("note",F);mxUtils.extend(P,F);mxCellRenderer.registerShape("note2",P);P.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,0)}return null};mxUtils.extend(Q,mxShape);Q.prototype.isoAngle=15;Q.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;D=Math.min(q*Math.tan(D),.5*x);d.translate(n,y);d.begin();d.moveTo(.5*q,0);d.lineTo(q,D);d.lineTo(q,x-D);d.lineTo(.5*q,x);d.lineTo(0,x-D);d.lineTo(0,D);d.close();d.fillAndStroke();d.setShadow(!1);d.begin();d.moveTo(0,D);d.lineTo(.5*q,2*D);d.lineTo(q,D);d.moveTo(.5*q,2*D);d.lineTo(.5*q,x);d.stroke()};mxCellRenderer.registerShape("isoCube2",-Q);mxUtils.extend(U,mxShape);U.prototype.size=15;U.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(n,y);0==D?(d.rect(0,0,q,x),d.fillAndStroke()):(d.begin(),d.moveTo(0,D),d.arcTo(.5*q,D,0,0,1,.5*q,0),d.arcTo(.5*q,D,0,0,1,q,D),d.lineTo(q,x-D),d.arcTo(.5*q,D,0,0,1,.5*q,x),d.arcTo(.5*q,D,0,0,1,0,x-D),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(q,D),d.arcTo(.5*q,D,0,0,1,.5*q,2*D),d.arcTo(.5*-q,D,0,0,1,0,D),d.stroke())};mxCellRenderer.registerShape("cylinder2",U);mxUtils.extend(c,mxCylinder);c.prototype.size=15;c.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"lid",!0);d.translate(n,y);0==D?(d.rect(0,0,q,x),d.fillAndStroke()):(d.begin(),E?(d.moveTo(0,D),d.arcTo(.5*q,D,0,0,1,.5*q,0),d.arcTo(.5*q,D,0,0,1,q,D)):(d.moveTo(0,0),d.arcTo(.5*q,D,0,0,0,.5*q,D),d.arcTo(.5*q,D,+Q);mxUtils.extend(T,mxShape);T.prototype.size=15;T.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(n,y);0==D?(d.rect(0,0,q,x),d.fillAndStroke()):(d.begin(),d.moveTo(0,D),d.arcTo(.5*q,D,0,0,1,.5*q,0),d.arcTo(.5*q,D,0,0,1,q,D),d.lineTo(q,x-D),d.arcTo(.5*q,D,0,0,1,.5*q,x),d.arcTo(.5*q,D,0,0,1,0,x-D),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(q,D),d.arcTo(.5*q,D,0,0,1,.5*q,2*D),d.arcTo(.5*+q,D,0,0,1,0,D),d.stroke())};mxCellRenderer.registerShape("cylinder2",T);mxUtils.extend(c,mxCylinder);c.prototype.size=15;c.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"lid",!0);d.translate(n,y);0==D?(d.rect(0,0,q,x),d.fillAndStroke()):(d.begin(),E?(d.moveTo(0,D),d.arcTo(.5*q,D,0,0,1,.5*q,0),d.arcTo(.5*q,D,0,0,1,q,D)):(d.moveTo(0,0),d.arcTo(.5*q,D,0,0,0,.5*q,D),d.arcTo(.5*q,D,0,0,0,q,0)),d.lineTo(q,x-D),d.arcTo(.5*q,D,0,0,1,.5*q,x),d.arcTo(.5*q,D,0,0,1,0,x-D),d.close(),d.fillAndStroke(),d.setShadow(!1),E&&(d.begin(),d.moveTo(q,D),d.arcTo(.5*q,D,0,0,1,.5*q,2*D),d.arcTo(.5*q,D,0,0,1,0,D),d.stroke()))};mxCellRenderer.registerShape("cylinder3",c);mxUtils.extend(f,mxActor);f.prototype.redrawPath=function(d,n,y,q,x){d.moveTo(0,0);d.quadTo(q/2,.5*x,q,0);d.quadTo(.5*q,x/2,q,x);d.quadTo(q/2,.5*x,0,x);d.quadTo(.5*q,x/2,0,0);d.end()};mxCellRenderer.registerShape("switch",f);mxUtils.extend(k,mxCylinder);k.prototype.tabWidth=60;k.prototype.tabHeight=20;k.prototype.tabPosition="right";k.prototype.arcSize=.1;k.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);n=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));y=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var D=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),E=mxUtils.getValue(this.style,"rounded",!1),ha=mxUtils.getValue(this.style,-"absoluteArcSize",!1),L=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ha||(L*=Math.min(q,x));L=Math.min(L,.5*q,.5*(x-y));n=Math.max(n,L);n=Math.min(q-L,n);E||(L=0);d.begin();"left"==D?(d.moveTo(Math.max(L,0),y),d.lineTo(Math.max(L,0),0),d.lineTo(n,0),d.lineTo(n,y)):(d.moveTo(q-n,y),d.lineTo(q-n,0),d.lineTo(q-Math.max(L,0),0),d.lineTo(q-Math.max(L,0),y));E?(d.moveTo(0,L+y),d.arcTo(L,L,0,0,1,L,y),d.lineTo(q-L,y),d.arcTo(L,L,0,0,1,q,L+y),d.lineTo(q,x-L),d.arcTo(L,L,0,0,1,q-L,x),d.lineTo(L,-x),d.arcTo(L,L,0,0,1,0,x-L)):(d.moveTo(0,y),d.lineTo(q,y),d.lineTo(q,x),d.lineTo(0,x));d.close();d.fillAndStroke();d.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(d.begin(),d.moveTo(q-30,y+20),d.lineTo(q-20,y+10),d.lineTo(q-10,y+20),d.close(),d.stroke())};mxCellRenderer.registerShape("folder",k);k.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,+"absoluteArcSize",!1),M=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ha||(M*=Math.min(q,x));M=Math.min(M,.5*q,.5*(x-y));n=Math.max(n,M);n=Math.min(q-M,n);E||(M=0);d.begin();"left"==D?(d.moveTo(Math.max(M,0),y),d.lineTo(Math.max(M,0),0),d.lineTo(n,0),d.lineTo(n,y)):(d.moveTo(q-n,y),d.lineTo(q-n,0),d.lineTo(q-Math.max(M,0),0),d.lineTo(q-Math.max(M,0),y));E?(d.moveTo(0,M+y),d.arcTo(M,M,0,0,1,M,y),d.lineTo(q-M,y),d.arcTo(M,M,0,0,1,q,M+y),d.lineTo(q,x-M),d.arcTo(M,M,0,0,1,q-M,x),d.lineTo(M,+x),d.arcTo(M,M,0,0,1,0,x-M)):(d.moveTo(0,y),d.lineTo(q,y),d.lineTo(q,x),d.lineTo(0,x));d.close();d.fillAndStroke();d.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(d.begin(),d.moveTo(q-30,y+20),d.lineTo(q-20,y+10),d.lineTo(q-10,y+20),d.close(),d.stroke())};mxCellRenderer.registerShape("folder",k);k.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var y=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var q=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),D=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));x||(D*=Math.min(d.width,d.height));D=Math.min(D,.5*d.width,.5*(d.height-n));q||(D=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(D,0,Math.min(d.width,d.width-y),Math.min(d.height,d.height-n)):new mxRectangle(Math.min(d.width,d.width-y),0,D,Math.min(d.height,d.height-n))}return new mxRectangle(0,Math.min(d.height,n),0,0)}return null};mxUtils.extend(B,mxCylinder);B.prototype.arcSize=.1;B.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);var D=mxUtils.getValue(this.style,"rounded",!1),E=mxUtils.getValue(this.style,"absoluteArcSize",!1);n=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));y=mxUtils.getValue(this.style,"umlStateConnection",null);E||(n*=Math.min(q,x));n=Math.min(n,.5*q,.5*x);D||(n=0);D=0;null!=y&&(D=10);d.begin();d.moveTo(D,n);d.arcTo(n,n,0,0,1,D+n,0);d.lineTo(q-n,0);d.arcTo(n,n,0,0,1,q,n);d.lineTo(q,x-n);d.arcTo(n,n,0,0,1,q-n,x);d.lineTo(D+n,x);d.arcTo(n,n,0,0,1,D,x-n);d.close();d.fillAndStroke();d.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(d.roundrect(q-40,x-20,10,10,3,3),d.stroke(),d.roundrect(q-20,x-20,10,10,3,3),d.stroke(),d.begin(),d.moveTo(q-30,x-15),d.lineTo(q-20,x-15),d.stroke());"connPointRefEntry"==y?(d.ellipse(0,.5*x-10,20,20),d.fillAndStroke()):"connPointRefExit"==y&&(d.ellipse(0,.5*x-10,20,20),d.fillAndStroke(),d.begin(),d.moveTo(5,.5*x-5),d.lineTo(15,.5*x+5),d.moveTo(15,.5*x-5),d.lineTo(5,.5*x+5),d.stroke())};B.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};mxCellRenderer.registerShape("umlState",B);mxUtils.extend(z,mxActor);z.prototype.size=30;z.prototype.isRoundable=function(){return!0};z.prototype.redrawPath=function(d,n,y,q,x){n=Math.max(0,Math.min(q,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,0),new mxPoint(q,0),new mxPoint(q,x),new mxPoint(0,x),new mxPoint(0,n)],this.isRounded,y,!0);d.end()};mxCellRenderer.registerShape("card",z);mxUtils.extend(C,mxActor);C.prototype.size=.4;C.prototype.redrawPath=function(d,n,y,q,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,n/2);d.quadTo(q/4,1.4*n,q/2,n/2);d.quadTo(3*q/4,n*(1-1.4),q,n/2);d.lineTo(q,x-n/2);d.quadTo(3*q/4,x-1.4*n,q/2,x-n/2);d.quadTo(q/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};C.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",this.size),y=d.width,q=d.height;if(null==this.direction||-this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return n*=q,new mxRectangle(d.x,d.y+n,y,q-2*n);n*=y;return new mxRectangle(d.x+n,d.y,y-2*n,q)}return d};mxCellRenderer.registerShape("tape",C);mxUtils.extend(H,mxActor);H.prototype.size=.3;H.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*d.height):null};H.prototype.redrawPath=function(d,n,y,-q,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,0);d.lineTo(q,0);d.lineTo(q,x-n/2);d.quadTo(3*q/4,x-1.4*n,q/2,x-n/2);d.quadTo(q/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};mxCellRenderer.registerShape("document",H);var fb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(d,n,y,q){var x=mxUtils.getValue(this.style,"size");return null!=x?q*Math.max(0,Math.min(1,x)):fb.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=+this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return n*=q,new mxRectangle(d.x,d.y+n,y,q-2*n);n*=y;return new mxRectangle(d.x+n,d.y,y-2*n,q)}return d};mxCellRenderer.registerShape("tape",C);mxUtils.extend(I,mxActor);I.prototype.size=.3;I.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*d.height):null};I.prototype.redrawPath=function(d,n,y,+q,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,0);d.lineTo(q,0);d.lineTo(q,x-n/2);d.quadTo(3*q/4,x-1.4*n,q/2,x-n/2);d.quadTo(q/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};mxCellRenderer.registerShape("document",I);var fb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(d,n,y,q){var x=mxUtils.getValue(this.style,"size");return null!=x?q*Math.max(0,Math.min(1,x)):fb.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,d.height*n),0,0)}return null};c.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(n/=2);return new mxRectangle(0,Math.min(d.height*this.scale,2*n*this.scale),0,Math.max(0,.3*n*this.scale))}return null};k.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var y=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var q=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),D=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));x||(D*=Math.min(d.width,d.height));D=Math.min(D,.5*d.width,.5*(d.height-n));q||(D=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(D,0,Math.min(d.width,d.width-y),Math.min(d.height,d.height-n)):new mxRectangle(Math.min(d.width,d.width-y),0,D,Math.min(d.height,d.height-n))}return new mxRectangle(0,Math.min(d.height,n),0,0)}return null};B.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*-this.scale,0,0,0):null};P.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,Math.max(0,n*this.scale))}return null};mxUtils.extend(K,mxActor);K.prototype.size=.2;K.prototype.fixedSize=20;K.prototype.isRoundable=function(){return!0};K.prototype.redrawPath=function(d,n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,-"size",this.fixedSize)))):q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(q,0),new mxPoint(q-n,x)],this.isRounded,y,!0);d.end()};mxCellRenderer.registerShape("parallelogram",K);mxUtils.extend(M,mxActor);M.prototype.size=.2;M.prototype.fixedSize=20;M.prototype.isRoundable=function(){return!0};M.prototype.redrawPath=function(d,-n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*q,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):q*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(q-n,0),new mxPoint(q,x)],this.isRounded,y,!0)};mxCellRenderer.registerShape("trapezoid",M);mxUtils.extend(O,mxActor);-O.prototype.size=.5;O.prototype.redrawPath=function(d,n,y,q,x){d.setFillColor(null);n=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(q,0),new mxPoint(n,0),new mxPoint(n,x/2),new mxPoint(0,x/2),new mxPoint(n,x/2),new mxPoint(n,x),new mxPoint(q,x)],this.isRounded,y,!1);d.end()};mxCellRenderer.registerShape("curlyBracket",O);mxUtils.extend(ea,mxActor);-ea.prototype.redrawPath=function(d,n,y,q,x){d.setStrokeWidth(1);d.setFillColor(this.stroke);n=q/5;d.rect(0,0,n,x);d.fillAndStroke();d.rect(2*n,0,n,x);d.fillAndStroke();d.rect(4*n,0,n,x);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ea);fa.prototype.moveTo=function(d,n){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;this.firstX=d;this.firstY=n};fa.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,+this.scale,0,0,0):null};P.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,Math.max(0,n*this.scale))}return null};mxUtils.extend(L,mxActor);L.prototype.size=.2;L.prototype.fixedSize=20;L.prototype.isRoundable=function(){return!0};L.prototype.redrawPath=function(d,n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,+"size",this.fixedSize)))):q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(q,0),new mxPoint(q-n,x)],this.isRounded,y,!0);d.end()};mxCellRenderer.registerShape("parallelogram",L);mxUtils.extend(J,mxActor);J.prototype.size=.2;J.prototype.fixedSize=20;J.prototype.isRoundable=function(){return!0};J.prototype.redrawPath=function(d,+n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*q,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):q*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(q-n,0),new mxPoint(q,x)],this.isRounded,y,!0)};mxCellRenderer.registerShape("trapezoid",J);mxUtils.extend(O,mxActor);+O.prototype.size=.5;O.prototype.redrawPath=function(d,n,y,q,x){d.setFillColor(null);n=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(q,0),new mxPoint(n,0),new mxPoint(n,x/2),new mxPoint(0,x/2),new mxPoint(n,x/2),new mxPoint(n,x),new mxPoint(q,x)],this.isRounded,y,!1);d.end()};mxCellRenderer.registerShape("curlyBracket",O);mxUtils.extend(da,mxActor);+da.prototype.redrawPath=function(d,n,y,q,x){d.setStrokeWidth(1);d.setFillColor(this.stroke);n=q/5;d.rect(0,0,n,x);d.fillAndStroke();d.rect(2*n,0,n,x);d.fillAndStroke();d.rect(4*n,0,n,x);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",da);fa.prototype.moveTo=function(d,n){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;this.firstX=d;this.firstY=n};fa.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};fa.prototype.quadTo=function(d,n,y,q){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=y;this.lastY=q};fa.prototype.curveTo=function(d,n,y,q,x,D){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=x;this.lastY=D};fa.prototype.arcTo=function(d,n,y,q,x,D,E){this.originalArcTo.apply(this.canvas,arguments);this.lastX=D;this.lastY=E};fa.prototype.lineTo=function(d,n){if(null!=this.lastX&&null!=this.lastY){var y=function(na){return"number"===-typeof na?na?0>na?-1:1:na===na?0:NaN:NaN},q=Math.abs(d-this.lastX),x=Math.abs(n-this.lastY),D=Math.sqrt(q*q+x*x);if(2>D){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;return}var E=Math.round(D/10),ha=this.defaultVariation;5>E&&(E=5,ha/=3);var L=y(d-this.lastX)*q/E;y=y(n-this.lastY)*x/E;q/=D;x/=D;for(D=0;D<E;D++){var va=(Math.random()-.5)*ha;this.originalLineTo.call(this.canvas,L*D+this.lastX-va*x,y*D+this.lastY-va*q)}this.originalLineTo.call(this.canvas,d,n)}else this.originalLineTo.apply(this.canvas,+typeof na?na?0>na?-1:1:na===na?0:NaN:NaN},q=Math.abs(d-this.lastX),x=Math.abs(n-this.lastY),D=Math.sqrt(q*q+x*x);if(2>D){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;return}var E=Math.round(D/10),ha=this.defaultVariation;5>E&&(E=5,ha/=3);var M=y(d-this.lastX)*q/E;y=y(n-this.lastY)*x/E;q/=D;x/=D;for(D=0;D<E;D++){var va=(Math.random()-.5)*ha;this.originalLineTo.call(this.canvas,M*D+this.lastX-va*x,y*D+this.lastY-va*q)}this.originalLineTo.call(this.canvas,d,n)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n};fa.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var jb=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(d){jb.apply(this,arguments);null==d.handJiggle&&(d.handJiggle=this.createHandJiggle(d))};var sb=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(d){sb.apply(this,arguments);null!=d.handJiggle&&(d.handJiggle.destroy(),delete d.handJiggle)};mxShape.prototype.createComicCanvas=function(d){return new fa(d,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(d){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(d)};var Ab=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&Ab.apply(this,arguments)};var nb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(d,n,y,q,x){if(null==d.handJiggle||d.handJiggle.constructor!=fa)nb.apply(this,arguments);else{var D=!0;null!=this.style&&(D="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(D||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)D||null!=this.fill&&this.fill!=mxConstants.NONE||(d.pointerEvents=!1),d.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?D=Math.min(q/2,Math.min(x/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,D=Math.min(q*D,x*D)),d.moveTo(n+-D,y),d.lineTo(n+q-D,y),d.quadTo(n+q,y,n+q,y+D),d.lineTo(n+q,y+x-D),d.quadTo(n+q,y+x,n+q-D,y+x),d.lineTo(n+D,y+x),d.quadTo(n,y+x,n,y+x-D),d.lineTo(n,y+D),d.quadTo(n,y,n+D,y)):(d.moveTo(n,y),d.lineTo(n+q,y),d.lineTo(n+q,y+x),d.lineTo(n,y+x),d.lineTo(n,y)),d.close(),d.end(),d.fillAndStroke()}};mxUtils.extend(S,mxRectangleShape);S.prototype.size=.1;S.prototype.fixedSize=!1;S.prototype.isHtmlAllowed=function(){return!1};S.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,-!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var n=d.width,y=d.height;d=new mxRectangle(d.x,d.y,n,y);var q=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var x=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;q=Math.max(q,Math.min(n*x,y*x))}d.x+=Math.round(q);d.width-=Math.round(2*q);return d}return d};S.prototype.paintForeground=+D,y),d.lineTo(n+q-D,y),d.quadTo(n+q,y,n+q,y+D),d.lineTo(n+q,y+x-D),d.quadTo(n+q,y+x,n+q-D,y+x),d.lineTo(n+D,y+x),d.quadTo(n,y+x,n,y+x-D),d.lineTo(n,y+D),d.quadTo(n,y,n+D,y)):(d.moveTo(n,y),d.lineTo(n+q,y),d.lineTo(n+q,y+x),d.lineTo(n,y+x),d.lineTo(n,y)),d.close(),d.end(),d.fillAndStroke()}};mxUtils.extend(V,mxRectangleShape);V.prototype.size=.1;V.prototype.fixedSize=!1;V.prototype.isHtmlAllowed=function(){return!1};V.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,+!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var n=d.width,y=d.height;d=new mxRectangle(d.x,d.y,n,y);var q=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var x=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;q=Math.max(q,Math.min(n*x,y*x))}d.x+=Math.round(q);d.width-=Math.round(2*q);return d}return d};V.prototype.paintForeground=function(d,n,y,q,x){var D=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),E=parseFloat(mxUtils.getValue(this.style,"size",this.size));E=D?Math.max(0,Math.min(q,E)):q*Math.max(0,Math.min(1,E));this.isRounded&&(D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,E=Math.max(E,Math.min(q*D,x*D)));E=Math.round(E);d.begin();d.moveTo(n+E,y);d.lineTo(n+E,y+x);d.moveTo(n+q-E,y);d.lineTo(n+q-E,y+x);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,-arguments)};mxCellRenderer.registerShape("process",S);mxCellRenderer.registerShape("process2",S);mxUtils.extend(ca,mxRectangleShape);ca.prototype.paintBackground=function(d,n,y,q,x){d.setFillColor(mxConstants.NONE);d.rect(n,y,q,x);d.fill()};ca.prototype.paintForeground=function(d,n,y,q,x){};mxCellRenderer.registerShape("transparent",ca);mxUtils.extend(ma,mxHexagon);ma.prototype.size=30;ma.prototype.position=.5;ma.prototype.position2=.5;ma.prototype.base=20;ma.prototype.getLabelMargins=function(){return new mxRectangle(0,+arguments)};mxCellRenderer.registerShape("process",V);mxCellRenderer.registerShape("process2",V);mxUtils.extend(ba,mxRectangleShape);ba.prototype.paintBackground=function(d,n,y,q,x){d.setFillColor(mxConstants.NONE);d.rect(n,y,q,x);d.fill()};ba.prototype.paintForeground=function(d,n,y,q,x){};mxCellRenderer.registerShape("transparent",ba);mxUtils.extend(ma,mxHexagon);ma.prototype.size=30;ma.prototype.position=.5;ma.prototype.position2=.5;ma.prototype.base=20;ma.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};ma.prototype.isRoundable=function(){return!0};ma.prototype.redrawPath=function(d,n,y,q,x){n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;y=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var D=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),E=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),ha=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(d,[new mxPoint(0,0),new mxPoint(q,0),new mxPoint(q,x-y),new mxPoint(Math.min(q,D+ha),x-y),new mxPoint(E,x),new mxPoint(Math.max(0,D),x-y),new mxPoint(0,x-y)],this.isRounded,n,!0,[4])};mxCellRenderer.registerShape("callout",ma);mxUtils.extend(la,mxActor);la.prototype.size=.2;la.prototype.fixedSize=20;la.prototype.isRoundable=function(){return!0};la.prototype.redrawPath=function(d,n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(q-n,0),new mxPoint(q,x/2),new mxPoint(q-n,x),new mxPoint(0,x),new mxPoint(n,x/2)],this.isRounded,y,!0);d.end()};mxCellRenderer.registerShape("step",la);mxUtils.extend(Z,mxHexagon);Z.prototype.size=.25;Z.prototype.fixedSize=20;Z.prototype.isRoundable=function(){return!0};Z.prototype.redrawPath=function(d,n,y,q,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*q,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,-0),new mxPoint(q-n,0),new mxPoint(q,.5*x),new mxPoint(q-n,x),new mxPoint(n,x),new mxPoint(0,.5*x)],this.isRounded,y,!0)};mxCellRenderer.registerShape("hexagon",Z);mxUtils.extend(da,mxRectangleShape);da.prototype.isHtmlAllowed=function(){return!1};da.prototype.paintForeground=function(d,n,y,q,x){var D=Math.min(q/5,x/5)+1;d.begin();d.moveTo(n+q/2,y+D);d.lineTo(n+q/2,y+x-D);d.moveTo(n+D,y+x/2);d.lineTo(n+q-D,y+x/2);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};-mxCellRenderer.registerShape("plus",da);var lb=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};mxRhombus.prototype.paintVertexShape=function(d,n,y,q,x){lb.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var D=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||+0),new mxPoint(q-n,0),new mxPoint(q,.5*x),new mxPoint(q-n,x),new mxPoint(n,x),new mxPoint(0,.5*x)],this.isRounded,y,!0)};mxCellRenderer.registerShape("hexagon",Z);mxUtils.extend(ea,mxRectangleShape);ea.prototype.isHtmlAllowed=function(){return!1};ea.prototype.paintForeground=function(d,n,y,q,x){var D=Math.min(q/5,x/5)+1;d.begin();d.moveTo(n+q/2,y+D);d.lineTo(n+q/2,y+x-D);d.moveTo(n+D,y+x/2);d.lineTo(n+q-D,y+x/2);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};+mxCellRenderer.registerShape("plus",ea);var lb=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};mxRhombus.prototype.paintVertexShape=function(d,n,y,q,x){lb.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var D=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=D;y+=D;q-=2*D;x-=2*D;0<q&&0<x&&(d.setShadow(!1),lb.apply(this,[d,n,y,q,x]))}};mxUtils.extend(aa,mxRectangleShape);aa.prototype.isHtmlAllowed=function(){return!1};aa.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};aa.prototype.paintForeground=function(d,n,y,q,x){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var D=-Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=D;y+=D;q-=2*D;x-=2*D;0<q&&0<x&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}d.setDashed(!1);D=0;do{var E=mxCellRenderer.defaultShapes[this.style["symbol"+D]];if(null!=E){var ha=this.style["symbol"+D+"Align"],L=this.style["symbol"+D+"VerticalAlign"],va=this.style["symbol"+D+"Width"],na=this.style["symbol"+D+"Height"],Va=this.style["symbol"+D+"Spacing"]||0,gb=this.style["symbol"+D+"VSpacing"]||-Va,bb=this.style["symbol"+D+"ArcSpacing"];null!=bb&&(bb*=this.getArcSize(q+this.strokewidth,x+this.strokewidth),Va+=bb,gb+=bb);bb=n;var Fa=y;bb=ha==mxConstants.ALIGN_CENTER?bb+(q-va)/2:ha==mxConstants.ALIGN_RIGHT?bb+(q-va-Va):bb+Va;Fa=L==mxConstants.ALIGN_MIDDLE?Fa+(x-na)/2:L==mxConstants.ALIGN_BOTTOM?Fa+(x-na-gb):Fa+gb;d.save();ha=new E;ha.style=this.style;E.prototype.paintVertexShape.call(ha,d,bb,Fa,va,na);d.restore()}D++}while(null!=E)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};+Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=D;y+=D;q-=2*D;x-=2*D;0<q&&0<x&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}d.setDashed(!1);D=0;do{var E=mxCellRenderer.defaultShapes[this.style["symbol"+D]];if(null!=E){var ha=this.style["symbol"+D+"Align"],M=this.style["symbol"+D+"VerticalAlign"],va=this.style["symbol"+D+"Width"],na=this.style["symbol"+D+"Height"],Va=this.style["symbol"+D+"Spacing"]||0,gb=this.style["symbol"+D+"VSpacing"]||+Va,bb=this.style["symbol"+D+"ArcSpacing"];null!=bb&&(bb*=this.getArcSize(q+this.strokewidth,x+this.strokewidth),Va+=bb,gb+=bb);bb=n;var Fa=y;bb=ha==mxConstants.ALIGN_CENTER?bb+(q-va)/2:ha==mxConstants.ALIGN_RIGHT?bb+(q-va-Va):bb+Va;Fa=M==mxConstants.ALIGN_MIDDLE?Fa+(x-na)/2:M==mxConstants.ALIGN_BOTTOM?Fa+(x-na-gb):Fa+gb;d.save();ha=new E;ha.style=this.style;E.prototype.paintVertexShape.call(ha,d,bb,Fa,va,na);d.restore()}D++}while(null!=E)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",aa);mxUtils.extend(l,mxCylinder);l.prototype.redrawPath=function(d,n,y,q,x,D){D?(d.moveTo(0,0),d.lineTo(q/2,x/2),d.lineTo(q,0),d.end()):(d.moveTo(0,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(0,x),d.close())};mxCellRenderer.registerShape("message",l);mxUtils.extend(t,mxShape);t.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.ellipse(q/4,0,q/2,x/4);d.fillAndStroke();d.begin();d.moveTo(q/2,x/4);d.lineTo(q/2,2*x/3);d.moveTo(q/2,x/3);d.lineTo(0,x/3);d.moveTo(q/-2,x/3);d.lineTo(q,x/3);d.moveTo(q/2,2*x/3);d.lineTo(0,x);d.moveTo(q/2,2*x/3);d.lineTo(q,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlActor",t);mxUtils.extend(I,mxShape);I.prototype.getLabelMargins=function(d){return new mxRectangle(d.width/6,0,0,0)};I.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(0,x/4);d.lineTo(0,3*x/4);d.end();d.stroke();d.begin();d.moveTo(0,x/2);d.lineTo(q/6,x/2);d.end();d.stroke();d.ellipse(q/6,0,5*q/6,x);d.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",-I);mxUtils.extend(V,mxEllipse);V.prototype.paintVertexShape=function(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(n+q/8,y+x);d.lineTo(n+7*q/8,y+x);d.end();d.stroke()};mxCellRenderer.registerShape("umlEntity",V);mxUtils.extend(J,mxShape);J.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(q,0);d.lineTo(0,x);d.moveTo(0,0);d.lineTo(q,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlDestroy",J);mxUtils.extend(W,mxShape);+2,x/3);d.lineTo(q,x/3);d.moveTo(q/2,2*x/3);d.lineTo(0,x);d.moveTo(q/2,2*x/3);d.lineTo(q,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlActor",t);mxUtils.extend(H,mxShape);H.prototype.getLabelMargins=function(d){return new mxRectangle(d.width/6,0,0,0)};H.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(0,x/4);d.lineTo(0,3*x/4);d.end();d.stroke();d.begin();d.moveTo(0,x/2);d.lineTo(q/6,x/2);d.end();d.stroke();d.ellipse(q/6,0,5*q/6,x);d.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",+H);mxUtils.extend(U,mxEllipse);U.prototype.paintVertexShape=function(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(n+q/8,y+x);d.lineTo(n+7*q/8,y+x);d.end();d.stroke()};mxCellRenderer.registerShape("umlEntity",U);mxUtils.extend(K,mxShape);K.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(q,0);d.lineTo(0,x);d.moveTo(0,0);d.lineTo(q,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlDestroy",K);mxUtils.extend(W,mxShape);W.prototype.getLabelBounds=function(d){return new mxRectangle(d.x,d.y+d.height/8,d.width,7*d.height/8)};W.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(3*q/8,x/8*1.1);d.lineTo(5*q/8,0);d.end();d.stroke();d.ellipse(0,x/8,q,7*x/8);d.fillAndStroke()};W.prototype.paintForeground=function(d,n,y,q,x){d.begin();d.moveTo(3*q/8,x/8*1.1);d.lineTo(5*q/8,x/4);d.end();d.stroke()};mxCellRenderer.registerShape("umlControl",W);mxUtils.extend(Y,mxRectangleShape);Y.prototype.size=40;Y.prototype.isHtmlAllowed=function(){return!1};Y.prototype.getLabelBounds=function(d){var n=Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(d.x,d.y,d.width,n)};Y.prototype.paintBackground=function(d,n,y,q,x){var D=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"participant");null==E||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,d,n,y,q,D):(E=this.state.view.graph.cellRenderer.getShape(E),null!=E&&E!=Y&&(E=new E,E.apply(this.state),d.save(),E.paintVertexShape(d,n,y,q,D),d.restore()));D<x&&(d.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),d.begin(),d.moveTo(n+q/2,y+D),d.lineTo(n+q/2,y+x),d.end(),d.stroke())};Y.prototype.paintForeground=function(d,n,y,q,x){var D=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,d,n,y,q,Math.min(x,-D))};mxCellRenderer.registerShape("umlLifeline",Y);mxUtils.extend(ba,mxShape);ba.prototype.width=60;ba.prototype.height=30;ba.prototype.corner=10;ba.prototype.configurePointerEvents=function(d){var n=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=n&&n!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(d.pointerEvents=!1)};ba.prototype.getLabelMargins=function(d){return new mxRectangle(0,-0,d.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),d.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};ba.prototype.paintBackground=function(d,n,y,q,x){var D=this.corner,E=Math.min(q,Math.max(D,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ha=Math.min(x,Math.max(1.5*D,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),L=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);L!=mxConstants.NONE&&-(d.setFillColor(L),d.rect(n,y,q,x),d.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(d,n,y,q,x),d.setGradient(this.fill,this.gradient,n,y,q,x,this.gradientDirection)):d.setFillColor(this.fill);d.pointerEvents=!0;d.begin();d.moveTo(n,y);d.lineTo(n+E,y);d.lineTo(n+E,y+Math.max(0,ha-1.5*D));d.lineTo(n+Math.max(0,E-D),y+ha);d.lineTo(n,y+ha);d.close();d.fillAndStroke();this.configurePointerEvents(d);d.begin();d.moveTo(n+E,y);-d.lineTo(n+q,y);d.lineTo(n+q,y+x);d.lineTo(n,y+x);d.lineTo(n,y+ha);d.stroke()};mxCellRenderer.registerShape("umlFrame",ba);mxPerimeter.CenterPerimeter=function(d,n,y,q){return new mxPoint(d.getCenterX(),d.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(d,n,y,q){q=Y.prototype.size;null!=n&&(q=mxUtils.getValue(n.style,"size",q)*n.view.scale);n=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;y.x<d.getCenterX()&&+D))};mxCellRenderer.registerShape("umlLifeline",Y);mxUtils.extend(ca,mxShape);ca.prototype.width=60;ca.prototype.height=30;ca.prototype.corner=10;ca.prototype.configurePointerEvents=function(d){var n=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=n&&n!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(d.pointerEvents=!1)};ca.prototype.getLabelMargins=function(d){return new mxRectangle(0,+0,d.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),d.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};ca.prototype.paintBackground=function(d,n,y,q,x){var D=this.corner,E=Math.min(q,Math.max(D,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ha=Math.min(x,Math.max(1.5*D,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),M=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);M!=mxConstants.NONE&&+(d.setFillColor(M),d.rect(n,y,q,x),d.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(d,n,y,q,x),d.setGradient(this.fill,this.gradient,n,y,q,x,this.gradientDirection)):d.setFillColor(this.fill);d.pointerEvents=!0;d.begin();d.moveTo(n,y);d.lineTo(n+E,y);d.lineTo(n+E,y+Math.max(0,ha-1.5*D));d.lineTo(n+Math.max(0,E-D),y+ha);d.lineTo(n,y+ha);d.close();d.fillAndStroke();this.configurePointerEvents(d);d.begin();d.moveTo(n+E,y);+d.lineTo(n+q,y);d.lineTo(n+q,y+x);d.lineTo(n,y+x);d.lineTo(n,y+ha);d.stroke()};mxCellRenderer.registerShape("umlFrame",ca);mxPerimeter.CenterPerimeter=function(d,n,y,q){return new mxPoint(d.getCenterX(),d.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(d,n,y,q){q=Y.prototype.size;null!=n&&(q=mxUtils.getValue(n.style,"size",q)*n.view.scale);n=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;y.x<d.getCenterX()&&(n=-1*(n+1));return new mxPoint(d.getCenterX()+n,Math.min(d.y+d.height,Math.max(d.y+q,y.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(d,n,y,q){q=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(d,n,y,q){q=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;null!=n.style.backboneSize&&(q+=parseFloat(n.style.backboneSize)*n.view.scale/2-1);if("south"==n.style[mxConstants.STYLE_DIRECTION]||"north"==n.style[mxConstants.STYLE_DIRECTION])return y.x<d.getCenterX()&&(q=-1*(q+1)),new mxPoint(d.getCenterX()+q,Math.min(d.y+d.height,Math.max(d.y,y.y)));y.y<d.getCenterY()&&(q=-1*(q+1));return new mxPoint(Math.min(d.x+d.width,Math.max(d.x,y.x)),d.getCenterY()+q)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(d,n,y,q){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(d,-new mxRectangle(0,0,0,Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(n.style,"size",ma.prototype.size))*n.view.scale))),n.style),n,y,q)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?K.prototype.fixedSize:K.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,L=d.width,va=d.height;n=null!=n?mxUtils.getValue(n.style,-mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+L,ha+x),new mxPoint(E+L,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha)]):(x=x?Math.max(0,Math.min(.5*L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+L,ha),new mxPoint(E+L-x,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,ha)]);va=d.getCenterX();-d=d.getCenterY();d=new mxPoint(va,d);q&&(y.x<E||y.x>E+L?d.y=y.y:d.x=y.x);return mxUtils.getPerimeterPoint(ha,d,y)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?M.prototype.fixedSize:M.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,L=d.width,va=d.height;n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,-mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(.5*L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+L-x,ha),new mxPoint(E+L,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,ha)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+L,ha),new mxPoint(E+L-x,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,ha)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,-Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha+x),new mxPoint(E+L,ha),new mxPoint(E+L,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha+x)]):(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+L,ha+x),new mxPoint(E+L,ha+va-x),new mxPoint(E,ha+va),new mxPoint(E,ha)]);va=d.getCenterX();d=d.getCenterY();d=new mxPoint(va,d);q&&(y.x<E||y.x>E+L?d.y=y.y:d.x=y.x);return mxUtils.getPerimeterPoint(ha,d,y)};mxStyleRegistry.putValue("trapezoidPerimeter",-mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?la.prototype.fixedSize:la.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,L=d.width,va=d.height,na=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(L,D)):L*Math.max(0,-Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+L-x,ha),new mxPoint(E+L,d),new mxPoint(E+L-x,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,d),new mxPoint(E,ha)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+L,ha),new mxPoint(E+L-x,d),new mxPoint(E+L,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,d),new mxPoint(E+x,ha)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,-ha+x),new mxPoint(na,ha),new mxPoint(E+L,ha+x),new mxPoint(E+L,ha+va),new mxPoint(na,ha+va-x),new mxPoint(E,ha+va),new mxPoint(E,ha+x)]):(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(na,ha+x),new mxPoint(E+L,ha),new mxPoint(E+L,ha+va-x),new mxPoint(na,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha)]);na=new mxPoint(na,d);q&&(y.x<E||y.x>E+L?na.y=y.y:na.x=y.x);return mxUtils.getPerimeterPoint(ha,na,y)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);-mxPerimeter.HexagonPerimeter2=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?Z.prototype.fixedSize:Z.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,L=d.width,va=d.height,na=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(va,D)):va*-Math.max(0,Math.min(1,D)),ha=[new mxPoint(na,ha),new mxPoint(E+L,ha+x),new mxPoint(E+L,ha+va-x),new mxPoint(na,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha+x),new mxPoint(na,ha)]):(x=x?Math.max(0,Math.min(L,D)):L*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+L-x,ha),new mxPoint(E+L,d),new mxPoint(E+L-x,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,d),new mxPoint(E+x,ha)]);na=new mxPoint(na,d);q&&(y.x<E||y.x>E+L?na.y=y.y:na.x=y.x);return mxUtils.getPerimeterPoint(ha,na,y)};mxStyleRegistry.putValue("hexagonPerimeter2",+new mxRectangle(0,0,0,Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(n.style,"size",ma.prototype.size))*n.view.scale))),n.style),n,y,q)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?L.prototype.fixedSize:L.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,M=d.width,va=d.height;n=null!=n?mxUtils.getValue(n.style,+mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+M,ha+x),new mxPoint(E+M,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha)]):(x=x?Math.max(0,Math.min(.5*M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+M,ha),new mxPoint(E+M-x,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,ha)]);va=d.getCenterX();+d=d.getCenterY();d=new mxPoint(va,d);q&&(y.x<E||y.x>E+M?d.y=y.y:d.x=y.x);return mxUtils.getPerimeterPoint(ha,d,y)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?J.prototype.fixedSize:J.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,M=d.width,va=d.height;n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,+mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(.5*M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+M-x,ha),new mxPoint(E+M,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,ha)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+M,ha),new mxPoint(E+M-x,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,ha)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,+Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha+x),new mxPoint(E+M,ha),new mxPoint(E+M,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha+x)]):(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+M,ha+x),new mxPoint(E+M,ha+va-x),new mxPoint(E,ha+va),new mxPoint(E,ha)]);va=d.getCenterX();d=d.getCenterY();d=new mxPoint(va,d);q&&(y.x<E||y.x>E+M?d.y=y.y:d.x=y.x);return mxUtils.getPerimeterPoint(ha,d,y)};mxStyleRegistry.putValue("trapezoidPerimeter",+mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?la.prototype.fixedSize:la.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,M=d.width,va=d.height,na=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(M,D)):M*Math.max(0,+Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(E+M-x,ha),new mxPoint(E+M,d),new mxPoint(E+M-x,ha+va),new mxPoint(E,ha+va),new mxPoint(E+x,d),new mxPoint(E,ha)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+M,ha),new mxPoint(E+M-x,d),new mxPoint(E+M,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,d),new mxPoint(E+x,ha)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,+ha+x),new mxPoint(na,ha),new mxPoint(E+M,ha+x),new mxPoint(E+M,ha+va),new mxPoint(na,ha+va-x),new mxPoint(E,ha+va),new mxPoint(E,ha+x)]):(x=x?Math.max(0,Math.min(va,D)):va*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E,ha),new mxPoint(na,ha+x),new mxPoint(E+M,ha),new mxPoint(E+M,ha+va-x),new mxPoint(na,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha)]);na=new mxPoint(na,d);q&&(y.x<E||y.x>E+M?na.y=y.y:na.x=y.x);return mxUtils.getPerimeterPoint(ha,na,y)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);+mxPerimeter.HexagonPerimeter2=function(d,n,y,q){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),D=x?Z.prototype.fixedSize:Z.prototype.size;null!=n&&(D=mxUtils.getValue(n.style,"size",D));x&&(D*=n.view.scale);var E=d.x,ha=d.y,M=d.width,va=d.height,na=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(va,D)):va*+Math.max(0,Math.min(1,D)),ha=[new mxPoint(na,ha),new mxPoint(E+M,ha+x),new mxPoint(E+M,ha+va-x),new mxPoint(na,ha+va),new mxPoint(E,ha+va-x),new mxPoint(E,ha+x),new mxPoint(na,ha)]):(x=x?Math.max(0,Math.min(M,D)):M*Math.max(0,Math.min(1,D)),ha=[new mxPoint(E+x,ha),new mxPoint(E+M-x,ha),new mxPoint(E+M,d),new mxPoint(E+M-x,ha+va),new mxPoint(E+x,ha+va),new mxPoint(E,d),new mxPoint(E+x,ha)]);na=new mxPoint(na,d);q&&(y.x<E||y.x>E+M?na.y=y.y:na.x=y.x);return mxUtils.getPerimeterPoint(ha,na,y)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ja,mxShape);ja.prototype.size=10;ja.prototype.paintBackground=function(d,n,y,q,x){var D=parseFloat(mxUtils.getValue(this.style,"size",this.size));d.translate(n,y);d.ellipse((q-D)/2,0,D,D);d.fillAndStroke();d.begin();d.moveTo(q/2,D);d.lineTo(q/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("lollipop",ja);mxUtils.extend(oa,mxShape);oa.prototype.size=10;oa.prototype.inset=2;oa.prototype.paintBackground=function(d,n,y,q,x){var D=parseFloat(mxUtils.getValue(this.style,"size",this.size)),E=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(n,y);d.begin();d.moveTo(q/2,D+E);d.lineTo(q/2,x);d.end();d.stroke();d.begin();d.moveTo((q-D)/2-E,D/2);d.quadTo((q-D)/2-E,D+E,q/2,D+E);d.quadTo((q+D)/2+E,D+E,(q+D)/2+E,D/2);d.end();d.stroke()};mxCellRenderer.registerShape("requires",oa);mxUtils.extend(qa,mxShape);qa.prototype.paintBackground=function(d,n,y,q,x){d.translate(n,y);d.begin();d.moveTo(0,0);d.quadTo(q,0,q,x/2);d.quadTo(q,x,0,x);d.end();d.stroke()};mxCellRenderer.registerShape("requiredInterface",qa);mxUtils.extend(ra,mxShape);ra.prototype.inset=2;ra.prototype.paintBackground=function(d,n,y,q,x){var D=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(n,y);d.ellipse(0,D,q-2*D,x-2*D);d.fillAndStroke();d.begin();d.moveTo(q/2,0);d.quadTo(q,0,q,x/2);d.quadTo(q,x,q/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",ra);mxUtils.extend(xa,mxCylinder);xa.prototype.jettyWidth=-20;xa.prototype.jettyHeight=10;xa.prototype.redrawPath=function(d,n,y,q,x,D){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));y=E/2;E=y+E/2;var ha=Math.min(n,x-n),L=Math.min(ha+2*n,x-n);D?(d.moveTo(y,ha),d.lineTo(E,ha),d.lineTo(E,ha+n),d.lineTo(y,ha+n),d.moveTo(y,L),d.lineTo(E,L),d.lineTo(E,L+n),d.lineTo(y,L+n)):(d.moveTo(y,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(y,x),d.lineTo(y,L+n),d.lineTo(0,L+-n),d.lineTo(0,L),d.lineTo(y,L),d.lineTo(y,ha+n),d.lineTo(0,ha+n),d.lineTo(0,ha),d.lineTo(y,ha),d.close());d.end()};mxCellRenderer.registerShape("module",xa);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=32;Ba.prototype.jettyHeight=12;Ba.prototype.redrawPath=function(d,n,y,q,x,D){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));y=E/2;E=y+E/2;var ha=.3*x-n/2,L=.7*x-n/2;D?(d.moveTo(y,ha),d.lineTo(E,-ha),d.lineTo(E,ha+n),d.lineTo(y,ha+n),d.moveTo(y,L),d.lineTo(E,L),d.lineTo(E,L+n),d.lineTo(y,L+n)):(d.moveTo(y,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(y,x),d.lineTo(y,L+n),d.lineTo(0,L+n),d.lineTo(0,L),d.lineTo(y,L),d.lineTo(y,ha+n),d.lineTo(0,ha+n),d.lineTo(0,ha),d.lineTo(y,ha),d.close());d.end()};mxCellRenderer.registerShape("component",Ba);mxUtils.extend(ya,mxRectangleShape);ya.prototype.paintForeground=function(d,n,y,q,x){var D=q/2,E=x/2,ha=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,+20;xa.prototype.jettyHeight=10;xa.prototype.redrawPath=function(d,n,y,q,x,D){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));y=E/2;E=y+E/2;var ha=Math.min(n,x-n),M=Math.min(ha+2*n,x-n);D?(d.moveTo(y,ha),d.lineTo(E,ha),d.lineTo(E,ha+n),d.lineTo(y,ha+n),d.moveTo(y,M),d.lineTo(E,M),d.lineTo(E,M+n),d.lineTo(y,M+n)):(d.moveTo(y,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(y,x),d.lineTo(y,M+n),d.lineTo(0,M++n),d.lineTo(0,M),d.lineTo(y,M),d.lineTo(y,ha+n),d.lineTo(0,ha+n),d.lineTo(0,ha),d.lineTo(y,ha),d.close());d.end()};mxCellRenderer.registerShape("module",xa);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=32;Ba.prototype.jettyHeight=12;Ba.prototype.redrawPath=function(d,n,y,q,x,D){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));y=E/2;E=y+E/2;var ha=.3*x-n/2,M=.7*x-n/2;D?(d.moveTo(y,ha),d.lineTo(E,+ha),d.lineTo(E,ha+n),d.lineTo(y,ha+n),d.moveTo(y,M),d.lineTo(E,M),d.lineTo(E,M+n),d.lineTo(y,M+n)):(d.moveTo(y,0),d.lineTo(q,0),d.lineTo(q,x),d.lineTo(y,x),d.lineTo(y,M+n),d.lineTo(0,M+n),d.lineTo(0,M),d.lineTo(y,M),d.lineTo(y,ha+n),d.lineTo(0,ha+n),d.lineTo(0,ha),d.lineTo(y,ha),d.close());d.end()};mxCellRenderer.registerShape("component",Ba);mxUtils.extend(ya,mxRectangleShape);ya.prototype.paintForeground=function(d,n,y,q,x){var D=q/2,E=x/2,ha=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;d.begin();this.addPoints(d,[new mxPoint(n+D,y),new mxPoint(n+q,y+E),new mxPoint(n+D,y+x),new mxPoint(n,y+E)],this.isRounded,ha,!0);d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",ya);mxUtils.extend(Da,mxDoubleEllipse);Da.prototype.outerStroke=!0;Da.prototype.paintVertexShape=function(d,n,y,q,x){var D=Math.min(4,Math.min(q/5,x/5));0<q&&0<x&&(d.ellipse(n+D,y+D,q-2*D,x-2*D),d.fillAndStroke());d.setShadow(!1);this.outerStroke&&(d.ellipse(n,y,q,x),d.stroke())};mxCellRenderer.registerShape("endState",Da);mxUtils.extend(La,Da);La.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",La);mxUtils.extend(sa,mxArrowConnector);sa.prototype.defaultWidth=4;sa.prototype.isOpenEnded=function(){return!0};sa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};sa.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",sa);mxUtils.extend(Aa,mxArrowConnector);Aa.prototype.defaultWidth=10;Aa.prototype.defaultArrowWidth=20;Aa.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Aa.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Aa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-@@ -2810,8 +2810,8 @@ d.begin();d.moveTo(n+q/2,y+x);d.lineTo(n+q,y+x);d.end();d.stroke()};mxCellRenderfunction(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(n+.145*q,y+.145*x);d.lineTo(n+.855*q,y+.855*x);d.end();d.stroke();d.begin();d.moveTo(n+.855*q,y+.145*x);d.lineTo(n+.145*q,y+.855*x);d.end();d.stroke()};mxCellRenderer.registerShape("sumEllipse",pa);mxUtils.extend(wa,mxRhombus);wa.prototype.paintVertexShape=function(d,n,y,q,x){mxRhombus.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(n,y+x/2);d.lineTo(n+q,y+x/2);d.end();d.stroke()};mxCellRenderer.registerShape("sortShape",wa);mxUtils.extend(ta,mxEllipse);ta.prototype.paintVertexShape=function(d,n,y,q,x){d.begin();d.moveTo(n,y);d.lineTo(n+q,y);d.lineTo(n+q/2,y+x/2);d.close();d.fillAndStroke();d.begin();d.moveTo(n,y+x);d.lineTo(n+q,y+x);d.lineTo(n+q/2,y+x/2);d.close();d.fillAndStroke()};mxCellRenderer.registerShape("collate",ta);mxUtils.extend(ua,mxEllipse);ua.prototype.paintVertexShape=function(d,n,y,q,x){var D=d.state.strokeWidth/2,E=10+2*D,ha=y+x-E/2;d.begin();d.moveTo(n,y);d.lineTo(n,y+x);d.moveTo(n+D,ha);d.lineTo(n+D+E,ha-E/2);d.moveTo(n+D,ha);d.lineTo(n+D+E,ha+E/2);d.moveTo(n+D,ha);d.lineTo(n+q-D,ha);d.moveTo(n+q,y);d.lineTo(n+q,y+x);d.moveTo(n+q-D,ha);d.lineTo(n+q-E-D,ha-E/2);d.moveTo(n+q-D,ha);d.lineTo(n+q-E-D,ha+E/2);d.end();d.stroke()};mxCellRenderer.registerShape("dimension",ua);mxUtils.extend(Ca,mxEllipse);Ca.prototype.drawHidden=!0;Ca.prototype.paintVertexShape=function(d,n,y,q,x){this.outline||d.setStrokeColor(null);if(null!=-this.style){var D=d.pointerEvents,E=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||E||(d.pointerEvents=!1);var ha="1"==mxUtils.getValue(this.style,"top","1"),L="1"==mxUtils.getValue(this.style,"left","1"),va="1"==mxUtils.getValue(this.style,"right","1"),na="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||E||this.outline||ha||va||na||L?(d.rect(n,y,q,x),d.fill(),d.pointerEvents=D,d.setStrokeColor(this.stroke),d.setLineCap("square"),-d.begin(),d.moveTo(n,y),this.outline||ha?d.lineTo(n+q,y):d.moveTo(n+q,y),this.outline||va?d.lineTo(n+q,y+x):d.moveTo(n+q,y+x),this.outline||na?d.lineTo(n,y+x):d.moveTo(n,y+x),(this.outline||L)&&d.lineTo(n,y),d.end(),d.stroke(),d.setLineCap("flat")):d.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Ca);mxUtils.extend(Na,mxEllipse);Na.prototype.paintVertexShape=function(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();"vertical"==+this.style){var D=d.pointerEvents,E=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||E||(d.pointerEvents=!1);var ha="1"==mxUtils.getValue(this.style,"top","1"),M="1"==mxUtils.getValue(this.style,"left","1"),va="1"==mxUtils.getValue(this.style,"right","1"),na="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||E||this.outline||ha||va||na||M?(d.rect(n,y,q,x),d.fill(),d.pointerEvents=D,d.setStrokeColor(this.stroke),d.setLineCap("square"),+d.begin(),d.moveTo(n,y),this.outline||ha?d.lineTo(n+q,y):d.moveTo(n+q,y),this.outline||va?d.lineTo(n+q,y+x):d.moveTo(n+q,y+x),this.outline||na?d.lineTo(n,y+x):d.moveTo(n,y+x),(this.outline||M)&&d.lineTo(n,y),d.end(),d.stroke(),d.setLineCap("flat")):d.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Ca);mxUtils.extend(Na,mxEllipse);Na.prototype.paintVertexShape=function(d,n,y,q,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();"vertical"==mxUtils.getValue(this.style,"line")?(d.moveTo(n+q/2,y),d.lineTo(n+q/2,y+x)):(d.moveTo(n,y+x/2),d.lineTo(n+q,y+x/2));d.end();d.stroke()};mxCellRenderer.registerShape("lineEllipse",Na);mxUtils.extend(Ya,mxActor);Ya.prototype.redrawPath=function(d,n,y,q,x){n=Math.min(q,x/2);d.moveTo(0,0);d.lineTo(q-n,0);d.quadTo(q,0,q,x/2);d.quadTo(q,x,q-n,x);d.lineTo(0,x);d.close();d.end()};mxCellRenderer.registerShape("delay",Ya);mxUtils.extend(Za,mxActor);Za.prototype.size=.2;Za.prototype.redrawPath=function(d,n,y,q,x){n=Math.min(x,q);var D=Math.max(0,Math.min(n,n*parseFloat(mxUtils.getValue(this.style,"size",this.size))));n=(x-D)/2;y=n+D;var E=(q-D)/2;D=E+D;d.moveTo(0,n);d.lineTo(E,n);d.lineTo(E,0);d.lineTo(D,0);d.lineTo(D,n);d.lineTo(q,n);d.lineTo(q,y);d.lineTo(D,y);d.lineTo(D,x);d.lineTo(E,x);d.lineTo(E,y);d.lineTo(0,y);d.close();d.end()};mxCellRenderer.registerShape("cross",Za);mxUtils.extend(ab,mxActor);ab.prototype.size=.25;ab.prototype.redrawPath=function(d,n,y,q,x){n=Math.min(q,x/2);y=Math.min(q-n,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*q);d.moveTo(0,x/2);d.lineTo(y,0);d.lineTo(q-n,0);d.quadTo(q,0,q,x/2);d.quadTo(q,x,q-n,x);d.lineTo(y,x);d.close();d.end()};mxCellRenderer.registerShape("display",ab);mxUtils.extend(Ra,mxActor);Ra.prototype.cst={RECT2:"mxgraph.basic.rect"};Ra.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},@@ -2820,82 +2820,82 @@ defVal:"none"},{name:"gradientColor2",dispName:"Inside Gradient Color",type:"coldispName:"Left ",type:"bool",defVal:!0},{name:"topLeftStyle",dispName:"Top Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"topRightStyle",dispName:"Top Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomRightStyle",dispName:"Bottom Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomLeftStyle",dispName:"Bottom Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]}];Ra.prototype.paintVertexShape=function(d,n,y,q,x){d.translate(n,y);this.strictDrawShape(d,0,0,q,x)};Ra.prototype.strictDrawShape=function(d,n,y,q,x,D){var E=D&&D.rectStyle?D.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ha=D&&D.absoluteCornerSize?D.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",-this.absoluteCornerSize),L=D&&D.size?D.size:Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),va=D&&D.rectOutline?D.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),na=D&&D.indent?D.indent:Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Va=D&&D.dashed?D.dashed:mxUtils.getValue(this.style,"dashed",!1),gb=D&&D.dashPattern?D.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),bb=D&&D.relIndent?D.relIndent:+this.absoluteCornerSize),M=D&&D.size?D.size:Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),va=D&&D.rectOutline?D.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),na=D&&D.indent?D.indent:Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Va=D&&D.dashed?D.dashed:mxUtils.getValue(this.style,"dashed",!1),gb=D&&D.dashPattern?D.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),bb=D&&D.relIndent?D.relIndent:Math.max(0,Math.min(50,na)),Fa=D&&D.top?D.top:mxUtils.getValue(this.style,"top",!0),Ja=D&&D.right?D.right:mxUtils.getValue(this.style,"right",!0),Ha=D&&D.bottom?D.bottom:mxUtils.getValue(this.style,"bottom",!0),Ga=D&&D.left?D.left:mxUtils.getValue(this.style,"left",!0),Qa=D&&D.topLeftStyle?D.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),Sa=D&&D.topRightStyle?D.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),Ta=D&&D.bottomRightStyle?D.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),Ua=D&&D.bottomLeftStyle?D.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Fb=D&&D.fillColor?D.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");D&&D.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Gb=D&&D.strokeWidth?D.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Db=D&&D.fillColor2?D.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Eb=D&&D.gradientColor2?D.gradientColor2:mxUtils.getValue(this.style,-"gradientColor2","none"),Hb=D&&D.gradientDirection2?D.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Ib=D&&D.opacity?D.opacity:mxUtils.getValue(this.style,"opacity","100"),Jb=Math.max(0,Math.min(50,L));D=Ra.prototype;d.setDashed(Va);gb&&""!=gb&&d.setDashPattern(gb);d.setStrokeWidth(Gb);L=Math.min(.5*x,.5*q,L);ha||(L=Jb*Math.min(q,x)/100);L=Math.min(L,.5*Math.min(q,x));ha||(na=Math.min(bb*Math.min(q,x)/100));na=Math.min(na,.5*Math.min(q,x)-L);(Fa||Ja||Ha||Ga)&&"frame"!=-va&&(d.begin(),Fa?D.moveNW(d,n,y,q,x,E,Qa,L,Ga):d.moveTo(0,0),Fa&&D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),Ja&&D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),Ha&&D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),Ga&&D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),d.close(),d.fill(),d.setShadow(!1),d.setFillColor(Db),Va=ha=Ib,"none"==Db&&(ha=0),"none"==Eb&&(Va=0),d.setGradient(Db,Eb,0,0,q,x,Hb,ha,Va),d.begin(),Fa?D.moveNWInner(d,-n,y,q,x,E,Qa,L,na,Fa,Ga):d.moveTo(na,0),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),Ga&&Ha&&D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),Ha&&Ja&&D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),Ja&&Fa&&D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),Fa&&Ga&&D.paintNWInner(d,n,y,q,x,E,Qa,L,na),d.fill(),"none"==Fb&&(d.begin(),D.paintFolds(d,n,y,q,x,E,Qa,Sa,Ta,Ua,L,Fa,Ja,Ha,Ga),d.stroke()));Fa||Ja||-Ha||!Ga?Fa||Ja||!Ha||Ga?!Fa&&!Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,-n,y,q,x,E,Qa,L,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa||!Ja||Ha||Ga?!Fa&&Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga)),d.stroke(),d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,-n,y,q,x,E,Ta,L,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke(),d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),d.close(),d.fillAndStroke()):-!Fa&&Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),-D.lineSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),d.close(),d.fillAndStroke()):!Fa&&Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,-n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,-n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),d.close(),d.fillAndStroke()):!Fa||Ja||Ha||Ga?Fa&&!Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,-n,y,q,x,E,Ua,L,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke()):Fa&&!Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),"double"==va&&(D.moveNEInner(d,n,y,-q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa)),d.stroke(),d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),d.close(),d.fillAndStroke(),d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,-q,x,E,Ua,L,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa&&!Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,-n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),D.paintSWInner(d,-n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa&&Ja&&!Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,-n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,-Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.lineSEInner(d,n,y,q,x,E,-Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke()):Fa&&Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),"double"==va&&(D.moveSWInner(d,-n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,-n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ja&&Ha&&Ga&&("frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,-L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),d.close(),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close()),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintNW(d,-n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.paintNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.paintSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.paintSW(d,n,y,q,x,E,Ua,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),d.close(),D.moveSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,L,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,L,na),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,L,na),D.paintTopInner(d,-n,y,q,x,E,Qa,L,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,L,na),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke())):"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,L,Ga),D.paintTop(d,n,y,q,x,E,Sa,L,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,L,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,L,na,Ga,Fa),d.close(),d.fillAndStroke()):-"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,L,Fa),D.paintRight(d,n,y,q,x,E,Ta,L,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,L,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,L,na,Fa,Ja),d.close(),d.fillAndStroke()):"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),"double"==va&&(D.moveSWInner(d,-n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,L,Ja),D.paintBottom(d,n,y,q,x,E,Ua,L,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,L,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,L,na,Ja,Ha),d.close(),d.fillAndStroke()):"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,-Qa,L,Ha),D.paintLeft(d,n,y,q,x,E,Qa,L,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,L,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,L,na,Ha,Ga),d.close(),d.fillAndStroke());d.begin();D.paintFolds(d,n,y,q,x,E,Qa,Sa,Ta,Ua,L,Fa,Ja,Ha,Ga);d.stroke()};Ra.prototype.moveNW=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.moveTo(0,0):d.moveTo(0,ha)};Ra.prototype.moveNE=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.moveTo(q,0):d.moveTo(q-ha,0)};Ra.prototype.moveSE=function(d,-n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.moveTo(q,x):d.moveTo(q,x-ha)};Ra.prototype.moveSW=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.moveTo(0,x):d.moveTo(ha,x)};Ra.prototype.paintNW=function(d,n,y,q,x,D,E,ha,L){if(L)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,ha,0)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==E&&-"fold"==D)&&d.lineTo(ha,0);else d.lineTo(0,0)};Ra.prototype.paintTop=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.lineTo(q,0):d.lineTo(q-ha,0)};Ra.prototype.paintNE=function(d,n,y,q,x,D,E,ha,L){if(L)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,q,ha)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q,ha);else d.lineTo(q,-0)};Ra.prototype.paintRight=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.lineTo(q,x):d.lineTo(q,x-ha)};Ra.prototype.paintLeft=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.lineTo(0,0):d.lineTo(0,ha)};Ra.prototype.paintSE=function(d,n,y,q,x,D,E,ha,L){if(L)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,q-ha,x)}else("snip"==E||"default"==-E&&"snip"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-ha,x);else d.lineTo(q,x)};Ra.prototype.paintBottom=function(d,n,y,q,x,D,E,ha,L){"square"==E||"default"==E&&"square"==D||!L?d.lineTo(0,x):d.lineTo(ha,x)};Ra.prototype.paintSW=function(d,n,y,q,x,D,E,ha,L){if(L)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,0,x-ha)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==-E&&"fold"==D)&&d.lineTo(0,x-ha);else d.lineTo(0,x)};Ra.prototype.paintNWInner=function(d,n,y,q,x,D,E,ha,L){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*L,ha-.5*L,0,0,0,L,.5*L+ha);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+L,ha+L,0,0,1,L,L+ha);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(L,.5*L+ha);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(L+ha,L+ha),d.lineTo(L,L+ha)};Ra.prototype.paintTopInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(0,-L):va&&!na?d.lineTo(L,0):va?"square"==E||"default"==E&&"square"==D?d.lineTo(L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(ha+.5*L,L):d.lineTo(ha+L,L):d.lineTo(0,L):d.lineTo(0,0)};Ra.prototype.paintNEInner=function(d,n,y,q,x,D,E,ha,L){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*L,ha-.5*L,0,0,0,q-ha-.5*L,L);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+L,ha+L,0,0,1,q-ha-L,L);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(q--ha-.5*L,L);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(q-ha-L,ha+L),d.lineTo(q-ha-L,L)};Ra.prototype.paintRightInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(q-L,0):va&&!na?d.lineTo(q,L):va?"square"==E||"default"==E&&"square"==D?d.lineTo(q-L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-L,ha+.5*L):d.lineTo(q-L,ha+L):d.lineTo(q-L,0):d.lineTo(q,0)};Ra.prototype.paintLeftInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(L,-x):va&&!na?d.lineTo(0,x-L):va?"square"==E||"default"==E&&"square"==D?d.lineTo(L,x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(L,x-ha-.5*L):d.lineTo(L,x-ha-L):d.lineTo(L,x):d.lineTo(0,x)};Ra.prototype.paintSEInner=function(d,n,y,q,x,D,E,ha,L){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*L,ha-.5*L,0,0,0,q-L,x-ha-.5*L);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+L,ha+L,0,0,1,q-L,x-ha-L);else if("snip"==E||"default"==E&&"snip"==-D)d.lineTo(q-L,x-ha-.5*L);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(q-ha-L,x-ha-L),d.lineTo(q-L,x-ha-L)};Ra.prototype.paintBottomInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(q,x-L):va&&!na?d.lineTo(q-L,x):"square"==E||"default"==E&&"square"==D||!va?d.lineTo(q-L,x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-ha-.5*L,x-L):d.lineTo(q-ha-L,x-L):d.lineTo(q,x)};Ra.prototype.paintSWInner=function(d,n,y,q,x,D,E,ha,L,va){if(!va)d.lineTo(L,-x);else if("square"==E||"default"==E&&"square"==D)d.lineTo(L,x-L);else if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*L,ha-.5*L,0,0,0,ha+.5*L,x-L);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+L,ha+L,0,0,1,ha+L,x-L);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(ha+.5*L,x-L);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(L+ha,x-ha-L),d.lineTo(L+ha,x-L)};Ra.prototype.moveSWInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D?d.moveTo(L,-x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(L,x-ha-.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(L,x-ha-L):d.moveTo(0,x-L)};Ra.prototype.lineSWInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D?d.lineTo(L,x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(L,x-ha-.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==-E&&"fold"==D)&&d.lineTo(L,x-ha-L):d.lineTo(0,x-L)};Ra.prototype.moveSEInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D?d.moveTo(q-L,x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(q-L,x-ha-.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(q-L,x-ha-L):d.moveTo(q-L,x)};Ra.prototype.lineSEInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D?d.lineTo(q-L,-x-L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-L,x-ha-.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-L,x-ha-L):d.lineTo(q-L,x)};Ra.prototype.moveNEInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D||va?d.moveTo(q-L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(q-L,ha+.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==-E&&"fold"==D)&&d.moveTo(q-L,ha+L):d.moveTo(q,L)};Ra.prototype.lineNEInner=function(d,n,y,q,x,D,E,ha,L,va){va?"square"==E||"default"==E&&"square"==D||va?d.lineTo(q-L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-L,ha+.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-L,ha+L):d.lineTo(q,L)};Ra.prototype.moveNWInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.moveTo(L,0):va&&!na?d.moveTo(0,L):"square"==-E||"default"==E&&"square"==D?d.moveTo(L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(L,ha+.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(L,ha+L):d.moveTo(0,0)};Ra.prototype.lineNWInner=function(d,n,y,q,x,D,E,ha,L,va,na){va||na?!va&&na?d.lineTo(L,0):va&&!na?d.lineTo(0,L):"square"==E||"default"==E&&"square"==D?d.lineTo(L,L):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(L,-ha+.5*L):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(L,ha+L):d.lineTo(0,0)};Ra.prototype.paintFolds=function(d,n,y,q,x,D,E,ha,L,va,na,Va,gb,bb,Fa){if("fold"==D||"fold"==E||"fold"==ha||"fold"==L||"fold"==va)("fold"==E||"default"==E&&"fold"==D)&&Va&&Fa&&(d.moveTo(0,na),d.lineTo(na,na),d.lineTo(na,0)),("fold"==ha||"default"==ha&&"fold"==D)&&Va&&gb&&(d.moveTo(q-na,0),d.lineTo(q-na,na),d.lineTo(q,na)),("fold"==L||"default"==L&&"fold"==D)&&bb&&gb&&(d.moveTo(q-+"gradientColor2","none"),Hb=D&&D.gradientDirection2?D.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Ib=D&&D.opacity?D.opacity:mxUtils.getValue(this.style,"opacity","100"),Jb=Math.max(0,Math.min(50,M));D=Ra.prototype;d.setDashed(Va);gb&&""!=gb&&d.setDashPattern(gb);d.setStrokeWidth(Gb);M=Math.min(.5*x,.5*q,M);ha||(M=Jb*Math.min(q,x)/100);M=Math.min(M,.5*Math.min(q,x));ha||(na=Math.min(bb*Math.min(q,x)/100));na=Math.min(na,.5*Math.min(q,x)-M);(Fa||Ja||Ha||Ga)&&"frame"!=+va&&(d.begin(),Fa?D.moveNW(d,n,y,q,x,E,Qa,M,Ga):d.moveTo(0,0),Fa&&D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),Ja&&D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),Ha&&D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),Ga&&D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),d.close(),d.fill(),d.setShadow(!1),d.setFillColor(Db),Va=ha=Ib,"none"==Db&&(ha=0),"none"==Eb&&(Va=0),d.setGradient(Db,Eb,0,0,q,x,Hb,ha,Va),d.begin(),Fa?D.moveNWInner(d,+n,y,q,x,E,Qa,M,na,Fa,Ga):d.moveTo(na,0),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),Ga&&Ha&&D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),Ha&&Ja&&D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),Ja&&Fa&&D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),Fa&&Ga&&D.paintNWInner(d,n,y,q,x,E,Qa,M,na),d.fill(),"none"==Fb&&(d.begin(),D.paintFolds(d,n,y,q,x,E,Qa,Sa,Ta,Ua,M,Fa,Ja,Ha,Ga),d.stroke()));Fa||Ja||+Ha||!Ga?Fa||Ja||!Ha||Ga?!Fa&&!Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,+n,y,q,x,E,Qa,M,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa||!Ja||Ha||Ga?!Fa&&Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga)),d.stroke(),d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,+n,y,q,x,E,Ta,M,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke(),d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),d.close(),d.fillAndStroke()):+!Fa&&Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),+D.lineSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),d.close(),d.fillAndStroke()):!Fa&&Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,+n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,+n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),d.close(),d.fillAndStroke()):!Fa||Ja||Ha||Ga?Fa&&!Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,+n,y,q,x,E,Ua,M,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke()):Fa&&!Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),"double"==va&&(D.moveNEInner(d,n,y,+q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa)),d.stroke(),d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),d.close(),d.fillAndStroke(),d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,+q,x,E,Ua,M,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa&&!Ja&&Ha&&Ga?"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,+n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),D.paintSWInner(d,+n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),d.close(),d.fillAndStroke()):Fa&&Ja&&!Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,+n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ja&&!Ha&&Ga?"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,+Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.lineSEInner(d,n,y,q,x,E,+Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke()):Fa&&Ja&&Ha&&!Ga?"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),"double"==va&&(D.moveSWInner(d,+n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,+n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ja&&Ha&&Ga&&("frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,+M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),d.close(),"double"==va&&(D.moveSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close()),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintNW(d,+n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.paintNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.paintSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.paintSW(d,n,y,q,x,E,Ua,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),d.close(),D.moveSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintSWInner(d,n,y,q,x,E,Ua,M,na,Ha),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),D.paintSEInner(d,n,y,q,x,E,Ta,M,na),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),D.paintNEInner(d,n,y,q,x,E,Sa,M,na),D.paintTopInner(d,+n,y,q,x,E,Qa,M,na,Ga,Fa),D.paintNWInner(d,n,y,q,x,E,Qa,M,na),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke())):"frame"!=va?(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),"double"==va&&(D.moveNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa)),d.stroke()):(d.begin(),D.moveNW(d,n,y,q,x,E,Qa,M,Ga),D.paintTop(d,n,y,q,x,E,Sa,M,Ja),D.lineNEInner(d,n,y,q,x,E,Sa,M,na,Ja),D.paintTopInner(d,n,y,q,x,E,Qa,M,na,Ga,Fa),d.close(),d.fillAndStroke()):+"frame"!=va?(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),"double"==va&&(D.moveSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja)),d.stroke()):(d.begin(),D.moveNE(d,n,y,q,x,E,Sa,M,Fa),D.paintRight(d,n,y,q,x,E,Ta,M,Ha),D.lineSEInner(d,n,y,q,x,E,Ta,M,na,Ha),D.paintRightInner(d,n,y,q,x,E,Sa,M,na,Fa,Ja),d.close(),d.fillAndStroke()):"frame"!=va?(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),"double"==va&&(D.moveSWInner(d,+n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha)),d.stroke()):(d.begin(),D.moveSE(d,n,y,q,x,E,Ta,M,Ja),D.paintBottom(d,n,y,q,x,E,Ua,M,Ga),D.lineSWInner(d,n,y,q,x,E,Ua,M,na,Ga),D.paintBottomInner(d,n,y,q,x,E,Ta,M,na,Ja,Ha),d.close(),d.fillAndStroke()):"frame"!=va?(d.begin(),D.moveSW(d,n,y,q,x,E,Qa,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),"double"==va&&(D.moveNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga)),d.stroke()):(d.begin(),D.moveSW(d,n,y,q,x,E,+Qa,M,Ha),D.paintLeft(d,n,y,q,x,E,Qa,M,Fa),D.lineNWInner(d,n,y,q,x,E,Qa,M,na,Fa,Ga),D.paintLeftInner(d,n,y,q,x,E,Ua,M,na,Ha,Ga),d.close(),d.fillAndStroke());d.begin();D.paintFolds(d,n,y,q,x,E,Qa,Sa,Ta,Ua,M,Fa,Ja,Ha,Ga);d.stroke()};Ra.prototype.moveNW=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.moveTo(0,0):d.moveTo(0,ha)};Ra.prototype.moveNE=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.moveTo(q,0):d.moveTo(q-ha,0)};Ra.prototype.moveSE=function(d,+n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.moveTo(q,x):d.moveTo(q,x-ha)};Ra.prototype.moveSW=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.moveTo(0,x):d.moveTo(ha,x)};Ra.prototype.paintNW=function(d,n,y,q,x,D,E,ha,M){if(M)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,ha,0)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==E&&+"fold"==D)&&d.lineTo(ha,0);else d.lineTo(0,0)};Ra.prototype.paintTop=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.lineTo(q,0):d.lineTo(q-ha,0)};Ra.prototype.paintNE=function(d,n,y,q,x,D,E,ha,M){if(M)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,q,ha)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q,ha);else d.lineTo(q,+0)};Ra.prototype.paintRight=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.lineTo(q,x):d.lineTo(q,x-ha)};Ra.prototype.paintLeft=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.lineTo(0,0):d.lineTo(0,ha)};Ra.prototype.paintSE=function(d,n,y,q,x,D,E,ha,M){if(M)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,q-ha,x)}else("snip"==E||"default"==+E&&"snip"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-ha,x);else d.lineTo(q,x)};Ra.prototype.paintBottom=function(d,n,y,q,x,D,E,ha,M){"square"==E||"default"==E&&"square"==D||!M?d.lineTo(0,x):d.lineTo(ha,x)};Ra.prototype.paintSW=function(d,n,y,q,x,D,E,ha,M){if(M)if("rounded"==E||"default"==E&&"rounded"==D||"invRound"==E||"default"==E&&"invRound"==D){n=0;if("rounded"==E||"default"==E&&"rounded"==D)n=1;d.arcTo(ha,ha,0,0,n,0,x-ha)}else("snip"==E||"default"==E&&"snip"==D||"fold"==E||"default"==+E&&"fold"==D)&&d.lineTo(0,x-ha);else d.lineTo(0,x)};Ra.prototype.paintNWInner=function(d,n,y,q,x,D,E,ha,M){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*M,ha-.5*M,0,0,0,M,.5*M+ha);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+M,ha+M,0,0,1,M,M+ha);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(M,.5*M+ha);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(M+ha,M+ha),d.lineTo(M,M+ha)};Ra.prototype.paintTopInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(0,+M):va&&!na?d.lineTo(M,0):va?"square"==E||"default"==E&&"square"==D?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(ha+.5*M,M):d.lineTo(ha+M,M):d.lineTo(0,M):d.lineTo(0,0)};Ra.prototype.paintNEInner=function(d,n,y,q,x,D,E,ha,M){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*M,ha-.5*M,0,0,0,q-ha-.5*M,M);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+M,ha+M,0,0,1,q-ha-M,M);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(q-+ha-.5*M,M);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(q-ha-M,ha+M),d.lineTo(q-ha-M,M)};Ra.prototype.paintRightInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(q-M,0):va&&!na?d.lineTo(q,M):va?"square"==E||"default"==E&&"square"==D?d.lineTo(q-M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-M,ha+.5*M):d.lineTo(q-M,ha+M):d.lineTo(q-M,0):d.lineTo(q,0)};Ra.prototype.paintLeftInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(M,+x):va&&!na?d.lineTo(0,x-M):va?"square"==E||"default"==E&&"square"==D?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(M,x-ha-.5*M):d.lineTo(M,x-ha-M):d.lineTo(M,x):d.lineTo(0,x)};Ra.prototype.paintSEInner=function(d,n,y,q,x,D,E,ha,M){if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*M,ha-.5*M,0,0,0,q-M,x-ha-.5*M);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+M,ha+M,0,0,1,q-M,x-ha-M);else if("snip"==E||"default"==E&&"snip"==+D)d.lineTo(q-M,x-ha-.5*M);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(q-ha-M,x-ha-M),d.lineTo(q-M,x-ha-M)};Ra.prototype.paintBottomInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(q,x-M):va&&!na?d.lineTo(q-M,x):"square"==E||"default"==E&&"square"==D||!va?d.lineTo(q-M,x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-ha-.5*M,x-M):d.lineTo(q-ha-M,x-M):d.lineTo(q,x)};Ra.prototype.paintSWInner=function(d,n,y,q,x,D,E,ha,M,va){if(!va)d.lineTo(M,+x);else if("square"==E||"default"==E&&"square"==D)d.lineTo(M,x-M);else if("rounded"==E||"default"==E&&"rounded"==D)d.arcTo(ha-.5*M,ha-.5*M,0,0,0,ha+.5*M,x-M);else if("invRound"==E||"default"==E&&"invRound"==D)d.arcTo(ha+M,ha+M,0,0,1,ha+M,x-M);else if("snip"==E||"default"==E&&"snip"==D)d.lineTo(ha+.5*M,x-M);else if("fold"==E||"default"==E&&"fold"==D)d.lineTo(M+ha,x-ha-M),d.lineTo(M+ha,x-M)};Ra.prototype.moveSWInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D?d.moveTo(M,+x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(M,x-ha-.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(M,x-ha-M):d.moveTo(0,x-M)};Ra.prototype.lineSWInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(M,x-ha-.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==+E&&"fold"==D)&&d.lineTo(M,x-ha-M):d.lineTo(0,x-M)};Ra.prototype.moveSEInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D?d.moveTo(q-M,x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(q-M,x-ha-.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(q-M,x-ha-M):d.moveTo(q-M,x)};Ra.prototype.lineSEInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D?d.lineTo(q-M,+x-M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-M,x-ha-.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-M,x-ha-M):d.lineTo(q-M,x)};Ra.prototype.moveNEInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D||va?d.moveTo(q-M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(q-M,ha+.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==+E&&"fold"==D)&&d.moveTo(q-M,ha+M):d.moveTo(q,M)};Ra.prototype.lineNEInner=function(d,n,y,q,x,D,E,ha,M,va){va?"square"==E||"default"==E&&"square"==D||va?d.lineTo(q-M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(q-M,ha+.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(q-M,ha+M):d.lineTo(q,M)};Ra.prototype.moveNWInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.moveTo(M,0):va&&!na?d.moveTo(0,M):"square"==+E||"default"==E&&"square"==D?d.moveTo(M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.moveTo(M,ha+.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.moveTo(M,ha+M):d.moveTo(0,0)};Ra.prototype.lineNWInner=function(d,n,y,q,x,D,E,ha,M,va,na){va||na?!va&&na?d.lineTo(M,0):va&&!na?d.lineTo(0,M):"square"==E||"default"==E&&"square"==D?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==D||"snip"==E||"default"==E&&"snip"==D?d.lineTo(M,+ha+.5*M):("invRound"==E||"default"==E&&"invRound"==D||"fold"==E||"default"==E&&"fold"==D)&&d.lineTo(M,ha+M):d.lineTo(0,0)};Ra.prototype.paintFolds=function(d,n,y,q,x,D,E,ha,M,va,na,Va,gb,bb,Fa){if("fold"==D||"fold"==E||"fold"==ha||"fold"==M||"fold"==va)("fold"==E||"default"==E&&"fold"==D)&&Va&&Fa&&(d.moveTo(0,na),d.lineTo(na,na),d.lineTo(na,0)),("fold"==ha||"default"==ha&&"fold"==D)&&Va&&gb&&(d.moveTo(q-na,0),d.lineTo(q-na,na),d.lineTo(q,na)),("fold"==M||"default"==M&&"fold"==D)&&bb&&gb&&(d.moveTo(q-na,x),d.lineTo(q-na,x-na),d.lineTo(q,x-na)),("fold"==va||"default"==va&&"fold"==D)&&bb&&Fa&&(d.moveTo(0,x-na),d.lineTo(na,x-na),d.lineTo(na,x))};mxCellRenderer.registerShape(Ra.prototype.cst.RECT2,Ra);Ra.prototype.constraints=null;mxUtils.extend(Oa,mxConnector);Oa.prototype.origPaintEdgeShape=Oa.prototype.paintEdgeShape;Oa.prototype.paintEdgeShape=function(d,n,y){for(var q=[],x=0;x<n.length;x++)q.push(mxUtils.clone(n[x]));x=d.state.dashed;var D=d.state.fixDash;Oa.prototype.origPaintEdgeShape.apply(this,[d,q,y]);3<=d.state.strokeWidth&&(q=mxUtils.getValue(this.style,"fillColor",null),null!=q&&(d.setStrokeColor(q),d.setStrokeWidth(d.state.strokeWidth-2),d.setDashed(x,D),Oa.prototype.origPaintEdgeShape.apply(this,[d,n,y])))};mxCellRenderer.registerShape("filledEdge",Oa);"undefined"!==typeof StyleFormatPanel&&function(){var d=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var n=this.editorUi.getSelectionState(),y=d.apply(this,arguments);"umlFrame"==-n.style.shape&&y.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return y}}();mxMarker.addMarker("dash",function(d,n,y,q,x,D,E,ha,L,va){var na=x*(E+L+1),Va=D*(E+L+1);return function(){d.begin();d.moveTo(q.x-na/2-Va/2,q.y-Va/2+na/2);d.lineTo(q.x+Va/2-3*na/2,q.y-3*Va/2-na/2);d.stroke()}});mxMarker.addMarker("box",function(d,n,y,q,x,D,E,ha,L,va){var na=x*(E+L+1),Va=D*(E+L+1),gb=q.x+na/2,bb=q.y+Va/2;q.x-=na;q.y-=Va;return function(){d.begin();d.moveTo(gb-na/2--Va/2,bb-Va/2+na/2);d.lineTo(gb-na/2+Va/2,bb-Va/2-na/2);d.lineTo(gb+Va/2-3*na/2,bb-3*Va/2-na/2);d.lineTo(gb-Va/2-3*na/2,bb-3*Va/2+na/2);d.close();va?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("cross",function(d,n,y,q,x,D,E,ha,L,va){var na=x*(E+L+1),Va=D*(E+L+1);return function(){d.begin();d.moveTo(q.x-na/2-Va/2,q.y-Va/2+na/2);d.lineTo(q.x+Va/2-3*na/2,q.y-3*Va/2-na/2);d.moveTo(q.x-na/2+Va/2,q.y-Va/2-na/2);d.lineTo(q.x-Va/2-3*na/2,q.y-3*Va/2+na/2);d.stroke()}});mxMarker.addMarker("circle",kb);-mxMarker.addMarker("circlePlus",function(d,n,y,q,x,D,E,ha,L,va){var na=q.clone(),Va=kb.apply(this,arguments),gb=x*(E+2*L),bb=D*(E+2*L);return function(){Va.apply(this,arguments);d.begin();d.moveTo(na.x-x*L,na.y-D*L);d.lineTo(na.x-2*gb+x*L,na.y-2*bb+D*L);d.moveTo(na.x-gb-bb+D*L,na.y-bb+gb-x*L);d.lineTo(na.x+bb-gb-D*L,na.y-bb-gb+x*L);d.stroke()}});mxMarker.addMarker("halfCircle",function(d,n,y,q,x,D,E,ha,L,va){var na=x*(E+L+1),Va=D*(E+L+1),gb=q.clone();q.x-=na;q.y-=Va;return function(){d.begin();d.moveTo(gb.x--Va,gb.y+na);d.quadTo(q.x-Va,q.y+na,q.x,q.y);d.quadTo(q.x+Va,q.y-na,gb.x+Va,gb.y-na);d.stroke()}});mxMarker.addMarker("async",function(d,n,y,q,x,D,E,ha,L,va){n=x*L*1.118;y=D*L*1.118;x*=E+L;D*=E+L;var na=q.clone();na.x-=n;na.y-=y;q.x+=-x-n;q.y+=-D-y;return function(){d.begin();d.moveTo(na.x,na.y);ha?d.lineTo(na.x-x-D/2,na.y-D+x/2):d.lineTo(na.x+D/2-x,na.y-D-x/2);d.lineTo(na.x-x,na.y-D);d.close();va?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("openAsync",function(d){d=null!=d?d:2;return function(n,-y,q,x,D,E,ha,L,va,na){D*=ha+va;E*=ha+va;var Va=x.clone();return function(){n.begin();n.moveTo(Va.x,Va.y);L?n.lineTo(Va.x-D-E/d,Va.y-E+D/d):n.lineTo(Va.x+E/d-D,Va.y-E-D/d);n.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var db=function(d,n,y){return mb(d,["width"],n,function(q,x,D,E,ha){ha=d.shape.getEdgeWidth()*d.view.scale+y;return new mxPoint(E.x+x*q/4+D*ha/2,E.y+D*q/4-x*ha/2)},function(q,x,D,E,ha,L){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));d.style.width=Math.round(2*-q)/d.view.scale-y})},mb=function(d,n,y,q,x){return ib(d,n,function(D){var E=d.absolutePoints;if(null!=E&&0<E.length){var ha=E.length-1;D=d.view.translate;var L=d.view.scale,va=y?E[0]:E[ha];E=y?E[1]:E[ha-1];ha=E.x-va.x;var na=E.y-va.y,Va=Math.sqrt(ha*ha+na*na);va=q.call(this,Va,ha/Va,na/Va,va,E);return new mxPoint(va.x/L-D.x,va.y/L-D.y)}return null},function(D,E,ha){var L=d.absolutePoints,va=L.length-1;D=d.view.translate;var na=d.view.scale,Va=y?L[0]:L[va];L=y?L[1]:L[va-1];va=L.x-Va.x;var gb=L.y-Va.y,-bb=Math.sqrt(va*va+gb*gb);E.x=(E.x+D.x)*na;E.y=(E.y+D.y)*na;x.call(this,bb,va/bb,gb/bb,Va,L,E,ha)})},ub=function(d,n){return function(y){return[mb(y,["startWidth"],!0,function(q,x,D,E,ha){ha=mxUtils.getNumber(y.style,"startWidth",d)*y.view.scale+n;return new mxPoint(E.x+x*q/4+D*ha/2,E.y+D*q/4-x*ha/2)},function(q,x,D,E,ha,L){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));y.style.startWidth=Math.round(2*q)/y.view.scale-n})]}},eb=function(d){return function(n){return[ib(n,["arrowWidth",+n.style.shape&&y.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return y}}();mxMarker.addMarker("dash",function(d,n,y,q,x,D,E,ha,M,va){var na=x*(E+M+1),Va=D*(E+M+1);return function(){d.begin();d.moveTo(q.x-na/2-Va/2,q.y-Va/2+na/2);d.lineTo(q.x+Va/2-3*na/2,q.y-3*Va/2-na/2);d.stroke()}});mxMarker.addMarker("box",function(d,n,y,q,x,D,E,ha,M,va){var na=x*(E+M+1),Va=D*(E+M+1),gb=q.x+na/2,bb=q.y+Va/2;q.x-=na;q.y-=Va;return function(){d.begin();d.moveTo(gb-na/2-+Va/2,bb-Va/2+na/2);d.lineTo(gb-na/2+Va/2,bb-Va/2-na/2);d.lineTo(gb+Va/2-3*na/2,bb-3*Va/2-na/2);d.lineTo(gb-Va/2-3*na/2,bb-3*Va/2+na/2);d.close();va?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("cross",function(d,n,y,q,x,D,E,ha,M,va){var na=x*(E+M+1),Va=D*(E+M+1);return function(){d.begin();d.moveTo(q.x-na/2-Va/2,q.y-Va/2+na/2);d.lineTo(q.x+Va/2-3*na/2,q.y-3*Va/2-na/2);d.moveTo(q.x-na/2+Va/2,q.y-Va/2-na/2);d.lineTo(q.x-Va/2-3*na/2,q.y-3*Va/2+na/2);d.stroke()}});mxMarker.addMarker("circle",kb);+mxMarker.addMarker("circlePlus",function(d,n,y,q,x,D,E,ha,M,va){var na=q.clone(),Va=kb.apply(this,arguments),gb=x*(E+2*M),bb=D*(E+2*M);return function(){Va.apply(this,arguments);d.begin();d.moveTo(na.x-x*M,na.y-D*M);d.lineTo(na.x-2*gb+x*M,na.y-2*bb+D*M);d.moveTo(na.x-gb-bb+D*M,na.y-bb+gb-x*M);d.lineTo(na.x+bb-gb-D*M,na.y-bb-gb+x*M);d.stroke()}});mxMarker.addMarker("halfCircle",function(d,n,y,q,x,D,E,ha,M,va){var na=x*(E+M+1),Va=D*(E+M+1),gb=q.clone();q.x-=na;q.y-=Va;return function(){d.begin();d.moveTo(gb.x-+Va,gb.y+na);d.quadTo(q.x-Va,q.y+na,q.x,q.y);d.quadTo(q.x+Va,q.y-na,gb.x+Va,gb.y-na);d.stroke()}});mxMarker.addMarker("async",function(d,n,y,q,x,D,E,ha,M,va){n=x*M*1.118;y=D*M*1.118;x*=E+M;D*=E+M;var na=q.clone();na.x-=n;na.y-=y;q.x+=-x-n;q.y+=-D-y;return function(){d.begin();d.moveTo(na.x,na.y);ha?d.lineTo(na.x-x-D/2,na.y-D+x/2):d.lineTo(na.x+D/2-x,na.y-D-x/2);d.lineTo(na.x-x,na.y-D);d.close();va?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("openAsync",function(d){d=null!=d?d:2;return function(n,+y,q,x,D,E,ha,M,va,na){D*=ha+va;E*=ha+va;var Va=x.clone();return function(){n.begin();n.moveTo(Va.x,Va.y);M?n.lineTo(Va.x-D-E/d,Va.y-E+D/d):n.lineTo(Va.x+E/d-D,Va.y-E-D/d);n.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var db=function(d,n,y){return mb(d,["width"],n,function(q,x,D,E,ha){ha=d.shape.getEdgeWidth()*d.view.scale+y;return new mxPoint(E.x+x*q/4+D*ha/2,E.y+D*q/4-x*ha/2)},function(q,x,D,E,ha,M){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));d.style.width=Math.round(2*+q)/d.view.scale-y})},mb=function(d,n,y,q,x){return ib(d,n,function(D){var E=d.absolutePoints;if(null!=E&&0<E.length){var ha=E.length-1;D=d.view.translate;var M=d.view.scale,va=y?E[0]:E[ha];E=y?E[1]:E[ha-1];ha=E.x-va.x;var na=E.y-va.y,Va=Math.sqrt(ha*ha+na*na);va=q.call(this,Va,ha/Va,na/Va,va,E);return new mxPoint(va.x/M-D.x,va.y/M-D.y)}return null},function(D,E,ha){var M=d.absolutePoints,va=M.length-1;D=d.view.translate;var na=d.view.scale,Va=y?M[0]:M[va];M=y?M[1]:M[va-1];va=M.x-Va.x;var gb=M.y-Va.y,+bb=Math.sqrt(va*va+gb*gb);E.x=(E.x+D.x)*na;E.y=(E.y+D.y)*na;x.call(this,bb,va/bb,gb/bb,Va,M,E,ha)})},ub=function(d,n){return function(y){return[mb(y,["startWidth"],!0,function(q,x,D,E,ha){ha=mxUtils.getNumber(y.style,"startWidth",d)*y.view.scale+n;return new mxPoint(E.x+x*q/4+D*ha/2,E.y+D*q/4-x*ha/2)},function(q,x,D,E,ha,M){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));y.style.startWidth=Math.round(2*q)/y.view.scale-n})]}},eb=function(d){return function(n){return[ib(n,["arrowWidth","arrowSize"],function(y){var q=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Ia.prototype.arrowWidth))),x=Math.max(0,Math.min(d,mxUtils.getValue(this.state.style,"arrowSize",Ia.prototype.arrowSize)));return new mxPoint(y.x+(1-x)*y.width,y.y+(1-q)*y.height/2)},function(y,q){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(y.y+y.height/2-q.y)/y.height*2));this.state.style.arrowSize=Math.max(0,Math.min(d,(y.x+y.width-q.x)/y.width))})]}},ob=function(d){return function(n){return[ib(n,["size"],function(y){var q=Math.max(0,Math.min(.5*y.height,parseFloat(mxUtils.getValue(this.state.style,"size",d))));return new mxPoint(y.x,y.y+q)},function(y,q){this.state.style.size=Math.max(0,q.y-y.y)},!0)]}},tb=function(d,n,y){return function(q){var x=[ib(q,["size"],function(D){var E=Math.max(0,Math.min(D.width,Math.min(D.height,parseFloat(mxUtils.getValue(this.state.style,"size",n)))))*d;return new mxPoint(D.x+E,D.y+E)},function(D,E){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(D.width,-E.x-D.x),Math.min(D.height,E.y-D.y)))/d)},!1)];y&&mxUtils.getValue(q.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(xb(q));return x}},pb=function(d,n,y,q,x){y=null!=y?y:.5;return function(D){var E=[ib(D,["size"],function(ha){var L=null!=x?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,va=parseFloat(mxUtils.getValue(this.state.style,"size",L?x:d));return new mxPoint(ha.x+Math.max(0,Math.min(.5*ha.width,va*(L?1:ha.width))),ha.getCenterY())},function(ha,L,va){ha=null!=x&&"0"!=mxUtils.getValue(this.state.style,-"fixedSize","0")?L.x-ha.x:Math.max(0,Math.min(y,(L.x-ha.x)/ha.width));this.state.style.size=ha},!1,q)];n&&mxUtils.getValue(D.style,mxConstants.STYLE_ROUNDED,!1)&&E.push(xb(D));return E}},wb=function(d,n,y){d=null!=d?d:.5;return function(q){var x=[ib(q,["size"],function(D){var E=null!=y?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ha=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",E?y:n)));return new mxPoint(D.x+Math.min(.75*D.width*d,ha*(E?.75:.75*D.width)),D.y+D.height/+E.x-D.x),Math.min(D.height,E.y-D.y)))/d)},!1)];y&&mxUtils.getValue(q.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(xb(q));return x}},pb=function(d,n,y,q,x){y=null!=y?y:.5;return function(D){var E=[ib(D,["size"],function(ha){var M=null!=x?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,va=parseFloat(mxUtils.getValue(this.state.style,"size",M?x:d));return new mxPoint(ha.x+Math.max(0,Math.min(.5*ha.width,va*(M?1:ha.width))),ha.getCenterY())},function(ha,M,va){ha=null!=x&&"0"!=mxUtils.getValue(this.state.style,+"fixedSize","0")?M.x-ha.x:Math.max(0,Math.min(y,(M.x-ha.x)/ha.width));this.state.style.size=ha},!1,q)];n&&mxUtils.getValue(D.style,mxConstants.STYLE_ROUNDED,!1)&&E.push(xb(D));return E}},wb=function(d,n,y){d=null!=d?d:.5;return function(q){var x=[ib(q,["size"],function(D){var E=null!=y?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ha=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",E?y:n)));return new mxPoint(D.x+Math.min(.75*D.width*d,ha*(E?.75:.75*D.width)),D.y+D.height/4)},function(D,E){D=null!=y&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?E.x-D.x:Math.max(0,Math.min(d,(E.x-D.x)/D.width*.75));this.state.style.size=D},!1,!0)];mxUtils.getValue(q.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(xb(q));return x}},vb=function(){return function(d){var n=[];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(xb(d));return n}},xb=function(d,n){return ib(d,[mxConstants.STYLE_ARCSIZE],function(y){var q=null!=n?n:y.height/8;if("1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var x=mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(y.x+y.width-Math.min(y.width/2,x),y.y+q)}x=Math.max(0,parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(y.x+y.width-Math.min(Math.max(y.width/2,y.height/2),Math.min(y.width,y.height)*x),y.y+q)},function(y,q,x){"1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?-this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(y.width,2*(y.x+y.width-q.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(y.width-q.x+y.x)/Math.min(y.width,y.height))))})},ib=function(d,n,y,q,x,D,E){var ha=new mxHandle(d,null,mxVertexHandler.prototype.secondaryHandleImage);ha.execute=function(va){for(var na=0;na<n.length;na++)this.copyStyle(n[na]);E&&E(va)};ha.getPosition=y;ha.setPosition=q;ha.ignoreGrid=null!=x?x:!0;if(D){var L=ha.positionChanged;-ha.positionChanged=function(){L.apply(this,arguments);d.view.invalidate(this.state.cell);d.view.validate()}}return ha},hb={link:function(d){return[db(d,!0,10),db(d,!1,10)]},flexArrow:function(d){var n=d.view.graph.gridSize/d.view.scale,y=[];mxUtils.getValue(d.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(y.push(mb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(q,x,D,E,ha){q=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,-mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)+D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)-x*q/2)},function(q,x,D,E,ha,L,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,L.x,L.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*q)/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||+this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(y.width,2*(y.x+y.width-q.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(y.width-q.x+y.x)/Math.min(y.width,y.height))))})},ib=function(d,n,y,q,x,D,E){var ha=new mxHandle(d,null,mxVertexHandler.prototype.secondaryHandleImage);ha.execute=function(va){for(var na=0;na<n.length;na++)this.copyStyle(n[na]);E&&E(va)};ha.getPosition=y;ha.setPosition=q;ha.ignoreGrid=null!=x?x:!0;if(D){var M=ha.positionChanged;+ha.positionChanged=function(){M.apply(this,arguments);d.view.invalidate(this.state.cell);d.view.validate()}}return ha},hb={link:function(d){return[db(d,!0,10),db(d,!1,10)]},flexArrow:function(d){var n=d.view.graph.gridSize/d.view.scale,y=[];mxUtils.getValue(d.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(y.push(mb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(q,x,D,E,ha){q=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,+mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)+D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)-x*q/2)},function(q,x,D,E,ha,M,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*q)/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(va.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<n/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE])})),y.push(mb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(q,x,D,E,ha){q=(d.shape.getStartArrowWidth()-d.shape.strokewidth)*d.view.scale;-ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)+D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)-x*q/2)},function(q,x,D,E,ha,L,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,L.x,L.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.startWidth=Math.max(0,Math.round(2*q)-d.shape.getEdgeWidth())/+ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)+D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)-x*q/2)},function(q,x,D,E,ha,M,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.startWidth=Math.max(0,Math.round(2*q)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE],d.style.endWidth=d.style.startWidth;mxEvent.isAltDown(va.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<n/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(d.style.startWidth)-parseFloat(d.style.endWidth))<n&&(d.style.startWidth=d.style.endWidth))})));mxUtils.getValue(d.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(y.push(mb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(q,x,D,E,ha){q=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)-D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)+x*q/2)},function(q,-x,D,E,ha,L,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,L.x,L.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*q)/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(va.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<-n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE])})),y.push(mb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(q,x,D,E,ha){q=(d.shape.getEndArrowWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)-D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)+x*q/2)},function(q,x,D,E,ha,L,-va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,L.x,L.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,L.x,L.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.endWidth=Math.max(0,Math.round(2*q)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE],d.style.startWidth=d.style.endWidth;mxEvent.isAltDown(va.getEvent())||+x,D,E,ha,M,va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*q)/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(va.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<+n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE])})),y.push(mb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(q,x,D,E,ha){q=(d.shape.getEndArrowWidth()-d.shape.strokewidth)*d.view.scale;ha=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(ha+d.shape.strokewidth*d.view.scale)-D*q/2,E.y+D*(ha+d.shape.strokewidth*d.view.scale)+x*q/2)},function(q,x,D,E,ha,M,+va){q=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,ha.x,ha.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+D,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.endWidth=Math.max(0,Math.round(2*q)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE],d.style.startWidth=d.style.endWidth;mxEvent.isAltDown(va.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(d.style.endWidth)-parseFloat(d.style.startWidth))<n&&(d.style.endWidth=d.style.startWidth))})));return y},swimlane:function(d){var n=[];if(mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED)){var y=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));n.push(xb(d,y/2))}n.push(ib(d,[mxConstants.STYLE_STARTSIZE],function(q){var x=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(d.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(q.getCenterX(),q.y+Math.max(0,Math.min(q.height,x))):new mxPoint(q.x+Math.max(0,Math.min(q.width,x)),q.getCenterY())},function(q,x){d.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(q.height,x.y-q.y))):Math.round(Math.max(0,Math.min(q.width,x.x-q.x)))},!1,null,function(q){var x=d.view.graph;if(!mxEvent.isShiftDown(q.getEvent())&&!mxEvent.isControlDown(q.getEvent())&&(x.isTableRow(d.cell)||x.isTableCell(d.cell))){q=x.getSwimlaneDirection(d.style);var D=x.model.getParent(d.cell);D=x.model.getChildCells(D,!0);for(var E=[],ha=0;ha<D.length;ha++)D[ha]!=d.cell&&x.isSwimlane(D[ha])&&x.getSwimlaneDirection(x.getCurrentCellStyle(D[ha]))==q&&E.push(D[ha]);x.setCellStyles(mxConstants.STYLE_STARTSIZE,-d.style[mxConstants.STYLE_STARTSIZE],E)}}));return n},label:vb(),ext:vb(),rectangle:vb(),triangle:vb(),rhombus:vb(),umlLifeline:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",Y.prototype.size))));return new mxPoint(n.getCenterX(),n.y+y)},function(n,y){this.state.style.size=Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},umlFrame:function(d){return[ib(d,["width","height"],function(n){var y=Math.max(ba.prototype.corner,-Math.min(n.width,mxUtils.getValue(this.state.style,"width",ba.prototype.width))),q=Math.max(1.5*ba.prototype.corner,Math.min(n.height,mxUtils.getValue(this.state.style,"height",ba.prototype.height)));return new mxPoint(n.x+y,n.y+q)},function(n,y){this.state.style.width=Math.round(Math.max(ba.prototype.corner,Math.min(n.width,y.x-n.x)));this.state.style.height=Math.round(Math.max(1.5*ba.prototype.corner,Math.min(n.height,y.y-n.y)))},!1)]},process:function(d){var n=[ib(d,["size"],function(y){var q=-"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),x=parseFloat(mxUtils.getValue(this.state.style,"size",S.prototype.size));return q?new mxPoint(y.x+x,y.y+y.height/4):new mxPoint(y.x+y.width*x,y.y+y.height/4)},function(y,q){y="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*y.width,q.x-y.x)):Math.max(0,Math.min(.5,(q.x-y.x)/y.width));this.state.style.size=y},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(xb(d));return n},cross:function(d){return[ib(d,+d.style[mxConstants.STYLE_STARTSIZE],E)}}));return n},label:vb(),ext:vb(),rectangle:vb(),triangle:vb(),rhombus:vb(),umlLifeline:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",Y.prototype.size))));return new mxPoint(n.getCenterX(),n.y+y)},function(n,y){this.state.style.size=Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},umlFrame:function(d){return[ib(d,["width","height"],function(n){var y=Math.max(ca.prototype.corner,+Math.min(n.width,mxUtils.getValue(this.state.style,"width",ca.prototype.width))),q=Math.max(1.5*ca.prototype.corner,Math.min(n.height,mxUtils.getValue(this.state.style,"height",ca.prototype.height)));return new mxPoint(n.x+y,n.y+q)},function(n,y){this.state.style.width=Math.round(Math.max(ca.prototype.corner,Math.min(n.width,y.x-n.x)));this.state.style.height=Math.round(Math.max(1.5*ca.prototype.corner,Math.min(n.height,y.y-n.y)))},!1)]},process:function(d){var n=[ib(d,["size"],function(y){var q=+"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),x=parseFloat(mxUtils.getValue(this.state.style,"size",V.prototype.size));return q?new mxPoint(y.x+x,y.y+y.height/4):new mxPoint(y.x+y.width*x,y.y+y.height/4)},function(y,q){y="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*y.width,q.x-y.x)):Math.max(0,Math.min(.5,(q.x-y.x)/y.width));this.state.style.size=y},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(xb(d));return n},cross:function(d){return[ib(d,["size"],function(n){var y=Math.min(n.width,n.height);y=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Za.prototype.size)))*y/2;return new mxPoint(n.getCenterX()-y,n.getCenterY()-y)},function(n,y){var q=Math.min(n.width,n.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,n.getCenterY()-y.y)/q*2,Math.max(0,n.getCenterX()-y.x)/q*2)))})]},note:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(n.width,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",F.prototype.size)))));return new mxPoint(n.x+n.width-y,n.y+y)},function(n,y){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(n.width,n.x+n.width-y.x),Math.min(n.height,y.y-n.y))))})]},note2:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(n.width,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",P.prototype.size)))));return new mxPoint(n.x+n.width-y,n.y+y)},function(n,y){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(n.width,n.x+n.width-y.x),Math.min(n.height,y.y-n.y))))})]},manualInput:function(d){var n=[ib(d,["size"],function(y){var q=Math.max(0,Math.min(y.height,mxUtils.getValue(this.state.style,"size",Ea.prototype.size)));return new mxPoint(y.x+y.width/4,y.y+3*q/4)},function(y,q){this.state.style.size=Math.round(Math.max(0,Math.min(y.height,4*(q.y-y.y)/3)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(xb(d));return n},dataStorage:function(d){return[ib(d,["size"],function(n){var y="0"!=mxUtils.getValue(this.state.style,@@ -2908,15 +2908,15 @@ Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",ma.prototypeq=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"dy",Ma.prototype.dy)));return new mxPoint(n.x+y,n.y+q)},function(n,y){this.state.style.dx=Math.round(Math.max(0,Math.min(n.width,y.x-n.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},tee:function(d){return[ib(d,["dx","dy"],function(n){var y=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"dx",Wa.prototype.dx))),q=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"dy",Wa.prototype.dy)));return new mxPoint(n.x+(n.width+y)/2,n.y+q)},function(n,y){this.state.style.dx=Math.round(Math.max(0,2*Math.min(n.width/2,y.x-n.x-n.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},singleArrow:eb(1),doubleArrow:eb(.5),"mxgraph.arrows2.wedgeArrow":ub(20,20),"mxgraph.arrows2.wedgeArrowDashed":ub(20,20),"mxgraph.arrows2.wedgeArrowDashed2":ub(20,20),folder:function(d){return[ib(d,["tabWidth","tabHeight"],function(n){var y=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"tabWidth",k.prototype.tabWidth))),q=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"tabHeight",k.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",k.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(y=n.width-y);return new mxPoint(n.x+y,n.y+q)},function(n,y){var q=Math.max(0,Math.min(n.width,y.x-n.x));mxUtils.getValue(this.state.style,"tabPosition",k.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(q=n.width-q);this.state.style.tabWidth=Math.round(q);this.state.style.tabHeight=-Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},document:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",H.prototype.size))));return new mxPoint(n.x+3*n.width/4,n.y+(1-y)*n.height)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-y.y)/n.height))},!1)]},tape:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",C.prototype.size))));-return new mxPoint(n.getCenterX(),n.y+y*n.height/2)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(y.y-n.y)/n.height*2))},!1)]},isoCube2:function(d){return[ib(d,["isoAngle"],function(n){var y=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",Q.isoAngle))))*Math.PI/200;return new mxPoint(n.x,n.y+Math.min(n.width*Math.tan(y),.5*n.height))},function(n,y){this.state.style.isoAngle=Math.max(0,50*(y.y-n.y)/n.height)},!0)]},cylinder2:ob(U.prototype.size),cylinder3:ob(c.prototype.size),+Math.round(Math.max(0,Math.min(n.height,y.y-n.y)))},!1)]},document:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",I.prototype.size))));return new mxPoint(n.x+3*n.width/4,n.y+(1-y)*n.height)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-y.y)/n.height))},!1)]},tape:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",C.prototype.size))));+return new mxPoint(n.getCenterX(),n.y+y*n.height/2)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(y.y-n.y)/n.height*2))},!1)]},isoCube2:function(d){return[ib(d,["isoAngle"],function(n){var y=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",Q.isoAngle))))*Math.PI/200;return new mxPoint(n.x,n.y+Math.min(n.width*Math.tan(y),.5*n.height))},function(n,y){this.state.style.isoAngle=Math.max(0,50*(y.y-n.y)/n.height)},!0)]},cylinder2:ob(T.prototype.size),cylinder3:ob(c.prototype.size),offPageConnector:function(d){return[ib(d,["size"],function(n){var y=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",X.prototype.size))));return new mxPoint(n.getCenterX(),n.y+(1-y)*n.height)},function(n,y){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-y.y)/n.height))},!1)]},"mxgraph.basic.rect":function(d){var n=[Graph.createHandle(d,["size"],function(y){var q=Math.max(0,Math.min(y.width/2,y.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(y.x+q,y.y+q)},function(y,q){this.state.style.size=Math.round(100*Math.max(0,Math.min(y.height/2,y.width/2,q.x-y.x)))/100})];d=Graph.createHandle(d,["indent"],function(y){var q=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(y.x+.75*y.width,y.y+q*y.height/200)},function(y,q){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(q.y-y.y)/y.height)))/100});n.push(d);return n},step:pb(la.prototype.size,!0,null,-!0,la.prototype.fixedSize),hexagon:pb(Z.prototype.size,!0,.5,!0,Z.prototype.fixedSize),curlyBracket:pb(O.prototype.size,!1),display:pb(ab.prototype.size,!1),cube:tb(1,m.prototype.size,!1),card:tb(.5,z.prototype.size,!0),loopLimit:tb(.5,R.prototype.size,!0),trapezoid:wb(.5,M.prototype.size,M.prototype.fixedSize),parallelogram:wb(1,K.prototype.size,K.prototype.fixedSize)};Graph.createHandle=ib;Graph.handleFactory=hb;var Bb=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=+!0,la.prototype.fixedSize),hexagon:pb(Z.prototype.size,!0,.5,!0,Z.prototype.fixedSize),curlyBracket:pb(O.prototype.size,!1),display:pb(ab.prototype.size,!1),cube:tb(1,m.prototype.size,!1),card:tb(.5,z.prototype.size,!0),loopLimit:tb(.5,R.prototype.size,!0),trapezoid:wb(.5,J.prototype.size,J.prototype.fixedSize),parallelogram:wb(1,L.prototype.size,L.prototype.fixedSize)};Graph.createHandle=ib;Graph.handleFactory=hb;var Bb=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var d=Bb.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var n=this.state.style.shape;null==mxCellRenderer.defaultShapes[n]&&null==mxStencilRegistry.getStencil(n)?n=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(n=mxConstants.SHAPE_SWIMLANE);n=hb[n];null==n&&null!=this.state.shape&&this.state.shape.isRoundable()&&(n=hb[mxConstants.SHAPE_RECTANGLE]);null!=n&&(n=n(this.state),null!=n&&(d=null==d?n:d.concat(n)))}return d};mxEdgeHandler.prototype.createCustomHandles=function(){var d=this.state.style.shape;null==mxCellRenderer.defaultShapes[d]&&null==mxStencilRegistry.getStencil(d)&&(d=mxConstants.SHAPE_CONNECTOR);d=hb[d];return null!=d?d(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var rb=new mxPoint(1,0),yb=new mxPoint(1,0),zb=mxUtils.toRadians(-30);rb=mxUtils.getRotatedPoint(rb,Math.cos(zb),Math.sin(zb));var qb=mxUtils.toRadians(-150);yb=mxUtils.getRotatedPoint(yb,Math.cos(qb),Math.sin(qb));mxEdgeStyle.IsometricConnector=function(d,-n,y,q,x){var D=d.view;q=null!=q&&0<q.length?q[0]:null;var E=d.absolutePoints,ha=E[0];E=E[E.length-1];null!=q&&(q=D.transformControlPoint(d,q));null==ha&&null!=n&&(ha=new mxPoint(n.getCenterX(),n.getCenterY()));null==E&&null!=y&&(E=new mxPoint(y.getCenterX(),y.getCenterY()));var L=rb.x,va=rb.y,na=yb.x,Va=yb.y,gb="horizontal"==mxUtils.getValue(d.style,"elbow","horizontal");if(null!=E&&null!=ha){d=function(Fa,Ja,Ha){Fa-=bb.x;var Ga=Ja-bb.y;Ja=(Va*Fa-na*Ga)/(L*Va-va*na);Fa=(va*Fa-L*Ga)/(va*na-L*Va);gb?-(Ha&&(bb=new mxPoint(bb.x+L*Ja,bb.y+va*Ja),x.push(bb)),bb=new mxPoint(bb.x+na*Fa,bb.y+Va*Fa)):(Ha&&(bb=new mxPoint(bb.x+na*Fa,bb.y+Va*Fa),x.push(bb)),bb=new mxPoint(bb.x+L*Ja,bb.y+va*Ja));x.push(bb)};var bb=ha;null==q&&(q=new mxPoint(ha.x+(E.x-ha.x)/2,ha.y+(E.y-ha.y)/2));d(q.x,q.y,!0);d(E.x,E.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Cb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(d,n){if(n==mxEdgeStyle.IsometricConnector){var y=+n,y,q,x){var D=d.view;q=null!=q&&0<q.length?q[0]:null;var E=d.absolutePoints,ha=E[0];E=E[E.length-1];null!=q&&(q=D.transformControlPoint(d,q));null==ha&&null!=n&&(ha=new mxPoint(n.getCenterX(),n.getCenterY()));null==E&&null!=y&&(E=new mxPoint(y.getCenterX(),y.getCenterY()));var M=rb.x,va=rb.y,na=yb.x,Va=yb.y,gb="horizontal"==mxUtils.getValue(d.style,"elbow","horizontal");if(null!=E&&null!=ha){d=function(Fa,Ja,Ha){Fa-=bb.x;var Ga=Ja-bb.y;Ja=(Va*Fa-na*Ga)/(M*Va-va*na);Fa=(va*Fa-M*Ga)/(va*na-M*Va);gb?+(Ha&&(bb=new mxPoint(bb.x+M*Ja,bb.y+va*Ja),x.push(bb)),bb=new mxPoint(bb.x+na*Fa,bb.y+Va*Fa)):(Ha&&(bb=new mxPoint(bb.x+na*Fa,bb.y+Va*Fa),x.push(bb)),bb=new mxPoint(bb.x+M*Ja,bb.y+va*Ja));x.push(bb)};var bb=ha;null==q&&(q=new mxPoint(ha.x+(E.x-ha.x)/2,ha.y+(E.y-ha.y)/2));d(q.x,q.y,!0);d(E.x,E.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Cb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(d,n){if(n==mxEdgeStyle.IsometricConnector){var y=new mxElbowEdgeHandler(d);y.snapToTerminals=!1;return y}return Cb.apply(this,arguments)};A.prototype.constraints=[];G.prototype.getConstraints=function(d,n,y){d=[];var q=Math.tan(mxUtils.toRadians(30)),x=(.5-q)/2;q=Math.min(n,y/(.5+q));n=(n-q)/2;y=(y-q)/2;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,y+.25*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+.5*q,y+q*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+q,y+.25*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+q,y+.75*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+.5*q,y+(1-x)*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,y+.75*q));return d};Q.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;q=Math.min(n*Math.tan(q),.5*y);d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,q));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,y-q));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,y-q));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,q));return d};ma.prototype.getConstraints=function(d,n,y){d=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var q=Math.max(0,Math.min(y,parseFloat(mxUtils.getValue(this.style,@@ -2924,7 +2924,7 @@ new mxElbowEdgeHandler(d);y.snapToTerminals=!1;return y}return Cb.apply(this,arg0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(y-q)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,y-q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,y));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,y-q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(y-q)));n>=2*q&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,-0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Ca.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;da.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;F.prototype.getConstraints=+0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Ca.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;ea.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;F.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(0,Math.min(n,Math.min(y,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-q),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-q,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-.5*q,.5*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(y+q)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));n>=2*q&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};z.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(0,Math.min(n,Math.min(y,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+q),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*q,.5*q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(y+q)));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,@@ -2952,7 +2952,7 @@ mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),n[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,-.25),!1)];K.prototype.constraints=mxRectangleShape.prototype.constraints;M.prototype.constraints=mxRectangleShape.prototype.constraints;H.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),+.25),!1)];L.prototype.constraints=mxRectangleShape.prototype.constraints;J.prototype.constraints=mxRectangleShape.prototype.constraints;I.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;Wa.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(y,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*n+.25*q,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+q),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+q),.5*(y+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+q),y));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-q),y));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-q),.5*(y+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-q),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*n-.25*q,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*x));return d};Ma.prototype.getConstraints=function(d,n,y){d=[];var q=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,@@ -2967,19 +2967,19 @@ mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),n0),!1,null,.5*(n+x),D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,q));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,q));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,q));return d};Y.prototype.constraints=null;u.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];N.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ra.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}-Actions.prototype.init=function(){function b(F){p.escape();F=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),F);null!=F&&p.setSelectionCells(F)}function e(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),P=0;P<F.length;P++)p.cellLabelChanged(F[P],"")}finally{p.getModel().endUpdate()}}}function g(F,P,Q,U,c){c.getModel().beginUpdate();try{var f=c.getCellGeometry(F);null!=f&&Q&&U&&(Q/=U,f=f.clone(),1<Q?f.height=f.width/Q:f.width=f.height*Q,c.getModel().setGeometry(F,+Actions.prototype.init=function(){function b(F){p.escape();F=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),F);null!=F&&p.setSelectionCells(F)}function e(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),P=0;P<F.length;P++)p.cellLabelChanged(F[P],"")}finally{p.getModel().endUpdate()}}}function g(F,P,Q,T,c){c.getModel().beginUpdate();try{var f=c.getCellGeometry(F);null!=f&&Q&&T&&(Q/=T,f=f.clone(),1<Q?f.height=f.width/Q:f.width=f.height*Q,c.getModel().setGeometry(F,f));c.setCellStyles(mxConstants.STYLE_CLIP_PATH,P,[F]);c.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[F])}finally{c.getModel().endUpdate()}}var m=this.editorUi,v=m.editor,p=v.graph,A=function(){return Action.prototype.isEnabled.apply(this,arguments)&&p.isEnabled()};this.addAction("new...",function(){p.openLink(m.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";m.openFile()});this.put("smartFit",new Action(mxResources.get("fitWindow")+" / "+mxResources.get("resetView"),-function(){p.popupMenuHandler.hideMenu();var F=p.view.scale,P=p.container.scrollLeft,Q=p.container.scrollTop,U=p.view.translate.x,c=p.view.translate.y;m.actions.get("resetView").funct();1E-5>Math.abs(F-p.view.scale)&&5>Math.abs(P-p.container.scrollLeft)&&5>Math.abs(Q-p.container.scrollTop)&&U==p.view.translate.x&&c==p.view.translate.y&&m.actions.get("fitWindow").funct()},null,null,"Enter"));this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?m.actions.get("smartFit").funct():p.isEnabled()&&-p.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){m.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(F,P){try{var Q=mxUtils.parseXml(F);v.graph.setSelectionCells(v.graph.importGraphModel(Q.documentElement))}catch(U){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+U.message)}}));m.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=+function(){p.popupMenuHandler.hideMenu();var F=p.view.scale,P=p.container.scrollLeft,Q=p.container.scrollTop,T=p.view.translate.x,c=p.view.translate.y;m.actions.get("resetView").funct();1E-5>Math.abs(F-p.view.scale)&&5>Math.abs(P-p.container.scrollLeft)&&5>Math.abs(Q-p.container.scrollTop)&&T==p.view.translate.x&&c==p.view.translate.y&&m.actions.get("fitWindow").funct()},null,null,"Enter"));this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?m.actions.get("smartFit").funct():p.isEnabled()&&+p.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){m.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(F,P){try{var Q=mxUtils.parseXml(F);v.graph.setSelectionCells(v.graph.importGraphModel(Q.documentElement))}catch(T){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+T.message)}}));m.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=A;this.addAction("save",function(){m.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=A;this.addAction("saveAs...",function(){m.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S");this.addAction("export...",function(){m.showDialog((new ExportDialog(m)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var F=new EditDiagramDialog(m);m.showDialog(F.container,620,420,!0,!1);F.init()}).isEnabled=A;this.addAction("pageSetup...",function(){m.showDialog((new PageSetupDialog(m)).container,320,240,!0,!0)}).isEnabled=A;this.addAction("print...",function(){m.showPrintDialog()},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(p,null,10,10)});this.addAction("undo",function(){m.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){m.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){var F=null;try{F=m.copyXml(),null!=F&&p.removeCells(F,!1)}catch(P){}try{null==F&&mxClipboard.cut(p)}catch(P){m.handleError(P)}},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{m.copyXml()}catch(F){}try{mxClipboard.copy(p)}catch(F){m.handleError(F)}},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(P){if(null!=P){p.getModel().beginUpdate();try{m.pasteXml(P,!0)}finally{p.getModel().endUpdate()}}else mxClipboard.paste(p)}),-F=!0)}catch(P){}F||mxClipboard.paste(p)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(F){function P(U){if(null!=U){for(var c=!0,f=0;f<U.length&&c;f++)c=c&&p.model.isEdge(U[f]);var k=p.view.translate;f=p.view.scale;var B=k.x,z=k.y;k=null;if(1==U.length&&c){var C=p.getCellGeometry(U[0]);null!=C&&(k=C.getTerminalPoint(!0))}k=null!=k?k:p.getBoundingBoxFromGeometry(U,c);null!=k&&(c=Math.round(p.snap(p.popupMenuHandler.triggerX/f-B)),f=Math.round(p.snap(p.popupMenuHandler.triggerY/-f-z)),p.cellsMoved(U,c-k.x,f-k.y))}}function Q(){p.getModel().beginUpdate();try{P(mxClipboard.paste(p))}finally{p.getModel().endUpdate()}}if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(U){if(null!=U){p.getModel().beginUpdate();try{P(m.pasteXml(U,!0))}finally{p.getModel().endUpdate()}}else Q()}),F=!0)}catch(U){}F||Q()}});this.addAction("swap",function(){var F=p.getSelectionCells();2==F.length&&p.swapShapes(F[0],+F=!0)}catch(P){}F||mxClipboard.paste(p)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(F){function P(T){if(null!=T){for(var c=!0,f=0;f<T.length&&c;f++)c=c&&p.model.isEdge(T[f]);var k=p.view.translate;f=p.view.scale;var B=k.x,z=k.y;k=null;if(1==T.length&&c){var C=p.getCellGeometry(T[0]);null!=C&&(k=C.getTerminalPoint(!0))}k=null!=k?k:p.getBoundingBoxFromGeometry(T,c);null!=k&&(c=Math.round(p.snap(p.popupMenuHandler.triggerX/f-B)),f=Math.round(p.snap(p.popupMenuHandler.triggerY/+f-z)),p.cellsMoved(T,c-k.x,f-k.y))}}function Q(){p.getModel().beginUpdate();try{P(mxClipboard.paste(p))}finally{p.getModel().endUpdate()}}if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(T){if(null!=T){p.getModel().beginUpdate();try{P(m.pasteXml(T,!0))}finally{p.getModel().endUpdate()}}else Q()}),F=!0)}catch(T){}F||Q()}});this.addAction("swap",function(){var F=p.getSelectionCells();2==F.length&&p.swapShapes(F[0],F[1])});this.addAction("copySize",function(){var F=p.getSelectionCell();p.isEnabled()&&null!=F&&p.getModel().isVertex(F)&&(F=p.getCellGeometry(F),null!=F&&(m.copiedSize=new mxRectangle(F.x,F.y,F.width,F.height)))},null,null,"Alt+Shift+F");this.addAction("pasteSize",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedSize){p.getModel().beginUpdate();try{for(var F=p.getResizableCells(p.getSelectionCells()),P=0;P<F.length;P++)if(p.getModel().isVertex(F[P])){var Q=p.getCellGeometry(F[P]);null!=Q&&(Q=Q.clone(),Q.width=m.copiedSize.width,Q.height=m.copiedSize.height,p.getModel().setGeometry(F[P],Q))}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+V");this.addAction("copyData",function(){var F=p.getSelectionCell()||p.getModel().getRoot();p.isEnabled()&&null!=F&&(F=F.cloneValue(),null==F||isNaN(F.nodeType)||(m.copiedValue=F))},null,null,"Alt+Shift+B");this.addAction("copyAsText",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F)try{p.isHtmlLabel(F)?m.writeHtmlToClipboard(p.getLabel(F),-mxUtils.bind(this,function(P){m.handleError(P)})):m.writeTextToClipboard(p.getLabel(F),mxUtils.bind(this,function(P){m.handleError(P)}))}catch(P){m.handleError(P)}});this.addAction("pasteData",function(F,P){function Q(f,k){var B=U.getValue(f);k=f.cloneValue(k);k.removeAttribute("placeholders");null==B||isNaN(B.nodeType)||k.setAttribute("placeholders",B.getAttribute("placeholders"));null!=F&&mxEvent.isShiftDown(F)||k.setAttribute("label",p.convertValueToString(f));U.setValue(f,k)}F=null!=P?P:F;var U=-p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedValue){U.beginUpdate();try{var c=p.getEditableCells(p.getSelectionCells());if(0==c.length)Q(U.getRoot(),m.copiedValue);else for(P=0;P<c.length;P++)Q(c[P],m.copiedValue)}finally{U.endUpdate()}}},null,null,"Alt+Shift+E");this.addAction("delete",function(F,P){F=null!=P?P:F;null!=F&&mxEvent.isShiftDown(F)?e():b(null!=F&&(mxEvent.isControlDown(F)||mxEvent.isMetaDown(F)||mxEvent.isAltDown(F)))},null,null,"Delete");this.addAction("deleteAll",+mxUtils.bind(this,function(P){m.handleError(P)})):m.writeTextToClipboard(p.getLabel(F),mxUtils.bind(this,function(P){m.handleError(P)}))}catch(P){m.handleError(P)}});this.addAction("pasteData",function(F,P){function Q(f,k){var B=T.getValue(f);k=f.cloneValue(k);k.removeAttribute("placeholders");null==B||isNaN(B.nodeType)||k.setAttribute("placeholders",B.getAttribute("placeholders"));null!=F&&mxEvent.isShiftDown(F)||k.setAttribute("label",p.convertValueToString(f));T.setValue(f,k)}F=null!=P?P:F;var T=+p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedValue){T.beginUpdate();try{var c=p.getEditableCells(p.getSelectionCells());if(0==c.length)Q(T.getRoot(),m.copiedValue);else for(P=0;P<c.length;P++)Q(c[P],m.copiedValue)}finally{T.endUpdate()}}},null,null,"Alt+Shift+E");this.addAction("delete",function(F,P){F=null!=P?P:F;null!=F&&mxEvent.isShiftDown(F)?e():b(null!=F&&(mxEvent.isControlDown(F)||mxEvent.isMetaDown(F)||mxEvent.isAltDown(F)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){e()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{p.setSelectionCells(p.duplicateCells()),p.scrollCellToVisible(p.getSelectionCell())}catch(F){m.handleError(F)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action(mxResources.get("merge"),function(){var F=m.getSelectionState();if(null!=F.mergeCell){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",F.rowspan,[F.mergeCell]),p.setCellStyles("colspan",F.colspan,[F.mergeCell])}finally{p.getModel().endUpdate()}}}));this.put("unmergeCells",new Action(mxResources.get("unmerge"),function(){var F=m.getSelectionState();if(0<F.cells.length){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",null,F.cells),p.setCellStyles("colspan",null,F.cells)}finally{p.getModel().endUpdate()}}}));this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(F,P){F=null!=P?P:F;p.turnShapes(p.getResizableCells(p.getSelectionCells()),null!=F?mxEvent.isShiftDown(F):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R"));this.put("selectConnections",new Action(mxResources.get("selectEdges"),function(F){F=p.getSelectionCell();p.isEnabled()&&null!=F&&p.addSelectionCells(p.getEdges(F))}));this.addAction("selectVertices",function(){p.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){p.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){p.selectAll(null,@@ -2989,14 +2989,14 @@ null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){pfunction(F){p.orderCells(!1,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(F){p.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("group",function(){if(p.isEnabled()){var F=mxUtils.sortCells(p.getSelectionCells(),!0);1!=F.length||p.isTable(F[0])||p.isTableRow(F[0])?(F=p.getCellsForGroup(F),1<F.length&&p.setSelectionCell(p.groupCells(null,0,F))):p.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(p.isEnabled()){var F=p.getEditableCells(p.getSelectionCells());p.model.beginUpdate();try{var P=p.ungroupCells();if(null!=F)for(var Q=0;Q<F.length;Q++)p.model.contains(F[Q])&&(0==p.model.getChildCount(F[Q])&&p.model.isVertex(F[Q])&&p.setCellStyles("container","0",[F[Q]]),P.push(F[Q]))}finally{p.model.endUpdate()}0<P.length&&p.setSelectionCells(P)}},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){if(p.isEnabled()){var F=p.getSelectionCells();if(null!=F){for(var P=[],Q=0;Q<F.length;Q++)p.isTableRow(F[Q])||p.isTableCell(F[Q])||P.push(F[Q]);p.removeCellsFromParent(P);0<P.length&&p.scrollCellToVisible(P[0])}}});this.addAction("edit",function(){p.isEnabled()&&p.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var F=p.getSelectionCell()||p.getModel().getRoot();m.showDataDialog(F)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var P=-"";if(mxUtils.isNode(F.value)){var Q=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&F.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(Q=F.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==Q&&(Q=F.value.getAttribute("tooltip"));null!=Q&&(P=Q)}P=new TextareaDialog(m,mxResources.get("editTooltip")+":",P,function(U){p.setTooltipForCell(F,U)});m.showDialog(P.container,320,200,!0,!0);P.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var F=p.getLinkForCell(p.getSelectionCell());-null!=F&&p.openLink(F)});this.addAction("editLink...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var P=p.getLinkForCell(F,!0)||"";m.showLinkDialog(P,mxResources.get("ok"),function(Q,U,c){p.getModel().beginUpdate();try{p.setLinkForCell(F,0<Q.length?Q:null),p.setAttributeForCell(F,"linkTarget",c)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(F))}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){p.isEnabled()&&-!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),m.actions.get("image").funct())})).isEnabled=A;this.addAction("editImage...",function(){m.actions.get("image").funct()});this.put("insertLink",new Action(mxResources.get("link")+"...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&m.showLinkDialog("",mxResources.get("ok"),function(F,P,Q){F=mxUtils.trim(F);if(0<F.length){var U=null,c=p.getLinkTitle(F);null!=P&&0<P.length&&(U=P[0].iconUrl,c=P[0].name||P[0].type,c=c.charAt(0).toUpperCase()+-c.substring(1),30<c.length&&(c=c.substring(0,30)+"..."));P=new mxCell(c,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=U?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+U:"spacing=10;"));P.vertex=!0;U=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([P],!0));P.geometry.x=U.x;P.geometry.y=U.y;p.setAttributeForCell(P,"linkTarget",Q);p.setLinkForCell(P,F);p.cellSizeUpdated(P,!0);p.getModel().beginUpdate();try{P=p.addCell(P),-p.fireEvent(new mxEventObject("cellsInserted","cells",[P]))}finally{p.getModel().endUpdate()}p.setSelectionCell(P);p.scrollCellToVisible(p.getSelectionCell())}},!0)},null,null,"L")).isEnabled=A;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var F=p.getSelectedElement(),P=p.getParentByName(F,"A",p.cellEditor.textarea),Q="";if(null==P&&null!=F&&null!=F.getElementsByTagName)for(var U=F.getElementsByTagName("a"),c=0;c<U.length&&null==P;c++)U[c].textContent==-F.textContent&&(P=U[c]);null!=P&&"A"==P.nodeName&&(Q=P.getAttribute("href")||"",p.selectNode(P));var f=p.cellEditor.saveSelection();m.showLinkDialog(Q,mxResources.get("ok"),mxUtils.bind(this,function(k){p.cellEditor.restoreSelection(f);null!=k&&p.insertLink(k)}))}else p.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=A;this.addAction("autosize",function(){var F=p.getSelectionCells();if(null!=F){p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=+"";if(mxUtils.isNode(F.value)){var Q=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&F.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(Q=F.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==Q&&(Q=F.value.getAttribute("tooltip"));null!=Q&&(P=Q)}P=new TextareaDialog(m,mxResources.get("editTooltip")+":",P,function(T){p.setTooltipForCell(F,T)});m.showDialog(P.container,320,200,!0,!0);P.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var F=p.getLinkForCell(p.getSelectionCell());+null!=F&&p.openLink(F)});this.addAction("editLink...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var P=p.getLinkForCell(F,!0)||"";m.showLinkDialog(P,mxResources.get("ok"),function(Q,T,c){p.getModel().beginUpdate();try{p.setLinkForCell(F,0<Q.length?Q:null),p.setAttributeForCell(F,"linkTarget",c)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(F))}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){p.isEnabled()&&+!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),m.actions.get("image").funct())})).isEnabled=A;this.addAction("editImage...",function(){m.actions.get("image").funct()});this.put("insertLink",new Action(mxResources.get("link")+"...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&m.showLinkDialog("",mxResources.get("ok"),function(F,P,Q){F=mxUtils.trim(F);if(0<F.length){var T=null,c=p.getLinkTitle(F);null!=P&&0<P.length&&(T=P[0].iconUrl,c=P[0].name||P[0].type,c=c.charAt(0).toUpperCase()++c.substring(1),30<c.length&&(c=c.substring(0,30)+"..."));P=new mxCell(c,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=T?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+T:"spacing=10;"));P.vertex=!0;T=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([P],!0));P.geometry.x=T.x;P.geometry.y=T.y;p.setAttributeForCell(P,"linkTarget",Q);p.setLinkForCell(P,F);p.cellSizeUpdated(P,!0);p.getModel().beginUpdate();try{P=p.addCell(P),+p.fireEvent(new mxEventObject("cellsInserted","cells",[P]))}finally{p.getModel().endUpdate()}p.setSelectionCell(P);p.scrollCellToVisible(p.getSelectionCell())}},!0)},null,null,"L")).isEnabled=A;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var F=p.getSelectedElement(),P=p.getParentByName(F,"A",p.cellEditor.textarea),Q="";if(null==P&&null!=F&&null!=F.getElementsByTagName)for(var T=F.getElementsByTagName("a"),c=0;c<T.length&&null==P;c++)T[c].textContent==+F.textContent&&(P=T[c]);null!=P&&"A"==P.nodeName&&(Q=P.getAttribute("href")||"",p.selectNode(P));var f=p.cellEditor.saveSelection();m.showLinkDialog(Q,mxResources.get("ok"),mxUtils.bind(this,function(k){p.cellEditor.restoreSelection(f);null!=k&&p.insertLink(k)}))}else p.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=A;this.addAction("autosize",function(){var F=p.getSelectionCells();if(null!=F){p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=F[P];p.getModel().isVertex(Q)&&(0<p.getModel().getChildCount(Q)?p.updateGroupBounds([Q],0,!0):p.updateCellSize(Q))}}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("snapToGrid",function(){p.snapCellsToGrid(p.getSelectionCells(),p.gridSize)});this.addAction("formattedText",function(){p.stopEditing();var F=p.getCommonStyle(p.getSelectionCells());F="1"==mxUtils.getValue(F,"html","0")?null:"1";p.getModel().beginUpdate();try{for(var P=p.getEditableCells(p.getSelectionCells()),-Q=0;Q<P.length;Q++)if(state=p.getView().getState(P[Q]),null!=state){var U=mxUtils.getValue(state.style,"html","0");if("1"==U&&null==F)p.removeTextStyleForCell(state.cell),p.setCellStyles("html",F,[P[Q]]);else if("0"==U&&"1"==F){var c=mxUtils.htmlEntities(p.convertValueToString(state.cell),!1);"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>"));p.cellLabelChanged(state.cell,Graph.sanitizeHtml(c));p.setCellStyles("html",F,[P[Q]])}}m.fireEvent(new mxEventObject("styleChanged",+Q=0;Q<P.length;Q++)if(state=p.getView().getState(P[Q]),null!=state){var T=mxUtils.getValue(state.style,"html","0");if("1"==T&&null==F)p.removeTextStyleForCell(state.cell),p.setCellStyles("html",F,[P[Q]]);else if("0"==T&&"1"==F){var c=mxUtils.htmlEntities(p.convertValueToString(state.cell),!1);"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>"));p.cellLabelChanged(state.cell,Graph.sanitizeHtml(c));p.setCellStyles("html",F,[P[Q]])}}m.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=F?F:"0"],"cells",P))}finally{p.getModel().endUpdate()}});this.addAction("wordWrap",function(){var F=p.getView().getState(p.getSelectionCell()),P="wrap";p.stopEditing();null!=F&&"wrap"==F.style[mxConstants.STYLE_WHITE_SPACE]&&(P=null);p.setCellStyles(mxConstants.STYLE_WHITE_SPACE,P)});this.addAction("rotation",function(){var F="0",P=p.getView().getState(p.getSelectionCell());null!=P&&(F=P.style[mxConstants.STYLE_ROTATION]||F);F=new FilenameDialog(m,F,mxResources.get("apply"),function(Q){null!=Q&&0<Q.length&&p.setCellStyles(mxConstants.STYLE_ROTATION,Q)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");m.showDialog(F.container,375,80,!0,!0);F.init()});this.addAction("resetView",function(){p.zoomTo(1);m.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(F){p.isFastZoomEnabled()?p.lazyZoom(!0,!0,m.buttonZoomDelay):p.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(F){p.isFastZoomEnabled()?p.lazyZoom(!1,!0,m.buttonZoomDelay):p.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){p.pageVisible&&p.isSelectionEmpty()?p.fitPages():m.fitDiagramToWindow()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(2):this.get("pageView").funct()}),@@ -3007,9 +3007,9 @@ G.setEnabled(!1);G=this.addAction("animations",function(){Editor.enableAnimationG=this.addAction("collapseExpand",function(){var F=new ChangePageSetup(m);F.ignoreColor=!0;F.ignoreImage=!0;F.foldingEnabled=!p.foldingEnabled;p.model.execute(F)});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.foldingEnabled});G.isEnabled=A;G=this.addAction("pageView",mxUtils.bind(this,function(){m.setPageVisible(!p.pageVisible)}));G.setToggleAction(!0);G.setSelectedCallback(function(){return p.pageVisible});G=this.addAction("connectionArrows",function(){p.connectionArrowsEnabled=!p.connectionArrowsEnabled;m.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionArrowsEnabled});G=this.addAction("connectionPoints",function(){p.setConnectable(!p.connectionHandler.isEnabled());m.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+O");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionHandler.isEnabled()});G=this.addAction("copyConnect",function(){p.connectionHandler.setCreateTarget(!p.connectionHandler.isCreateTarget());m.fireEvent(new mxEventObject("copyConnectChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionHandler.isCreateTarget()});G.isEnabled=A;G=this.addAction("autosave",function(){m.editor.setAutosave(!m.editor.autosave)});G.setToggleAction(!0);G.setSelectedCallback(function(){return m.editor.autosave});G.isEnabled=A;G.visible=!1;this.addAction("help",function(){var F="";mxResources.isLanguageSupported(mxClient.language)&&-(F="_"+mxClient.language);p.openLink(RESOURCES_PATH+"/help"+F+".html")});var T=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){T||(m.showDialog((new AboutDialog(m)).container,320,280,!0,!0,function(){T=!1}),T=!0)}));G=mxUtils.bind(this,function(F,P,Q,U){return this.addAction(F,function(){if(null!=Q&&p.cellEditor.isContentEditing())Q();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var c=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,+(F="_"+mxClient.language);p.openLink(RESOURCES_PATH+"/help"+F+".html")});var S=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){S||(m.showDialog((new AboutDialog(m)).container,320,280,!0,!0,function(){S=!1}),S=!0)}));G=mxUtils.bind(this,function(F,P,Q,T){return this.addAction(F,function(){if(null!=Q&&p.cellEditor.isContentEditing())Q();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var c=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,P,c);(P&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?p.updateLabelElements(c,function(k){k.style.fontWeight=null;"B"==k.nodeName&&p.replaceElement(k)}):(P&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?p.updateLabelElements(c,function(k){k.style.fontStyle=null;"I"==k.nodeName&&p.replaceElement(k)}):(P&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&p.updateLabelElements(c,function(k){k.style.textDecoration=null;"U"==k.nodeName&&p.replaceElement(k)});for(var f=0;f<c.length;f++)0==p.model.getChildCount(c[f])&&-p.autoSizeCell(c[f],!1)}finally{p.getModel().endUpdate()}}},null,null,U)});G("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");G("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");G("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){m.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000",+p.autoSizeCell(c[f],!1)}finally{p.getModel().endUpdate()}}},null,null,T)});G("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");G("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");G("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){m.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",p.shapeForegroundColor)});this.addAction("strokeColor...",function(){m.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("fillColor...",function(){m.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",p.shapeBackgroundColor)});this.addAction("gradientColor...",function(){m.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("backgroundColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor",null,"default",p.shapeBackgroundColor)});this.addAction("borderColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("removeFormat",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&!p.isEditing()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),P=0;P<F.length;P++)p.removeTextStyleForCell(F[P],!0)}finally{p.getModel().endUpdate()}}});this.addAction("vertical",function(){m.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){m.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,null),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dashed",function(){p.getModel().beginUpdate();@@ -3019,16 +3019,16 @@ this.addAction("rounded",function(){p.getModel().beginUpdate();try{p.setCellStylQ="1"==mxUtils.getValue(P,mxConstants.STYLE_ROUNDED,"0")?"0":"1";p.setCellStyles(mxConstants.STYLE_ROUNDED,Q);p.setCellStyles(mxConstants.STYLE_CURVED,null);m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[Q,"0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}}});this.addAction("curved",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,"1"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("collapsible",function(){var F=p.view.getState(p.getSelectionCell()),P="1";null!=F&&null!=p.getFoldingImage(F)&&(P="0");p.setCellStyles("collapsible",P);m.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[P],"cells",p.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var F=p.getEditableCells(p.getSelectionCells());if(null!=F&&0<F.length){var P=p.getModel();P=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",P.getStyle(F[0])||"",function(Q){null!=Q&&p.setCellStyle(mxUtils.trim(Q),F)},null,null,400,220);this.editorUi.showDialog(P.container,420,300,!0,!0);P.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){p.isEnabled()&&!p.isSelectionEmpty()&&m.setDefaultStyle(p.getSelectionCell())},-null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&m.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var F=p.getSelectionCell();if(null!=F&&p.getModel().isEdge(F)){var P=v.graph.selectionCellsHandler.getHandler(F);if(P instanceof mxEdgeHandler){var Q=p.view.translate,U=p.view.scale,c=Q.x;Q=Q.y;F=p.getModel().getParent(F);for(var f=p.getCellGeometry(F);p.getModel().isVertex(F)&&null!=f;)c+=f.x,Q+=f.y,F=-p.getModel().getParent(F),f=p.getCellGeometry(F);c=Math.round(p.snap(p.popupMenuHandler.triggerX/U-c));U=Math.round(p.snap(p.popupMenuHandler.triggerY/U-Q));P.addPointAt(P.state,c,U)}}});this.addAction("removeWaypoint",function(){var F=m.actions.get("removeWaypoint");null!=F.handler&&F.handler.removePoint(F.handler.state,F.index)});this.addAction("clearAnchors",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=-F[P];p.getModel().isEdge(Q)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[Q]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[Q]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[Q]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[Q]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=F[P];if(p.getModel().isEdge(Q)){var U=p.getCellGeometry(Q);-null!=U&&(U=U.clone(),U.points=null,U.x=0,U.y=0,U.offset=null,p.getModel().setGeometry(Q,U))}}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+R");G=this.addAction("subscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");G=this.addAction("superscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");G=this.addAction("decreaseFontSize",+null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&m.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var F=p.getSelectionCell();if(null!=F&&p.getModel().isEdge(F)){var P=v.graph.selectionCellsHandler.getHandler(F);if(P instanceof mxEdgeHandler){var Q=p.view.translate,T=p.view.scale,c=Q.x;Q=Q.y;F=p.getModel().getParent(F);for(var f=p.getCellGeometry(F);p.getModel().isVertex(F)&&null!=f;)c+=f.x,Q+=f.y,F=+p.getModel().getParent(F),f=p.getCellGeometry(F);c=Math.round(p.snap(p.popupMenuHandler.triggerX/T-c));T=Math.round(p.snap(p.popupMenuHandler.triggerY/T-Q));P.addPointAt(P.state,c,T)}}});this.addAction("removeWaypoint",function(){var F=m.actions.get("removeWaypoint");null!=F.handler&&F.handler.removePoint(F.handler.state,F.index)});this.addAction("clearAnchors",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=+F[P];p.getModel().isEdge(Q)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[Q]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[Q]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[Q]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[Q]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var Q=F[P];if(p.getModel().isEdge(Q)){var T=p.getCellGeometry(Q);+null!=T&&(T=T.clone(),T.points=null,T.x=0,T.y=0,T.offset=null,p.getModel().setGeometry(Q,T))}}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+R");G=this.addAction("subscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");G=this.addAction("superscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");G=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var F=p.getCurrentCellStyle(p.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,F-1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift + (Numpad)");G=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var F=p.getCurrentCellStyle(p.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,-mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,F+1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift - (Numpad)");this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=mxResources.get("image")+" ("+mxResources.get("url")+"):",P=p.getView().getState(p.getSelectionCell()),Q="",U=null;null!=P&&(Q=P.style[mxConstants.STYLE_IMAGE]||Q,U=P.style[mxConstants.STYLE_CLIP_PATH]||U);var c=p.cellEditor.saveSelection();-m.showImageDialog(F,Q,function(f,k,B,z,C,H){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(c),p.insertImage(f,k,B);else{var K=p.getSelectionCells();if(null!=f&&(0<f.length||0<K.length)){var M=null;p.getModel().beginUpdate();try{if(0==K.length){K=[p.insertVertex(p.getDefaultParent(),null,"",0,0,k,B,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var O=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(K,!0));K[0].geometry.x=O.x;K[0].geometry.y=-O.y;null!=z&&g(K[0],z,C,H,p);M=K;p.fireEvent(new mxEventObject("cellsInserted","cells",M))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<f.length?f:null,K);var ea=p.getCurrentCellStyle(K[0]);"image"!=ea[mxConstants.STYLE_SHAPE]&&"label"!=ea[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",K):0==f.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,K);null==z&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,K);if(null!=k&&null!=B)for(f=0;f<K.length;f++){var fa=K[f];if("0"!=p.getCurrentCellStyle(fa).expand){var S=-p.getModel().getGeometry(fa);null!=S&&(S=S.clone(),S.width=k,S.height=B,p.getModel().setGeometry(fa,S))}null!=z&&g(fa,z,C,H,p)}}finally{p.getModel().endUpdate()}null!=M&&(p.setSelectionCells(M),p.scrollCellToVisible(M[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,U)}}).isEnabled=A;this.addAction("crop...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F){var P=p.getCurrentCellStyle(F),Q=P[mxConstants.STYLE_IMAGE],-U=P[mxConstants.STYLE_SHAPE];Q&&"image"==U&&(P=new CropImageDialog(m,Q,P[mxConstants.STYLE_CLIP_PATH],function(c,f,k){g(F,c,f,k,p)}),m.showDialog(P.container,300,390,!0,!0))}}).isEnabled=A;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(m,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",+mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,F+1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift - (Numpad)");this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=mxResources.get("image")+" ("+mxResources.get("url")+"):",P=p.getView().getState(p.getSelectionCell()),Q="",T=null;null!=P&&(Q=P.style[mxConstants.STYLE_IMAGE]||Q,T=P.style[mxConstants.STYLE_CLIP_PATH]||T);var c=p.cellEditor.saveSelection();+m.showImageDialog(F,Q,function(f,k,B,z,C,I){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(c),p.insertImage(f,k,B);else{var L=p.getSelectionCells();if(null!=f&&(0<f.length||0<L.length)){var J=null;p.getModel().beginUpdate();try{if(0==L.length){L=[p.insertVertex(p.getDefaultParent(),null,"",0,0,k,B,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var O=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(L,!0));L[0].geometry.x=O.x;L[0].geometry.y=+O.y;null!=z&&g(L[0],z,C,I,p);J=L;p.fireEvent(new mxEventObject("cellsInserted","cells",J))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<f.length?f:null,L);var da=p.getCurrentCellStyle(L[0]);"image"!=da[mxConstants.STYLE_SHAPE]&&"label"!=da[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",L):0==f.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,L);null==z&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,L);if(null!=k&&null!=B)for(f=0;f<L.length;f++){var fa=L[f];if("0"!=p.getCurrentCellStyle(fa).expand){var V=+p.getModel().getGeometry(fa);null!=V&&(V=V.clone(),V.width=k,V.height=B,p.getModel().setGeometry(fa,V))}null!=z&&g(fa,z,C,I,p)}}finally{p.getModel().endUpdate()}null!=J&&(p.setSelectionCells(J),p.scrollCellToVisible(J[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,T)}}).isEnabled=A;this.addAction("crop...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F){var P=p.getCurrentCellStyle(F),Q=P[mxConstants.STYLE_IMAGE],+T=P[mxConstants.STYLE_SHAPE];Q&&"image"==T&&(P=new CropImageDialog(m,Q,P[mxConstants.STYLE_CLIP_PATH],function(c,f,k){g(F,c,f,k,p)}),m.showDialog(P.container,300,390,!0,!0))}}).isEnabled=A;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(m,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){m.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));G=this.addAction("format",mxUtils.bind(this,function(){m.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return m.isFormatPanelVisible()}));G=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(m,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){m.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editConnectionPoints...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F&&null!=F.geometry){var P=@@ -3042,25 +3042,25 @@ DrawioFile.prototype.synchronizeFile=function(b,e){if(this.savingFile)null!=e&&efunction(A){g&&(window.clearTimeout(m),this.sync.cleanup(b,e,A))}),v,p):this.updateFile(mxUtils.bind(this,function(){g&&(window.clearTimeout(m),null!=b&&b())}),v,p)}};DrawioFile.prototype.updateFile=function(b,e,g,m,v){null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():this.getLatestVersion(mxUtils.bind(this,function(p){try{null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[p]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():null!=p?this.mergeFile(p,b,e,m,v):this.reloadFile(b,e))}catch(A){null!=e&&e(A)}}),e))};-DrawioFile.prototype.mergeFile=function(b,e,g,m,v){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var A=this.getShadowPages(),G=[this.ui.diffPages(null!=m?m:A,p)],T=this.ignorePatches(G);if(T)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",T),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(A,-this.isRealtime()?this.ownPages:this.ui.pages):null,P=this.ui.patchPages(this.ui.clonePages(A),G[0]),Q=this.ui.getHashValueForPages(P,{}),U=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",A,"pages",p,"patched",P,"patches",G,"changes",F,"checksum",Q,"current",U,"valid",Q==U,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=Q&&Q!=U)this.checksumError(g,G,null,null,"mergeFile",-Q,U,b.getCurrentRevisionId());else{this.setShadowPages(p);if(null!=this.sync){var c=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?F:null,null,v);null==c||mxUtils.isEmptyObject(c)||G.push(c)}this.patch(G,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=e&&e()}}catch(B){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=g&&g(B);try{var f=this.getCurrentUser(),k=null!=f?+DrawioFile.prototype.mergeFile=function(b,e,g,m,v){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var A=this.getShadowPages(),G=[this.ui.diffPages(null!=m?m:A,p)],S=this.ignorePatches(G);if(S)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",S),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(A,+this.isRealtime()?this.ownPages:this.ui.pages):null,P=this.ui.patchPages(this.ui.clonePages(A),G[0]),Q=this.ui.getHashValueForPages(P,{}),T=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",A,"pages",p,"patched",P,"patches",G,"changes",F,"checksum",Q,"current",T,"valid",Q==T,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=Q&&Q!=T)this.checksumError(g,G,null,null,"mergeFile",+Q,T,b.getCurrentRevisionId());else{this.setShadowPages(p);if(null!=this.sync){var c=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?F:null,null,v);null==c||mxUtils.isEmptyObject(c)||G.push(c)}this.patch(G,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=e&&e()}}catch(B){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=g&&g(B);try{var f=this.getCurrentUser(),k=null!=f?f.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),k,B)}catch(z){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(B){null!=g&&g(B)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var e=new mxCodec(mxUtils.createXmlDocument()),g=e.document.createElement("mxfile");if(null!=b)for(var m=0;m<b.length;m++){var v=e.encode(new mxGraphModel(b[m].root));"1"!=urlParams.dev&&(v=this.ui.anonymizeNode(v,!0));v.setAttribute("id",b[m].getId());b[m].viewState&&this.ui.editor.graph.saveViewState(b[m].viewState,v,!0);g.appendChild(v)}return mxUtils.getPrettyXml(g)};DrawioFile.prototype.compressReportData=function(b,e,g){e=null!=e?e:1E4;null!=g&&null!=b&&b.length>g?b=b.substring(0,g)+"[...]":null!=b&&b.length>e&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,e,g,m,v,p,A,G){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var T=this.getCurrentUser(),F=null!=T?T.id:"unknown",P=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",Q=JSON.stringify(e).length,U=null;if(null!=e&&1E3>Q){for(b=0;b<e.length;b++)this.ui.anonymizePatch(e[b]);U=JSON.stringify(e);U=null!=U&&1E3>U.length?Graph.compress(U):-null}this.getLatestVersion(mxUtils.bind(this,function(c){try{var f=null!=U?"report":"error",k=this.ui.getHashValueForPages(c.getShadowPages()),B="unknown",z="unknown",C="unknown";try{var H=null!=c.initialData&&0<c.initialData.length?mxUtils.parseXml(c.initialData).documentElement:null;null!=H&&(null!=H.getAttribute("version")&&(B=H.getAttribute("version")),null!=H.getAttribute("agent")&&(z=H.getAttribute("agent")),null!=H.getAttribute("type")&&(C=H.getAttribute("type")))}catch(K){}EditorUi.logError("Checksum "+-f+" in "+v,null,this.getMode()+"."+P,"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+e.length+(null!=U?"-json_"+U:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=A?"-current_"+A:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=k?"-latest_"+k:"")+"-latestRev_"+this.ui.hashValue(c.getCurrentRevisionId())+("-latestVersion_"+B)+("-latestAgent_"+z)+("-latestType_"+C));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+P,action:v,label:"user_"+-F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+e.length+"-size_"+this.getSize()})}catch(K){}}),function(){})}catch(c){}};-DrawioFile.prototype.sendErrorReport=function(b,e,g,m){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),A=this.getCurrentUser(),G=null!=A?this.ui.hashValue(A.id):"unknown",T=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",F=this.getTitle(),P=F.lastIndexOf(".");A="xml";0<P&&(A=F.substring(P));var Q=null!=g?g.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+-":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+A+")\nUser="+G+T+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:-"")+(null!=g?"\n\nError: "+g.message:"")+"\n\nStack:\n"+Q+"\n\nShadow:\n"+v+"\n\nData:\n"+p,m)}catch(U){}};+DrawioFile.prototype.checksumError=function(b,e,g,m,v,p,A,G){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var S=this.getCurrentUser(),F=null!=S?S.id:"unknown",P=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",Q=JSON.stringify(e).length,T=null;if(null!=e&&1E3>Q){for(b=0;b<e.length;b++)this.ui.anonymizePatch(e[b]);T=JSON.stringify(e);T=null!=T&&1E3>T.length?Graph.compress(T):+null}this.getLatestVersion(mxUtils.bind(this,function(c){try{var f=null!=T?"report":"error",k=this.ui.getHashValueForPages(c.getShadowPages()),B="unknown",z="unknown",C="unknown";try{var I=null!=c.initialData&&0<c.initialData.length?mxUtils.parseXml(c.initialData).documentElement:null;null!=I&&(null!=I.getAttribute("version")&&(B=I.getAttribute("version")),null!=I.getAttribute("agent")&&(z=I.getAttribute("agent")),null!=I.getAttribute("type")&&(C=I.getAttribute("type")))}catch(L){}EditorUi.logError("Checksum "++f+" in "+v,null,this.getMode()+"."+P,"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+e.length+(null!=T?"-json_"+T:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=A?"-current_"+A:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=k?"-latest_"+k:"")+"-latestRev_"+this.ui.hashValue(c.getCurrentRevisionId())+("-latestVersion_"+B)+("-latestAgent_"+z)+("-latestType_"+C));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+P,action:v,label:"user_"++F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+e.length+"-size_"+this.getSize()})}catch(L){}}),function(){})}catch(c){}};+DrawioFile.prototype.sendErrorReport=function(b,e,g,m){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),A=this.getCurrentUser(),G=null!=A?this.ui.hashValue(A.id):"unknown",S=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",F=this.getTitle(),P=F.lastIndexOf(".");A="xml";0<P&&(A=F.substring(P));var Q=null!=g?g.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+A+")\nUser="+G+S+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:+"")+(null!=g?"\n\nError: "+g.message:"")+"\n\nStack:\n"+Q+"\n\nShadow:\n"+v+"\n\nData:\n"+p,m)}catch(T){}};DrawioFile.prototype.reloadFile=function(b,e){try{this.stats.fileReloaded++;var g=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),m=this.ui.editor.graph,v=m.getSelectionCells(),p=m.getViewState(),A=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(G){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[g],"viewState",[p],"latestFile",G);null!=G?(this.ui.replaceFileData(G.getData(),-[g]),this.ui.restoreViewState(A,p,v),this.setDescriptor(G.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var T=this.ui.getCurrentFile();null!=T&&(T.stats=this.stats,T.patch([g]),T.fileChanged());this.ui.restoreViewState(A,p,v);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(G){null!=e&&e(G)}};+[g]),this.ui.restoreViewState(A,p,v),this.setDescriptor(G.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var S=this.ui.getCurrentFile();null!=S&&(S.stats=this.stats,S.patch([g]),S.fileChanged());this.ui.restoreViewState(A,p,v);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(G){null!=e&&e(G)}};DrawioFile.prototype.copyFile=function(b,e){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var e=!0;if(null!=b)for(var g=0;g<b.length&&e;g++)e=e&&mxUtils.isEmptyObject(b[g]);return e};-DrawioFile.prototype.patch=function(b,e,g,m){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),A=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var T=this.changeListenerEnabled;this.changeListenerEnabled=g;var F=G.foldingEnabled,P=G.mathEnabled,Q=G.cellRenderer.redraw;G.cellRenderer.redraw=function(z){z.view.graph.isEditing(z.cell)&&(z.view.graph.scrollCellToVisible(z.cell),z.view.graph.cellEditor.resize());Q.apply(this,arguments)};G.model.beginUpdate();-try{if(g){for(var U=this.ui.pages.slice(),c=this.ui.currentPage,f=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified()),k=0;k<f.length;k++){var B=mxUtils.indexOf(this.ui.pages,f[k]);0>B?this.ui.insertPage(f[k],Math.min(k,this.ui.pages.length)):this.ui.movePage(B,k)}for(k=0;k<U.length;k++)0>mxUtils.indexOf(f,U[k])&&this.ui.removePage(U[k]);0<=mxUtils.indexOf(this.ui.pages,c)&&this.ui.selectPage(c,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified());0==this.ui.pages.length&&-this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);G.checkDefaultParent()}finally{G.container.style.visibility="";G.model.endUpdate();G.cellRenderer.redraw=Q;this.changeListenerEnabled=T;g||(v.history=p,v.indexOfNextAdd=A,v.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)P!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):(F!=G.foldingEnabled?+DrawioFile.prototype.patch=function(b,e,g,m){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),A=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var S=this.changeListenerEnabled;this.changeListenerEnabled=g;var F=G.foldingEnabled,P=G.mathEnabled,Q=G.cellRenderer.redraw;G.cellRenderer.redraw=function(z){z.view.graph.isEditing(z.cell)&&(z.view.graph.scrollCellToVisible(z.cell),z.view.graph.cellEditor.resize());Q.apply(this,arguments)};G.model.beginUpdate();+try{if(g){for(var T=this.ui.pages.slice(),c=this.ui.currentPage,f=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified()),k=0;k<f.length;k++){var B=mxUtils.indexOf(this.ui.pages,f[k]);0>B?this.ui.insertPage(f[k],Math.min(k,this.ui.pages.length)):this.ui.movePage(B,k)}for(k=0;k<T.length;k++)0>mxUtils.indexOf(f,T[k])&&this.ui.removePage(T[k]);0<=mxUtils.indexOf(this.ui.pages,c)&&this.ui.selectPage(c,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified());0==this.ui.pages.length&&+this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);G.checkDefaultParent()}finally{G.container.style.visibility="";G.model.endUpdate();G.cellRenderer.redraw=Q;this.changeListenerEnabled=S;g||(v.history=p,v.indexOfNextAdd=A,v.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)P!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):(F!=G.foldingEnabled?G.view.revalidate():G.view.validate(),G.sizeDidChange());null!=this.sync&&this.isRealtime()&&!m&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",e,"undoable",g)}return b};DrawioFile.prototype.save=function(b,e,g,m,v,p){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",m,"overwrite",v,"manual",p,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=g)g({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=e&&e();else if(null!=g)g({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(A){if(null!=g)g(A);else throw A;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var e=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=e&&(e.viewState=this.ui.editor.graph.getViewState(),e.needsUpdate=!0)}e=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return e};@@ -3111,7 +3111,7 @@ DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=newmxUtils.bind(this,function(e){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(e){this.handleFileError(e)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var e=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(e,mxUtils.bind(this,function(g){EditorUi.debug("DrawioFile.createSecret",[this],"secret",e,"token",g);b(e,g)}),mxUtils.bind(this,function(){b(e)})):b(e)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};DrawioFile.prototype.fileSaved=function(b,e,g,m,v,p,A){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;p=null!=p?p:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(p),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=g&&g()):this.sync.fileSaved(p,e,g,m,v,A)}catch(F){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=m&&m(F);try{var G=this.getCurrentUser(),T=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),T,F)}catch(P){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(F){this.descriptorChanged(),null!=m&&m(F)}};+this.inConflictState=!0;this.descriptorChanged();null!=m&&m(F);try{var G=this.getCurrentUser(),S=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),S,F)}catch(P){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(F){this.descriptorChanged(),null!=m&&m(F)}};DrawioFile.prototype.autosave=function(b,e,g,m){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<e?b:0;this.clearAutosave();var p=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==p&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var A=this.isAutosaveRevision();A&&(this.lastAutosaveRevision=(new Date).getTime());this.save(A,mxUtils.bind(this,function(G){this.autosaveCompleted();null!=g&&g(G)}),mxUtils.bind(this,function(G){null!=m&&m(G)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=g&&g(null)}catch(G){null!=m&&m(G)}}),v);this.autosaveThread=p;EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"delay",b,"maxDelay",e,"actualDelay",v,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};@@ -3120,10 +3120,10 @@ DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(thisDrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,e){b([])};DrawioFile.prototype.addComment=function(b,e,g){e(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,e){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,e)};LocalFile=function(b,e,g,m,v,p,A){DrawioFile.call(this,b,e);this.title=g;this.mode=m?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=p;this.editable=A};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,e,g,m,v){this.saveAs(this.title,e,g,m,v)};LocalFile.prototype.saveAs=function(b,e,g,m,v){this.saveFile(b,!1,e,g,null,m,v)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,e){null==this.fileHandle?null!=e&&e({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,e)};-LocalFile.prototype.saveFile=function(b,e,g,m,v,p,A){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var T=this.getData(),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=g&&g()}),P=mxUtils.bind(this,function(Q){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var U=mxUtils.bind(this,function(f){this.savingFile=!1;null!=m&&m({error:f})});this.saveDraft(T);this.fileHandle.createWritable().then(mxUtils.bind(this,function(f){this.fileHandle.getFile().then(mxUtils.bind(this,function(k){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[k],"conflict",this.desc.lastModified!=k.lastModified);A||this.desc.lastModified==k.lastModified?f.write(G?this.ui.base64ToBlob(Q,"image/png"):Q).then(mxUtils.bind(this,function(){f.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(B){try{var z=this.desc;this.savingFile=!1;this.desc=B;this.fileSaved(T,z,F,U);this.removeDraft()}catch(C){U(C)}}),U)}),U)}),U):(this.inConflictState=!0,U())}),mxUtils.bind(this,function(k){this.invalidFileHandle=!0;U(k)}))}),U)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(Q,b,G?"image/png":"text/xml",G);else if(Q.length<MAX_REQUEST_SIZE){var c=b.lastIndexOf(".");c=0<c?b.substring(c+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+c+"&xml="+encodeURIComponent(Q)+"&filename="+encodeURIComponent(b)+(G?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Q)}));F()}});G?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(Q){P(Q)}),m,this.ui.getCurrentFile()!=this?T:null,e.scale,e.border)):P(T)};+LocalFile.prototype.saveFile=function(b,e,g,m,v,p,A){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var S=this.getData(),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=g&&g()}),P=mxUtils.bind(this,function(Q){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var T=mxUtils.bind(this,function(f){this.savingFile=!1;null!=m&&m({error:f})});this.saveDraft(S);this.fileHandle.createWritable().then(mxUtils.bind(this,function(f){this.fileHandle.getFile().then(mxUtils.bind(this,function(k){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[k],"conflict",this.desc.lastModified!=k.lastModified);A||this.desc.lastModified==k.lastModified?f.write(G?this.ui.base64ToBlob(Q,"image/png"):Q).then(mxUtils.bind(this,function(){f.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(B){try{var z=this.desc;this.savingFile=!1;this.desc=B;this.fileSaved(S,z,F,T);this.removeDraft()}catch(C){T(C)}}),T)}),T)}),T):(this.inConflictState=!0,T())}),mxUtils.bind(this,function(k){this.invalidFileHandle=!0;T(k)}))}),T)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(Q,b,G?"image/png":"text/xml",G);else if(Q.length<MAX_REQUEST_SIZE){var c=b.lastIndexOf(".");c=0<c?b.substring(c+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+c+"&xml="+encodeURIComponent(Q)+"&filename="+encodeURIComponent(b)+(G?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Q)}));F()}});G?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(Q){P(Q)}),m,this.ui.getCurrentFile()!=this?S:null,e.scale,e.border)):P(S)};LocalFile.prototype.rename=function(b,e,g){this.title=b;this.descriptorChanged();null!=e&&e()};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinCommentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEyLjUgMjcuNWgyM3YtMi4yNWgtMjNabTAtNi4zNWgyM3YtMi4zaC0yM1ptMC02LjRoMjNWMTIuNWgtMjNaTTQzIDQyLjEgMzUuOSAzNWgtMjhxLTEuMTUgMC0yLjAyNS0uODc1VDUgMzIuMVY3LjlxMC0xLjE1Ljg3NS0yLjAyNVQ3LjkgNWgzMi4ycTEuMiAwIDIuMDUuODc1UTQzIDYuNzUgNDMgNy45Wk03LjI1IDcuOXYyNC44NUgzNi45bDMuODUgMy44NVY3LjlxMC0uMy0uMTc1LS40NzVUNDAuMSA3LjI1SDcuOXEtLjMgMC0uNDc1LjE3NVQ3LjI1IDcuOVptMCAwdjI4LjdWNy4yNSA3LjlaIi8+PC9zdmc+";Editor.thinDesignImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";@@ -3195,102 +3195,102 @@ type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"floatdispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(l,t){return t.editorUi.editor.graph.isCellConnectable(0<l.vertices.length&&0==l.edges.length?l.vertices[0]:null)},isVisible:function(l,t){return 0<l.vertices.length&&0==l.edges.length}},{name:"allowArrows",dispName:"Allow Arrows",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"perimeter",dispName:"Perimeter",defVal:"none",type:"enum",enumList:[{val:"none",dispName:"None"},{val:"rectanglePerimeter",dispName:"Rectangle"},{val:"ellipsePerimeter",dispName:"Ellipse"},{val:"rhombusPerimeter",dispName:"Rhombus"},{val:"trianglePerimeter",dispName:"Triangle"},{val:"hexagonPerimeter2",dispName:"Hexagon"},{val:"lifelinePerimeter",dispName:"Lifeline"},{val:"orthogonalPerimeter",dispName:"Orthogonal"},{val:"backbonePerimeter",dispName:"Backbone"},{val:"calloutPerimeter",dispName:"Callout"},{val:"parallelogramPerimeter",dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},{val:"stepPerimeter",dispName:"Step"},{val:"centerPerimeter",dispName:"Center"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",getDefaultValue:function(l,t){l=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;return null!=l&&t.isSwimlane(l)},isVisible:function(l,t){return 1==l.vertices.length&&-0==l.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(l,t){l=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;return null!=l&&(t.isSwimlane(l)||0<t.model.getChildCount(l))},isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(l,t){var I=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;-return null!=I&&(t.isContainer(I)&&"0"!=l.style.collapsible||!t.isContainer(I)&&"1"==l.style.collapsible)},isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length&&!t.editorUi.editor.graph.isSwimlane(l.vertices[0])&&null==mxUtils.getValue(l.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",+0==l.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(l,t){l=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;return null!=l&&(t.isSwimlane(l)||0<t.model.getChildCount(l))},isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(l,t){var H=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;t=t.editorUi.editor.graph;+return null!=H&&(t.isContainer(H)&&"0"!=l.style.collapsible||!t.isContainer(H)&&"1"==l.style.collapsible)},isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(l,t){return 1==l.vertices.length&&0==l.edges.length&&!t.editorUi.editor.graph.isSwimlane(l.vertices[0])&&null==mxUtils.getValue(l.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(l,t){t=t.editorUi.editor.graph.model;return 0<l.vertices.length?t.isVertex(t.getParent(l.vertices[0])):!1}},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"movableLabel",dispName:"Movable Label",type:"bool",defVal:!1,isVisible:function(l,t){l=0<l.vertices.length?t.editorUi.editor.graph.getCellGeometry(l.vertices[0]):null;return null!=l&&!l.relative}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"autosizeGrid",dispName:"Autosize Grid",type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"1",dispName:"Enabled"},{val:"0",dispName:"Disabled"}],isVisible:function(l,t){return 0<l.vertices.length&&t.editorUi.editor.graph.isAutoSizeCell(l.vertices[0])}},{name:"fixedWidth",dispName:"Fixed Width",type:"bool",defVal:!1},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",-type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(l,t){var I=mxUtils.getValue(l.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||t.editorUi.editor.graph.isSwimlane(l.vertices[0])||null==I||I==mxConstants.NONE||0==mxUtils.getValue(l.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(l.style,mxConstants.STYLE_OPACITY,100)||null!=l.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",+type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(l,t){var H=mxUtils.getValue(l.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||t.editorUi.editor.graph.isSwimlane(l.vertices[0])||null==H||H==mxConstants.NONE||0==mxUtils.getValue(l.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(l.style,mxConstants.STYLE_OPACITY,100)||null!=l.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",type:"bool",defVal:!1,isVisible:function(l,t){return 0<l.vertices.length&&t.editorUi.editor.graph.isContainer(l.vertices[0])}}].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart or a JSON string as used in\n## Layout, Apply. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.createRoughCanvas=function(l){var t=rough.canvas({getContext:function(){return l}});t.draw=function(I){var V=I.sets||[];I=I.options||this.getDefaultOptions();for(var J=0;J<V.length;J++){var W=V[J];switch(W.type){case "path":null!=I.stroke&&this._drawToContext(l,W,I);break;case "fillPath":this._drawToContext(l,W,I);break;case "fillSketch":this.fillSketch(l,W,I)}}};t.fillSketch=function(I,V,J){var W=l.state.strokeColor,Y=l.state.strokeWidth,ba=l.state.strokeAlpha,ja=l.state.dashed,oa=J.fillWeight;-0>oa&&(oa=J.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(J.fill||"");l.setStrokeWidth(oa);l.setDashed(!1);this._drawToContext(I,V,J);l.setDashed(ja);l.setStrokeWidth(Y);l.setStrokeColor(W);l.setStrokeAlpha(ba)};t._drawToContext=function(I,V,J){I.begin();for(var W=0;W<V.ops.length;W++){var Y=V.ops[W],ba=Y.data;switch(Y.op){case "move":I.moveTo(ba[0],ba[1]);break;case "bcurveTo":I.curveTo(ba[0],ba[1],ba[2],ba[3],ba[4],ba[5]);break;case "lineTo":I.lineTo(ba[0],ba[1])}}I.end();-"fillPath"===V.type&&J.filled?I.fill():I.stroke()};return t};(function(){function l(W,Y,ba){this.canvas=W;this.rc=Y;this.shape=ba;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,l.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,l.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,l.prototype.rect);this.originalRoundrect=this.canvas.roundrect;+Editor.createRoughCanvas=function(l){var t=rough.canvas({getContext:function(){return l}});t.draw=function(H){var U=H.sets||[];H=H.options||this.getDefaultOptions();for(var K=0;K<U.length;K++){var W=U[K];switch(W.type){case "path":null!=H.stroke&&this._drawToContext(l,W,H);break;case "fillPath":this._drawToContext(l,W,H);break;case "fillSketch":this.fillSketch(l,W,H)}}};t.fillSketch=function(H,U,K){var W=l.state.strokeColor,Y=l.state.strokeWidth,ca=l.state.strokeAlpha,ja=l.state.dashed,oa=K.fillWeight;+0>oa&&(oa=K.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(K.fill||"");l.setStrokeWidth(oa);l.setDashed(!1);this._drawToContext(H,U,K);l.setDashed(ja);l.setStrokeWidth(Y);l.setStrokeColor(W);l.setStrokeAlpha(ca)};t._drawToContext=function(H,U,K){H.begin();for(var W=0;W<U.ops.length;W++){var Y=U.ops[W],ca=Y.data;switch(Y.op){case "move":H.moveTo(ca[0],ca[1]);break;case "bcurveTo":H.curveTo(ca[0],ca[1],ca[2],ca[3],ca[4],ca[5]);break;case "lineTo":H.lineTo(ca[0],ca[1])}}H.end();+"fillPath"===U.type&&K.filled?H.fill():H.stroke()};return t};(function(){function l(W,Y,ca){this.canvas=W;this.rc=Y;this.shape=ca;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,l.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,l.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,l.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,l.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,l.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,l.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,l.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,-l.prototype.fillAndStroke);this.path=[];this.passThrough=!1}l.prototype.moveOp="M";l.prototype.lineOp="L";l.prototype.quadOp="Q";l.prototype.curveOp="C";l.prototype.closeOp="Z";l.prototype.getStyle=function(W,Y){var ba=1;if(null!=this.shape.state){var ja=this.shape.state.cell.id;if(null!=ja)for(var oa=0;oa<ja.length;oa++)ba=(ba<<5)-ba+ja.charCodeAt(oa)<<0}ba={strokeWidth:this.canvas.state.strokeWidth,seed:ba,preserveVertices:!0};ja=this.rc.getDefaultOptions();ba.stroke=W?this.canvas.state.strokeColor===-mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;W=null;(ba.filled=Y)?(ba.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,W=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):ba.fill="";ba.bowing=mxUtils.getValue(this.shape.style,"bowing",ja.bowing);ba.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ja.hachureAngle);ba.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ja.curveFitting);-ba.roughness=mxUtils.getValue(this.shape.style,"jiggle",ja.roughness);ba.simplification=mxUtils.getValue(this.shape.style,"simplification",ja.simplification);ba.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ja.disableMultiStroke);ba.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ja.disableMultiStrokeFill);Y=mxUtils.getValue(this.shape.style,"hachureGap",-1);ba.hachureGap="auto"==Y?-1:Y;ba.dashGap=mxUtils.getValue(this.shape.style,"dashGap",-Y);ba.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",Y);ba.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",Y);Y=mxUtils.getValue(this.shape.style,"fillWeight",-1);ba.fillWeight="auto"==Y?-1:Y;Y=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==Y&&(Y="auto");"auto"==Y&&(Y=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&Y.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&Y.push(mxUtils.hex2rgb(Editor.darkColor)),Y=-null!=ba.fill&&(null!=W||0<=mxUtils.indexOf(Y,mxUtils.hex2rgb(ba.fill)))?"solid":ja.fillStyle);ba.fillStyle=Y;return ba};l.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};l.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};l.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var W=2;W<arguments.length;W+=2)this.lastX=arguments[W-1],this.lastY=arguments[W],+l.prototype.fillAndStroke);this.path=[];this.passThrough=!1}l.prototype.moveOp="M";l.prototype.lineOp="L";l.prototype.quadOp="Q";l.prototype.curveOp="C";l.prototype.closeOp="Z";l.prototype.getStyle=function(W,Y){var ca=1;if(null!=this.shape.state){var ja=this.shape.state.cell.id;if(null!=ja)for(var oa=0;oa<ja.length;oa++)ca=(ca<<5)-ca+ja.charCodeAt(oa)<<0}ca={strokeWidth:this.canvas.state.strokeWidth,seed:ca,preserveVertices:!0};ja=this.rc.getDefaultOptions();ca.stroke=W?this.canvas.state.strokeColor===+mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;W=null;(ca.filled=Y)?(ca.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,W=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):ca.fill="";ca.bowing=mxUtils.getValue(this.shape.style,"bowing",ja.bowing);ca.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ja.hachureAngle);ca.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ja.curveFitting);+ca.roughness=mxUtils.getValue(this.shape.style,"jiggle",ja.roughness);ca.simplification=mxUtils.getValue(this.shape.style,"simplification",ja.simplification);ca.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ja.disableMultiStroke);ca.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ja.disableMultiStrokeFill);Y=mxUtils.getValue(this.shape.style,"hachureGap",-1);ca.hachureGap="auto"==Y?-1:Y;ca.dashGap=mxUtils.getValue(this.shape.style,"dashGap",+Y);ca.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",Y);ca.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",Y);Y=mxUtils.getValue(this.shape.style,"fillWeight",-1);ca.fillWeight="auto"==Y?-1:Y;Y=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==Y&&(Y="auto");"auto"==Y&&(Y=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&Y.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&Y.push(mxUtils.hex2rgb(Editor.darkColor)),Y=+null!=ca.fill&&(null!=W||0<=mxUtils.indexOf(Y,mxUtils.hex2rgb(ca.fill)))?"solid":ja.fillStyle);ca.fillStyle=Y;return ca};l.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};l.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};l.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var W=2;W<arguments.length;W+=2)this.lastX=arguments[W-1],this.lastY=arguments[W],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};l.prototype.lineTo=function(W,Y){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,W,Y),this.lastX=W,this.lastY=Y)};l.prototype.moveTo=function(W,Y){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,W,Y),this.lastX=W,this.lastY=Y,this.firstX=W,this.firstY=Y)};l.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,-arguments):this.addOp(this.closeOp)};l.prototype.quadTo=function(W,Y,ba,ja){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,W,Y,ba,ja),this.lastX=ba,this.lastY=ja)};l.prototype.curveTo=function(W,Y,ba,ja,oa,qa){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,W,Y,ba,ja,oa,qa),this.lastX=oa,this.lastY=qa)};l.prototype.arcTo=function(W,Y,ba,ja,oa,qa,ra){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);-else{var xa=mxUtils.arcToCurves(this.lastX,this.lastY,W,Y,ba,ja,oa,qa,ra);if(null!=xa)for(var Ba=0;Ba<xa.length;Ba+=6)this.curveTo(xa[Ba],xa[Ba+1],xa[Ba+2],xa[Ba+3],xa[Ba+4],xa[Ba+5]);this.lastX=qa;this.lastY=ra}};l.prototype.rect=function(W,Y,ba,ja){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(W,Y,ba,ja,this.getStyle(!0,!0)))};l.prototype.ellipse=function(W,Y,ba,ja){this.passThrough?this.originalEllipse.apply(this.canvas,-arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(W+ba/2,Y+ja/2,ba,ja,this.getStyle(!0,!0)))};l.prototype.roundrect=function(W,Y,ba,ja,oa,qa){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(W+oa,Y),this.lineTo(W+ba-oa,Y),this.quadTo(W+ba,Y,W+ba,Y+qa),this.lineTo(W+ba,Y+ja-qa),this.quadTo(W+ba,Y+ja,W+ba-oa,Y+ja),this.lineTo(W+oa,Y+ja),this.quadTo(W,Y+ja,W,Y+ja-qa),this.lineTo(W,Y+qa),this.quadTo(W,Y,W+oa,Y))};l.prototype.drawPath=function(W){if(0<-this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),W)}catch(ba){}this.passThrough=!1}else if(null!=this.nextShape){for(var Y in W)this.nextShape.options[Y]=W[Y];W.stroke!=mxConstants.NONE&&null!=W.stroke||delete this.nextShape.options.stroke;W.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};l.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,+arguments):this.addOp(this.closeOp)};l.prototype.quadTo=function(W,Y,ca,ja){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,W,Y,ca,ja),this.lastX=ca,this.lastY=ja)};l.prototype.curveTo=function(W,Y,ca,ja,oa,qa){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,W,Y,ca,ja,oa,qa),this.lastX=oa,this.lastY=qa)};l.prototype.arcTo=function(W,Y,ca,ja,oa,qa,ra){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);+else{var xa=mxUtils.arcToCurves(this.lastX,this.lastY,W,Y,ca,ja,oa,qa,ra);if(null!=xa)for(var Ba=0;Ba<xa.length;Ba+=6)this.curveTo(xa[Ba],xa[Ba+1],xa[Ba+2],xa[Ba+3],xa[Ba+4],xa[Ba+5]);this.lastX=qa;this.lastY=ra}};l.prototype.rect=function(W,Y,ca,ja){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(W,Y,ca,ja,this.getStyle(!0,!0)))};l.prototype.ellipse=function(W,Y,ca,ja){this.passThrough?this.originalEllipse.apply(this.canvas,+arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(W+ca/2,Y+ja/2,ca,ja,this.getStyle(!0,!0)))};l.prototype.roundrect=function(W,Y,ca,ja,oa,qa){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(W+oa,Y),this.lineTo(W+ca-oa,Y),this.quadTo(W+ca,Y,W+ca,Y+qa),this.lineTo(W+ca,Y+ja-qa),this.quadTo(W+ca,Y+ja,W+ca-oa,Y+ja),this.lineTo(W+oa,Y+ja),this.quadTo(W,Y+ja,W,Y+ja-qa),this.lineTo(W,Y+qa),this.quadTo(W,Y,W+oa,Y))};l.prototype.drawPath=function(W){if(0<+this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),W)}catch(ca){}this.passThrough=!1}else if(null!=this.nextShape){for(var Y in W)this.nextShape.options[Y]=W[Y];W.stroke!=mxConstants.NONE&&null!=W.stroke||delete this.nextShape.options.stroke;W.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};l.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};l.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};l.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(W){return new l(W,Editor.createRoughCanvas(W),this)};var t=mxShape.prototype.createHandJiggle;-mxShape.prototype.createHandJiggle=function(W){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?t.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(W):this.createRoughCanvas(W)};var I=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(W,Y,ba,ja,oa){null!=W.handJiggle&&W.handJiggle.passThrough||I.apply(this,arguments)};var V=mxShape.prototype.paint;mxShape.prototype.paint=-function(W){var Y=W.addTolerance,ba=!0;null!=this.style&&(ba="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=W.handJiggle&&W.handJiggle.constructor==l&&!this.outline){W.save();var ja=this.fill,oa=this.stroke;this.stroke=this.fill=null;var qa=this.configurePointerEvents,ra=W.setStrokeColor;W.setStrokeColor=function(){};var xa=W.setFillColor;W.setFillColor=function(){};ba||null==ja||(this.configurePointerEvents=function(){});W.handJiggle.passThrough=!0;V.apply(this,-arguments);W.handJiggle.passThrough=!1;W.setFillColor=xa;W.setStrokeColor=ra;this.configurePointerEvents=qa;this.stroke=oa;this.fill=ja;W.restore();ba&&null!=ja&&(W.addTolerance=function(){})}V.apply(this,arguments);W.addTolerance=Y};var J=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(W,Y,ba,ja,oa,qa){null!=W.handJiggle&&W.handJiggle.constructor==l?(W.handJiggle.passThrough=!0,J.apply(this,arguments),W.handJiggle.passThrough=!1):J.apply(this,arguments)}})();Editor.fastCompress=-function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:pako.inflateRaw(Graph.stringToArrayBuffer(atob(l)),{to:"string"})};Editor.extractGraphModel=function(l,t,I){if(null!=l&&"undefined"!==typeof pako){var V=l.ownerDocument.getElementsByTagName("div"),J=[];if(null!=V&&0<V.length)for(var W=0;W<V.length;W++)if("mxgraph"==V[W].getAttribute("class")){J.push(V[W]);-break}0<J.length&&(V=J[0].getAttribute("data-mxgraph"),null!=V?(J=JSON.parse(V),null!=J&&null!=J.xml&&(l=mxUtils.parseXml(J.xml),l=l.documentElement)):(J=J[0].getElementsByTagName("div"),0<J.length&&(V=mxUtils.getTextContent(J[0]),V=Graph.decompress(V,null,I),0<V.length&&(l=mxUtils.parseXml(V),l=l.documentElement))))}if(null!=l&&"svg"==l.nodeName)if(V=l.getAttribute("content"),null!=V&&"<"!=V.charAt(0)&&"%"!=V.charAt(0)&&(V=unescape(window.atob?atob(V):Base64.decode(cont,V))),null!=V&&"%"==V.charAt(0)&&-(V=decodeURIComponent(V)),null!=V&&0<V.length)l=mxUtils.parseXml(V).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==l||t||(J=null,"diagram"==l.nodeName?J=l:"mxfile"==l.nodeName&&(V=l.getElementsByTagName("diagram"),0<V.length&&(J=V[Math.max(0,Math.min(V.length-1,urlParams.page||0))])),null!=J&&(l=Editor.parseDiagramNode(J,I)));null==l||"mxGraphModel"==l.nodeName||t&&"mxfile"==l.nodeName||(l=null);return l};Editor.parseDiagramNode=function(l,t,I){Editor.validateDiagramNode(l);-var V=mxUtils.trim(mxUtils.getTextContent(l)),J=null;0<V.length?(t=Graph.decompress(V,null,t),null!=t&&0<t.length&&(J=mxUtils.parseXml(t).documentElement)):(l=mxUtils.getChildNodes(l),0<l.length&&(J=l[0],I&&(J=Editor.parseDiagramNode(J,t,!1)),t=mxUtils.createXmlDocument(),t.appendChild(t.importNode(J,!0)),J=t.documentElement));return J};Editor.getDiagramNodeXml=function(l){Editor.validateDiagramNode(l);var t=mxUtils.getNodeValue(l),I=null;0<t.length?I=Graph.decompress(t):(l=l.getElementsByTagName("mxGraphModel"),-null!=l&&0<l.length&&(I=mxUtils.getXml(l[0])));return I};Editor.validateDiagramNode=function(l){if(0==mxUtils.trim(mxUtils.getTextContent(l)).length&&0==mxUtils.getChildNodes(l).length){var t=new mxCodec,I=new mxGraphModel;l.appendChild(t.encode(I))}return l};Editor.extractGraphModelFromPdf=function(l){var t=null;l=l.substring(l.indexOf(",")+1);l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0);if("%PDF-1.7"==l.substring(0,8)){var I=l.indexOf("EmbeddedFile");if(-1<I){var V=l.indexOf("stream",-I)+9;if(0<l.substring(I,V).indexOf("application#2Fvnd.jgraph.mxfile")){var J=l.indexOf("endstream",V-1);return pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(V,J)),{to:"string"})}}for(I=l.indexOf("/ObjStm");0<I;){V=l.indexOf("stream",I)+9;J=l.indexOf("endstream",V-1);V=pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(V,J)),{to:"string"});J=V.indexOf("/Subject <");if(0<J){I=V.substring(J+14,V.indexOf(">",J));if(null!=I){t=I;I=[];for(V=0;V<t.length;V+=2)J=t.substr(V,2),"00"!=J&&I.push(String.fromCharCode(parseInt(J,-16)));t=I.join("")}break}I=l.indexOf("/ObjStm",I+1)}}if(null==t&&"%PDF-1.4"==l.substring(0,8)){I="";J=V=0;for(var W=[],Y=null;J<l.length;){var ba=l.charCodeAt(J);J+=1;10!=ba&&(I+=String.fromCharCode(ba));ba=="/Subject (%3Cmxfile".charCodeAt(V)?V++:V=0;if(19==V){var ja=l.indexOf("%3C%2Fmxfile%3E",J)+15;J-=9;if(ja>J){t=l.substring(J,ja);break}}10==ba&&("endobj"==I?Y=null:"obj"==I.substring(I.length-3,I.length)||"xref"==I||"trailer"==I?(Y=[],W[I.split(" ")[0]]=Y):null!=Y&&Y.push(I),I="")}}null==t&&null!=-W&&(t=Editor.extractGraphModelFromXref(W));null!=t&&(t=decodeURIComponent(t.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return t};Editor.extractGraphModelFromXref=function(l){var t=l.trailer,I=null;null!=t&&(t=/.* \/Info (\d+) (\d+) R/g.exec(t.join("\n")),null!=t&&0<t.length&&(t=l[t[1]],null!=t&&(t=/.* \/Subject (\d+) (\d+) R/g.exec(t.join("\n")),null!=t&&0<t.length&&(l=l[t[1]],null!=l&&(l=l.join("\n"),I=l.substring(1,l.length-1))))));return I};Editor.extractParserError=function(l,t){var I=null;l=-null!=l?l.getElementsByTagName("parsererror"):null;null!=l&&0<l.length&&(I=t||mxResources.get("invalidChars"),t=l[0].getElementsByTagName("div"),0<t.length&&(I=mxUtils.getTextContent(t[0])));return null!=I?mxUtils.trim(I):I};Editor.addRetryToError=function(l,t){null!=l&&(l=null!=l.error?l.error:l,null==l.retry&&(l.retry=t))};Editor.mermaidToDrawio=function(l,t,I){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(l,t,I)};Editor.configure=function(l){if(null!=l){Editor.config=l;Editor.configVersion=+mxShape.prototype.createHandJiggle=function(W){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?t.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(W):this.createRoughCanvas(W)};var H=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(W,Y,ca,ja,oa){null!=W.handJiggle&&W.handJiggle.passThrough||H.apply(this,arguments)};var U=mxShape.prototype.paint;mxShape.prototype.paint=+function(W){var Y=W.addTolerance,ca=!0;null!=this.style&&(ca="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=W.handJiggle&&W.handJiggle.constructor==l&&!this.outline){W.save();var ja=this.fill,oa=this.stroke;this.stroke=this.fill=null;var qa=this.configurePointerEvents,ra=W.setStrokeColor;W.setStrokeColor=function(){};var xa=W.setFillColor;W.setFillColor=function(){};ca||null==ja||(this.configurePointerEvents=function(){});W.handJiggle.passThrough=!0;U.apply(this,+arguments);W.handJiggle.passThrough=!1;W.setFillColor=xa;W.setStrokeColor=ra;this.configurePointerEvents=qa;this.stroke=oa;this.fill=ja;W.restore();ca&&null!=ja&&(W.addTolerance=function(){})}U.apply(this,arguments);W.addTolerance=Y};var K=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(W,Y,ca,ja,oa,qa){null!=W.handJiggle&&W.handJiggle.constructor==l?(W.handJiggle.passThrough=!0,K.apply(this,arguments),W.handJiggle.passThrough=!1):K.apply(this,arguments)}})();Editor.fastCompress=+function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:pako.inflateRaw(Graph.stringToArrayBuffer(atob(l)),{to:"string"})};Editor.extractGraphModel=function(l,t,H){if(null!=l&&"undefined"!==typeof pako){var U=l.ownerDocument.getElementsByTagName("div"),K=[];if(null!=U&&0<U.length)for(var W=0;W<U.length;W++)if("mxgraph"==U[W].getAttribute("class")){K.push(U[W]);+break}0<K.length&&(U=K[0].getAttribute("data-mxgraph"),null!=U?(K=JSON.parse(U),null!=K&&null!=K.xml&&(l=mxUtils.parseXml(K.xml),l=l.documentElement)):(K=K[0].getElementsByTagName("div"),0<K.length&&(U=mxUtils.getTextContent(K[0]),U=Graph.decompress(U,null,H),0<U.length&&(l=mxUtils.parseXml(U),l=l.documentElement))))}if(null!=l&&"svg"==l.nodeName)if(U=l.getAttribute("content"),null!=U&&"<"!=U.charAt(0)&&"%"!=U.charAt(0)&&(U=unescape(window.atob?atob(U):Base64.decode(cont,U))),null!=U&&"%"==U.charAt(0)&&+(U=decodeURIComponent(U)),null!=U&&0<U.length)l=mxUtils.parseXml(U).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==l||t||(K=null,"diagram"==l.nodeName?K=l:"mxfile"==l.nodeName&&(U=l.getElementsByTagName("diagram"),0<U.length&&(K=U[Math.max(0,Math.min(U.length-1,urlParams.page||0))])),null!=K&&(l=Editor.parseDiagramNode(K,H)));null==l||"mxGraphModel"==l.nodeName||t&&"mxfile"==l.nodeName||(l=null);return l};Editor.parseDiagramNode=function(l,t,H){Editor.validateDiagramNode(l);+var U=mxUtils.trim(mxUtils.getTextContent(l)),K=null;0<U.length?(t=Graph.decompress(U,null,t),null!=t&&0<t.length&&(K=mxUtils.parseXml(t).documentElement)):(l=mxUtils.getChildNodes(l),0<l.length&&(K=l[0],H&&(K=Editor.parseDiagramNode(K,t,!1)),t=mxUtils.createXmlDocument(),t.appendChild(t.importNode(K,!0)),K=t.documentElement));return K};Editor.getDiagramNodeXml=function(l){Editor.validateDiagramNode(l);var t=mxUtils.getNodeValue(l),H=null;0<t.length?H=Graph.decompress(t):(l=l.getElementsByTagName("mxGraphModel"),+null!=l&&0<l.length&&(H=mxUtils.getXml(l[0])));return H};Editor.validateDiagramNode=function(l){if(0==mxUtils.trim(mxUtils.getTextContent(l)).length&&0==mxUtils.getChildNodes(l).length){var t=new mxCodec,H=new mxGraphModel;l.appendChild(t.encode(H))}return l};Editor.extractGraphModelFromPdf=function(l){var t=null;l=l.substring(l.indexOf(",")+1);l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0);if("%PDF-1.7"==l.substring(0,8)){var H=l.indexOf("EmbeddedFile");if(-1<H){var U=l.indexOf("stream",+H)+9;if(0<l.substring(H,U).indexOf("application#2Fvnd.jgraph.mxfile")){var K=l.indexOf("endstream",U-1);return pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(U,K)),{to:"string"})}}for(H=l.indexOf("/ObjStm");0<H;){U=l.indexOf("stream",H)+9;K=l.indexOf("endstream",U-1);U=pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(U,K)),{to:"string"});K=U.indexOf("/Subject <");if(0<K){H=U.substring(K+14,U.indexOf(">",K));if(null!=H){t=H;H=[];for(U=0;U<t.length;U+=2)K=t.substr(U,2),"00"!=K&&H.push(String.fromCharCode(parseInt(K,+16)));t=H.join("")}break}H=l.indexOf("/ObjStm",H+1)}}if(null==t&&"%PDF-1.4"==l.substring(0,8)){H="";K=U=0;for(var W=[],Y=null;K<l.length;){var ca=l.charCodeAt(K);K+=1;10!=ca&&(H+=String.fromCharCode(ca));ca=="/Subject (%3Cmxfile".charCodeAt(U)?U++:U=0;if(19==U){var ja=l.indexOf("%3C%2Fmxfile%3E",K)+15;K-=9;if(ja>K){t=l.substring(K,ja);break}}10==ca&&("endobj"==H?Y=null:"obj"==H.substring(H.length-3,H.length)||"xref"==H||"trailer"==H?(Y=[],W[H.split(" ")[0]]=Y):null!=Y&&Y.push(H),H="")}}null==t&&null!=+W&&(t=Editor.extractGraphModelFromXref(W));null!=t&&(t=decodeURIComponent(t.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return t};Editor.extractGraphModelFromXref=function(l){var t=l.trailer,H=null;null!=t&&(t=/.* \/Info (\d+) (\d+) R/g.exec(t.join("\n")),null!=t&&0<t.length&&(t=l[t[1]],null!=t&&(t=/.* \/Subject (\d+) (\d+) R/g.exec(t.join("\n")),null!=t&&0<t.length&&(l=l[t[1]],null!=l&&(l=l.join("\n"),H=l.substring(1,l.length-1))))));return H};Editor.extractParserError=function(l,t){var H=null;l=+null!=l?l.getElementsByTagName("parsererror"):null;null!=l&&0<l.length&&(H=t||mxResources.get("invalidChars"),t=l[0].getElementsByTagName("div"),0<t.length&&(H=mxUtils.getTextContent(t[0])));return null!=H?mxUtils.trim(H):H};Editor.addRetryToError=function(l,t){null!=l&&(l=null!=l.error?l.error:l,null==l.retry&&(l.retry=t))};Editor.mermaidToDrawio=function(l,t,H){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(l,t,H)};Editor.configure=function(l){if(null!=l){Editor.config=l;Editor.configVersion=l.version;l.debug&&(urlParams.test="1");null!=l.defaultFonts&&(Menus.prototype.defaultFonts=l.defaultFonts);null!=l.presetColors&&(ColorDialog.prototype.presetColors=l.presetColors);null!=l.defaultColors&&(ColorDialog.prototype.defaultColors=l.defaultColors);null!=l.colorNames&&(ColorDialog.prototype.colorNames=l.colorNames);null!=l.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=l.defaultColorSchemes);null!=l.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=l.defaultEdgeLength);null!=l.selectParentLayer&&(Graph.selectParentLayer=l.selectParentLayer);null!=l.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=l.autosaveDelay);null!=l.templateFile&&(EditorUi.templateFile=l.templateFile);null!=l.styles&&(Array.isArray(l.styles)?Editor.styles=l.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=l.globalVars&&(Editor.globalVars=l.globalVars);null!=l.compressXml&&(Editor.defaultCompressed=l.compressXml,Editor.compressXml=l.compressXml);null!=l.includeDiagram&&(Editor.defaultIncludeDiagram=l.includeDiagram);null!=l.simpleLabels&&(Editor.simpleLabels=l.simpleLabels);null!=l.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=l.oneDriveInlinePicker);null!=l.defaultAdaptiveColors?Graph.defaultAdaptiveColors=l.defaultAdaptiveColors:0==l.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=l.darkColor&&(Editor.darkColor=l.darkColor);null!=l.darkColorVar&&(Editor.darkColorVar=l.darkColorVar);Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":"light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.defaultPageBorderColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=l.settingsName&&(Editor.configurationKey="."+l.settingsName+"-configuration",Editor.settingsKey="."+l.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=l.customFonts&&(Menus.prototype.defaultFonts=l.customFonts.concat(Menus.prototype.defaultFonts));-null!=l.customPresetColors&&(ColorDialog.prototype.presetColors=l.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=l.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=l.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=l.css){var t=document.createElement("style");t.setAttribute("type","text/css");t.appendChild(document.createTextNode(l.css));var I=document.getElementsByTagName("script")[0];I.parentNode.insertBefore(t,I)}null!=+null!=l.customPresetColors&&(ColorDialog.prototype.presetColors=l.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=l.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=l.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=l.css){var t=document.createElement("style");t.setAttribute("type","text/css");t.appendChild(document.createTextNode(l.css));var H=document.getElementsByTagName("script")[0];H.parentNode.insertBefore(t,H)}null!=l.expandLibraries&&(Sidebar.prototype.expandLibraries=l.expandLibraries);null!=l.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=l.appendCustomLibraries);null!=l.libraries&&(Sidebar.prototype.customEntries=l.libraries);null!=l.enabledLibraries&&(Array.isArray(l.enabledLibraries)?Sidebar.prototype.enabledLibraries=l.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=l.defaultLibraries&&(Sidebar.prototype.defaultEntries=l.defaultLibraries);null!=l.defaultCustomLibraries&&(Editor.defaultCustomLibraries=l.defaultCustomLibraries);null!=l.enableCustomLibraries&&(Editor.enableCustomLibraries=l.enableCustomLibraries);null!=l.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=l.defaultVertexStyle);null!=l.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=l.defaultEdgeStyle);null!=l.defaultPageVisible&&(Graph.prototype.defaultPageVisible=l.defaultPageVisible);null!=l.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=l.defaultGridEnabled);null!=l.zoomWheel&&(Graph.zoomWheel=l.zoomWheel);null!=l.zoomFactor&&(t=parseFloat(l.zoomFactor),!isNaN(t)&&1<t?Graph.prototype.zoomFactor=t:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=l.defaultGridSize&&(t=parseInt(l.defaultGridSize),!isNaN(t)&&0<t?mxGraph.prototype.gridSize=t:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=l.gridSteps&&(t=parseInt(l.gridSteps),!isNaN(t)&&0<t?mxGraphView.prototype.gridSteps=t:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));-null!=l.pageFormat&&(t=parseInt(l.pageFormat.width),I=parseInt(l.pageFormat.height),!isNaN(t)&&0<t&&!isNaN(I)&&0<I?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,t,I),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=l.thumbWidth&&(Sidebar.prototype.thumbWidth=l.thumbWidth);null!=l.thumbHeight&&(Sidebar.prototype.thumbHeight=l.thumbHeight);null!=l.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=+null!=l.pageFormat&&(t=parseInt(l.pageFormat.width),H=parseInt(l.pageFormat.height),!isNaN(t)&&0<t&&!isNaN(H)&&0<H?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,t,H),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=l.thumbWidth&&(Sidebar.prototype.thumbWidth=l.thumbWidth);null!=l.thumbHeight&&(Sidebar.prototype.thumbHeight=l.thumbHeight);null!=l.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=l.emptyLibraryXml);null!=l.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=l.emptyDiagramXml);null!=l.sidebarWidth&&(EditorUi.prototype.hsplitPosition=l.sidebarWidth);null!=l.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=l.updateDefaultStyle);null!=l.sidebarTitles&&(Sidebar.prototype.sidebarTitles=l.sidebarTitles);null!=l.sidebarTitleSize&&(t=parseInt(l.sidebarTitleSize),!isNaN(t)&&0<t?Sidebar.prototype.sidebarTitleSize=t:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=l.fontCss&&("string"===typeof l.fontCss?Editor.configureFontCss(l.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=l.autosaveDelay&&(t=parseInt(l.autosaveDelay),!isNaN(t)&&0<t?DrawioFile.prototype.autosaveDelay=t:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=l.maxImageBytes&&(EditorUi.prototype.maxImageBytes=l.maxImageBytes);null!=l.maxImageSize&&(EditorUi.prototype.maxImageSize=l.maxImageSize);null!=l.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=l.shareCursorPosition);null!=l.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=l.showRemoteCursors);null!=l.restrictExport&&(DrawioFile.RESTRICT_EXPORT=l.restrictExport);null!=l.replaceSvgDataUris&&(Editor.replaceSvgDataUris=l.replaceSvgDataUris);null!=l.foreignObjectImages&&(Editor.foreignObjectImages=l.foreignObjectImages);null!=l.shadowColor&&(mxConstants.SHADOW_COLOR=l.shadowColor);null!=l.shadowOpacity&&(mxConstants.SHADOW_OPACITY=l.shadowOpacity);null!=l.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=l.shadowOffsetX);null!=l.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=l.shadowOffsetY);null!=l.shadowBlur&&(mxConstants.SHADOW_BLUR=l.shadowBlur);null!=l.enableAnimations&&(Editor.enableAnimations=l.enableAnimations);null!=l.enableChatGpt&&(Editor.enableChatGpt=l.enableChatGpt);null!=l.gptApiKey&&(Editor.gptApiKey=l.gptApiKey);null!=l.gptModel&&(Editor.gptModel=l.gptModel);null!=l.gptUrl&&(Editor.gptUrl=l.gptUrl)}};Editor.isSettingsEnabled=function(){return"undefined"!==-typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(l){if(null!=l){Editor.prototype.fontCss=l;var t=document.getElementsByTagName("script")[0];if(null!=t&&null!=t.parentNode){var I=document.createElement("style");I.setAttribute("type","text/css");I.appendChild(document.createTextNode(l));t.parentNode.insertBefore(I,t);l=l.split("url(");for(I=1;I<l.length;I++){var V=l[I].indexOf(")");V=Editor.trimCssUrl(l[I].substring(0,V));var J=document.createElement("link");-J.setAttribute("rel","preload");J.setAttribute("href",V);J.setAttribute("as","font");J.setAttribute("crossorigin","");t.parentNode.insertBefore(J,t)}}}};Editor.trimCssUrl=function(l){return l.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=-20;Editor.guid=function(l){l=null!=l?l:Editor.GUID_LENGTH;for(var t=[],I=0;I<l;I++)t.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return t.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},+typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(l){if(null!=l){Editor.prototype.fontCss=l;var t=document.getElementsByTagName("script")[0];if(null!=t&&null!=t.parentNode){var H=document.createElement("style");H.setAttribute("type","text/css");H.appendChild(document.createTextNode(l));t.parentNode.insertBefore(H,t);l=l.split("url(");for(H=1;H<l.length;H++){var U=l[H].indexOf(")");U=Editor.trimCssUrl(l[H].substring(0,U));var K=document.createElement("link");+K.setAttribute("rel","preload");K.setAttribute("href",U);K.setAttribute("as","font");K.setAttribute("crossorigin","");t.parentNode.insertBefore(K,t)}}}};Editor.trimCssUrl=function(l){return l.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=+20;Editor.guid=function(l){l=null!=l?l:Editor.GUID_LENGTH;for(var t=[],H=0;H<l;H++)t.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return t.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!mxClient.IS_IE;var b=Editor.prototype.setGraphXml;-Editor.prototype.setGraphXml=function(l){l=null!=l&&"mxlibrary"!=l.nodeName?this.extractGraphModel(l):null;if(null!=l){var t=Editor.extractParserError(l,mxResources.get("invalidOrMissingFile"));if(t)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[l],"cause",[t]),Error(mxResources.get("notADiagramFile")+" ("+t+")");if("mxGraphModel"==l.nodeName){t=l.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=t&&""!=t)t!=this.graph.currentStyle&&(I=null!=this.graph.themes?-this.graph.themes[t]:mxUtils.load(STYLE_PATH+"/"+t+".xml").getDocumentElement(),null!=I&&(V=new mxCodec(I.ownerDocument),V.decode(I,this.graph.getStylesheet())));else{var I=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=I){var V=new mxCodec(I.ownerDocument);V.decode(I,this.graph.getStylesheet())}}this.graph.currentStyle=t;this.graph.mathEnabled="1"==urlParams.math||"1"==l.getAttribute("math");this.graph.setAdaptiveColors(l.getAttribute("adaptiveColors"));-t=l.getAttribute("backgroundImage");null!=t?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(t)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==l.getAttribute("shadow"),!1);if(t=l.getAttribute("extFonts"))try{for(t=t.split("|").map(function(J){J=J.split("^");return{name:J[0],url:J[1]}}),I=0;I<t.length;I++)this.graph.addExtFont(t[I].name,-t[I].url)}catch(J){console.log("ExtFonts format error: "+J.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var e=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(l,t){l=null!=l?l:!0;var I=e.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&I.setAttribute("style",-this.graph.currentStyle);var V=this.graph.getBackgroundImageObject(this.graph.backgroundImage,t);null!=V&&I.setAttribute("backgroundImage",JSON.stringify(V));I.setAttribute("math",this.graph.mathEnabled?"1":"0");I.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?I.setAttribute("adaptiveColors",this.graph.adaptiveColors):I.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(V=this.graph.extFonts.map(function(J){return J.name+-"^"+J.url}),I.setAttribute("extFonts",V.join("|")));return I};Editor.prototype.isDataSvg=function(l){try{var t=mxUtils.parseXml(l).documentElement.getAttribute("content");if(null!=t&&(null!=t&&"<"!=t.charAt(0)&&"%"!=t.charAt(0)&&(t=unescape(window.atob?atob(t):Base64.decode(cont,t))),null!=t&&"%"==t.charAt(0)&&(t=decodeURIComponent(t)),null!=t&&0<t.length)){var I=mxUtils.parseXml(t).documentElement;return"mxfile"==I.nodeName||"mxGraphModel"==I.nodeName}}catch(V){}return!1};Editor.prototype.extractGraphModel=-function(l,t,I){return Editor.extractGraphModel.apply(this,arguments)};var g=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();g.apply(this,arguments)};var m=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=-function(){m.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(l,t){if("undefined"===typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var I=function(){V=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};l=null!=l?l:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var V=null;Editor.doMathJaxRender=-function(Y){try{null==V?(MathJax.typesetClear([Y]),MathJax.typeset([Y]),I()):V!=Y&&Editor.mathJaxQueue.push(Y)}catch(ba){MathJax.typesetClear([Y]),null!=ba.retry?(V=Y,ba.retry.then(function(){MathJax.typesetPromise([Y]).then(I)["catch"](function(ja){console.log("Error in MathJax.typesetPromise: "+ja.toString());I()})})["catch"](function(ja){console.log("Error in MathJax.retry: "+ja.toString());I()})):null!=window.console&&console.log("Error in MathJax.typeset: "+ba.toString())}};window.MathJax=null!=+Editor.prototype.setGraphXml=function(l){l=null!=l&&"mxlibrary"!=l.nodeName?this.extractGraphModel(l):null;if(null!=l){var t=Editor.extractParserError(l,mxResources.get("invalidOrMissingFile"));if(t)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[l],"cause",[t]),Error(mxResources.get("notADiagramFile")+" ("+t+")");if("mxGraphModel"==l.nodeName){t=l.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=t&&""!=t)t!=this.graph.currentStyle&&(H=null!=this.graph.themes?+this.graph.themes[t]:mxUtils.load(STYLE_PATH+"/"+t+".xml").getDocumentElement(),null!=H&&(U=new mxCodec(H.ownerDocument),U.decode(H,this.graph.getStylesheet())));else{var H=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=H){var U=new mxCodec(H.ownerDocument);U.decode(H,this.graph.getStylesheet())}}this.graph.currentStyle=t;this.graph.mathEnabled="1"==urlParams.math||"1"==l.getAttribute("math");this.graph.setAdaptiveColors(l.getAttribute("adaptiveColors"));+t=l.getAttribute("backgroundImage");null!=t?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(t)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==l.getAttribute("shadow"),!1);if(t=l.getAttribute("extFonts"))try{for(t=t.split("|").map(function(K){K=K.split("^");return{name:K[0],url:K[1]}}),H=0;H<t.length;H++)this.graph.addExtFont(t[H].name,+t[H].url)}catch(K){console.log("ExtFonts format error: "+K.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var e=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(l,t){l=null!=l?l:!0;var H=e.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&H.setAttribute("style",+this.graph.currentStyle);var U=this.graph.getBackgroundImageObject(this.graph.backgroundImage,t);null!=U&&H.setAttribute("backgroundImage",JSON.stringify(U));H.setAttribute("math",this.graph.mathEnabled?"1":"0");H.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?H.setAttribute("adaptiveColors",this.graph.adaptiveColors):H.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(U=this.graph.extFonts.map(function(K){return K.name++"^"+K.url}),H.setAttribute("extFonts",U.join("|")));return H};Editor.prototype.isDataSvg=function(l){try{var t=mxUtils.parseXml(l).documentElement.getAttribute("content");if(null!=t&&(null!=t&&"<"!=t.charAt(0)&&"%"!=t.charAt(0)&&(t=unescape(window.atob?atob(t):Base64.decode(cont,t))),null!=t&&"%"==t.charAt(0)&&(t=decodeURIComponent(t)),null!=t&&0<t.length)){var H=mxUtils.parseXml(t).documentElement;return"mxfile"==H.nodeName||"mxGraphModel"==H.nodeName}}catch(U){}return!1};Editor.prototype.extractGraphModel=+function(l,t,H){return Editor.extractGraphModel.apply(this,arguments)};var g=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();g.apply(this,arguments)};var m=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=+function(){m.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(l,t){if("undefined"===typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var H=function(){U=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};l=null!=l?l:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var U=null;Editor.doMathJaxRender=+function(Y){try{null==U?(MathJax.typesetClear([Y]),MathJax.typeset([Y]),H()):U!=Y&&Editor.mathJaxQueue.push(Y)}catch(ca){MathJax.typesetClear([Y]),null!=ca.retry?(U=Y,ca.retry.then(function(){MathJax.typesetPromise([Y]).then(H)["catch"](function(ja){console.log("Error in MathJax.typesetPromise: "+ja.toString());H()})})["catch"](function(ja){console.log("Error in MathJax.retry: "+ja.toString());H()})):null!=window.console&&console.log("Error in MathJax.typeset: "+ca.toString())}};window.MathJax=null!=t?t:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"]},startup:{pageReady:function(){for(var Y=0;Y<Editor.mathJaxQueue.length;Y++)Editor.doMathJaxRender(Editor.mathJaxQueue[Y])}}};Editor.MathJaxRender=function(Y){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(Y):Editor.mathJaxQueue.push(Y)};Editor.onMathJaxDone=function(){};-var J=Editor.prototype.init;Editor.prototype.init=function(){J.apply(this,arguments);var Y=mxUtils.bind(this,function(ba,ja){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,Y);this.graph.addListener(mxEvent.REFRESH,Y)};t=document.getElementsByTagName("script");if(null!=t&&0<t.length){var W=document.createElement("script");W.setAttribute("type","text/javascript");W.setAttribute("src",l);t[0].parentNode.appendChild(W)}}};-Editor.prototype.csvToArray=function(l){if(0<l.length){var t="",I=[""],V=0,J=!0,W;l=$jscomp.makeIterator(l);for(W=l.next();!W.done;W=l.next())W=W.value,'"'===W?(J&&W===t&&(I[V]+=W),J=!J):","===W&&J?W=I[++V]="":I[V]+=W,t=W;return I}return[]};Editor.prototype.getProxiedUrl=function(l){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(l)){var t=EditorUi.isVisioFilename(l);t=/\.png$/i.test(l)||/\.pdf$/i.test(l)||t;var I=-"t="+(new Date).getTime();l=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+I+(t?"&base64=1":"")}return l};Editor.prototype.isCorsEnabledForUrl=function(l){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||l.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(l)||"https://raw.githubusercontent.com/"===l.substring(0,34)||-"https://fonts.googleapis.com/"===l.substring(0,29)||"https://fonts.gstatic.com/"===l.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var l=new mxUrlConverter;l.updateBaseUrl();var t=l.convert,I=this;l.convert=function(V){null!=V&&navigator.onLine&&("http://"!=V.substring(0,7)&&"https://"!=V.substring(0,8)||V.substring(0,l.baseUrl.length)==l.baseUrl||I.crossOriginImages&&I.isCorsEnabledForUrl(V)?"chrome-extension://"!=V.substring(0,19)&&(V=t.apply(this,arguments)):V=PROXY_URL+-"?url="+encodeURIComponent(V));return V};return l};Editor.createSvgDataUri=function(l){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(l)))};Editor.prototype.convertImageToDataUri=function(l,t,I,V,J){try{var W=!0,Y=window.setTimeout(mxUtils.bind(this,function(){W=!1;t(l)}),this.timeout),ba=mxUtils.bind(this,function(){null!=V?this.convertImageToDataUri(l,t,I,V,!0):t(l)});if(/(\.svg)$/i.test(l)&&!J)mxUtils.get(l,mxUtils.bind(this,function(oa){window.clearTimeout(Y);W&&(200>oa.getStatus()||-299<oa.getStatus()?ba():t(Editor.createSvgDataUri(oa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Y);W&&ba()}));else{var ja=new Image;this.crossOriginImages&&(ja.crossOrigin="anonymous");ja.onload=function(){window.clearTimeout(Y);if(W)try{V=null!=V&&J?V:1;var oa=document.createElement("canvas"),qa=oa.getContext("2d");qa.scale(V,V);oa.height=ja.height*V;oa.width=ja.width*V;qa.drawImage(ja,0,0);t(oa.toDataURL())}catch(ra){t(l)}};ja.onerror=function(){window.clearTimeout(Y);W&&(null!=-I?I():t(l))};ja.src=l}}catch(oa){null!=I?I():t(l)}};Editor.prototype.convertImages=function(l,t,I,V){function J(){0<W.length?W.shift()():t(l)}null==V&&(V=this.createImageUrlConverter());var W=[],Y=I||{};I=mxUtils.bind(this,function(ba,ja){ba=l.getElementsByTagName(ba);for(var oa=0;oa<ba.length;oa++)mxUtils.bind(this,function(qa){W.push(mxUtils.bind(this,function(){try{if(null!=qa){var ra=V.convert(qa.getAttribute(ja));if(null!=ra&&"data:"!=ra.substring(0,5)){var xa=Y[ra];null==xa?this.convertImageToDataUri(ra,-function(Ba){null!=Ba&&(Y[ra]=Ba,qa.setAttribute(ja,Ba));J()},null,Editor.svgRasterScale):(qa.setAttribute(ja,xa),J())}else null!=ra&&qa.setAttribute(ja,ra),J()}}catch(Ba){J()}}))})(ba[oa])});I("image","xlink:href");I("img","src");J()};Editor.base64Encode=function(l){for(var t="",I=0,V=l.length,J,W,Y;I<V;){J=l.charCodeAt(I++)&255;if(I==V){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(J>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((J&-3)<<4);t+="==";break}W=l.charCodeAt(I++);if(I==V){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(J>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((J&3)<<4|(W&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2);t+="=";break}Y=l.charCodeAt(I++);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(J>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((J&-3)<<4|(W&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2|(Y&192)>>6);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y&63)}return t};Editor.prototype.loadUrl=function(l,t,I,V,J,W,Y,ba){try{var ja=!Y&&(V||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));J=null!=J?J:!0;var oa=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(qa){if(200<=qa.getStatus()&&-299>=qa.getStatus()){if(null!=t){var ra=qa.getText();if(ja){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){qa=mxUtilsBinaryToArray(qa.request.responseBody).toArray();ra=Array(qa.length);for(var xa=0;xa<qa.length;xa++)ra[xa]=String.fromCharCode(qa[xa]);ra=ra.join("")}W=null!=W?W:"data:image/png;base64,";ra=W+Editor.base64Encode(ra)}t(ra)}}else null!=I&&(0==qa.getStatus()?I({message:mxResources.get("accessDenied")},qa):404==qa.getStatus()?-I({message:mxResources.get("fileNotFound"),code:qa.getStatus()},qa):I({message:this.getErrorMessage(qa)},qa))}),function(qa){null!=I&&I({message:mxResources.get("error")+" "+qa.getStatus()})},ja,this.timeout,function(){J&&null!=I&&I({code:App.ERROR_TIMEOUT,retry:oa})},ba)});oa()}catch(qa){null!=I&&I(qa)}};Editor.prototype.getErrorMessage=function(l){var t=mxResources.get("error")+" "+l.getStatus();try{var I=l.getText(),V=JSON.parse(I);null!=V&&null!=V.error&&null!=V.error.message&&(t=V.error.message+-" ("+t+")")}catch(J){}return t};Editor.prototype.absoluteCssFonts=function(l){var t=null;if(null!=l){var I=l.split("url(");if(0<I.length){t=[I[0]];l=window.location.pathname;var V=null!=l?l.lastIndexOf("/"):-1;0<=V&&(l=l.substring(0,V+1));V=document.getElementsByTagName("base");var J=null;null!=V&&0<V.length&&(J=V[0].getAttribute("href"));for(var W=1;W<I.length;W++)if(V=I[W].indexOf(")"),0<V){var Y=Editor.trimCssUrl(I[W].substring(0,V));this.graph.isRelativeUrl(Y)&&(Y=null!=J?J+Y:window.location.protocol+-"//"+window.location.hostname+("/"==Y.charAt(0)?"":l)+Y);t.push('url("'+Y+'"'+I[W].substring(V))}else t.push(I[W])}else t=[l]}return null!=t?t.join(""):null};Editor.prototype.mapFontUrl=function(l,t,I){/^https?:\/\//.test(t)&&!this.isCorsEnabledForUrl(t)&&(t=PROXY_URL+"?url="+encodeURIComponent(t));I(l,t)};Editor.prototype.embedCssFonts=function(l,t){var I=l.split("url("),V=0;null==this.cachedFonts&&(this.cachedFonts={});var J=mxUtils.bind(this,function(){if(0==V){for(var ja=[I[0]],oa=1;oa<I.length;oa++){var qa=-I[oa].indexOf(")");ja.push('url("');ja.push(this.cachedFonts[Editor.trimCssUrl(I[oa].substring(0,qa))]);ja.push('"'+I[oa].substring(qa))}t(ja.join(""))}});if(0<I.length){for(l=1;l<I.length;l++){var W=I[l].indexOf(")"),Y=null,ba=I[l].indexOf("format(",W);0<ba&&(Y=Editor.trimCssUrl(I[l].substring(ba+7,I[l].indexOf(")",ba))));mxUtils.bind(this,function(ja){if(null==this.cachedFonts[ja]){this.cachedFonts[ja]=ja;V++;var oa="application/x-font-ttf";if("svg"==Y||/(\.svg)($|\?)/i.test(ja))oa="image/svg+xml";+var K=Editor.prototype.init;Editor.prototype.init=function(){K.apply(this,arguments);var Y=mxUtils.bind(this,function(ca,ja){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,Y);this.graph.addListener(mxEvent.REFRESH,Y)};t=document.getElementsByTagName("script");if(null!=t&&0<t.length){var W=document.createElement("script");W.setAttribute("type","text/javascript");W.setAttribute("src",l);t[0].parentNode.appendChild(W)}}};+Editor.prototype.csvToArray=function(l){if(0<l.length){var t="",H=[""],U=0,K=!0,W;l=$jscomp.makeIterator(l);for(W=l.next();!W.done;W=l.next())W=W.value,'"'===W?(K&&W===t&&(H[U]+=W),K=!K):","===W&&K?W=H[++U]="":H[U]+=W,t=W;return H}return[]};Editor.prototype.getProxiedUrl=function(l){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(l)){var t=EditorUi.isVisioFilename(l);t=/\.png$/i.test(l)||/\.pdf$/i.test(l)||t;var H=+"t="+(new Date).getTime();l=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+H+(t?"&base64=1":"")}return l};Editor.prototype.isCorsEnabledForUrl=function(l){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||l.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(l)||"https://raw.githubusercontent.com/"===l.substring(0,34)||+"https://fonts.googleapis.com/"===l.substring(0,29)||"https://fonts.gstatic.com/"===l.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var l=new mxUrlConverter;l.updateBaseUrl();var t=l.convert,H=this;l.convert=function(U){null!=U&&navigator.onLine&&("http://"!=U.substring(0,7)&&"https://"!=U.substring(0,8)||U.substring(0,l.baseUrl.length)==l.baseUrl||H.crossOriginImages&&H.isCorsEnabledForUrl(U)?"chrome-extension://"!=U.substring(0,19)&&(U=t.apply(this,arguments)):U=PROXY_URL++"?url="+encodeURIComponent(U));return U};return l};Editor.createSvgDataUri=function(l){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(l)))};Editor.prototype.convertImageToDataUri=function(l,t,H,U,K){try{var W=!0,Y=window.setTimeout(mxUtils.bind(this,function(){W=!1;t(l)}),this.timeout),ca=mxUtils.bind(this,function(){null!=U?this.convertImageToDataUri(l,t,H,U,!0):t(l)});if(/(\.svg)$/i.test(l)&&!K)mxUtils.get(l,mxUtils.bind(this,function(oa){window.clearTimeout(Y);W&&(200>oa.getStatus()||+299<oa.getStatus()?ca():t(Editor.createSvgDataUri(oa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Y);W&&ca()}));else{var ja=new Image;this.crossOriginImages&&(ja.crossOrigin="anonymous");ja.onload=function(){window.clearTimeout(Y);if(W)try{U=null!=U&&K?U:1;var oa=document.createElement("canvas"),qa=oa.getContext("2d");qa.scale(U,U);oa.height=ja.height*U;oa.width=ja.width*U;qa.drawImage(ja,0,0);t(oa.toDataURL())}catch(ra){t(l)}};ja.onerror=function(){window.clearTimeout(Y);W&&(null!=+H?H():t(l))};ja.src=l}}catch(oa){null!=H?H():t(l)}};Editor.prototype.convertImages=function(l,t,H,U){function K(){0<W.length?W.shift()():t(l)}null==U&&(U=this.createImageUrlConverter());var W=[],Y=H||{};H=mxUtils.bind(this,function(ca,ja){ca=l.getElementsByTagName(ca);for(var oa=0;oa<ca.length;oa++)mxUtils.bind(this,function(qa){W.push(mxUtils.bind(this,function(){try{if(null!=qa){var ra=U.convert(qa.getAttribute(ja));if(null!=ra&&"data:"!=ra.substring(0,5)){var xa=Y[ra];null==xa?this.convertImageToDataUri(ra,+function(Ba){null!=Ba&&(Y[ra]=Ba,qa.setAttribute(ja,Ba));K()},null,Editor.svgRasterScale):(qa.setAttribute(ja,xa),K())}else null!=ra&&qa.setAttribute(ja,ra),K()}}catch(Ba){K()}}))})(ca[oa])});H("image","xlink:href");H("img","src");K()};Editor.base64Encode=function(l){for(var t="",H=0,U=l.length,K,W,Y;H<U;){K=l.charCodeAt(H++)&255;if(H==U){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(K>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((K&+3)<<4);t+="==";break}W=l.charCodeAt(H++);if(H==U){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(K>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((K&3)<<4|(W&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2);t+="=";break}Y=l.charCodeAt(H++);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(K>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((K&+3)<<4|(W&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2|(Y&192)>>6);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y&63)}return t};Editor.prototype.loadUrl=function(l,t,H,U,K,W,Y,ca){try{var ja=!Y&&(U||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));K=null!=K?K:!0;var oa=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(qa){if(200<=qa.getStatus()&&+299>=qa.getStatus()){if(null!=t){var ra=qa.getText();if(ja){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){qa=mxUtilsBinaryToArray(qa.request.responseBody).toArray();ra=Array(qa.length);for(var xa=0;xa<qa.length;xa++)ra[xa]=String.fromCharCode(qa[xa]);ra=ra.join("")}W=null!=W?W:"data:image/png;base64,";ra=W+Editor.base64Encode(ra)}t(ra)}}else null!=H&&(0==qa.getStatus()?H({message:mxResources.get("accessDenied")},qa):404==qa.getStatus()?+H({message:mxResources.get("fileNotFound"),code:qa.getStatus()},qa):H({message:this.getErrorMessage(qa)},qa))}),function(qa){null!=H&&H({message:mxResources.get("error")+" "+qa.getStatus()})},ja,this.timeout,function(){K&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:oa})},ca)});oa()}catch(qa){null!=H&&H(qa)}};Editor.prototype.getErrorMessage=function(l){var t=mxResources.get("error")+" "+l.getStatus();try{var H=l.getText(),U=JSON.parse(H);null!=U&&null!=U.error&&null!=U.error.message&&(t=U.error.message++" ("+t+")")}catch(K){}return t};Editor.prototype.absoluteCssFonts=function(l){var t=null;if(null!=l){var H=l.split("url(");if(0<H.length){t=[H[0]];l=window.location.pathname;var U=null!=l?l.lastIndexOf("/"):-1;0<=U&&(l=l.substring(0,U+1));U=document.getElementsByTagName("base");var K=null;null!=U&&0<U.length&&(K=U[0].getAttribute("href"));for(var W=1;W<H.length;W++)if(U=H[W].indexOf(")"),0<U){var Y=Editor.trimCssUrl(H[W].substring(0,U));this.graph.isRelativeUrl(Y)&&(Y=null!=K?K+Y:window.location.protocol++"//"+window.location.hostname+("/"==Y.charAt(0)?"":l)+Y);t.push('url("'+Y+'"'+H[W].substring(U))}else t.push(H[W])}else t=[l]}return null!=t?t.join(""):null};Editor.prototype.mapFontUrl=function(l,t,H){/^https?:\/\//.test(t)&&!this.isCorsEnabledForUrl(t)&&(t=PROXY_URL+"?url="+encodeURIComponent(t));H(l,t)};Editor.prototype.embedCssFonts=function(l,t){var H=l.split("url("),U=0;null==this.cachedFonts&&(this.cachedFonts={});var K=mxUtils.bind(this,function(){if(0==U){for(var ja=[H[0]],oa=1;oa<H.length;oa++){var qa=+H[oa].indexOf(")");ja.push('url("');ja.push(this.cachedFonts[Editor.trimCssUrl(H[oa].substring(0,qa))]);ja.push('"'+H[oa].substring(qa))}t(ja.join(""))}});if(0<H.length){for(l=1;l<H.length;l++){var W=H[l].indexOf(")"),Y=null,ca=H[l].indexOf("format(",W);0<ca&&(Y=Editor.trimCssUrl(H[l].substring(ca+7,H[l].indexOf(")",ca))));mxUtils.bind(this,function(ja){if(null==this.cachedFonts[ja]){this.cachedFonts[ja]=ja;U++;var oa="application/x-font-ttf";if("svg"==Y||/(\.svg)($|\?)/i.test(ja))oa="image/svg+xml";else if("otf"==Y||"embedded-opentype"==Y||/(\.otf)($|\?)/i.test(ja))oa="application/x-font-opentype";else if("woff"==Y||/(\.woff)($|\?)/i.test(ja))oa="application/font-woff";else if("woff2"==Y||/(\.woff2)($|\?)/i.test(ja))oa="application/font-woff2";else if("eot"==Y||/(\.eot)($|\?)/i.test(ja))oa="application/vnd.ms-fontobject";else if("sfnt"==Y||/(\.sfnt)($|\?)/i.test(ja))oa="application/font-sfnt";this.mapFontUrl(oa,ja,mxUtils.bind(this,function(qa,ra){this.loadUrl(ra,mxUtils.bind(this,function(xa){this.cachedFonts[ja]=-xa;V--;J()}),mxUtils.bind(this,function(xa){V--;J()}),!0,null,"data:"+qa+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(I[l].substring(0,W)),Y)}J()}else t(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(t){this.resolvedFontCss=t;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=function(){var l={},t;for(t in Graph.fontMapping)Graph.isCssFontUrl(t)&&(l[t]=Graph.fontMapping[t]);-return l};Editor.prototype.embedExtFonts=function(l){var t=this.graph.getCustomFonts();if(0<t.length){var I=[],V=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var J=mxUtils.bind(this,function(){0==V&&this.embedCssFonts(I.join(""),l)}),W=0;W<t.length;W++)mxUtils.bind(this,function(Y,ba){Graph.isCssFontUrl(ba)?null==this.cachedGoogleFonts[ba]?(V++,this.loadUrl(Graph.rewriteGoogleFontUrl(ba),mxUtils.bind(this,function(ja){this.cachedGoogleFonts[ba]=ja;I.push(ja+-"\n");V--;J()}),mxUtils.bind(this,function(ja){V--;I.push("@import url("+ba+");\n");J()}))):I.push(this.cachedGoogleFonts[ba]+"\n"):I.push('@font-face {font-family: "'+Y+'";src: url("'+ba+'")}\n')})(t[W].name,t[W].url);J()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&0<l.length)for(var t=document.getElementsByTagName("style"),I=0;I<t.length;I++){var V=mxUtils.getTextContent(t[I]);0>V.indexOf("mxPageSelector")&&0<V.indexOf("MathJax")&&l[0].appendChild(t[I].cloneNode(!0))}};-Editor.prototype.addFontCss=function(l,t){t=null!=t?t:this.absoluteCssFonts(this.fontCss);if(null!=t){var I=mxUtils.getSvgDefs(l),V=t.split("\n");t=[];for(var J=[],W=0;W<V.length;W++)"@import"==V[W].substring(0,7)?t.push(V[W]):J.push(V[W]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"style"):l.createElement("style");l.setAttribute("type","text/css");0<t.length&&(mxUtils.setTextContent(l,t.join("\n")),I.appendChild(l));0<J.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,-J.join("\n")),I.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(l,t,I){var V=mxClient.IS_FF?8192:16384;return Math.min(I,Math.min(V/l,V/t))};Editor.prototype.exportToCanvas=function(l,t,I,V,J,W,Y,ba,ja,oa,qa,ra,xa,Ba,ya,Da,La,sa){try{W=null!=W?W:!0;Y=null!=Y?Y:!0;ra=null!=ra?ra:this.graph;xa=null!=xa?xa:0;var Aa=ja?null:ra.background;Aa==mxConstants.NONE&&(Aa=null);null==Aa&&(Aa=V);null==-Aa&&0==ja&&(Aa="dark"==Da?Editor.darkColor:"#ffffff");this.convertImages(ra.getSvg(null,null,xa,Ba,null,Y,null,null,null,oa,null,Da,La,sa),mxUtils.bind(this,function(Ea){try{var Ka=new Image;Ka.onload=mxUtils.bind(this,function(){try{var za=function(){mxClient.IS_SF?window.setTimeout(function(){Pa.drawImage(Ka,0,0);l(Wa,Ea)},0):(Pa.drawImage(Ka,0,0),l(Wa,Ea))},Wa=document.createElement("canvas"),Ia=parseInt(Ea.getAttribute("width")),Xa=parseInt(Ea.getAttribute("height"));ba=null!=ba?ba:1;null!=t&&-(ba=W?Math.min(1,Math.min(3*t/(4*Xa),t/Ia)):t/Ia);ba=this.getMaxCanvasScale(Ia,Xa,ba);Ia=Math.ceil(ba*Ia);Xa=Math.ceil(ba*Xa);Wa.setAttribute("width",Ia);Wa.setAttribute("height",Xa);var Pa=Wa.getContext("2d");null!=Aa&&(Pa.beginPath(),Pa.rect(0,0,Ia,Xa),Pa.fillStyle=Aa,Pa.fill());1!=ba&&Pa.scale(ba,ba);if(ya){var u=ra.view,N=u.scale;u.scale=1;var R=btoa(unescape(encodeURIComponent(u.createSvgGrid(u.gridColor))));u.scale=N;R="data:image/svg+xml;base64,"+R;var X=ra.gridSize*u.gridSteps*ba,ia=ra.getGraphBounds(),-ka=u.translate.x*N,pa=u.translate.y*N,wa=ka+(ia.x-ka)/N-xa,ta=pa+(ia.y-pa)/N-xa,ua=new Image;ua.onload=function(){try{for(var Ca=-Math.round(X-mxUtils.mod((ka-wa)*ba,X)),Na=-Math.round(X-mxUtils.mod((pa-ta)*ba,X));Ca<Ia;Ca+=X)for(var Ya=Na;Ya<Xa;Ya+=X)Pa.drawImage(ua,Ca/ba,Ya/ba);za()}catch(Za){null!=J&&J(Za)}};ua.onerror=function(Ca){null!=J&&J(Ca)};ua.src=R}else za()}catch(Ca){null!=J&&J(Ca)}});Ka.onerror=function(za){null!=J&&J(za)};oa&&this.graph.addSvgShadow(Ea);this.graph.mathEnabled&&this.addMathCss(Ea);-var Ma=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ea,this.resolvedFontCss),Ka.src=Editor.createSvgDataUri(mxUtils.getXml(Ea))}catch(za){null!=J&&J(za)}});this.embedExtFonts(mxUtils.bind(this,function(za){try{null!=za&&this.addFontCss(Ea,za),this.loadFonts(Ma)}catch(Wa){null!=J&&J(Wa)}}))}catch(za){null!=J&&J(za)}}),I,qa)}catch(Ea){null!=J&&J(Ea)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,A=0;8>A;A++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=-p;Editor.updateCRC=function(l,t,I,V){for(var J=0;J<V;J++)l=Editor.crcTable[(l^t.charCodeAt(I+J))&255]^l>>>8;return l};Editor.crc32=function(l){for(var t=-1,I=0;I<l.length;I++)t=t>>>8^Editor.crcTable[(t^l.charCodeAt(I))&255];return(t^-1)>>>0};Editor.writeGraphModelToPng=function(l,t,I,V,J){function W(qa,ra){var xa=ja;ja+=ra;return qa.substring(xa,ja)}function Y(qa){qa=W(qa,4);return qa.charCodeAt(3)+(qa.charCodeAt(2)<<8)+(qa.charCodeAt(1)<<16)+(qa.charCodeAt(0)<<24)}function ba(qa){return String.fromCharCode(qa>>-24&255,qa>>16&255,qa>>8&255,qa&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?atob(l):Base64.decode(l,!0);var ja=0;if(W(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=J&&J();else if(W(l,4),"IHDR"!=W(l,4))null!=J&&J();else{W(l,17);J=l.substring(0,ja);do{var oa=Y(l);if("IDAT"==W(l,4)){J=l.substring(0,ja-8);"pHYs"==t&&"dpi"==I?(I=Math.round(V/.0254),I=ba(I)+ba(I)+String.fromCharCode(1)):I=I+String.fromCharCode(0)+("zTXt"==t?String.fromCharCode(0):"")+V;V=4294967295;V=-Editor.updateCRC(V,t,0,4);V=Editor.updateCRC(V,I,0,I.length);J+=ba(I.length)+t+I+ba(V^4294967295);J+=l.substring(ja-8,l.length);break}J+=l.substring(ja-8,ja-4+oa);W(l,oa);W(l,4)}while(oa);return"data:image/png;base64,"+(window.btoa?btoa(J):Base64.encode(J,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,t){G.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);-mxSettings.save()};var T=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){T.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,t){var I=null;null!=l.editor.graph.getModel().getParent(t)?I=t.getId():null!=l.currentPage&&(I=l.currentPage.getId());return I});if(null!=window.StyleFormatPanel){var F=Format.prototype.init;Format.prototype.init=function(){F.apply(this,+xa;U--;K()}),mxUtils.bind(this,function(xa){U--;K()}),!0,null,"data:"+qa+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(H[l].substring(0,W)),Y)}K()}else t(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(t){this.resolvedFontCss=t;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=function(){var l={},t;for(t in Graph.fontMapping)Graph.isCssFontUrl(t)&&(l[t]=Graph.fontMapping[t]);+return l};Editor.prototype.embedExtFonts=function(l){var t=this.graph.getCustomFonts();if(0<t.length){var H=[],U=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var K=mxUtils.bind(this,function(){0==U&&this.embedCssFonts(H.join(""),l)}),W=0;W<t.length;W++)mxUtils.bind(this,function(Y,ca){Graph.isCssFontUrl(ca)?null==this.cachedGoogleFonts[ca]?(U++,this.loadUrl(Graph.rewriteGoogleFontUrl(ca),mxUtils.bind(this,function(ja){this.cachedGoogleFonts[ca]=ja;H.push(ja++"\n");U--;K()}),mxUtils.bind(this,function(ja){U--;H.push("@import url("+ca+");\n");K()}))):H.push(this.cachedGoogleFonts[ca]+"\n"):H.push('@font-face {font-family: "'+Y+'";src: url("'+ca+'")}\n')})(t[W].name,t[W].url);K()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&0<l.length)for(var t=document.getElementsByTagName("style"),H=0;H<t.length;H++){var U=mxUtils.getTextContent(t[H]);0>U.indexOf("mxPageSelector")&&0<U.indexOf("MathJax")&&l[0].appendChild(t[H].cloneNode(!0))}};+Editor.prototype.addFontCss=function(l,t){t=null!=t?t:this.absoluteCssFonts(this.fontCss);if(null!=t){var H=mxUtils.getSvgDefs(l),U=t.split("\n");t=[];for(var K=[],W=0;W<U.length;W++)"@import"==U[W].substring(0,7)?t.push(U[W]):K.push(U[W]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"style"):l.createElement("style");l.setAttribute("type","text/css");0<t.length&&(mxUtils.setTextContent(l,t.join("\n")),H.appendChild(l));0<K.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,+K.join("\n")),H.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(l,t,H){var U=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(U/l,U/t))};Editor.prototype.exportToCanvas=function(l,t,H,U,K,W,Y,ca,ja,oa,qa,ra,xa,Ba,ya,Da,La,sa){try{W=null!=W?W:!0;Y=null!=Y?Y:!0;ra=null!=ra?ra:this.graph;xa=null!=xa?xa:0;var Aa=ja?null:ra.background;Aa==mxConstants.NONE&&(Aa=null);null==Aa&&(Aa=U);null==+Aa&&0==ja&&(Aa="dark"==Da?Editor.darkColor:"#ffffff");this.convertImages(ra.getSvg(null,null,xa,Ba,null,Y,null,null,null,oa,null,Da,La,sa),mxUtils.bind(this,function(Ea){try{var Ka=new Image;Ka.onload=mxUtils.bind(this,function(){try{var za=function(){mxClient.IS_SF?window.setTimeout(function(){Pa.drawImage(Ka,0,0);l(Wa,Ea)},0):(Pa.drawImage(Ka,0,0),l(Wa,Ea))},Wa=document.createElement("canvas"),Ia=parseInt(Ea.getAttribute("width")),Xa=parseInt(Ea.getAttribute("height"));ca=null!=ca?ca:1;null!=t&&+(ca=W?Math.min(1,Math.min(3*t/(4*Xa),t/Ia)):t/Ia);ca=this.getMaxCanvasScale(Ia,Xa,ca);Ia=Math.ceil(ca*Ia);Xa=Math.ceil(ca*Xa);Wa.setAttribute("width",Ia);Wa.setAttribute("height",Xa);var Pa=Wa.getContext("2d");null!=Aa&&(Pa.beginPath(),Pa.rect(0,0,Ia,Xa),Pa.fillStyle=Aa,Pa.fill());1!=ca&&Pa.scale(ca,ca);if(ya){var u=ra.view,N=u.scale;u.scale=1;var R=btoa(unescape(encodeURIComponent(u.createSvgGrid(u.gridColor))));u.scale=N;R="data:image/svg+xml;base64,"+R;var X=ra.gridSize*u.gridSteps*ca,ia=ra.getGraphBounds(),+ka=u.translate.x*N,pa=u.translate.y*N,wa=ka+(ia.x-ka)/N-xa,ta=pa+(ia.y-pa)/N-xa,ua=new Image;ua.onload=function(){try{for(var Ca=-Math.round(X-mxUtils.mod((ka-wa)*ca,X)),Na=-Math.round(X-mxUtils.mod((pa-ta)*ca,X));Ca<Ia;Ca+=X)for(var Ya=Na;Ya<Xa;Ya+=X)Pa.drawImage(ua,Ca/ca,Ya/ca);za()}catch(Za){null!=K&&K(Za)}};ua.onerror=function(Ca){null!=K&&K(Ca)};ua.src=R}else za()}catch(Ca){null!=K&&K(Ca)}});Ka.onerror=function(za){null!=K&&K(za)};oa&&this.graph.addSvgShadow(Ea);this.graph.mathEnabled&&this.addMathCss(Ea);+var Ma=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ea,this.resolvedFontCss),Ka.src=Editor.createSvgDataUri(mxUtils.getXml(Ea))}catch(za){null!=K&&K(za)}});this.embedExtFonts(mxUtils.bind(this,function(za){try{null!=za&&this.addFontCss(Ea,za),this.loadFonts(Ma)}catch(Wa){null!=K&&K(Wa)}}))}catch(za){null!=K&&K(za)}}),H,qa)}catch(Ea){null!=K&&K(Ea)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,A=0;8>A;A++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=+p;Editor.updateCRC=function(l,t,H,U){for(var K=0;K<U;K++)l=Editor.crcTable[(l^t.charCodeAt(H+K))&255]^l>>>8;return l};Editor.crc32=function(l){for(var t=-1,H=0;H<l.length;H++)t=t>>>8^Editor.crcTable[(t^l.charCodeAt(H))&255];return(t^-1)>>>0};Editor.writeGraphModelToPng=function(l,t,H,U,K){function W(qa,ra){var xa=ja;ja+=ra;return qa.substring(xa,ja)}function Y(qa){qa=W(qa,4);return qa.charCodeAt(3)+(qa.charCodeAt(2)<<8)+(qa.charCodeAt(1)<<16)+(qa.charCodeAt(0)<<24)}function ca(qa){return String.fromCharCode(qa>>+24&255,qa>>16&255,qa>>8&255,qa&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?atob(l):Base64.decode(l,!0);var ja=0;if(W(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=K&&K();else if(W(l,4),"IHDR"!=W(l,4))null!=K&&K();else{W(l,17);K=l.substring(0,ja);do{var oa=Y(l);if("IDAT"==W(l,4)){K=l.substring(0,ja-8);"pHYs"==t&&"dpi"==H?(H=Math.round(U/.0254),H=ca(H)+ca(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==t?String.fromCharCode(0):"")+U;U=4294967295;U=+Editor.updateCRC(U,t,0,4);U=Editor.updateCRC(U,H,0,H.length);K+=ca(H.length)+t+H+ca(U^4294967295);K+=l.substring(ja-8,l.length);break}K+=l.substring(ja-8,ja-4+oa);W(l,oa);W(l,4)}while(oa);return"data:image/png;base64,"+(window.btoa?btoa(K):Base64.encode(K,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,t){G.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);+mxSettings.save()};var S=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){S.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,t){var H=null;null!=l.editor.graph.getModel().getParent(t)?H=t.getId():null!=l.currentPage&&(H=l.currentPage.getId());return H});if(null!=window.StyleFormatPanel){var F=Format.prototype.init;Format.prototype.init=function(){F.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var P=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?P.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(l){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var Q=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=-function(l){l=Q.apply(this,arguments);var t=this.editorUi,I=t.editor.graph;if(I.isEnabled()){var V=t.getCurrentFile();null!=V&&V.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),function(){return t.editor.autosave},function(Y){t.editor.setAutosave(Y);t.editor.autosave&&V.isModified()&&V.fileChanged()},{install:function(Y){this.listener=function(){Y(t.editor.autosave)};t.editor.addListener("autosaveChanged",this.listener)},destroy:function(){t.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&-I.isEnabled()&&"undefined"!==typeof MathJax){var J=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return I.mathEnabled},function(Y){t.actions.get("mathematicalTypesetting").funct()},{install:function(Y){this.listener=function(){Y(I.mathEnabled)};t.addListener("mathEnabledChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}});l.appendChild(J);if(!t.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var W=t.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting");-W.style.position="absolute";W.style.left="85%";J.appendChild(W)}}return l};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",+function(l){l=Q.apply(this,arguments);var t=this.editorUi,H=t.editor.graph;if(H.isEnabled()){var U=t.getCurrentFile();null!=U&&U.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),function(){return t.editor.autosave},function(Y){t.editor.setAutosave(Y);t.editor.autosave&&U.isModified()&&U.fileChanged()},{install:function(Y){this.listener=function(){Y(t.editor.autosave)};t.editor.addListener("autosaveChanged",this.listener)},destroy:function(){t.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&+H.isEnabled()&&"undefined"!==typeof MathJax){var K=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(Y){t.actions.get("mathematicalTypesetting").funct()},{install:function(Y){this.listener=function(){Y(H.mathEnabled)};t.addListener("mathEnabledChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}});l.appendChild(K);if(!t.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var W=t.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting");+W.style.position="absolute";W.style.left="85%";K.appendChild(W)}}return l};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.25,@@ -3313,95 +3313,95 @@ min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},-{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(l,t,I,V){if(null!=t){var J=mxUtils.bind(this,function(Y){if(null!=Y)if(I)for(var ba=0;ba<Y.length;ba++){if("function"!==typeof Y[ba].isVisible||Y[ba].isVisible(V,this))t[Y[ba].name]=Y[ba]}else for(var ja in t){var oa=!1;for(ba=-0;ba<Y.length;ba++)if(Y[ba].name==ja&&Y[ba].type==t[ja].type){oa=!0;break}oa||delete t[ja]}}),W=this.editorUi.editor.graph.view.getState(l);null!=W&&null!=W.shape&&(W.shape.commonCustomPropAdded||(W.shape.commonCustomPropAdded=!0,W.shape.customProperties=W.shape.customProperties||[],W.cell.vertex?Array.prototype.push.apply(W.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(W.shape.customProperties,Editor.commonEdgeProperties)),J(W.shape.customProperties));l=l.getAttribute("customProperties");-if(null!=l)try{J(JSON.parse(l))}catch(Y){}}};var U=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=l.style.shape&&!l.containsLabel&&0<l.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));U.apply(this,arguments);if(Editor.enableCustomProperties){for(var t={},I=l.vertices,V=l.edges,J=0;J<I.length;J++)this.findCommonProperties(I[J],t,-0==J,l);for(J=0;J<V.length;J++)this.findCommonProperties(V[J],t,0==I.length&&0==J,l);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(t).length&&this.container.appendChild(this.addProperties(this.createPanel(),t,l))}};var c=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var t=this.editorUi.getSelectionState();1==t.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=t.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);c.apply(this,-arguments);return l};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,t,I,V){function J(Pa,u,N,R,X){if(null!=N.valueChanged)N.valueChanged(u,X);else{xa.getModel().beginUpdate();try{X=[];var ia=[];if(null!=N.index){for(var ka=[],pa=N.parentRow.nextSibling;pa&&pa.getAttribute("data-pName")==Pa;)ka.push(pa.getAttribute("data-pValue")),pa=pa.nextSibling;N.index<ka.length?null!=R?ka.splice(R,1):ka[N.index]=u:ka.push(u);null!=N.size&&ka.length>N.size&&(ka=ka.slice(0,+{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(l,t,H,U){if(null!=t){var K=mxUtils.bind(this,function(Y){if(null!=Y)if(H)for(var ca=0;ca<Y.length;ca++){if("function"!==typeof Y[ca].isVisible||Y[ca].isVisible(U,this))t[Y[ca].name]=Y[ca]}else for(var ja in t){var oa=!1;for(ca=+0;ca<Y.length;ca++)if(Y[ca].name==ja&&Y[ca].type==t[ja].type){oa=!0;break}oa||delete t[ja]}}),W=this.editorUi.editor.graph.view.getState(l);null!=W&&null!=W.shape&&(W.shape.commonCustomPropAdded||(W.shape.commonCustomPropAdded=!0,W.shape.customProperties=W.shape.customProperties||[],W.cell.vertex?Array.prototype.push.apply(W.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(W.shape.customProperties,Editor.commonEdgeProperties)),K(W.shape.customProperties));l=l.getAttribute("customProperties");+if(null!=l)try{K(JSON.parse(l))}catch(Y){}}};var T=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=l.style.shape&&!l.containsLabel&&0<l.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));T.apply(this,arguments);if(Editor.enableCustomProperties){for(var t={},H=l.vertices,U=l.edges,K=0;K<H.length;K++)this.findCommonProperties(H[K],t,+0==K,l);for(K=0;K<U.length;K++)this.findCommonProperties(U[K],t,0==H.length&&0==K,l);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(t).length&&this.container.appendChild(this.addProperties(this.createPanel(),t,l))}};var c=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var t=this.editorUi.getSelectionState();1==t.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=t.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);c.apply(this,+arguments);return l};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,t,H,U){function K(Pa,u,N,R,X){if(null!=N.valueChanged)N.valueChanged(u,X);else{xa.getModel().beginUpdate();try{X=[];var ia=[];if(null!=N.index){for(var ka=[],pa=N.parentRow.nextSibling;pa&&pa.getAttribute("data-pName")==Pa;)ka.push(pa.getAttribute("data-pValue")),pa=pa.nextSibling;N.index<ka.length?null!=R?ka.splice(R,1):ka[N.index]=u:ka.push(u);null!=N.size&&ka.length>N.size&&(ka=ka.slice(0,N.size));u=ka.join(",");null!=N.countProperty&&(xa.setCellStyles(N.countProperty,ka.length,xa.getSelectionCells()),X.push(N.countProperty),ia.push(ka.length))}xa.setCellStyles(Pa,u,xa.getSelectionCells());X.push(Pa);ia.push(u);if(null!=N.dependentProps)for(Pa=0;Pa<N.dependentProps.length;Pa++){var wa=N.dependentPropsDefVal[Pa],ta=N.dependentPropsVals[Pa];if(ta.length>u)ta=ta.slice(0,u);else for(var ua=ta.length;ua<u;ua++)ta.push(wa);ta=ta.join(",");xa.setCellStyles(N.dependentProps[Pa],ta,xa.getSelectionCells());X.push(N.dependentProps[Pa]);ia.push(ta)}if("function"==typeof N.onChange)N.onChange(xa,u);ra.editorUi.fireEvent(new mxEventObject("styleChanged","keys",X,"values",ia,"cells",xa.getSelectionCells()))}finally{xa.getModel().endUpdate()}}}function W(Pa,u,N){var R=mxUtils.getOffset(l,!0),X=mxUtils.getOffset(Pa,!0);u.style.position="absolute";u.style.left=X.x-R.x+"px";u.style.top=X.y-R.y+"px";u.style.width=Pa.offsetWidth+"px";u.style.height=Pa.offsetHeight-(N?4:0)+"px";u.style.zIndex=5}function Y(Pa,u,N){function R(ia){if(null==ia||ia==mxConstants.NONE)X.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==ia)X.style.background="";else{var ka=mxUtils.getLightDarkColor(ia);mxUtils.isLightDarkColor(ia)&&ka.light!=ka.dark?X.style.background="linear-gradient(to right bottom, "+ka.cssText+" 50%, "+mxUtils.invertLightDarkColor(ka).cssText+" 50.3%)":X.style.background=ia}}var X=document.createElement("div");X.style.width="32px";X.style.height="8px";X.style.margin="2px";X.style.borderStyle=-"solid";X.style.borderWidth="1px";R(u);btn=mxUtils.button("",mxUtils.bind(ra,function(ia){this.editorUi.pickColor(u,function(ka){J(Pa,ka,N);R(ka)});mxEvent.consume(ia)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(X);return btn}function ba(Pa,u,N,R,X,ia,ka){null!=u&&(u=u.split(","),Ba.push({name:Pa,values:u,type:N,defVal:R,countProperty:X,parentRow:ia,isDeletable:!0,flipBkg:ka}));btn=mxUtils.button("+",-mxUtils.bind(ra,function(pa){for(var wa=ia,ta=0;null!=wa.nextSibling;)if(wa.nextSibling.getAttribute("data-pName")==Pa)wa=wa.nextSibling,ta++;else break;var ua={type:N,parentRow:ia,index:ta,isDeletable:!0,defVal:R,countProperty:X};ta=qa(Pa,"",ua,0==ta%2,ka);J(Pa,R,ua);wa.parentNode.insertBefore(ta,wa.nextSibling);mxEvent.consume(pa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ja(Pa,u,N,R,X,ia,ka){if(0<X){var pa=Array(X);u=null!=u?u.split(","):[];-for(var wa=0;wa<X;wa++)pa[wa]=null!=u[wa]?u[wa]:null!=R?R:"";Ba.push({name:Pa,values:pa,type:N,defVal:R,parentRow:ia,flipBkg:ka,size:X})}return document.createElement("div")}function oa(Pa,u,N){var R=document.createElement("input");R.type="checkbox";R.checked="1"==u;mxEvent.addListener(R,"change",function(){J(Pa,R.checked?"1":"0",N)});return R}function qa(Pa,u,N,R,X){var ia=N.dispName,ka=N.type,pa=document.createElement("tr");pa.className="gePropRow"+(X?"Dark":"")+(R?"Alt":"")+" gePropNonHeaderRow";+"solid";X.style.borderWidth="1px";R(u);btn=mxUtils.button("",mxUtils.bind(ra,function(ia){this.editorUi.pickColor(u,function(ka){K(Pa,ka,N);R(ka)});mxEvent.consume(ia)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(X);return btn}function ca(Pa,u,N,R,X,ia,ka){null!=u&&(u=u.split(","),Ba.push({name:Pa,values:u,type:N,defVal:R,countProperty:X,parentRow:ia,isDeletable:!0,flipBkg:ka}));btn=mxUtils.button("+",+mxUtils.bind(ra,function(pa){for(var wa=ia,ta=0;null!=wa.nextSibling;)if(wa.nextSibling.getAttribute("data-pName")==Pa)wa=wa.nextSibling,ta++;else break;var ua={type:N,parentRow:ia,index:ta,isDeletable:!0,defVal:R,countProperty:X};ta=qa(Pa,"",ua,0==ta%2,ka);K(Pa,R,ua);wa.parentNode.insertBefore(ta,wa.nextSibling);mxEvent.consume(pa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ja(Pa,u,N,R,X,ia,ka){if(0<X){var pa=Array(X);u=null!=u?u.split(","):[];+for(var wa=0;wa<X;wa++)pa[wa]=null!=u[wa]?u[wa]:null!=R?R:"";Ba.push({name:Pa,values:pa,type:N,defVal:R,parentRow:ia,flipBkg:ka,size:X})}return document.createElement("div")}function oa(Pa,u,N){var R=document.createElement("input");R.type="checkbox";R.checked="1"==u;mxEvent.addListener(R,"change",function(){K(Pa,R.checked?"1":"0",N)});return R}function qa(Pa,u,N,R,X){var ia=N.dispName,ka=N.type,pa=document.createElement("tr");pa.className="gePropRow"+(X?"Dark":"")+(R?"Alt":"")+" gePropNonHeaderRow";pa.setAttribute("data-pName",Pa);pa.setAttribute("data-pValue",u);R=!1;null!=N.index&&(pa.setAttribute("data-index",N.index),ia=(null!=ia?ia:"")+"["+N.index+"]",R=!0);var wa=document.createElement("td");wa.className="gePropRowCell";ia=mxResources.get(ia,null,ia);mxUtils.write(wa,ia);wa.setAttribute("title",ia);R&&(wa.style.textAlign="right");pa.appendChild(wa);wa=document.createElement("td");wa.className="gePropRowCell";wa.setAttribute("title",null!=u?u:mxResources.get("none"));if("color"==ka)wa.appendChild(Y(Pa,u,N));else if("bool"==ka||"boolean"==ka)wa.appendChild(oa(Pa,u,N));else if("enum"==ka){var ta=N.enumList;for(X=0;X<ta.length;X++)if(ia=ta[X],ia.val==u){mxUtils.write(wa,mxResources.get(ia.dispName,null,ia.dispName));break}mxEvent.addListener(wa,"click",mxUtils.bind(ra,function(){var ua=document.createElement("select"),Ca=null;W(wa,ua);for(var Na=0;Na<ta.length;Na++){var Ya=ta[Na],Za=document.createElement("option");Za.value=mxUtils.htmlEntities(Ya.val);mxUtils.write(Za,mxResources.get(Ya.dispName,-null,Ya.dispName));ua.appendChild(Za);null==Ya.val&&(Za.value="null",Ca=Za)}ua.value=null==u&&null!=Ca?"null":u;l.appendChild(ua);mxEvent.addListener(ua,"change",function(){var ab=mxUtils.htmlEntities(ua.value);if(ua[ua.selectedIndex]==Ca||"null"==ab.value)ab=null;J(Pa,ab,N)});ua.focus();mxEvent.addListener(ua,"blur",function(){l.removeChild(ua)})}))}else"dynamicArr"==ka?wa.appendChild(ba(Pa,u,N.subType,N.subDefVal,N.countProperty,pa,X)):"staticArr"==ka?wa.appendChild(ja(Pa,u,N.subType,N.subDefVal,+null,Ya.dispName));ua.appendChild(Za);null==Ya.val&&(Za.value="null",Ca=Za)}ua.value=null==u&&null!=Ca?"null":u;l.appendChild(ua);mxEvent.addListener(ua,"change",function(){var ab=mxUtils.htmlEntities(ua.value);if(ua[ua.selectedIndex]==Ca||"null"==ab.value)ab=null;K(Pa,ab,N)});ua.focus();mxEvent.addListener(ua,"blur",function(){l.removeChild(ua)})}))}else"dynamicArr"==ka?wa.appendChild(ca(Pa,u,N.subType,N.subDefVal,N.countProperty,pa,X)):"staticArr"==ka?wa.appendChild(ja(Pa,u,N.subType,N.subDefVal,N.size,pa,X)):"readOnly"==ka?(X=document.createElement("input"),X.setAttribute("readonly",""),X.value=u,X.style.borderWidth="0px","id"==Pa?(X.style.width="190px",X.style.position="relative",X.style.right="6px",X.style.float="right",X.style.background="none",X.style.textAlign="right",pa.firstChild.setAttribute("colspan","2"),X.setAttribute("title",u),pa.firstChild.appendChild(X)):(X.style.width="96px",wa.appendChild(X))):(wa.innerHTML=mxUtils.htmlEntities(decodeURIComponent(u)),mxEvent.addListener(wa,-"click",mxUtils.bind(ra,function(){function ua(){var Na=Ca.value;Na=0==Na.length&&"string"!=ka&&"numbers"!=ka?0:Na;N.allowAuto&&(null!=Na.trim&&"auto"==Na.trim().toLowerCase()?(Na="auto",ka="string"):(Na=parseFloat(Na),Na=isNaN(Na)?0:Na));null!=N.min&&Na<N.min?Na=N.min:null!=N.max&&Na>N.max&&(Na=N.max);var Ya=null;try{Ya="numbers"==ka?Na.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==ka?parseInt(Na):Na)+"")}catch(Za){}J(Pa,Ya,N,null,Ca)}var Ca=document.createElement("input");W(wa,-Ca,!0);Ca.value=decodeURIComponent(u);Ca.className="gePropEditor";"int"!=ka&&"float"!=ka||N.allowAuto||(Ca.type="number",Ca.step="int"==ka?"1":"any",null!=N.min&&(Ca.min=parseFloat(N.min)),null!=N.max&&(Ca.max=parseFloat(N.max)));l.appendChild(Ca);mxEvent.addListener(Ca,"keypress",function(Na){13==Na.keyCode&&ua()});Ca.focus();mxEvent.addListener(Ca,"blur",function(){ua()})})));N.isDeletable&&(X=mxUtils.button("-",mxUtils.bind(ra,function(ua){J(Pa,"",N,N.index);mxEvent.consume(ua)})),X.style.height=+"click",mxUtils.bind(ra,function(){function ua(){var Na=Ca.value;Na=0==Na.length&&"string"!=ka&&"numbers"!=ka?0:Na;N.allowAuto&&(null!=Na.trim&&"auto"==Na.trim().toLowerCase()?(Na="auto",ka="string"):(Na=parseFloat(Na),Na=isNaN(Na)?0:Na));null!=N.min&&Na<N.min?Na=N.min:null!=N.max&&Na>N.max&&(Na=N.max);var Ya=null;try{Ya="numbers"==ka?Na.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==ka?parseInt(Na):Na)+"")}catch(Za){}K(Pa,Ya,N,null,Ca)}var Ca=document.createElement("input");W(wa,+Ca,!0);Ca.value=decodeURIComponent(u);Ca.className="gePropEditor";"int"!=ka&&"float"!=ka||N.allowAuto||(Ca.type="number",Ca.step="int"==ka?"1":"any",null!=N.min&&(Ca.min=parseFloat(N.min)),null!=N.max&&(Ca.max=parseFloat(N.max)));l.appendChild(Ca);mxEvent.addListener(Ca,"keypress",function(Na){13==Na.keyCode&&ua()});Ca.focus();mxEvent.addListener(Ca,"blur",function(){ua()})})));N.isDeletable&&(X=mxUtils.button("-",mxUtils.bind(ra,function(ua){K(Pa,"",N,N.index);mxEvent.consume(ua)})),X.style.height="16px",X.style.width="25px",X.style.float="right",X.className="geColorBtn",wa.appendChild(X));pa.appendChild(wa);return pa}var ra=this,xa=this.editorUi.editor.graph,Ba=[];l.style.position="relative";l.style.padding="0";var ya=document.createElement("table");ya.className="geProperties";ya.style.whiteSpace="nowrap";ya.style.width="100%";var Da=document.createElement("tr");Da.className="gePropHeader";var La=document.createElement("th");La.className="gePropHeaderCell";La.style.paddingLeft="16px";La.style.backgroundRepeat="no-repeat";La.style.backgroundPosition="-2px 50%";La.style.backgroundSize="20px";mxUtils.write(La,mxResources.get("property"));Da.style.cursor="pointer";var sa=function(){var Pa=ya.querySelectorAll(".gePropNonHeaderRow");if(ra.editorUi.propertiesCollapsed){La.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var u="none";for(var N=l.childNodes.length-1;0<=N;N--)try{var R=l.childNodes[N],X=R.nodeName.toUpperCase();"INPUT"!=X&&"SELECT"!=X||l.removeChild(R)}catch(ia){}}else La.style.backgroundImage=-"url('"+Editor.arrowDownImage+"')",u="";for(N=0;N<Pa.length;N++)Pa[N].style.display=u};mxEvent.addListener(Da,"click",function(){ra.editorUi.propertiesCollapsed=!ra.editorUi.propertiesCollapsed;sa()});Da.appendChild(La);var Aa=document.createElement("th");Aa.className="gePropHeaderCell";Aa.style.paddingLeft="4px";mxUtils.write(Aa,mxResources.get("value"));Da.appendChild(Aa);ya.appendChild(Da);var Ea=Aa=!1;Da=null;1==I.vertices.length&&0==I.edges.length?Da=I.vertices[0].id:0==I.vertices.length&&1==-I.edges.length&&(Da=I.edges[0].id);null==Da||V||ya.appendChild(qa("id",mxUtils.htmlEntities(Da),{dispName:"id",type:"readOnly"},!0,!1));for(var Ka in t)if(V=t[Ka],"function"!=typeof V.isVisible||V.isVisible(I,this)){var Ma=null!=V.getValue?V.getValue():null!=I.style[Ka]?mxUtils.htmlEntities(I.style[Ka]+""):null!=V.getDefaultValue?V.getDefaultValue(I,this):V.defVal;if("separator"==V.type)Ea=!Ea;else{if("staticArr"==V.type)V.size=parseInt(I.style[V.sizeProperty]||t[V.sizeProperty].defVal)||0;else if(null!=-V.dependentProps){var za=V.dependentProps,Wa=[],Ia=[];for(Da=0;Da<za.length;Da++){var Xa=I.style[za[Da]];Ia.push(t[za[Da]].subDefVal);Wa.push(null!=Xa?Xa.split(","):[])}V.dependentPropsDefVal=Ia;V.dependentPropsVals=Wa}ya.appendChild(qa(Ka,Ma,V,Aa,Ea));Aa=!Aa}}for(Da=0;Da<Ba.length;Da++)for(V=Ba[Da],t=V.parentRow,I=0;I<V.values.length;I++)Ka=qa(V.name,V.values[I],{type:V.type,parentRow:V.parentRow,isDeletable:V.isDeletable,index:I,defVal:V.defVal,countProperty:V.countProperty,size:V.size},0==I%2,-V.flipBkg),t.parentNode.insertBefore(Ka,t.nextSibling),t=Ka;l.appendChild(ya);sa();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var t=function(Ba){mxEvent.addListener(Ba,"mouseenter",function(){Ba.style.opacity="1"});mxEvent.addListener(Ba,"mouseleave",function(){Ba.style.opacity="0.5"})},I=this.editorUi,V=I.editor.graph,J=document.createElement("div");J.style.whiteSpace="nowrap";J.style.paddingLeft="24px";J.style.paddingRight="20px";l.style.paddingLeft=-"16px";l.style.paddingBottom="6px";l.style.position="relative";l.appendChild(J);var W=document.createElement("div");W.style.whiteSpace="nowrap";W.style.position="relative";W.style.textAlign="center";W.style.width="210px";for(var Y=[],ba=0;ba<this.defaultColorSchemes.length;ba++){var ja=document.createElement("div");ja.style.display="inline-block";ja.style.width="6px";ja.style.height="6px";ja.style.marginLeft="4px";ja.style.marginRight="3px";ja.style.borderRadius="3px";ja.style.cursor="pointer";ja.style.background=-"transparent";ja.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(Ba){mxEvent.addListener(ja,"click",mxUtils.bind(this,function(){oa(Ba)}))})(ba);Y.push(ja);W.appendChild(ja)}var oa=mxUtils.bind(this,function(Ba){null!=Y[Ba]&&(null!=this.format.currentScheme&&null!=Y[this.format.currentScheme]&&(Y[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Ba,qa(this.defaultColorSchemes[this.format.currentScheme]),Y[this.format.currentScheme].style.background="#84d7ff")}),-qa=mxUtils.bind(this,function(Ba){var ya=mxUtils.clone(V.defaultVertexStyle);ya[mxConstants.STYLE_STROKECOLOR]=null!=ya[mxConstants.STYLE_STROKECOLOR]?ya[mxConstants.STYLE_STROKECOLOR]:"default";ya[mxConstants.STYLE_FILLCOLOR]=null!=ya[mxConstants.STYLE_FILLCOLOR]?ya[mxConstants.STYLE_FILLCOLOR]:"default";ya[mxConstants.STYLE_FONTCOLOR]=null!=ya[mxConstants.STYLE_FONTCOLOR]?ya[mxConstants.STYLE_FONTCOLOR]:"default";V.replaceDefaultColors(new mxCell,ya);var Da=mxUtils.bind(this,function(sa){var Aa=-mxUtils.button("",mxUtils.bind(this,function(Ma){V.getModel().beginUpdate();try{for(var za=I.getSelectionState().cells,Wa=0;Wa<za.length;Wa++){var Ia=V.getModel().getStyle(za[Wa]);null!=sa?(mxEvent.isShiftDown(Ma)||(Ia=""==sa.fill||null==sa.fill?mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,sa.fill),Ia=""==sa.gradient||null==sa.gradient?mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,-sa.gradient),mxEvent.isControlDown(Ma)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ma)||!V.getModel().isVertex(za[Wa])||(Ia=""==sa.font||null==sa.font?mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,sa.font))),mxEvent.isAltDown(Ma)||(Ia=""==sa.stroke||null==sa.fill?mxUtils.setStyle(Ia,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_STROKECOLOR,sa.stroke))):(Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,null),Ia=mxUtils.setStyle(Ia,-mxConstants.STYLE_STROKECOLOR,null),Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,null),V.getModel().isVertex(za[Wa])&&(Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,null)));V.getModel().setStyle(za[Wa],Ia)}}finally{V.getModel().endUpdate()}}));Aa.className="geStyleButton";Aa.style.width="36px";Aa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";Aa.style.margin="0px 6px 6px 0px";if(null!=sa){var Ea="1px solid";null!=sa.border&&(Ea=sa.border);if(null!=sa.gradient)Aa.style.backgroundImage=+"url('"+Editor.arrowDownImage+"')",u="";for(N=0;N<Pa.length;N++)Pa[N].style.display=u};mxEvent.addListener(Da,"click",function(){ra.editorUi.propertiesCollapsed=!ra.editorUi.propertiesCollapsed;sa()});Da.appendChild(La);var Aa=document.createElement("th");Aa.className="gePropHeaderCell";Aa.style.paddingLeft="4px";mxUtils.write(Aa,mxResources.get("value"));Da.appendChild(Aa);ya.appendChild(Da);var Ea=Aa=!1;Da=null;1==H.vertices.length&&0==H.edges.length?Da=H.vertices[0].id:0==H.vertices.length&&1==+H.edges.length&&(Da=H.edges[0].id);null==Da||U||ya.appendChild(qa("id",mxUtils.htmlEntities(Da),{dispName:"id",type:"readOnly"},!0,!1));for(var Ka in t)if(U=t[Ka],"function"!=typeof U.isVisible||U.isVisible(H,this)){var Ma=null!=U.getValue?U.getValue():null!=H.style[Ka]?mxUtils.htmlEntities(H.style[Ka]+""):null!=U.getDefaultValue?U.getDefaultValue(H,this):U.defVal;if("separator"==U.type)Ea=!Ea;else{if("staticArr"==U.type)U.size=parseInt(H.style[U.sizeProperty]||t[U.sizeProperty].defVal)||0;else if(null!=+U.dependentProps){var za=U.dependentProps,Wa=[],Ia=[];for(Da=0;Da<za.length;Da++){var Xa=H.style[za[Da]];Ia.push(t[za[Da]].subDefVal);Wa.push(null!=Xa?Xa.split(","):[])}U.dependentPropsDefVal=Ia;U.dependentPropsVals=Wa}ya.appendChild(qa(Ka,Ma,U,Aa,Ea));Aa=!Aa}}for(Da=0;Da<Ba.length;Da++)for(U=Ba[Da],t=U.parentRow,H=0;H<U.values.length;H++)Ka=qa(U.name,U.values[H],{type:U.type,parentRow:U.parentRow,isDeletable:U.isDeletable,index:H,defVal:U.defVal,countProperty:U.countProperty,size:U.size},0==H%2,+U.flipBkg),t.parentNode.insertBefore(Ka,t.nextSibling),t=Ka;l.appendChild(ya);sa();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var t=function(Ba){mxEvent.addListener(Ba,"mouseenter",function(){Ba.style.opacity="1"});mxEvent.addListener(Ba,"mouseleave",function(){Ba.style.opacity="0.5"})},H=this.editorUi,U=H.editor.graph,K=document.createElement("div");K.style.whiteSpace="nowrap";K.style.paddingLeft="24px";K.style.paddingRight="20px";l.style.paddingLeft=+"16px";l.style.paddingBottom="6px";l.style.position="relative";l.appendChild(K);var W=document.createElement("div");W.style.whiteSpace="nowrap";W.style.position="relative";W.style.textAlign="center";W.style.width="210px";for(var Y=[],ca=0;ca<this.defaultColorSchemes.length;ca++){var ja=document.createElement("div");ja.style.display="inline-block";ja.style.width="6px";ja.style.height="6px";ja.style.marginLeft="4px";ja.style.marginRight="3px";ja.style.borderRadius="3px";ja.style.cursor="pointer";ja.style.background=+"transparent";ja.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(Ba){mxEvent.addListener(ja,"click",mxUtils.bind(this,function(){oa(Ba)}))})(ca);Y.push(ja);W.appendChild(ja)}var oa=mxUtils.bind(this,function(Ba){null!=Y[Ba]&&(null!=this.format.currentScheme&&null!=Y[this.format.currentScheme]&&(Y[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Ba,qa(this.defaultColorSchemes[this.format.currentScheme]),Y[this.format.currentScheme].style.background="#84d7ff")}),+qa=mxUtils.bind(this,function(Ba){var ya=mxUtils.clone(U.defaultVertexStyle);ya[mxConstants.STYLE_STROKECOLOR]=null!=ya[mxConstants.STYLE_STROKECOLOR]?ya[mxConstants.STYLE_STROKECOLOR]:"default";ya[mxConstants.STYLE_FILLCOLOR]=null!=ya[mxConstants.STYLE_FILLCOLOR]?ya[mxConstants.STYLE_FILLCOLOR]:"default";ya[mxConstants.STYLE_FONTCOLOR]=null!=ya[mxConstants.STYLE_FONTCOLOR]?ya[mxConstants.STYLE_FONTCOLOR]:"default";U.replaceDefaultColors(new mxCell,ya);var Da=mxUtils.bind(this,function(sa){var Aa=+mxUtils.button("",mxUtils.bind(this,function(Ma){U.getModel().beginUpdate();try{for(var za=H.getSelectionState().cells,Wa=0;Wa<za.length;Wa++){var Ia=U.getModel().getStyle(za[Wa]);null!=sa?(mxEvent.isShiftDown(Ma)||(Ia=""==sa.fill||null==sa.fill?mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,sa.fill),Ia=""==sa.gradient||null==sa.gradient?mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,+sa.gradient),mxEvent.isControlDown(Ma)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ma)||!U.getModel().isVertex(za[Wa])||(Ia=""==sa.font||null==sa.font?mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,sa.font))),mxEvent.isAltDown(Ma)||(Ia=""==sa.stroke||null==sa.fill?mxUtils.setStyle(Ia,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(Ia,mxConstants.STYLE_STROKECOLOR,sa.stroke))):(Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_FILLCOLOR,null),Ia=mxUtils.setStyle(Ia,+mxConstants.STYLE_STROKECOLOR,null),Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_GRADIENTCOLOR,null),U.getModel().isVertex(za[Wa])&&(Ia=mxUtils.setStyle(Ia,mxConstants.STYLE_FONTCOLOR,null)));U.getModel().setStyle(za[Wa],Ia)}}finally{U.getModel().endUpdate()}}));Aa.className="geStyleButton";Aa.style.width="36px";Aa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";Aa.style.margin="0px 6px 6px 0px";if(null!=sa){var Ea="1px solid";null!=sa.border&&(Ea=sa.border);if(null!=sa.gradient)Aa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(sa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(sa.gradient).cssText+" 100%)";else if(sa.fill==mxConstants.NONE)Aa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==sa.fill||""==sa.fill)Aa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Ka=mxUtils.getLightDarkColor(sa.fill);Aa.style.backgroundImage="linear-gradient(to right bottom, "+Ka.cssText+" 50%, "+Ka.light+" 50.3%)"}null==sa.stroke||sa.stroke==mxConstants.NONE?Aa.style.border=Ea+" transparent":""==sa.stroke?Aa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Ka=mxUtils.getLightDarkColor(sa.stroke),Aa.style.border=Ea+" "+Ka.cssText,Aa.style.borderRightColor=Ka.light,Aa.style.borderBottomColor=Aa.style.borderRightColor);null!=sa.title&&Aa.setAttribute("title",sa.title)}else Ea=mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,-"#ffffff"),Ka=mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000"),Aa.style.backgroundColor=Ea,Aa.style.border="1px solid "+Ka;Aa.style.borderRadius="0";J.appendChild(Aa);null!=sa&&null!=sa.gradient&&(Ea=Aa.cloneNode(!1),Ea.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(sa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(sa.gradient).light+") 100%)",Ea.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ea.style.backgroundColor=-"transparent",J.appendChild(Ea),Ea.style.marginLeft="-42px",mxEvent.addListener(Ea,"click",function(){Aa.click()}))});J.innerText="";if(null!=Ba)for(var La=0;La<Ba.length;La++)0<La&&0==mxUtils.mod(La,4)&&mxUtils.br(J),Da(Ba[La])});null==this.format.currentScheme?oa(Math.min(Y.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):oa(this.format.currentScheme);ba=10>=this.defaultColorSchemes.length?28:8;var ra=document.createElement("div");ra.style.cssText="position:absolute;left:10px;top:8px;bottom:"+-ba+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";mxEvent.addListener(ra,"click",mxUtils.bind(this,function(){oa(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));-var xa=document.createElement("div");xa.style.cssText="position:absolute;left:202px;top:8px;bottom:"+ba+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";1<this.defaultColorSchemes.length&&+"#ffffff"),Ka=mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000"),Aa.style.backgroundColor=Ea,Aa.style.border="1px solid "+Ka;Aa.style.borderRadius="0";K.appendChild(Aa);null!=sa&&null!=sa.gradient&&(Ea=Aa.cloneNode(!1),Ea.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(sa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(sa.gradient).light+") 100%)",Ea.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ea.style.backgroundColor=+"transparent",K.appendChild(Ea),Ea.style.marginLeft="-42px",mxEvent.addListener(Ea,"click",function(){Aa.click()}))});K.innerText="";if(null!=Ba)for(var La=0;La<Ba.length;La++)0<La&&0==mxUtils.mod(La,4)&&mxUtils.br(K),Da(Ba[La])});null==this.format.currentScheme?oa(Math.min(Y.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):oa(this.format.currentScheme);ca=10>=this.defaultColorSchemes.length?28:8;var ra=document.createElement("div");ra.style.cssText="position:absolute;left:10px;top:8px;bottom:"++ca+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";mxEvent.addListener(ra,"click",mxUtils.bind(this,function(){oa(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));+var xa=document.createElement("div");xa.style.cssText="position:absolute;left:202px;top:8px;bottom:"+ca+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";1<this.defaultColorSchemes.length&&(l.appendChild(ra),l.appendChild(xa));mxEvent.addListener(xa,"click",mxUtils.bind(this,function(){oa(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));t(ra);t(xa);qa(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&l.appendChild(W)}return l}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(l){return l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||l.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(l){return Graph.isGoogleFontUrl(l)};Graph.rewriteGoogleFontUrl=function(l){null!=l&&l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(l=Editor.GOOGLE_FONTS_CSS2+l.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return l};Graph.createFontElement=-function(l,t){var I=Graph.fontMapping[t];null==I&&Graph.isCssFontUrl(t)?(l=document.createElement("link"),l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(t))):(null==I&&(I='@font-face {\nfont-family: "'+l+'";\nsrc: url("'+t+'");\n}'),l=document.createElement("style"),mxUtils.write(l,I));return l};Graph.addRecentCustomFont=function(l,t){};Graph.addFont=function(l,t,I){if(null!=l&&0<l.length&&null!=-t&&0<t.length){var V=l.toLowerCase();if("helvetica"!=V&&"arial"!=l&&"sans-serif"!=V){var J=Graph.customFontElements[V];null!=J&&J.url!=t&&(J.elt.parentNode.removeChild(J.elt),J=null);null==J?(J=t,"http:"==t.substring(0,5)&&(J=PROXY_URL+"?url="+encodeURIComponent(t)),J={name:l,url:t,elt:Graph.createFontElement(l,J)},Graph.customFontElements[V]=J,t=document.getElementsByTagName("head")[0],null!=I&&("link"==J.elt.nodeName.toLowerCase()?(J.elt.onload=I,J.elt.onerror=I):I()),null!=t&&t.appendChild(J.elt)):-null!=I&&I()}else null!=I&&I()}else null!=I&&I();return l};Graph.getFontUrl=function(l,t){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(t=l.url);return t};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var t=0;t<l.length;t++){var I=l[t].getAttribute("data-font-src");if(null!=I){var V="FONT"==l[t].nodeName?l[t].getAttribute("face"):l[t].style.fontFamily;null!=V&&Graph.addFont(V,I)}}};Graph.processFontStyle=function(l){if(null!=l){var t=mxUtils.getValue(l,"fontSource",-null);if(null!=t){var I=mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=I)try{Graph.addFont(I,decodeURIComponent(t))}catch(V){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur=-"1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var f=Graph.prototype.init;Graph.prototype.init=function(){function l(J){t=J}f.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var t=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",l);mxEvent.addListener(this.container,"mouseleave",function(J){t=null});this.isMouseInsertPoint=function(){return null!=-t};var I=this.getInsertPoint;this.getInsertPoint=function(){return null!=t?this.getPointForEvent(t):I.apply(this,arguments)};var V=this.layoutManager.getLayout;this.layoutManager.getLayout=function(J){var W=this.graph.getCellStyle(J);if(null!=W&&"rack"==W.childLayout){var Y=new mxStackLayout(this.graph,!1);Y.gridSize=null!=W.rackUnitSize?parseFloat(W.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;Y.marginLeft=W.marginLeft||0;Y.marginRight=W.marginRight||0;Y.marginTop=-W.marginTop||0;Y.marginBottom=W.marginBottom||0;Y.allowGaps=W.allowGaps||0;Y.horizontal="1"==mxUtils.getValue(W,"horizontalRack","0");Y.resizeParent=!1;Y.fill=!0;return Y}return V.apply(this,arguments)};this.updateGlobalUrlVariables()};var k=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,t){return Graph.processFontStyle(k.apply(this,arguments))};var B=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(l,t,I,V,J,W,Y,ba,ja,-oa,qa,ra){B.apply(this,arguments);Graph.processFontAttributes(ra)};var z=mxText.prototype.redraw;mxText.prototype.redraw=function(){z.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,t,I,V){function J(){for(var Da=ba.getSelectionCells(),La=[],sa=0;sa<Da.length;sa++)ba.isCellVisible(Da[sa])&&La.push(Da[sa]);ba.setSelectionCells(La)}function W(Da){ba.setHiddenTags(Da?[]:ja.slice());J();ba.refresh()}-function Y(Da,La){qa.innerText="";if(0<Da.length){var sa=document.createElement("table");sa.setAttribute("cellpadding","2");sa.style.boxSizing="border-box";sa.style.tableLayout="fixed";sa.style.width="100%";var Aa=document.createElement("tbody");if(null!=Da&&0<Da.length)for(var Ea=0;Ea<Da.length;Ea++)(function(Ka){function Ma(){var u=ba.getCellsForTags([Ka],null,null,!0);ba.isEnabled()?ba.setSelectionCells(u):ba.highlightCells(u,null,null,70)}var za=0>mxUtils.indexOf(ba.hiddenTags,Ka),Wa=document.createElement("tr"),+function(l,t){var H=Graph.fontMapping[t];null==H&&Graph.isCssFontUrl(t)?(l=document.createElement("link"),l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(t))):(null==H&&(H='@font-face {\nfont-family: "'+l+'";\nsrc: url("'+t+'");\n}'),l=document.createElement("style"),mxUtils.write(l,H));return l};Graph.addRecentCustomFont=function(l,t){};Graph.addFont=function(l,t,H){if(null!=l&&0<l.length&&null!=+t&&0<t.length){var U=l.toLowerCase();if("helvetica"!=U&&"arial"!=l&&"sans-serif"!=U){var K=Graph.customFontElements[U];null!=K&&K.url!=t&&(K.elt.parentNode.removeChild(K.elt),K=null);null==K?(K=t,"http:"==t.substring(0,5)&&(K=PROXY_URL+"?url="+encodeURIComponent(t)),K={name:l,url:t,elt:Graph.createFontElement(l,K)},Graph.customFontElements[U]=K,t=document.getElementsByTagName("head")[0],null!=H&&("link"==K.elt.nodeName.toLowerCase()?(K.elt.onload=H,K.elt.onerror=H):H()),null!=t&&t.appendChild(K.elt)):+null!=H&&H()}else null!=H&&H()}else null!=H&&H();return l};Graph.getFontUrl=function(l,t){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(t=l.url);return t};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var t=0;t<l.length;t++){var H=l[t].getAttribute("data-font-src");if(null!=H){var U="FONT"==l[t].nodeName?l[t].getAttribute("face"):l[t].style.fontFamily;null!=U&&Graph.addFont(U,H)}}};Graph.processFontStyle=function(l){if(null!=l){var t=mxUtils.getValue(l,"fontSource",+null);if(null!=t){var H=mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=H)try{Graph.addFont(H,decodeURIComponent(t))}catch(U){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur=+"1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var f=Graph.prototype.init;Graph.prototype.init=function(){function l(K){t=K}f.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var t=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",l);mxEvent.addListener(this.container,"mouseleave",function(K){t=null});this.isMouseInsertPoint=function(){return null!=+t};var H=this.getInsertPoint;this.getInsertPoint=function(){return null!=t?this.getPointForEvent(t):H.apply(this,arguments)};var U=this.layoutManager.getLayout;this.layoutManager.getLayout=function(K){var W=this.graph.getCellStyle(K);if(null!=W&&"rack"==W.childLayout){var Y=new mxStackLayout(this.graph,!1);Y.gridSize=null!=W.rackUnitSize?parseFloat(W.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;Y.marginLeft=W.marginLeft||0;Y.marginRight=W.marginRight||0;Y.marginTop=+W.marginTop||0;Y.marginBottom=W.marginBottom||0;Y.allowGaps=W.allowGaps||0;Y.horizontal="1"==mxUtils.getValue(W,"horizontalRack","0");Y.resizeParent=!1;Y.fill=!0;return Y}return U.apply(this,arguments)};this.updateGlobalUrlVariables()};var k=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,t){return Graph.processFontStyle(k.apply(this,arguments))};var B=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(l,t,H,U,K,W,Y,ca,ja,+oa,qa,ra){B.apply(this,arguments);Graph.processFontAttributes(ra)};var z=mxText.prototype.redraw;mxText.prototype.redraw=function(){z.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,t,H,U){function K(){for(var Da=ca.getSelectionCells(),La=[],sa=0;sa<Da.length;sa++)ca.isCellVisible(Da[sa])&&La.push(Da[sa]);ca.setSelectionCells(La)}function W(Da){ca.setHiddenTags(Da?[]:ja.slice());K();ca.refresh()}+function Y(Da,La){qa.innerText="";if(0<Da.length){var sa=document.createElement("table");sa.setAttribute("cellpadding","2");sa.style.boxSizing="border-box";sa.style.tableLayout="fixed";sa.style.width="100%";var Aa=document.createElement("tbody");if(null!=Da&&0<Da.length)for(var Ea=0;Ea<Da.length;Ea++)(function(Ka){function Ma(){var u=ca.getCellsForTags([Ka],null,null,!0);ca.isEnabled()?ca.setSelectionCells(u):ca.highlightCells(u,null,null,70)}var za=0>mxUtils.indexOf(ca.hiddenTags,Ka),Wa=document.createElement("tr"),Ia=document.createElement("td");Ia.style.align="center";Ia.style.width="16px";var Xa=document.createElement("img");Xa.setAttribute("src",za?Editor.visibleImage:Editor.hiddenImage);Xa.setAttribute("title",mxResources.get(za?"hideIt":"show",[Ka]));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter="invert(100%)";Ia.appendChild(Xa);mxEvent.addListener(Xa,"click",function(u){mxEvent.isShiftDown(u)?-W(0<=mxUtils.indexOf(ba.hiddenTags,Ka)):(ba.toggleHiddenTag(Ka),J(),ba.refresh());mxEvent.consume(u)});Wa.appendChild(Ia);Ia=document.createElement("td");Ia.style.align="center";Ia.style.width="16px";Xa=document.createElement("img");Xa.setAttribute("src",Editor.selectImage);Xa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter=+W(0<=mxUtils.indexOf(ca.hiddenTags,Ka)):(ca.toggleHiddenTag(Ka),K(),ca.refresh());mxEvent.consume(u)});Wa.appendChild(Ia);Ia=document.createElement("td");Ia.style.align="center";Ia.style.width="16px";Xa=document.createElement("img");Xa.setAttribute("src",Editor.selectImage);Xa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter="invert(100%)";mxEvent.addListener(Xa,"click",function(u){W(!0);Ma();mxEvent.consume(u)});Ia.appendChild(Xa);Wa.appendChild(Ia);Ia=document.createElement("td");Ia.style.overflow="hidden";Ia.style.whiteSpace="nowrap";Ia.style.textOverflow="ellipsis";Ia.style.verticalAlign="middle";Ia.style.cursor="pointer";Ia.setAttribute("title",Ka);a=document.createElement("a");mxUtils.write(a,Ka);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,za?100:40);Ia.appendChild(a);mxEvent.addListener(Ia,-"click",function(u){if(mxEvent.isShiftDown(u))W(!0),Ma();else if(za&&0<ba.hiddenTags.length)W(!0);else{var N=ja.slice(),R=mxUtils.indexOf(N,Ka);N.splice(R,1);ba.setHiddenTags(N);J();ba.refresh()}mxEvent.consume(u)});Wa.appendChild(Ia);if(ba.isEnabled()){Ia=document.createElement("td");Ia.style.verticalAlign="middle";Ia.style.textAlign="center";Ia.style.width="18px";if(null==La){Ia.style.align="center";Ia.style.width="16px";Xa=document.createElement("img");Xa.setAttribute("src",Editor.trashImage);-Xa.setAttribute("title",mxResources.get("removeIt",[Ka]));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter="invert(100%)";mxEvent.addListener(Xa,"click",function(u){var N=mxUtils.indexOf(ja,Ka);0<=N&&ja.splice(N,1);ba.removeTagsForCells(ba.model.getDescendants(ba.model.getRoot()),[Ka]);ba.refresh();mxEvent.consume(u)});Ia.appendChild(Xa)}else{var Pa=document.createElement("input");-Pa.setAttribute("type","checkbox");Pa.style.margin="0px";Pa.defaultChecked=null!=La&&0<=mxUtils.indexOf(La,Ka);Pa.checked=Pa.defaultChecked;Pa.style.background="transparent";Pa.setAttribute("title",mxResources.get(Pa.defaultChecked?"removeIt":"add",[Ka]));mxEvent.addListener(Pa,"change",function(u){Pa.checked?ba.addTagsForCells(ba.getSelectionCells(),[Ka]):ba.removeTagsForCells(ba.getSelectionCells(),[Ka]);mxEvent.consume(u)});Ia.appendChild(Pa)}Wa.appendChild(Ia)}Aa.appendChild(Wa)})(Da[Ea]);sa.appendChild(Aa);-qa.appendChild(sa)}}var ba=this,ja=ba.hiddenTags.slice(),oa=document.createElement("div");oa.style.userSelect="none";oa.style.overflow="hidden";oa.style.padding="10px";oa.style.height="100%";var qa=document.createElement("div");qa.style.boxSizing="border-box";qa.style.borderRadius="4px";qa.style.userSelect="none";qa.style.overflow="auto";qa.style.position="absolute";qa.style.left="10px";qa.style.right="10px";qa.style.top="10px";qa.style.border=ba.isEnabled()?"1px solid #808080":"none";qa.style.bottom=-ba.isEnabled()?"48px":"10px";oa.appendChild(qa);var ra=mxUtils.button(mxResources.get("reset"),function(Da){ba.setHiddenTags([]);mxEvent.isShiftDown(Da)||(ja=ba.hiddenTags.slice());J();ba.refresh()});ra.setAttribute("title",mxResources.get("reset"));ra.className="geBtn";ra.style.margin="0 4px 0 0";var xa=mxUtils.button(mxResources.get("add"),function(){null!=I&&I(ja,function(Da){ja=Da;Ba()})});xa.setAttribute("title",mxResources.get("add"));xa.className="geBtn";xa.style.margin="0";ba.addListener(mxEvent.ROOT,-function(){ja=ba.hiddenTags.slice()});var Ba=mxUtils.bind(this,function(Da,La){if(l()){Da=ba.getAllTags();for(La=0;La<Da.length;La++)0>mxUtils.indexOf(ja,Da[La])&&ja.push(Da[La]);ja.sort();ba.isSelectionEmpty()?Y(ja):Y(ja,ba.getCommonTagsForCells(ba.getSelectionCells()))}});ba.selectionModel.addListener(mxEvent.CHANGE,Ba);ba.model.addListener(mxEvent.CHANGE,Ba);ba.addListener(mxEvent.REFRESH,Ba);var ya=document.createElement("div");ya.style.display="flex";ya.style.alignItems="center";ya.style.boxSizing=-"border-box";ya.style.whiteSpace="nowrap";ya.style.position="absolute";ya.style.overflow="hidden";ya.style.bottom="6px";ya.style.height="42px";ya.style.right="10px";ya.style.left="10px";ba.isEnabled()&&(ya.appendChild(ra),ya.appendChild(xa),oa.appendChild(ya));null!=V&&ya.appendChild(V);return{div:oa,refresh:Ba}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var t in Graph.customFontElements){var I=Graph.customFontElements[t];l.push({name:I.name,url:I.url})}return l};-Graph.prototype.setFont=function(l,t){Graph.addFont(l,t);var I=Editor.guid();document.execCommand("fontname",!1,I);for(var V=this.cellEditor.textarea.getElementsByTagName("font"),J=!1,W=0;W<V.length;W++)V[W].getAttribute("face")==I&&(J=!0,V[W].setAttribute("face",l),null!=t?V[W].setAttribute("data-font-src",t):V[W].removeAttribute("data-font-src"));J||document.execCommand("fontname",!1,l)};var C=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return C.apply(this,arguments)&&-(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var l=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=l)for(var t in l)this.globalVars[t]=l[t]}catch(I){null!=window.console&&console.log("Error in vars URL parameter: "+I)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):-{}};var H=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(l){var t=H.apply(this,arguments);null==t&&null!=this.globalVars&&(t=this.globalVars[l]);return t};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var K=Graph.prototype.getSvg;Graph.prototype.getSvg=-function(l,t,I,V,J,W,Y,ba,ja,oa,qa,ra,xa,Ba,ya,Da){var La=K.apply(this,arguments);if(null!=ra){var sa=La.getAttribute("style");null==sa&&(sa="");ra="auto"==ra?"none"==this.getAdaptiveColors()?"light":"light dark":ra;La.setAttribute("style",sa+(" color-scheme: "+ra+";"))}var Aa=this.getCustomFonts();if(qa&&0<Aa.length){var Ea=La.ownerDocument;sa=null!=Ea.createElementNS?Ea.createElementNS(mxConstants.NS_SVG,"style"):Ea.createElement("style");null!=Ea.setAttributeNS?sa.setAttributeNS("type","text/css"):+"click",function(u){if(mxEvent.isShiftDown(u))W(!0),Ma();else if(za&&0<ca.hiddenTags.length)W(!0);else{var N=ja.slice(),R=mxUtils.indexOf(N,Ka);N.splice(R,1);ca.setHiddenTags(N);K();ca.refresh()}mxEvent.consume(u)});Wa.appendChild(Ia);if(ca.isEnabled()){Ia=document.createElement("td");Ia.style.verticalAlign="middle";Ia.style.textAlign="center";Ia.style.width="18px";if(null==La){Ia.style.align="center";Ia.style.width="16px";Xa=document.createElement("img");Xa.setAttribute("src",Editor.trashImage);+Xa.setAttribute("title",mxResources.get("removeIt",[Ka]));mxUtils.setOpacity(Xa,za?75:25);Xa.className="geAdaptiveAsset";Xa.style.verticalAlign="middle";Xa.style.cursor="pointer";Xa.style.width="16px";if(t||Editor.isDarkMode())Xa.style.filter="invert(100%)";mxEvent.addListener(Xa,"click",function(u){var N=mxUtils.indexOf(ja,Ka);0<=N&&ja.splice(N,1);ca.removeTagsForCells(ca.model.getDescendants(ca.model.getRoot()),[Ka]);ca.refresh();mxEvent.consume(u)});Ia.appendChild(Xa)}else{var Pa=document.createElement("input");+Pa.setAttribute("type","checkbox");Pa.style.margin="0px";Pa.defaultChecked=null!=La&&0<=mxUtils.indexOf(La,Ka);Pa.checked=Pa.defaultChecked;Pa.style.background="transparent";Pa.setAttribute("title",mxResources.get(Pa.defaultChecked?"removeIt":"add",[Ka]));mxEvent.addListener(Pa,"change",function(u){Pa.checked?ca.addTagsForCells(ca.getSelectionCells(),[Ka]):ca.removeTagsForCells(ca.getSelectionCells(),[Ka]);mxEvent.consume(u)});Ia.appendChild(Pa)}Wa.appendChild(Ia)}Aa.appendChild(Wa)})(Da[Ea]);sa.appendChild(Aa);+qa.appendChild(sa)}}var ca=this,ja=ca.hiddenTags.slice(),oa=document.createElement("div");oa.style.userSelect="none";oa.style.overflow="hidden";oa.style.padding="10px";oa.style.height="100%";var qa=document.createElement("div");qa.style.boxSizing="border-box";qa.style.borderRadius="4px";qa.style.userSelect="none";qa.style.overflow="auto";qa.style.position="absolute";qa.style.left="10px";qa.style.right="10px";qa.style.top="10px";qa.style.border=ca.isEnabled()?"1px solid #808080":"none";qa.style.bottom=+ca.isEnabled()?"48px":"10px";oa.appendChild(qa);var ra=mxUtils.button(mxResources.get("reset"),function(Da){ca.setHiddenTags([]);mxEvent.isShiftDown(Da)||(ja=ca.hiddenTags.slice());K();ca.refresh()});ra.setAttribute("title",mxResources.get("reset"));ra.className="geBtn";ra.style.margin="0 4px 0 0";var xa=mxUtils.button(mxResources.get("add"),function(){null!=H&&H(ja,function(Da){ja=Da;Ba()})});xa.setAttribute("title",mxResources.get("add"));xa.className="geBtn";xa.style.margin="0";ca.addListener(mxEvent.ROOT,+function(){ja=ca.hiddenTags.slice()});var Ba=mxUtils.bind(this,function(Da,La){if(l()){Da=ca.getAllTags();for(La=0;La<Da.length;La++)0>mxUtils.indexOf(ja,Da[La])&&ja.push(Da[La]);ja.sort();ca.isSelectionEmpty()?Y(ja):Y(ja,ca.getCommonTagsForCells(ca.getSelectionCells()))}});ca.selectionModel.addListener(mxEvent.CHANGE,Ba);ca.model.addListener(mxEvent.CHANGE,Ba);ca.addListener(mxEvent.REFRESH,Ba);var ya=document.createElement("div");ya.style.display="flex";ya.style.alignItems="center";ya.style.boxSizing=+"border-box";ya.style.whiteSpace="nowrap";ya.style.position="absolute";ya.style.overflow="hidden";ya.style.bottom="6px";ya.style.height="42px";ya.style.right="10px";ya.style.left="10px";ca.isEnabled()&&(ya.appendChild(ra),ya.appendChild(xa),oa.appendChild(ya));null!=U&&ya.appendChild(U);return{div:oa,refresh:Ba}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var t in Graph.customFontElements){var H=Graph.customFontElements[t];l.push({name:H.name,url:H.url})}return l};+Graph.prototype.setFont=function(l,t){Graph.addFont(l,t);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var U=this.cellEditor.textarea.getElementsByTagName("font"),K=!1,W=0;W<U.length;W++)U[W].getAttribute("face")==H&&(K=!0,U[W].setAttribute("face",l),null!=t?U[W].setAttribute("data-font-src",t):U[W].removeAttribute("data-font-src"));K||document.execCommand("fontname",!1,l)};var C=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return C.apply(this,arguments)&&+(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var l=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=l)for(var t in l)this.globalVars[t]=l[t]}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+H)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):+{}};var I=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(l){var t=I.apply(this,arguments);null==t&&null!=this.globalVars&&(t=this.globalVars[l]);return t};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var L=Graph.prototype.getSvg;Graph.prototype.getSvg=+function(l,t,H,U,K,W,Y,ca,ja,oa,qa,ra,xa,Ba,ya,Da){var La=L.apply(this,arguments);if(null!=ra){var sa=La.getAttribute("style");null==sa&&(sa="");ra="auto"==ra?"none"==this.getAdaptiveColors()?"light":"light dark":ra;La.setAttribute("style",sa+(" color-scheme: "+ra+";"))}var Aa=this.getCustomFonts();if(qa&&0<Aa.length){var Ea=La.ownerDocument;sa=null!=Ea.createElementNS?Ea.createElementNS(mxConstants.NS_SVG,"style"):Ea.createElement("style");null!=Ea.setAttributeNS?sa.setAttributeNS("type","text/css"):sa.setAttribute("type","text/css");for(var Ka="",Ma="",za=0;za<Aa.length;za++){var Wa=Aa[za].name,Ia=Aa[za].url;Graph.isCssFontUrl(Ia)?Ka+="@import url("+Graph.rewriteGoogleFontUrl(Ia)+");\n":Ma+='@font-face {\nfont-family: "'+Wa+'";\nsrc: url("'+Ia+'");\n}\n'}sa.appendChild(Ea.createTextNode(Ka+Ma));La.getElementsByTagName("defs")[0].appendChild(sa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(La);this.mathEnabled&&(document.body.appendChild(La),-Editor.MathJaxRender(La),La.parentNode.removeChild(La),sa=La.ownerDocument.getElementById("MJX-SVG-styles"),null!=sa&&La.getElementsByTagName("defs")[0].appendChild(sa.cloneNode(!0)));return La};var M=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(l){M.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var O=mxGraphView.prototype.resetValidationState;-mxGraphView.prototype.resetValidationState=function(){O.apply(this,arguments);this.enumerationState=0};var ea=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(l){null!=l.shape&&this.redrawEnumerationState(l);return ea.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(l){l=decodeURIComponent(mxUtils.getValue(l.style,"enumerateValue",""));""==l&&(l=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'++Editor.MathJaxRender(La),La.parentNode.removeChild(La),sa=La.ownerDocument.getElementById("MJX-SVG-styles"),null!=sa&&La.getElementsByTagName("defs")[0].appendChild(sa.cloneNode(!0)));return La};var J=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(l){J.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var O=mxGraphView.prototype.resetValidationState;+mxGraphView.prototype.resetValidationState=function(){O.apply(this,arguments);this.enumerationState=0};var da=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(l){null!=l.shape&&this.redrawEnumerationState(l);return da.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(l){l=decodeURIComponent(mxUtils.getValue(l.style,"enumerateValue",""));""==l&&(l=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(l)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(l){var t="1"==mxUtils.getValue(l.style,"enumerate",0);t&&null==l.secondLabel?(l.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),l.secondLabel.size=12,l.secondLabel.state=l,l.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(l,l.secondLabel)):t||null==l.secondLabel||(l.secondLabel.destroy(),l.secondLabel=null);t=l.secondLabel;if(null!=-t){var I=l.view.scale,V=this.createEnumerationValue(l);l=this.graph.model.isVertex(l.cell)?new mxRectangle(l.x+l.width-4*I,l.y+4*I,0,0):mxRectangle.fromPoint(l.view.getPoint(l));t.bounds.equals(l)&&t.value==V&&t.scale==I||(t.bounds=l,t.value=V,t.scale=I,t.redraw())}};var fa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();fa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&-(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var S=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){S.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(l,t){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(l.actions,null,t))};Graph.prototype.executeCustomActions=function(l,t,I){if(this.executingCustomActions)this.stoppingCustomActions=-!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var V=!1,J=0,W=0,Y=mxUtils.bind(this,function(){V||(V=!0,this.model.beginUpdate())}),ba=mxUtils.bind(this,function(){V&&(V=!1,this.model.endUpdate())}),ja=mxUtils.bind(this,function(){0<J&&J--;0==J&&oa()}),oa=mxUtils.bind(this,function(){if(W<l.length){var qa=-this.stoppingCustomActions,ra=l[W++],xa=[];if(null!=ra.open)if(ba(),this.isCustomLink(ra.open)){if(!this.customLinkClicked(ra.open,I))return}else this.openLink(ra.open);null==ra.wait||qa||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ja()}),J++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=ra.wait?parseInt(ra.wait):1E3),ba());null!=ra.opacity&&null!=ra.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(ra.opacity,-!0)),ra.opacity.value);null!=ra.fadeIn&&(J++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(ra.fadeIn,!0)),0,1,ja,qa?0:ra.fadeIn.delay));null!=ra.fadeOut&&(J++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(ra.fadeOut,!0)),1,0,ja,qa?0:ra.fadeOut.delay));null!=ra.wipeIn&&(xa=xa.concat(this.createWipeAnimations(this.getCellsForAction(ra.wipeIn,!0),!0)));null!=ra.wipeOut&&(xa=xa.concat(this.createWipeAnimations(this.getCellsForAction(ra.wipeOut,!0),!1)));null!=ra.toggle&&+t){var H=l.view.scale,U=this.createEnumerationValue(l);l=this.graph.model.isVertex(l.cell)?new mxRectangle(l.x+l.width-4*H,l.y+4*H,0,0):mxRectangle.fromPoint(l.view.getPoint(l));t.bounds.equals(l)&&t.value==U&&t.scale==H||(t.bounds=l,t.value=U,t.scale=H,t.redraw())}};var fa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();fa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&+(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var V=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){V.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(l,t){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(l.actions,null,t))};Graph.prototype.executeCustomActions=function(l,t,H){if(this.executingCustomActions)this.stoppingCustomActions=+!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var U=!1,K=0,W=0,Y=mxUtils.bind(this,function(){U||(U=!0,this.model.beginUpdate())}),ca=mxUtils.bind(this,function(){U&&(U=!1,this.model.endUpdate())}),ja=mxUtils.bind(this,function(){0<K&&K--;0==K&&oa()}),oa=mxUtils.bind(this,function(){if(W<l.length){var qa=+this.stoppingCustomActions,ra=l[W++],xa=[];if(null!=ra.open)if(ca(),this.isCustomLink(ra.open)){if(!this.customLinkClicked(ra.open,H))return}else this.openLink(ra.open);null==ra.wait||qa||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ja()}),K++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=ra.wait?parseInt(ra.wait):1E3),ca());null!=ra.opacity&&null!=ra.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(ra.opacity,+!0)),ra.opacity.value);null!=ra.fadeIn&&(K++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(ra.fadeIn,!0)),0,1,ja,qa?0:ra.fadeIn.delay));null!=ra.fadeOut&&(K++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(ra.fadeOut,!0)),1,0,ja,qa?0:ra.fadeOut.delay));null!=ra.wipeIn&&(xa=xa.concat(this.createWipeAnimations(this.getCellsForAction(ra.wipeIn,!0),!0)));null!=ra.wipeOut&&(xa=xa.concat(this.createWipeAnimations(this.getCellsForAction(ra.wipeOut,!0),!1)));null!=ra.toggle&&(Y(),this.toggleCells(this.getCellsForAction(ra.toggle,!0)));if(null!=ra.show){Y();var Ba=this.getCellsForAction(ra.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(Ba),1);this.setCellsVisible(Ba,!0)}null!=ra.hide&&(Y(),Ba=this.getCellsForAction(ra.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(Ba),0),this.setCellsVisible(Ba,!1));null!=ra.toggleStyle&&null!=ra.toggleStyle.key&&(Y(),this.toggleCellStyles(ra.toggleStyle.key,null!=ra.toggleStyle.defaultValue?ra.toggleStyle.defaultValue:"0",this.getCellsForAction(ra.toggleStyle,!0)));null!=ra.style&&null!=ra.style.key&&(Y(),this.setCellStyles(ra.style.key,ra.style.value,this.getCellsForAction(ra.style,!0)));Ba=[];null!=ra.select&&this.isEnabled()&&(Ba=this.getCellsForAction(ra.select),this.setSelectionCells(Ba));null!=ra.highlight&&(Ba=this.getCellsForAction(ra.highlight),this.highlightCells(Ba,ra.highlight.color,ra.highlight.duration,ra.highlight.opacity));null!=ra.scroll&&(Ba=this.getCellsForAction(ra.scroll));null!=ra.viewbox&&-this.fitWindow(ra.viewbox,ra.viewbox.border);0<Ba.length&&this.scrollCellToVisible(Ba[0]);null!=I&&null!=ra.explore&&Graph.exploreFromCell(this,I,ra.explore);if(null!=ra.tags){if(null!=ra.tags.toggle){var ya=ra.tags.toggle;0==ya.length&&(ya=this.getAllTags());for(Ba=0;Ba<ya.length;Ba++)this.toggleHiddenTag(ya[Ba])}ya=null;null!=ra.tags.hidden&&(null==ya&&(ya=[]),ya=ya.concat(ra.tags.hidden));if(null!=ra.tags.visible){null==ya&&(ya=[]);var Da=this.getAllTags();for(Ba=0;Ba<Da.length;Ba++)0>mxUtils.indexOf(ra.tags.visible,-Da[Ba])&&0>mxUtils.indexOf(ya,Da[Ba])&&ya.push(Da[Ba])}null!=ya&&this.setHiddenTags(ya);this.refresh()}0<xa.length&&(J++,this.executeAnimations(xa,ja,qa?1:ra.steps,qa?0:ra.delay));0==J?oa():ba()}else this.stoppingCustomActions=this.executingCustomActions=!1,ba(),null!=t&&t()});oa()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,t){var I=this.getLinkForCell(t);null!=I&&"data:action/json,"==I.substring(0,17)&&this.setLinkForCell(t,this.updateCustomLink(l,I));if(this.isHtmlLabel(t)){var V=document.createElement("div");-V.innerHTML=Graph.sanitizeHtml(this.getLabel(t));for(var J=V.getElementsByTagName("a"),W=!1,Y=0;Y<J.length;Y++)I=J[Y].getAttribute("href"),null!=I&&"data:action/json,"==I.substring(0,17)&&(J[Y].setAttribute("href",this.updateCustomLink(l,I)),W=!0);W&&this.labelChanged(t,V.innerHTML)}};Graph.prototype.updateCustomLink=function(l,t){if("data:action/json,"==t.substring(0,17))try{var I=JSON.parse(t.substring(17));null!=I.actions&&(this.updateCustomLinkActions(l,I.actions),t="data:action/json,"+JSON.stringify(I))}catch(V){}return t};-Graph.prototype.updateCustomLinkActions=function(l,t){for(var I=0;I<t.length;I++){var V=t[I],J;for(J in V)this.updateCustomLinkAction(l,V[J],"cells"),this.updateCustomLinkAction(l,V[J],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(l,t,I){if(null!=t&&null!=t[I]){for(var V=[],J=0;J<t[I].length;J++)if("*"==t[I][J])V.push(t[I][J]);else{var W=l[t[I][J]];null!=W?""!=W&&V.push(W):V.push(t[I][J])}t[I]=V}};Graph.prototype.getCellsForAction=function(l,t){t=this.getCellsById(l.cells).concat(this.getCellsForTags(l.tags,-null,t));if(null!=l.excludeCells){for(var I=[],V=0;V<t.length;V++)0>l.excludeCells.indexOf(t[V].id)&&I.push(t[V]);t=I}return t};Graph.prototype.getCellsById=function(l){var t=[];if(null!=l)for(var I=0;I<l.length;I++)if("*"==l[I]){var V=this.model.getRoot();t=t.concat(this.model.filterDescendants(function(W){return W!=V},V))}else{var J=this.model.getCell(l[I]);null!=J&&t.push(J)}return t};var ca=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(l){return ca.apply(this,arguments)&&+this.fitWindow(ra.viewbox,ra.viewbox.border);0<Ba.length&&this.scrollCellToVisible(Ba[0]);null!=H&&null!=ra.explore&&Graph.exploreFromCell(this,H,ra.explore);if(null!=ra.tags){if(null!=ra.tags.toggle){var ya=ra.tags.toggle;0==ya.length&&(ya=this.getAllTags());for(Ba=0;Ba<ya.length;Ba++)this.toggleHiddenTag(ya[Ba])}ya=null;null!=ra.tags.hidden&&(null==ya&&(ya=[]),ya=ya.concat(ra.tags.hidden));if(null!=ra.tags.visible){null==ya&&(ya=[]);var Da=this.getAllTags();for(Ba=0;Ba<Da.length;Ba++)0>mxUtils.indexOf(ra.tags.visible,+Da[Ba])&&0>mxUtils.indexOf(ya,Da[Ba])&&ya.push(Da[Ba])}null!=ya&&this.setHiddenTags(ya);this.refresh()}0<xa.length&&(K++,this.executeAnimations(xa,ja,qa?1:ra.steps,qa?0:ra.delay));0==K?oa():ca()}else this.stoppingCustomActions=this.executingCustomActions=!1,ca(),null!=t&&t()});oa()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,t){var H=this.getLinkForCell(t);null!=H&&"data:action/json,"==H.substring(0,17)&&this.setLinkForCell(t,this.updateCustomLink(l,H));if(this.isHtmlLabel(t)){var U=document.createElement("div");+U.innerHTML=Graph.sanitizeHtml(this.getLabel(t));for(var K=U.getElementsByTagName("a"),W=!1,Y=0;Y<K.length;Y++)H=K[Y].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(K[Y].setAttribute("href",this.updateCustomLink(l,H)),W=!0);W&&this.labelChanged(t,U.innerHTML)}};Graph.prototype.updateCustomLink=function(l,t){if("data:action/json,"==t.substring(0,17))try{var H=JSON.parse(t.substring(17));null!=H.actions&&(this.updateCustomLinkActions(l,H.actions),t="data:action/json,"+JSON.stringify(H))}catch(U){}return t};+Graph.prototype.updateCustomLinkActions=function(l,t){for(var H=0;H<t.length;H++){var U=t[H],K;for(K in U)this.updateCustomLinkAction(l,U[K],"cells"),this.updateCustomLinkAction(l,U[K],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(l,t,H){if(null!=t&&null!=t[H]){for(var U=[],K=0;K<t[H].length;K++)if("*"==t[H][K])U.push(t[H][K]);else{var W=l[t[H][K]];null!=W?""!=W&&U.push(W):U.push(t[H][K])}t[H]=U}};Graph.prototype.getCellsForAction=function(l,t){t=this.getCellsById(l.cells).concat(this.getCellsForTags(l.tags,+null,t));if(null!=l.excludeCells){for(var H=[],U=0;U<t.length;U++)0>l.excludeCells.indexOf(t[U].id)&&H.push(t[U]);t=H}return t};Graph.prototype.getCellsById=function(l){var t=[];if(null!=l)for(var H=0;H<l.length;H++)if("*"==l[H]){var U=this.model.getRoot();t=t.concat(this.model.filterDescendants(function(W){return W!=U},U))}else{var K=this.model.getCell(l[H]);null!=K&&t.push(K)}return t};var ba=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(l){return ba.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(l))};Graph.prototype.setHiddenTags=function(l){this.hiddenTags=l;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(l){var t=mxUtils.indexOf(this.hiddenTags,l);0>t?this.hiddenTags.push(l):0<=t&&this.hiddenTags.splice(t,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(l){if(null==l||0==l.length||0==this.hiddenTags.length)return!1;l=l.split(" ");if(l.length>this.hiddenTags.length)return!1;-for(var t=0;t<l.length;t++)if(0>mxUtils.indexOf(this.hiddenTags,l[t]))return!1;return!0};Graph.prototype.getCellsForTags=function(l,t,I,V){var J=[];if(null!=l){t=null!=t?t:this.model.getDescendants(this.model.getRoot());for(var W=0,Y={},ba=0;ba<l.length;ba++)0<l[ba].length&&(Y[l[ba]]=!0,W++);for(ba=0;ba<t.length;ba++)if(I&&this.model.getParent(t[ba])==this.model.root||this.model.isVertex(t[ba])||this.model.isEdge(t[ba])){var ja=this.getTagsForCell(t[ba]),oa=!1;if(0<ja.length&&(ja=ja.split(" "),ja.length>=-l.length)){for(var qa=oa=0;qa<ja.length&&oa<W;qa++)null!=Y[ja[qa]]&&oa++;oa=oa==W}oa&&(1!=V||this.isCellVisible(t[ba]))&&J.push(t[ba])}}return J};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var t=null,I=[],V=0;V<l.length;V++){var J=this.getTagsForCell(l[V]);I=[];if(0<J.length){J=J.split(" ");for(var W={},Y=0;Y<J.length;Y++)if(null==t||null!=t[J[Y]])W[J[Y]]=!0,I.push(J[Y]);-t=W}else return[]}return I};Graph.prototype.getTagsForCells=function(l){for(var t=[],I={},V=0;V<l.length;V++){var J=this.getTagsForCell(l[V]);if(0<J.length){J=J.split(" ");for(var W=0;W<J.length;W++)null==I[J[W]]&&(I[J[W]]=!0,t.push(J[W]))}}return t};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var I=0;I<l.length;I++){for(var V=this.getTagsForCell(l[I]),-J=V.split(" "),W=!1,Y=0;Y<t.length;Y++){var ba=mxUtils.trim(t[Y]);""!=ba&&0>mxUtils.indexOf(J,ba)&&(V=0<V.length?V+" "+ba:ba,W=!0)}W&&this.setAttributeForCell(l[I],"tags",V)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var I=0;I<l.length;I++){var V=this.getTagsForCell(l[I]);if(0<V.length){for(var J=V.split(" "),W=!1,Y=0;Y<t.length;Y++){var ba=mxUtils.indexOf(J,t[Y]);0<=ba&&(J.splice(ba,1),W=!0)}W&&this.setAttributeForCell(l[I],-"tags",J.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)this.model.setVisible(l[t],!this.model.isVisible(l[t]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(l,t){this.model.beginUpdate();try{for(var I=0;I<l.length;I++)this.model.setVisible(l[I],t)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(l,t,I,V){for(var J=0;J<l.length;J++)this.highlightCell(l[J],-t,I,V)};Graph.prototype.highlightCell=function(l,t,I,V,J){t=null!=t?t:mxConstants.DEFAULT_VALID_COLOR;I=null!=I?I:1E3;l=this.view.getState(l);var W=null;null!=l&&(J=null!=J?J:4,J=Math.max(J+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)+J),W=new mxCellHighlight(this,t,J,!1),null!=V&&(W.opacity=V),W.highlight(l),window.setTimeout(function(){null!=W.shape&&(mxUtils.setPrefixedStyle(W.shape.node.style,"transition","all 1200ms ease-in-out"),W.shape.node.style.opacity=0);window.setTimeout(function(){W.destroy()},-1200)},I));return W};Graph.prototype.addSvgShadow=function(l,t,I,V){I=null!=I?I:!1;V=null!=V?V:!0;var J=l.ownerDocument,W=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"filter"):J.createElement("filter");W.setAttribute("id",this.shadowId);var Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):J.createElement("feGaussianBlur");Y.setAttribute("in","SourceAlpha");Y.setAttribute("stdDeviation",this.svgShadowBlur);Y.setAttribute("result","blur");W.appendChild(Y);-Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feOffset"):J.createElement("feOffset");Y.setAttribute("in","blur");Y.setAttribute("dx",this.svgShadowSize);Y.setAttribute("dy",this.svgShadowSize);Y.setAttribute("result","offsetBlur");W.appendChild(Y);Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feFlood"):J.createElement("feFlood");Y.setAttribute("flood-color",this.svgShadowColor);Y.setAttribute("flood-opacity",this.svgShadowOpacity);Y.setAttribute("result","offsetColor");-W.appendChild(Y);Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feComposite"):J.createElement("feComposite");Y.setAttribute("in","offsetColor");Y.setAttribute("in2","offsetBlur");Y.setAttribute("operator","in");Y.setAttribute("result","offsetBlur");W.appendChild(Y);Y=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"feBlend"):J.createElement("feBlend");Y.setAttribute("in","SourceGraphic");Y.setAttribute("in2","offsetBlur");W.appendChild(Y);Y=l.getElementsByTagName("defs");-0==Y.length?(J=null!=J.createElementNS?J.createElementNS(mxConstants.NS_SVG,"defs"):J.createElement("defs"),null!=l.firstChild?l.insertBefore(J,l.firstChild):l.appendChild(J)):J=Y[0];J.appendChild(W);I||(t=null!=t?t:l.getElementsByTagName("g")[0],null!=t&&(t.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(l.getAttribute("width")))&&V&&(l.setAttribute("width",parseInt(l.getAttribute("width"))+6),l.setAttribute("height",parseInt(l.getAttribute("height"))+6),t=l.getAttribute("viewBox"),+for(var t=0;t<l.length;t++)if(0>mxUtils.indexOf(this.hiddenTags,l[t]))return!1;return!0};Graph.prototype.getCellsForTags=function(l,t,H,U){var K=[];if(null!=l){t=null!=t?t:this.model.getDescendants(this.model.getRoot());for(var W=0,Y={},ca=0;ca<l.length;ca++)0<l[ca].length&&(Y[l[ca]]=!0,W++);for(ca=0;ca<t.length;ca++)if(H&&this.model.getParent(t[ca])==this.model.root||this.model.isVertex(t[ca])||this.model.isEdge(t[ca])){var ja=this.getTagsForCell(t[ca]),oa=!1;if(0<ja.length&&(ja=ja.split(" "),ja.length>=+l.length)){for(var qa=oa=0;qa<ja.length&&oa<W;qa++)null!=Y[ja[qa]]&&oa++;oa=oa==W}oa&&(1!=U||this.isCellVisible(t[ca]))&&K.push(t[ca])}}return K};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var t=null,H=[],U=0;U<l.length;U++){var K=this.getTagsForCell(l[U]);H=[];if(0<K.length){K=K.split(" ");for(var W={},Y=0;Y<K.length;Y++)if(null==t||null!=t[K[Y]])W[K[Y]]=!0,H.push(K[Y]);+t=W}else return[]}return H};Graph.prototype.getTagsForCells=function(l){for(var t=[],H={},U=0;U<l.length;U++){var K=this.getTagsForCell(l[U]);if(0<K.length){K=K.split(" ");for(var W=0;W<K.length;W++)null==H[K[W]]&&(H[K[W]]=!0,t.push(K[W]))}}return t};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){for(var U=this.getTagsForCell(l[H]),+K=U.split(" "),W=!1,Y=0;Y<t.length;Y++){var ca=mxUtils.trim(t[Y]);""!=ca&&0>mxUtils.indexOf(K,ca)&&(U=0<U.length?U+" "+ca:ca,W=!0)}W&&this.setAttributeForCell(l[H],"tags",U)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){var U=this.getTagsForCell(l[H]);if(0<U.length){for(var K=U.split(" "),W=!1,Y=0;Y<t.length;Y++){var ca=mxUtils.indexOf(K,t[Y]);0<=ca&&(K.splice(ca,1),W=!0)}W&&this.setAttributeForCell(l[H],+"tags",K.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)this.model.setVisible(l[t],!this.model.isVisible(l[t]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(l,t){this.model.beginUpdate();try{for(var H=0;H<l.length;H++)this.model.setVisible(l[H],t)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(l,t,H,U){for(var K=0;K<l.length;K++)this.highlightCell(l[K],+t,H,U)};Graph.prototype.highlightCell=function(l,t,H,U,K){t=null!=t?t:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;l=this.view.getState(l);var W=null;null!=l&&(K=null!=K?K:4,K=Math.max(K+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)+K),W=new mxCellHighlight(this,t,K,!1),null!=U&&(W.opacity=U),W.highlight(l),window.setTimeout(function(){null!=W.shape&&(mxUtils.setPrefixedStyle(W.shape.node.style,"transition","all 1200ms ease-in-out"),W.shape.node.style.opacity=0);window.setTimeout(function(){W.destroy()},+1200)},H));return W};Graph.prototype.addSvgShadow=function(l,t,H,U){H=null!=H?H:!1;U=null!=U?U:!0;var K=l.ownerDocument,W=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"filter"):K.createElement("filter");W.setAttribute("id",this.shadowId);var Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):K.createElement("feGaussianBlur");Y.setAttribute("in","SourceAlpha");Y.setAttribute("stdDeviation",this.svgShadowBlur);Y.setAttribute("result","blur");W.appendChild(Y);+Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feOffset"):K.createElement("feOffset");Y.setAttribute("in","blur");Y.setAttribute("dx",this.svgShadowSize);Y.setAttribute("dy",this.svgShadowSize);Y.setAttribute("result","offsetBlur");W.appendChild(Y);Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feFlood"):K.createElement("feFlood");Y.setAttribute("flood-color",this.svgShadowColor);Y.setAttribute("flood-opacity",this.svgShadowOpacity);Y.setAttribute("result","offsetColor");+W.appendChild(Y);Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feComposite"):K.createElement("feComposite");Y.setAttribute("in","offsetColor");Y.setAttribute("in2","offsetBlur");Y.setAttribute("operator","in");Y.setAttribute("result","offsetBlur");W.appendChild(Y);Y=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"feBlend"):K.createElement("feBlend");Y.setAttribute("in","SourceGraphic");Y.setAttribute("in2","offsetBlur");W.appendChild(Y);Y=l.getElementsByTagName("defs");+0==Y.length?(K=null!=K.createElementNS?K.createElementNS(mxConstants.NS_SVG,"defs"):K.createElement("defs"),null!=l.firstChild?l.insertBefore(K,l.firstChild):l.appendChild(K)):K=Y[0];K.appendChild(W);H||(t=null!=t?t:l.getElementsByTagName("g")[0],null!=t&&(t.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(l.getAttribute("width")))&&U&&(l.setAttribute("width",parseInt(l.getAttribute("width"))+6),l.setAttribute("height",parseInt(l.getAttribute("height"))+6),t=l.getAttribute("viewBox"),null!=t&&0<t.length&&(t=t.split(" "),3<t.length&&(w=parseFloat(t[2])+6,h=parseFloat(t[3])+6,l.setAttribute("viewBox",t[0]+" "+t[1]+" "+w+" "+h))))));return W};Graph.prototype.setShadowVisible=function(l,t){mxClient.IS_SVG&&!mxClient.IS_SF&&(t=null!=t?t:!0,(this.shadowVisible=l)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),t&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.checkDefaultParent=function(){null==-this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var l=this.model.getChildCount(this.model.root),t=0;do var I=this.model.getChildAt(this.model.root,t);while(t++<l&&"1"==mxUtils.getValue(this.getCellStyle(I),"locked","0"));null!=I&&this.setDefaultParent(I)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=+this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var l=this.model.getChildCount(this.model.root),t=0;do var H=this.model.getChildAt(this.model.root,t);while(t++<l&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=@@ -3413,43 +3413,43 @@ this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultPar"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=-[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(l){var t=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?t="mxgraph.er":"sysML"==l.substring(0,5)&&(t="mxgraph.sysml"));return t};var ma=mxMarker.createMarker;mxMarker.createMarker=function(l,t,I,V,J,W,Y,ba,ja,oa){if(null!=I&&null==mxMarker.markers[I]){var qa=this.getPackageForType(I);-null!=qa&&mxStencilRegistry.getStencil(qa)}return ma.apply(this,arguments)};var la=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,t,I,V,J,W){"1"==mxUtils.getValue(t.style,"lineShape",null)&&l.setFillColor(mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return la.apply(this,arguments)};PrintDialog.prototype.create=function(l,t,I){function V(){Ba.value=Math.max(1,Math.min(oa,Math.max(parseInt(Ba.value),parseInt(xa.value))));xa.value=Math.max(1,Math.min(oa,-Math.min(parseInt(Ba.value),parseInt(xa.value))))}function J(ua){l.lastPrintPagesRadioChecked=ra.checked;l.lastPrintSelectionOnlyChecked=Da.checked;l.lastPrintCropRadioChecked=sa.checked;l.lastPrintFitRadioChecked=Aa.checked;ra.checked&&xa.value<Ba.value?(l.lastPrintPagesFromInput=xa.value,l.lastPrintPagesToInput=Ba.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);X.value=Math.max(1,Math.min(1600,parseInt(X.value)))+"%";l.lastPrintZoom=X.value;l.lastPrintBorder=R.value;l.lastPrintGrid=+[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(l){var t=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?t="mxgraph.er":"sysML"==l.substring(0,5)&&(t="mxgraph.sysml"));return t};var ma=mxMarker.createMarker;mxMarker.createMarker=function(l,t,H,U,K,W,Y,ca,ja,oa){if(null!=H&&null==mxMarker.markers[H]){var qa=this.getPackageForType(H);+null!=qa&&mxStencilRegistry.getStencil(qa)}return ma.apply(this,arguments)};var la=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,t,H,U,K,W){"1"==mxUtils.getValue(t.style,"lineShape",null)&&l.setFillColor(mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return la.apply(this,arguments)};PrintDialog.prototype.create=function(l,t,H){function U(){Ba.value=Math.max(1,Math.min(oa,Math.max(parseInt(Ba.value),parseInt(xa.value))));xa.value=Math.max(1,Math.min(oa,+Math.min(parseInt(Ba.value),parseInt(xa.value))))}function K(ua){l.lastPrintPagesRadioChecked=ra.checked;l.lastPrintSelectionOnlyChecked=Da.checked;l.lastPrintCropRadioChecked=sa.checked;l.lastPrintFitRadioChecked=Aa.checked;ra.checked&&xa.value<Ba.value?(l.lastPrintPagesFromInput=xa.value,l.lastPrintPagesToInput=Ba.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);X.value=Math.max(1,Math.min(1600,parseInt(X.value)))+"%";l.lastPrintZoom=X.value;l.lastPrintBorder=R.value;l.lastPrintGrid=ia.checked;l.lastPrintTransparent=ka.checked;l.lastPrintInclude=pa.checked;l.lastPrintSheetsAcross=u.value;l.lastPrintSheetsDown=N.value;var Ca={};Ca.border=parseInt(R.value);Ca.scale=parseInt(X.value)/100;Ca.grid=ia.checked;Ca.transparent=ka.checked;Ca.includeCopy=pa.checked;Ca.sheetsAcross=parseInt(u.value);Ca.sheetsDown=parseInt(N.value);Ca.pagesFrom=parseInt(xa.value);Ca.pagesTo=parseInt(Ba.value);Ca.allPages=qa.checked;Ca.selection=Da.checked;Ca.pageView=La.checked;Ca.crop=sa.checked;Ca.fit=-Aa.checked;return null!=I?I(!ua,Ca):l.print(!ua,Ca)}var W=l.editor.graph,Y=document.createElement("div"),ba=document.createElement("h3");ba.style.width="100%";ba.style.textAlign="center";ba.style.marginTop="0px";mxUtils.write(ba,t||mxResources.get("print"));Y.appendChild(ba);var ja=1,oa=1;ba=document.createElement("div");ba.style.whiteSpace="nowrap";var qa=document.createElement("input");qa.style.marginRight="8px";qa.style.marginBottom="8px";qa.setAttribute("type","radio");qa.setAttribute("name",-"pages-printdialog");ba.appendChild(qa);t=document.createElement("span");mxUtils.write(t,mxResources.get("allPages"));mxEvent.addListener(t,"click",function(){qa.checked=!0});ba.appendChild(t);mxUtils.br(ba);var ra=qa.cloneNode(!0);ba.appendChild(ra);t=document.createElement("span");mxUtils.write(t,mxResources.get("pages")+":");ba.appendChild(t);mxEvent.addListener(t,"click",function(){ra.checked=!0});var xa=document.createElement("input");xa.style.margin="0 4px";xa.setAttribute("value","1");xa.setAttribute("type",-"number");xa.setAttribute("min","1");xa.style.width="40px";ba.appendChild(xa);t=document.createElement("span");mxUtils.write(t,mxResources.get("to"));ba.appendChild(t);var Ba=xa.cloneNode(!0);ba.appendChild(Ba);mxEvent.addListener(xa,"focus",function(){ra.checked=!0});mxEvent.addListener(Ba,"focus",function(){ra.checked=!0});mxEvent.addListener(xa,"change",V);mxEvent.addListener(Ba,"change",V);if(null!=l.pages&&(oa=l.pages.length,null!=l.currentPage))for(var ya=0;ya<oa;ya++)if(l.currentPage==l.pages[ya]){ja=+Aa.checked;return null!=H?H(!ua,Ca):l.print(!ua,Ca)}var W=l.editor.graph,Y=document.createElement("div"),ca=document.createElement("h3");ca.style.width="100%";ca.style.textAlign="center";ca.style.marginTop="0px";mxUtils.write(ca,t||mxResources.get("print"));Y.appendChild(ca);var ja=1,oa=1;ca=document.createElement("div");ca.style.whiteSpace="nowrap";var qa=document.createElement("input");qa.style.marginRight="8px";qa.style.marginBottom="8px";qa.setAttribute("type","radio");qa.setAttribute("name",+"pages-printdialog");ca.appendChild(qa);t=document.createElement("span");mxUtils.write(t,mxResources.get("allPages"));mxEvent.addListener(t,"click",function(){qa.checked=!0});ca.appendChild(t);mxUtils.br(ca);var ra=qa.cloneNode(!0);ca.appendChild(ra);t=document.createElement("span");mxUtils.write(t,mxResources.get("pages")+":");ca.appendChild(t);mxEvent.addListener(t,"click",function(){ra.checked=!0});var xa=document.createElement("input");xa.style.margin="0 4px";xa.setAttribute("value","1");xa.setAttribute("type",+"number");xa.setAttribute("min","1");xa.style.width="40px";ca.appendChild(xa);t=document.createElement("span");mxUtils.write(t,mxResources.get("to"));ca.appendChild(t);var Ba=xa.cloneNode(!0);ca.appendChild(Ba);mxEvent.addListener(xa,"focus",function(){ra.checked=!0});mxEvent.addListener(Ba,"focus",function(){ra.checked=!0});mxEvent.addListener(xa,"change",U);mxEvent.addListener(Ba,"change",U);if(null!=l.pages&&(oa=l.pages.length,null!=l.currentPage))for(var ya=0;ya<oa;ya++)if(l.currentPage==l.pages[ya]){ja=ya+1;break}null!=l.lastPrintPagesFromInput&&null!=l.lastPrintPagesToInput?(xa.value=Math.min(oa,Math.max(1,l.lastPrintPagesFromInput)),Ba.value=Math.min(oa,Math.max(1,l.lastPrintPagesToInput))):(xa.value=ja,Ba.value=ja);xa.setAttribute("max",oa);Ba.setAttribute("max",oa);ya=mxUtils.button(mxResources.get("currentPage"),function(ua){xa.value=ja;Ba.value=ja;ra.checked=!0});ya.setAttribute("title",mxResources.get("currentPage"));ya.style.marginLeft="4px";ya.style.maxWidth="100px";ya.style.overflow="hidden";-ya.style.textOverflow="ellipsis";ya.style.whiteSpace="nowrap";ba.appendChild(ya);1<oa&&Y.appendChild(ba);ba=document.createElement("div");ba.style.borderBottom="1px solid lightGray";ba.style.paddingBottom="12px";ba.style.marginBottom="12px";ba.style.whiteSpace="nowrap";var Da=document.createElement("input");Da.setAttribute("name","pages-printdialog");Da.setAttribute("type",1==oa?"checkbox":"radio");Da.style.marginRight="8px";W.isSelectionEmpty()&&Da.setAttribute("disabled","disabled");W.isEnabled()&&-(ba.appendChild(Da),t=document.createElement("span"),mxUtils.write(t,mxResources.get("selectionOnly")),ba.appendChild(t));(W.isEnabled()||1<oa)&&Y.appendChild(ba);!l.isPagesEnabled()||l.lastPrintPagesRadioChecked?ra.checked=!0:!W.isSelectionEmpty()&&l.lastPrintSelectionOnlyChecked?Da.checked=!0:qa.checked=!0;W.isSelectionEmpty()||mxEvent.addListener(t,"click",function(){Da.checked=!Da.checked});W=document.createElement("div");W.style.whiteSpace="nowrap";var La=document.createElement("input");La.style.marginBottom=+ya.style.textOverflow="ellipsis";ya.style.whiteSpace="nowrap";ca.appendChild(ya);1<oa&&Y.appendChild(ca);ca=document.createElement("div");ca.style.borderBottom="1px solid lightGray";ca.style.paddingBottom="12px";ca.style.marginBottom="12px";ca.style.whiteSpace="nowrap";var Da=document.createElement("input");Da.setAttribute("name","pages-printdialog");Da.setAttribute("type",1==oa?"checkbox":"radio");Da.style.marginRight="8px";W.isSelectionEmpty()&&Da.setAttribute("disabled","disabled");W.isEnabled()&&+(ca.appendChild(Da),t=document.createElement("span"),mxUtils.write(t,mxResources.get("selectionOnly")),ca.appendChild(t));(W.isEnabled()||1<oa)&&Y.appendChild(ca);!l.isPagesEnabled()||l.lastPrintPagesRadioChecked?ra.checked=!0:!W.isSelectionEmpty()&&l.lastPrintSelectionOnlyChecked?Da.checked=!0:qa.checked=!0;W.isSelectionEmpty()||mxEvent.addListener(t,"click",function(){Da.checked=!Da.checked});W=document.createElement("div");W.style.whiteSpace="nowrap";var La=document.createElement("input");La.style.marginBottom="8px";La.style.marginRight="8px";La.setAttribute("type","radio");La.setAttribute("name","printSize");W.appendChild(La);t=document.createElement("span");mxUtils.write(t,mxResources.get("pageView"));W.appendChild(t);mxEvent.addListener(W,"click",function(){La.checked=!0});Y.appendChild(W);W=document.createElement("div");W.style.whiteSpace="nowrap";var sa=document.createElement("input");sa.style.marginBottom="8px";sa.style.marginRight="8px";sa.setAttribute("type","radio");sa.setAttribute("name","printSize");W.appendChild(sa);t=document.createElement("span");mxUtils.write(t,mxResources.get("crop"));W.appendChild(t);mxEvent.addListener(W,"click",function(){sa.checked=!0});Y.appendChild(W);W=document.createElement("div");W.style.whiteSpace="nowrap";var Aa=document.createElement("input");Aa.style.marginBottom="8px";Aa.style.marginRight="8px";Aa.setAttribute("type","radio");Aa.setAttribute("name","printSize");t=document.createElement("div");t.style.display="inline-block";t.style.verticalAlign="top";t.style.paddingTop=-"2px";t.appendChild(Aa);W.appendChild(t);ba=document.createElement("table");ba.style.display="inline-block";ba.style.borderSpacing="0";ya=document.createElement("tbody");var Ea=document.createElement("tr"),Ka=Ea.cloneNode(!0),Ma=document.createElement("td"),za=Ma.cloneNode(!0),Wa=Ma.cloneNode(!0),Ia=Ma.cloneNode(!0),Xa=Ma.cloneNode(!0),Pa=Ma.cloneNode(!0);Ma.style.textAlign="right";Ia.style.textAlign="right";mxUtils.write(Ma,mxResources.get("fitTo"));mxEvent.addListener(W,"click",function(ua){mxEvent.getSource(ua)!=+"2px";t.appendChild(Aa);W.appendChild(t);ca=document.createElement("table");ca.style.display="inline-block";ca.style.borderSpacing="0";ya=document.createElement("tbody");var Ea=document.createElement("tr"),Ka=Ea.cloneNode(!0),Ma=document.createElement("td"),za=Ma.cloneNode(!0),Wa=Ma.cloneNode(!0),Ia=Ma.cloneNode(!0),Xa=Ma.cloneNode(!0),Pa=Ma.cloneNode(!0);Ma.style.textAlign="right";Ia.style.textAlign="right";mxUtils.write(Ma,mxResources.get("fitTo"));mxEvent.addListener(W,"click",function(ua){mxEvent.getSource(ua)!=Aa&&(Aa.checked=!Aa.checked)});var u=document.createElement("input");u.style.margin="0 2px";u.style.boxSizing="border-box";u.setAttribute("value",l.lastPrintSheetsAcross||"1");u.setAttribute("min","1");u.setAttribute("type","number");u.style.width="40px";za.appendChild(u);t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsAcross"));Wa.appendChild(t);mxUtils.write(Ia,mxResources.get("fitToBy"));var N=u.cloneNode(!0);N.setAttribute("value",l.lastPrintSheetsDown||"1");Xa.appendChild(N);mxEvent.addListener(u,"click",function(ua){Aa.checked=!0;mxEvent.consume(ua)});mxEvent.addListener(N,"click",function(ua){Aa.checked=!0;mxEvent.consume(ua)});l.lastPrintCropRadioChecked?sa.checked=!0:l.lastPrintFitRadioChecked?Aa.checked=!0:La.checked=!0;t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsDown"));Pa.appendChild(t);Ea.appendChild(Ma);Ea.appendChild(za);Ea.appendChild(Wa);Ka.appendChild(Ia);Ka.appendChild(Xa);Ka.appendChild(Pa);ya.appendChild(Ea);ya.appendChild(Ka);-ba.appendChild(ya);W.appendChild(ba);Y.appendChild(W);W=document.createElement("div");W.style.borderTop="1px solid lightGray";W.style.whiteSpace="nowrap";W.style.paddingTop="12px";W.style.marginTop="12px";W.style.paddingLeft="8px";mxUtils.write(W,mxResources.get("borderWidth")+":");var R=document.createElement("input");R.setAttribute("type","number");R.setAttribute("min","0");R.style.width="40px";R.style.marginLeft="4px";R.value=null!=l.lastPrintBorder?l.lastPrintBorder:mxPrintPreview.prototype.pageMargin;+ca.appendChild(ya);W.appendChild(ca);Y.appendChild(W);W=document.createElement("div");W.style.borderTop="1px solid lightGray";W.style.whiteSpace="nowrap";W.style.paddingTop="12px";W.style.marginTop="12px";W.style.paddingLeft="8px";mxUtils.write(W,mxResources.get("borderWidth")+":");var R=document.createElement("input");R.setAttribute("type","number");R.setAttribute("min","0");R.style.width="40px";R.style.marginLeft="4px";R.value=null!=l.lastPrintBorder?l.lastPrintBorder:mxPrintPreview.prototype.pageMargin;W.appendChild(R);t=document.createElement("span");t.style.marginLeft="8px";mxUtils.write(t,mxResources.get("zoom")+":");W.appendChild(t);var X=document.createElement("input");X.style.width="60px";X.style.marginLeft="4px";X.value=null!=l.lastPrintZoom?l.lastPrintZoom:"100%";W.appendChild(X);mxUtils.br(W);var ia=document.createElement("input");ia.setAttribute("type","checkbox");ia.style.marginTop="12px";ia.checked=null!=l.lastPrintGrid?l.lastPrintGrid:!1;W.appendChild(ia);t=document.createElement("span");-t.style.marginLeft="4px";t.style.marginRight="8px";mxUtils.write(t,mxResources.get("grid"));W.appendChild(t);mxEvent.addListener(t,"click",function(ua){ia.checked=!0;mxEvent.consume(ua)});var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.style.marginTop="10px";ka.checked=null!=l.lastPrintTransparent?l.lastPrintTransparent:!1;null!=I&&(W.appendChild(ka),t=document.createElement("span"),t.style.marginLeft="4px",mxUtils.write(t,mxResources.get("transparentBackground")),W.appendChild(t),-mxEvent.addListener(t,"click",function(ua){ka.checked=!0;mxEvent.consume(ua)}));var pa=document.createElement("input");pa.setAttribute("type","checkbox");pa.style.marginTop="10px";pa.checked=null!=l.lastPrintInclude?l.lastPrintInclude:Editor.defaultIncludeDiagram;null==I||mxClient.IS_CHROMEAPP||"draw.io"!=l.getServiceName()||(mxUtils.br(W),W.appendChild(pa),t=document.createElement("span"),t.style.marginLeft="4px",mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram")),W.appendChild(t),mxEvent.addListener(t,-"click",function(ua){pa.checked=!0;mxEvent.consume(ua)}));Y.appendChild(W);t=document.createElement("div");t.style.marginTop="40px";t.style.textAlign="right";t.style.whiteSpace="nowrap";l.isOffline()||null!=I||t.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));W=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});W.className="geBtn";l.editor.cancelFirst&&t.appendChild(W);PrintDialog.previewEnabled&&null==I&&(ba=mxUtils.button(mxResources.get("preview"),-function(){try{l.hideDialog(),J(!1)}catch(ua){l.handleError(ua)}}),ba.className="geBtn",t.appendChild(ba));ba=mxUtils.button(mxResources.get(null!=I?"export":PrintDialog.previewEnabled?"print":"ok"),function(){try{l.hideDialog(),J(!0)}catch(ua){l.handleError(ua)}});ba.className="geBtn gePrimaryBtn";t.appendChild(ba);l.editor.cancelFirst||t.appendChild(W);Y.appendChild(t);if(l.editor.isChromelessView()){var wa=function(){Editor.isDarkMode()?(Y.classList.add("geDarkMode"),Y.style.colorScheme="dark"):+t.style.marginLeft="4px";t.style.marginRight="8px";mxUtils.write(t,mxResources.get("grid"));W.appendChild(t);mxEvent.addListener(t,"click",function(ua){ia.checked=!0;mxEvent.consume(ua)});var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.style.marginTop="10px";ka.checked=null!=l.lastPrintTransparent?l.lastPrintTransparent:!1;null!=H&&(W.appendChild(ka),t=document.createElement("span"),t.style.marginLeft="4px",mxUtils.write(t,mxResources.get("transparentBackground")),W.appendChild(t),+mxEvent.addListener(t,"click",function(ua){ka.checked=!0;mxEvent.consume(ua)}));var pa=document.createElement("input");pa.setAttribute("type","checkbox");pa.style.marginTop="10px";pa.checked=null!=l.lastPrintInclude?l.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=l.getServiceName()||(mxUtils.br(W),W.appendChild(pa),t=document.createElement("span"),t.style.marginLeft="4px",mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram")),W.appendChild(t),mxEvent.addListener(t,+"click",function(ua){pa.checked=!0;mxEvent.consume(ua)}));Y.appendChild(W);t=document.createElement("div");t.style.marginTop="40px";t.style.textAlign="right";t.style.whiteSpace="nowrap";l.isOffline()||null!=H||t.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));W=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});W.className="geBtn";l.editor.cancelFirst&&t.appendChild(W);PrintDialog.previewEnabled&&null==H&&(ca=mxUtils.button(mxResources.get("preview"),+function(){try{l.hideDialog(),K(!1)}catch(ua){l.handleError(ua)}}),ca.className="geBtn",t.appendChild(ca));ca=mxUtils.button(mxResources.get(null!=H?"export":PrintDialog.previewEnabled?"print":"ok"),function(){try{l.hideDialog(),K(!0)}catch(ua){l.handleError(ua)}});ca.className="geBtn gePrimaryBtn";t.appendChild(ca);l.editor.cancelFirst||t.appendChild(W);Y.appendChild(t);if(l.editor.isChromelessView()){var wa=function(){Editor.isDarkMode()?(Y.classList.add("geDarkMode"),Y.style.colorScheme="dark"):(Y.classList.remove("geDarkMode"),Y.style.colorScheme="light")};l.addListener("darkModeChanged",wa);wa();var ta=function(ua,Ca){ua=Ca.getProperty("dialog");Y.parentNode==ua.container&&(l.editor.removeListener(ta),l.removeListener(wa))};l.editor.addListener("hideDialog",ta)}this.container=Y};var Z=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var l=this.image;null!=l&&null!=l.src&&Graph.isPageLink(l.src)&&(l={originalSrc:l.src});this.page.viewState.backgroundImage=l}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else Z.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(l=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=l?l:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var da=document.createElement("canvas"),aa=new Image;aa.onload=function(){try{da.getContext("2d").drawImage(aa,0,0);var l=da.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=l&&6<l.length}catch(t){}};aa.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(l){}Editor.prototype.useCanvasForExport=+this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var ea=document.createElement("canvas"),aa=new Image;aa.onload=function(){try{ea.getContext("2d").drawImage(aa,0,0);var l=ea.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=l&&6<l.length}catch(t){}};aa.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(l){}Editor.prototype.useCanvasForExport=!1})();(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){m.previousColor=m.color;m.previousImage=m.image;m.previousFormat=m.format;m.previousAdaptiveColors=m.adaptiveColors;null!=m.foldingEnabled&&(m.foldingEnabled=!m.foldingEnabled);null!=m.mathEnabled&&(m.mathEnabled=!m.mathEnabled);null!=m.shadowVisible&&(m.shadowVisible=!m.shadowVisible);return m};mxCodecRegistry.register(b)})();-(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.0.3";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&+(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.0.4";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};-EditorUi.logError=function(c,f,k,B,z,C,H){if(null!=c){z=null!=z?z:Error(c);z.stack=null!=z.stack?z.stack:"";C=null!=C?C:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>z.stack.indexOf("extension:")&&0>z.stack.indexOf("<anonymous>:")&&-0>z.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+C+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=B?":colno:"+encodeURIComponent(B):"")+(""!=z.stack?"&stack="+encodeURIComponent(z.stack):""))}catch(K){}try{H||null==window.console||console.error(C,c,f,k,B,z)}catch(K){}}};EditorUi.logEvent=+EditorUi.logError=function(c,f,k,B,z,C,I){if(null!=c){z=null!=z?z:Error(c);z.stack=null!=z.stack?z.stack:"";C=null!=C?C:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>z.stack.indexOf("extension:")&&0>z.stack.indexOf("<anonymous>:")&&+0>z.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+C+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=B?":colno:"+encodeURIComponent(B):"")+(""!=z.stack?"&stack="+encodeURIComponent(z.stack):""))}catch(L){}try{I||null==window.console||console.error(C,c,f,k,B,z)}catch(L){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{f=null!=f?f:5E4,c.length>f&&(c=c.substring(0,f)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(k){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],f=0;f<arguments.length;f++)c.push(arguments[f]);console.log.apply(console,c)}}catch(k){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var f=[],k=0;k<c.length;k++)f.push(c[k]);for(k=0;k<f.length;k++)EditorUi.replaceSvgImage(f[k])};EditorUi.replaceSvgImage=function(c){try{var f=null;f=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var k=EditorUi.getSvgSubtree(f);if(null!=k&&"svg"==k.nodeName){k.setAttribute("x",c.getAttribute("x"));k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";var B=mxUtils.createElementNs(k.ownerDocument,mxConstants.NS_SVG,"g");B.appendChild(k);c.hasAttribute("transform")&&B.setAttribute("transform",c.getAttribute("transform"));c.parentNode.replaceChild(B,c)}}catch(z){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var k="svg-image-"+Editor.guid();c.setAttribute("id",k);for(var B=document.implementation.createHTMLDocument(""),-z=document.createElement("style"),C=0;C<f.length;C++){z.textContent=f[C].textContent;B.body.appendChild(z);for(var H="",K=0;K<z.sheet.cssRules.length;K++){var M=z.sheet.cssRules[K];if(null!=M.selectorText){for(var O=M.selectorText.split(","),ea=0;ea<O.length;ea++)O[ea]="#"+k+" "+O[ea];M.selectorText=O.join(",")}H+=M.cssText+"\n"}f[C].textContent=H}}f=c.getElementsByTagName("*");for(k=0;k<f.length;k++)f[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+z=document.createElement("style"),C=0;C<f.length;C++){z.textContent=f[C].textContent;B.body.appendChild(z);for(var I="",L=0;L<z.sheet.cssRules.length;L++){var J=z.sheet.cssRules[L];if(null!=J.selectorText){for(var O=J.selectorText.split(","),da=0;da<O.length;da++)O[da]="#"+k+" "+O[da];J.selectorText=O.join(",")}I+=J.cssText+"\n"}f[C].textContent=I}}f=c.getElementsByTagName("*");for(k=0;k<f.length;k++)f[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;EditorUi.prototype.webpSupported=!1;try{var c=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!c.getContext||!c.getContext("2d"))}catch(z){}try{var f=document.createElement("canvas"),@@ -3459,121 +3459,121 @@ f,k)};EditorUi.prototype.showSplash=function(c){};EditorUi.prototype.getLocalDatEditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,k){var B=null==c||null==f;k=null!=k?k:24;var z=new Spinner({lines:12,length:k,width:Math.round(k/3),radius:Math.round(k/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),C=this.timeout,H=z.spin,K=null,M=null,O=mxUtils.bind(this,function(fa){null!=fa&&fa()});z.spin=function(fa,S,ca,ma){ma=null!=ma?ma:C;var la=!1;if(!this.active){var Z=Date.now();null!=ca&&(K=window.setTimeout(function(){z.stop();K=null;ca({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:M})},ma));H.call(this,fa);this.active=!0;null!=S&&(B&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/+speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),C=this.timeout,I=z.spin,L=null,J=null,O=mxUtils.bind(this,function(fa){null!=fa&&fa()});z.spin=function(fa,V,ba,ma){ma=null!=ma?ma:C;var la=!1;if(!this.active){var Z=Date.now();null!=ba&&(L=window.setTimeout(function(){z.stop();L=null;ba({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:J})},ma));I.call(this,fa);this.active=!0;null!=V&&(B&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2),la=document.createElement("div"),la.className="geSpinnerStatus",la.style.position="absolute",la.style.whiteSpace="nowrap",la.style.background="#4B4243",la.style.color="white",la.style.fontFamily=Editor.defaultHtmlFont,la.style.fontSize="9pt",la.style.padding="6px",la.style.paddingLeft="10px",la.style.paddingRight="10px",la.style.zIndex=2E9,la.style.left=Math.max(0,c)+"px",la.style.top=Math.max(0,f+70)+"px",mxUtils.setPrefixedStyle(la.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(la.style,-"transform","translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(la.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=S.substring(S.length-3,S.length)&&"!"!=S.charAt(S.length-1)&&(S+="..."),la.innerHTML=mxUtils.htmlEntities(S),fa.appendChild(la),z.status=la);this.pause=mxUtils.bind(this,function(){var da=O;this.active&&(ma=Math.max(0,ma-(Date.now()-Z)),da=mxUtils.bind(this,function(aa){this.spin(fa,S,ca,ma);if(null!=aa)try{aa(),M=mxUtils.bind(this,function(){this.spin(fa,S,ca,ma);-try{aa()}catch(l){null!=ca&&ca(l)}})}catch(l){null!=ca&&ca(l)}}));this.stop();return da});la=!0}return la};var ea=z.stop;z.stop=function(){ea.call(this);this.active&&(this.active=!1,null!=K&&(window.clearTimeout(K),K=null),null!=z.status&&null!=z.status.parentNode&&z.status.parentNode.removeChild(z.status),z.status=null)};z.pause=function(){return O};return z};EditorUi.prototype.isCompatibleString=function(c){try{var f=mxUtils.parseXml(c),k=this.editor.extractGraphModel(f.documentElement,!0);return null!=+"transform","translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(la.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=V.substring(V.length-3,V.length)&&"!"!=V.charAt(V.length-1)&&(V+="..."),la.innerHTML=mxUtils.htmlEntities(V),fa.appendChild(la),z.status=la);this.pause=mxUtils.bind(this,function(){var ea=O;this.active&&(ma=Math.max(0,ma-(Date.now()-Z)),ea=mxUtils.bind(this,function(aa){this.spin(fa,V,ba,ma);if(null!=aa)try{aa(),J=mxUtils.bind(this,function(){this.spin(fa,V,ba,ma);+try{aa()}catch(l){null!=ba&&ba(l)}})}catch(l){null!=ba&&ba(l)}}));this.stop();return ea});la=!0}return la};var da=z.stop;z.stop=function(){da.call(this);this.active&&(this.active=!1,null!=L&&(window.clearTimeout(L),L=null),null!=z.status&&null!=z.status.parentNode&&z.status.parentNode.removeChild(z.status),z.status=null)};z.pause=function(){return O};return z};EditorUi.prototype.isCompatibleString=function(c){try{var f=mxUtils.parseXml(c),k=this.editor.extractGraphModel(f.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}catch(B){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=-function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=f.getFunction,B=this.editor.graph,z=this;f.getFunction=function(C){if(B.isSelectionEmpty()&&null!=z.pages&&0<z.pages.length){var H=z.getSelectedPageIndex();if(mxEvent.isShiftDown(C)){if(37==C.keyCode)return function(){0<H&&z.movePage(H,H-1)};if(38==C.keyCode)return function(){0<H&&z.movePage(H,0)};if(39==C.keyCode)return function(){H<z.pages.length-1&&z.movePage(H,H+1)};if(40==C.keyCode)return function(){H<-z.pages.length-1&&z.movePage(H,z.pages.length-1)}}else if(mxEvent.isControlDown(C)||mxClient.IS_MAC&&mxEvent.isMetaDown(C)){if(37==C.keyCode)return function(){0<H&&z.selectNextPage(!1)};if(38==C.keyCode)return function(){0<H&&z.selectPage(z.pages[0])};if(39==C.keyCode)return function(){H<z.pages.length-1&&z.selectNextPage(!0)};if(40==C.keyCode)return function(){H<z.pages.length-1&&z.selectPage(z.pages[z.pages.length-1])}}}return!(65<=C.keyCode&&90>=C.keyCode)||B.isSelectionEmpty()||mxEvent.isAltDown(C)||+function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=f.getFunction,B=this.editor.graph,z=this;f.getFunction=function(C){if(B.isSelectionEmpty()&&null!=z.pages&&0<z.pages.length){var I=z.getSelectedPageIndex();if(mxEvent.isShiftDown(C)){if(37==C.keyCode)return function(){0<I&&z.movePage(I,I-1)};if(38==C.keyCode)return function(){0<I&&z.movePage(I,0)};if(39==C.keyCode)return function(){I<z.pages.length-1&&z.movePage(I,I+1)};if(40==C.keyCode)return function(){I<+z.pages.length-1&&z.movePage(I,z.pages.length-1)}}else if(mxEvent.isControlDown(C)||mxClient.IS_MAC&&mxEvent.isMetaDown(C)){if(37==C.keyCode)return function(){0<I&&z.selectNextPage(!1)};if(38==C.keyCode)return function(){0<I&&z.selectPage(z.pages[0])};if(39==C.keyCode)return function(){I<z.pages.length-1&&z.selectNextPage(!0)};if(40==C.keyCode)return function(){I<z.pages.length-1&&z.selectPage(z.pages[z.pages.length-1])}}}return!(65<=C.keyCode&&90>=C.keyCode)||B.isSelectionEmpty()||mxEvent.isAltDown(C)||mxEvent.isShiftDown(C)||mxEvent.isControlDown(C)||mxClient.IS_MAC&&mxEvent.isMetaDown(C)?k.apply(this,arguments):null}}return f};var e=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=e.apply(this,arguments);if(null==f)try{var k=c.indexOf("<mxfile ");if(0<=k){var B=c.lastIndexOf("</mxfile>");B>k&&(f=c.substring(k,B+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var z=mxUtils.parseXml(c),-C=this.editor.extractGraphModel(z.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=C?mxUtils.getXml(C):""}}catch(H){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",-f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=null!=c?this.editor.extractGraphModel(c,!0):null;null!=k&&(c=k);if(null!=c){k=this.editor.graph;k.model.beginUpdate();try{var B=null!=this.pages?this.pages.slice():null,z=c.getElementsByTagName("diagram");if(1<z.length||1==z.length&&z[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var C=z.length-1;0<=C;C--){var H=this.updatePageRoot(new DiagramPage(z[C]));null==-H.getName()&&H.setName(mxResources.get("pageWithNumber",[C+1]));k.model.execute(new ChangePage(this,H,0==C?H:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,-k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=B)for(C=0;C<B.length;C++)k.model.execute(new ChangePage(this,B[C],null));var K=this.getCurrentFile();null!=K&&K.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){f=null!=f?f:this.editor.graph;z=null!=z?z:!1;M=null!=M?M:!0;ea=null!=ea?ea:!Editor.defaultCompressed;var ca=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var ma=-"_blank";else ca=ma=B;if(null==c)return"";var la=c;if("mxfile"!=la.nodeName.toLowerCase()){if(ea){var Z=c.ownerDocument.createElement("diagram");Z.setAttribute("name",mxResources.get("pageWithNumber",[1]));Z.setAttribute("id",Editor.guid());Z.appendChild(c)}else{Z=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(Z);if(Graph.decompress(la)!=Z)return Z;Z=c.ownerDocument.createElement("diagram");Z.setAttribute("name",mxResources.get("pageWithNumber",[1]));Z.setAttribute("id",Editor.guid());mxUtils.setTextContent(Z,+C=this.editor.extractGraphModel(z.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=C?mxUtils.getXml(C):""}}catch(I){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",+f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=null!=c?this.editor.extractGraphModel(c,!0):null;null!=k&&(c=k);if(null!=c){k=this.editor.graph;k.model.beginUpdate();try{var B=null!=this.pages?this.pages.slice():null,z=c.getElementsByTagName("diagram");if(1<z.length||1==z.length&&z[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var C=z.length-1;0<=C;C--){var I=this.updatePageRoot(new DiagramPage(z[C]));null==+I.getName()&&I.setName(mxResources.get("pageWithNumber",[C+1]));k.model.execute(new ChangePage(this,I,0==C?I:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,+k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=B)for(C=0;C<B.length;C++)k.model.execute(new ChangePage(this,B[C],null));var L=this.getCurrentFile();null!=L&&L.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){f=null!=f?f:this.editor.graph;z=null!=z?z:!1;J=null!=J?J:!0;da=null!=da?da:!Editor.defaultCompressed;var ba=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var ma=+"_blank";else ba=ma=B;if(null==c)return"";var la=c;if("mxfile"!=la.nodeName.toLowerCase()){if(da){var Z=c.ownerDocument.createElement("diagram");Z.setAttribute("name",mxResources.get("pageWithNumber",[1]));Z.setAttribute("id",Editor.guid());Z.appendChild(c)}else{Z=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(Z);if(Graph.decompress(la)!=Z)return Z;Z=c.ownerDocument.createElement("diagram");Z.setAttribute("name",mxResources.get("pageWithNumber",[1]));Z.setAttribute("id",Editor.guid());mxUtils.setTextContent(Z,la)}la=c.ownerDocument.createElement("mxfile");la.appendChild(Z)}O?(la=la.cloneNode(!0),la.removeAttribute("modified"),la.removeAttribute("host"),la.removeAttribute("agent"),la.removeAttribute("etag"),la.removeAttribute("userAgent"),la.removeAttribute("version"),la.removeAttribute("editor"),la.removeAttribute("type")):(la.removeAttribute("userAgent"),la.removeAttribute("modified"),la.removeAttribute("version"),la.removeAttribute("editor"),la.removeAttribute("pages"),la.removeAttribute("type"),la.removeAttribute("etag"),-mxClient.IS_CHROMEAPP?la.setAttribute("host","Chrome"):EditorUi.isElectronApp?la.setAttribute("host","Electron"):la.setAttribute("host",window.location.hostname),la.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),la.setAttribute("version",EditorUi.VERSION),1<la.getElementsByTagName("diagram").length&&null!=this.pages&&la.setAttribute("pages",this.pages.length));null!=fa&&(la=la.cloneNode(!0),la.setAttribute("scale",fa));null!=S&&(la=la.cloneNode(!0),la.setAttribute("border",-S));c=ea?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!C&&!z&&(H||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(la),f,null!=k?k.getTitle():null,ma,ca);else if(C||!z&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(B=null),k=this.getSvgFileProperties(la),c=this.getEmbeddedSvg(c,f,B,null,K,M,ca,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,B){c=-null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var z=this.editor.getGraphXml(c,B);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(M){var O=M.getElementsByTagName("mxGraphModel"),ea=0<O.length?O[0]:null;O=M;null==ea&&k?(ea=mxUtils.getNodeValue(M),0<ea.length&&(ea=Graph.decompress(ea),null!=ea&&0<ea.length&&(O=M.cloneNode(!1),O.appendChild(mxUtils.parseXml(ea).documentElement)))):null==ea||k?O=M.cloneNode(!0):(O=M.cloneNode(!1),mxUtils.setTextContent(O,Graph.compressNode(ea)));-z.appendChild(O)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(z),z=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var C=this.pages[f],H=C.node;if(C!=this.currentPage)if(C.needsUpdate){var K=new mxCodec(mxUtils.createXmlDocument());K=K.encode(new mxGraphModel(C.root));this.editor.graph.saveViewState(C.viewState,K,null,B);EditorUi.removeChildNodes(H);H.appendChild(K);delete C.needsUpdate}else B&&(this.updatePageRoot(C),-null!=C.viewState.backgroundImage&&(null!=C.viewState.backgroundImage.originalSrc?C.viewState.backgroundImage=this.createImageForPageLink(C.viewState.backgroundImage.originalSrc,C):Graph.isPageLink(C.viewState.backgroundImage.src)&&(C.viewState.backgroundImage=this.createImageForPageLink(C.viewState.backgroundImage.src,C))),null!=C.viewState.backgroundImage&&null!=C.viewState.backgroundImage.originalSrc&&(K=new mxCodec(mxUtils.createXmlDocument()),K=K.encode(new mxGraphModel(C.root)),this.editor.graph.saveViewState(C.viewState,-K,null,B),H=H.cloneNode(!1),H.appendChild(K)));c(H)}return z};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],B=0;B<c.length;B++){var z=c.charAt(B);0<=EditorUi.ignoredAnonymizedChars.indexOf(z)?k.push(z):isNaN(parseInt(z))?z.toLowerCase()!=z?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):z.toUpperCase()!=z?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(z)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizePatch=+mxClient.IS_CHROMEAPP?la.setAttribute("host","Chrome"):EditorUi.isElectronApp?la.setAttribute("host","Electron"):la.setAttribute("host",window.location.hostname),la.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),la.setAttribute("version",EditorUi.VERSION),1<la.getElementsByTagName("diagram").length&&null!=this.pages&&la.setAttribute("pages",this.pages.length));null!=fa&&(la=la.cloneNode(!0),la.setAttribute("scale",fa));null!=V&&(la=la.cloneNode(!0),la.setAttribute("border",+V));c=da?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!C&&!z&&(I||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(la),f,null!=k?k.getTitle():null,ma,ba);else if(C||!z&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(B=null),k=this.getSvgFileProperties(la),c=this.getEmbeddedSvg(c,f,B,null,L,J,ba,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,B){c=+null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var z=this.editor.getGraphXml(c,B);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(J){var O=J.getElementsByTagName("mxGraphModel"),da=0<O.length?O[0]:null;O=J;null==da&&k?(da=mxUtils.getNodeValue(J),0<da.length&&(da=Graph.decompress(da),null!=da&&0<da.length&&(O=J.cloneNode(!1),O.appendChild(mxUtils.parseXml(da).documentElement)))):null==da||k?O=J.cloneNode(!0):(O=J.cloneNode(!1),mxUtils.setTextContent(O,Graph.compressNode(da)));+z.appendChild(O)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(z),z=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var C=this.pages[f],I=C.node;if(C!=this.currentPage)if(C.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(C.root));this.editor.graph.saveViewState(C.viewState,L,null,B);EditorUi.removeChildNodes(I);I.appendChild(L);delete C.needsUpdate}else B&&(this.updatePageRoot(C),+null!=C.viewState.backgroundImage&&(null!=C.viewState.backgroundImage.originalSrc?C.viewState.backgroundImage=this.createImageForPageLink(C.viewState.backgroundImage.originalSrc,C):Graph.isPageLink(C.viewState.backgroundImage.src)&&(C.viewState.backgroundImage=this.createImageForPageLink(C.viewState.backgroundImage.src,C))),null!=C.viewState.backgroundImage&&null!=C.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(C.root)),this.editor.graph.saveViewState(C.viewState,+L,null,B),I=I.cloneNode(!1),I.appendChild(L)));c(I)}return z};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],B=0;B<c.length;B++){var z=c.charAt(B);0<=EditorUi.ignoredAnonymizedChars.indexOf(z)?k.push(z):isNaN(parseInt(z))?z.toLowerCase()!=z?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):z.toUpperCase()!=z?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(z)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizePatch=function(c){if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(k)}catch(C){c[EditorUi.DIFF_INSERT][f].data=C.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var B in c[EditorUi.DIFF_UPDATE]){var z=c[EditorUi.DIFF_UPDATE][B];null!=z.name&&-(z.name=this.anonymizeString(z.name));null!=z.cells&&(f=mxUtils.bind(this,function(C){var H=z.cells[C];if(null!=H){for(var K in H)null!=H[K].value&&(H[K].value="["+H[K].value.length+"]"),null!=H[K].xmlValue&&(H[K].xmlValue="["+H[K].xmlValue.length+"]"),null!=H[K].style&&(H[K].style="["+H[K].style.length+"]"),mxUtils.isEmptyObject(H[K])&&delete H[K];mxUtils.isEmptyObject(H)&&delete z.cells[C]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(z.cells)&&delete z.cells);mxUtils.isEmptyObject(z)&&+(z.name=this.anonymizeString(z.name));null!=z.cells&&(f=mxUtils.bind(this,function(C){var I=z.cells[C];if(null!=I){for(var L in I)null!=I[L].value&&(I[L].value="["+I[L].value.length+"]"),null!=I[L].xmlValue&&(I[L].xmlValue="["+I[L].xmlValue.length+"]"),null!=I[L].style&&(I[L].style="["+I[L].style.length+"]"),mxUtils.isEmptyObject(I[L])&&delete I[L];mxUtils.isEmptyObject(I)&&delete z.cells[C]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(z.cells)&&delete z.cells);mxUtils.isEmptyObject(z)&&delete c[EditorUi.DIFF_UPDATE][B]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var k=0;k<c.attributes.length;k++)"as"!=c.attributes[k].name&&c.setAttribute(c.attributes[k].name,this.anonymizeString(c.attributes[k].value,f));if(null!=c.childNodes)for(k=0;k<c.childNodes.length;k++)this.anonymizeAttributes(c.childNodes[k],f)};EditorUi.prototype.anonymizeNode=function(c,f){f=c.getElementsByTagName("mxCell");for(var k=0;k<f.length;k++)null!=f[k].getAttribute("value")&&f[k].setAttribute("value","["+f[k].getAttribute("value").length+"]"),null!=f[k].getAttribute("xmlValue")&&f[k].setAttribute("xmlValue","["+f[k].getAttribute("xmlValue").length+"]"),null!=f[k].getAttribute("style")&&f[k].setAttribute("style","["+f[k].getAttribute("style").length+"]"),null!=f[k].parentNode&&"root"!=f[k].parentNode.nodeName&&null!=f[k].parentNode.parentNode&&(f[k].setAttribute("id",f[k].parentNode.getAttribute("id")),f[k].parentNode.parentNode.replaceChild(f[k],f[k].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(f.clearAutosave(),this.editor.setStatus(""),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();-f.handleFileError(k,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){z=null!=z?z:!0;C=null!=C?C:!1;O=null!=O?O:!Editor.defaultCompressed;var ca=this.editor.graph;if((f||!c&&null!=M&&/(\.svg)$/i.test(M.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ma=ca.getGlobalVariable;ca=this.createTemporaryGraph(ca.getStylesheet());-ca.setBackgroundImage=this.editor.graph.setBackgroundImage;ca.background=this.editor.graph.background;var la=null!=this.pages?this.pages[0]:null;null==la||this.currentPage==la?ca.setBackgroundImage(this.editor.graph.backgroundImage):null!=la.viewState&&null!=la.viewState&&ca.setBackgroundImage(la.viewState.backgroundImage);ca.getGlobalVariable=function(Z){return"page"==Z&&null!=la?la.getName():"pagenumber"==Z?1:ma.apply(this,arguments)};document.body.appendChild(ca.container);null!=la&&ca.model.setRoot(la.root)}H=-null!=H?H:this.getXmlFileData(z,C,O,ea);M=null!=M?M:this.getCurrentFile();c=this.createFileData(H,ca,M,window.location.href,c,f,k,B,z,K,O,fa,S);ca!=this.editor.graph&&ca.container.parentNode.removeChild(ca.container);return c};EditorUi.prototype.getHtml=function(c,f,k,B,z,C){C=null!=C?C:!0;var H=null,K=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){H=C?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var M=f.view.scale;C=Math.floor(H.x/M-f.view.translate.x);M=Math.floor(H.y/M-f.view.translate.y);-H=f.background;null==z&&(f=this.getBasenames().join(";"),0<f.length&&(K=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",C);c.setAttribute("y0",M)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=B&&c.setAttribute("edit",B));null!=z&&(z=z.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";B=Graph.compress(c);Graph.decompress(B)!=c&&(B=encodeURIComponent(c));-return(null==z?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=z?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==z?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=z?'<meta http-equiv="refresh" content="0;URL=\''+z+"'\"/>\n":"")+"</head>\n<body"+(null==z&&null!=H&&H!=mxConstants.NONE?' style="background-color:'+H+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+-B+"</div>\n</div>\n"+(null==z?'<script type="text/javascript" src="'+K+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+z+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,B,z){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=z&&(z=z.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,+f.handleFileError(k,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){z=null!=z?z:!0;C=null!=C?C:!1;O=null!=O?O:!Editor.defaultCompressed;var ba=this.editor.graph;if((f||!c&&null!=J&&/(\.svg)$/i.test(J.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ma=ba.getGlobalVariable;ba=this.createTemporaryGraph(ba.getStylesheet());+ba.setBackgroundImage=this.editor.graph.setBackgroundImage;ba.background=this.editor.graph.background;var la=null!=this.pages?this.pages[0]:null;null==la||this.currentPage==la?ba.setBackgroundImage(this.editor.graph.backgroundImage):null!=la.viewState&&null!=la.viewState&&ba.setBackgroundImage(la.viewState.backgroundImage);ba.getGlobalVariable=function(Z){return"page"==Z&&null!=la?la.getName():"pagenumber"==Z?1:ma.apply(this,arguments)};document.body.appendChild(ba.container);null!=la&&ba.model.setRoot(la.root)}I=+null!=I?I:this.getXmlFileData(z,C,O,da);J=null!=J?J:this.getCurrentFile();c=this.createFileData(I,ba,J,window.location.href,c,f,k,B,z,L,O,fa,V);ba!=this.editor.graph&&ba.container.parentNode.removeChild(ba.container);return c};EditorUi.prototype.getHtml=function(c,f,k,B,z,C){C=null!=C?C:!0;var I=null,L=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){I=C?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var J=f.view.scale;C=Math.floor(I.x/J-f.view.translate.x);J=Math.floor(I.y/J-f.view.translate.y);+I=f.background;null==z&&(f=this.getBasenames().join(";"),0<f.length&&(L=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",C);c.setAttribute("y0",J)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=B&&c.setAttribute("edit",B));null!=z&&(z=z.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";B=Graph.compress(c);Graph.decompress(B)!=c&&(B=encodeURIComponent(c));+return(null==z?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=z?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==z?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=z?'<meta http-equiv="refresh" content="0;URL=\''+z+"'\"/>\n":"")+"</head>\n<body"+(null==z&&null!=I&&I!=mxConstants.NONE?' style="background-color:'+I+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'++B+"</div>\n</div>\n"+(null==z?'<script type="text/javascript" src="'+L+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+z+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,B,z){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=z&&(z=z.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==z?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=z?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==z?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=z?'<meta http-equiv="refresh" content="0;URL=\''+z+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>\n'+(null==z?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+z+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,k=Editor.extractParserError(f,mxResources.get("invalidOrMissingFile"));if(k)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[f],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),k={},0<c.length)){var B=this.getHashObject(),z=null;this.fileNode=f;this.pages=[];for(var C=0;C<c.length;C++){null==c[C].getAttribute("id")&&c[C].setAttribute("id",C);f=new DiagramPage(c[C]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[C+1]));this.pages.push(f);if(null==B.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=B.pageId&&f.getId()==B.pageId)z=f;if(null==k[f.getId()])k[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=z?z:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),-this.scrollToPage());if(null!=urlParams["layer-ids"])try{var H=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(C=0;C<H.length;C++)f[H[C]]=!0;var K=this.editor.graph.getModel(),M=K.getChildren(K.root);for(C=0;C<M.length;C++){var O=M[C];K.setVisible(O,f[O.id]||!1)}}catch(ea){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=-f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la){try{B=null!=B?B:this.editor.graph.isSelectionEmpty();var Z=this.getBaseFilename(!z),da=Z+("xml"==c||"pdf"==c&&ea?".drawio":"")+-"."+c;if("xml"==c){var aa=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,B,z,null,null,null,f);this.saveData(da,c,aa,"text/xml")}else if("html"==c)aa=this.getHtml2(this.getFileData(!0),this.editor.graph,Z),this.saveData(da,c,aa,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?da=Z+".png":"jpeg"==c&&(da=Z+".jpg"),this.saveRequest(da,c,mxUtils.bind(this,function(J,W){try{return this.createDownloadRequest(J,c,B,W,H,z,K,-M,O,ea,fa,void 0,void 0,!C,S,ca,ma,la)}catch(Y){this.handleError(Y)}}));else{var l=null,t=mxUtils.bind(this,function(J){J.length<=MAX_REQUEST_SIZE?this.saveData(da,"svg",J,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(l)}))});if("svg"==c){var I=this.editor.graph.background;if(H||I==mxConstants.NONE)I=null;var V=this.editor.graph.getSvg(I,null,null,null,null,B);k&&this.editor.graph.addSvgShadow(V);-this.editor.convertImages(V,mxUtils.bind(this,mxUtils.bind(this,function(J){this.spinner.stop();t(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(J))})))}else da=Z+".svg",l=this.getFileData(!1,!0,null,mxUtils.bind(this,function(J){this.spinner.stop();t(J)}),B)}}catch(J){this.handleError(J)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la,Z,da){c=this.downloadRequestBuilder(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la,Z,da);f="";for(var aa in c)k=c[aa],-null!=k&&(f+=aa+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la,Z,da){var aa=this.editor.graph,l=aa.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==C?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var t=null,I=null,V=null;if(!EditorUi.isElectronApp&&(l.width*l.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};O=O?"1":-"0";"pdf"==f&&(null!=ea?(t=ea.from,I=ea.to):0==C&&(V="1"));"xmlpng"==f&&(O="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(C=0;C<this.pages.length;C++)if(this.pages[C]==this.currentPage){t=C;break}C=aa.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!z?z||null!=C&&C!=mxConstants.NONE||(C="#ffffff"):C=mxConstants.NONE;z={globalVars:aa.getExportVariables()};M&&(z.grid={size:aa.gridSize,steps:aa.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:-aa.view.gridColor});Graph.translateDiagram&&(z.diagramLanguage=Graph.diagramLanguage);return{format:f,from:t,to:I,allPages:V,bg:null!=C?C:mxConstants.NONE,base64:B,embedXml:O,xml:k,filename:null!=c?c:"",extras:JSON.stringify(z),scale:H,border:K,pageMargin:ma,w:fa&&isFinite(fa)?fa:null,h:S&&isFinite(S)?S:null,crop:null!=ca&&ca?"1":"0",fit:null!=la&&la?"1":"0",sheetsAcross:Z,sheetsDown:da}};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;+this.scrollToPage());if(null!=urlParams["layer-ids"])try{var I=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(C=0;C<I.length;C++)f[I[C]]=!0;var L=this.editor.graph.getModel(),J=L.getChildren(L.root);for(C=0;C<J.length;C++){var O=J[C];L.setVisible(O,f[O.id]||!1)}}catch(da){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=+f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la){try{B=null!=B?B:this.editor.graph.isSelectionEmpty();var Z=this.getBaseFilename(!z),ea=Z+("xml"==c||"pdf"==c&&da?".drawio":"")++"."+c;if("xml"==c){var aa=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,B,z,null,null,null,f);this.saveData(ea,c,aa,"text/xml")}else if("html"==c)aa=this.getHtml2(this.getFileData(!0),this.editor.graph,Z),this.saveData(ea,c,aa,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?ea=Z+".png":"jpeg"==c&&(ea=Z+".jpg"),this.saveRequest(ea,c,mxUtils.bind(this,function(K,W){try{return this.createDownloadRequest(K,c,B,W,I,z,L,+J,O,da,fa,void 0,void 0,!C,V,ba,ma,la)}catch(Y){this.handleError(Y)}}));else{var l=null,t=mxUtils.bind(this,function(K){K.length<=MAX_REQUEST_SIZE?this.saveData(ea,"svg",K,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(l)}))});if("svg"==c){var H=this.editor.graph.background;if(I||H==mxConstants.NONE)H=null;var U=this.editor.graph.getSvg(H,null,null,null,null,B);k&&this.editor.graph.addSvgShadow(U);+this.editor.convertImages(U,mxUtils.bind(this,mxUtils.bind(this,function(K){this.spinner.stop();t(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(K))})))}else ea=Z+".svg",l=this.getFileData(!1,!0,null,mxUtils.bind(this,function(K){this.spinner.stop();t(K)}),B)}}catch(K){this.handleError(K)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la,Z,ea){c=this.downloadRequestBuilder(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la,Z,ea);f="";for(var aa in c)k=c[aa],+null!=k&&(f+=aa+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la,Z,ea){var aa=this.editor.graph,l=aa.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==C?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var t=null,H=null,U=null;if(!EditorUi.isElectronApp&&(l.width*l.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};O=O?"1":+"0";"pdf"==f&&(null!=da?(t=da.from,H=da.to):0==C&&(U="1"));"xmlpng"==f&&(O="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(C=0;C<this.pages.length;C++)if(this.pages[C]==this.currentPage){t=C;break}C=aa.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!z?z||null!=C&&C!=mxConstants.NONE||(C="#ffffff"):C=mxConstants.NONE;z={globalVars:aa.getExportVariables()};J&&(z.grid={size:aa.gridSize,steps:aa.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:+aa.view.gridColor});Graph.translateDiagram&&(z.diagramLanguage=Graph.diagramLanguage);return{format:f,from:t,to:H,allPages:U,bg:null!=C?C:mxConstants.NONE,base64:B,embedXml:O,xml:k,filename:null!=c?c:"",extras:JSON.stringify(z),scale:I,border:L,pageMargin:ma,w:fa&&isFinite(fa)?fa:null,h:V&&isFinite(V)?V:null,crop:null!=ba&&ba?"1":"0",fit:null!=la&&la?"1":"0",sheetsAcross:Z,sheetsDown:ea}};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var k=c.lastIndexOf("#");if(0<k){c=decodeURIComponent(c.substring(k+1));try{f=JSON.parse(c)}catch(B){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var k=f.lastIndexOf("#");0<k&&(f=f.substring(0,k));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(B){}0<k&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,k){var B=window.location.hash,-z=mxUtils.bind(this,function(H){var K=null!=c.data?c.data:"";null!=H&&0<H.length&&(0<K.length&&(K+="\n"),K+=H);H=new LocalFile(this,"csv"!=c.format&&0<K.length?K:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);H.getHash=function(){return B};this.fileLoaded(H);"csv"==c.format&&this.importCsv(K,mxUtils.bind(this,function(S){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var M=null!=c.interval?-parseInt(c.interval):6E4,O=null,ea=mxUtils.bind(this,function(){var S=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(ca){S===this.currentPage&&(200<=ca.getStatus()&&300>=ca.getStatus()?(this.updateDiagram(ca.getText()),fa()):this.handleError({message:mxResources.get("error")+" "+ca.getStatus()}))}),mxUtils.bind(this,function(ca){this.handleError(ca)}))}),fa=mxUtils.bind(this,function(){window.clearTimeout(O);O=-window.setTimeout(ea,M)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){fa();ea()}));fa();ea()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var C=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(C,mxUtils.bind(this,function(H){z(H)}),mxUtils.bind(this,function(H){null!=k&&k(H)}))}else z("")};EditorUi.prototype.updateDiagram=function(c){function f(l){var t=new mxCellOverlay(l.image||z.warningImage,l.tooltip,l.align,l.valign,l.offset);t.addListener(mxEvent.CLICK,function(I,-V){B.alert(l.tooltip)});return t}var k=null,B=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var z=this.editor.graph,C=z.getModel();C.beginUpdate();var H=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var K=C.getCell(c.getAttribute("id"));if(null!=K){try{var M=c.getAttribute("value");if(null!=M){var O=mxUtils.parseXml(M).documentElement;if(null!=O)if("1"==O.getAttribute("replace-value"))C.setValue(K,O);else for(var ea=-O.attributes,fa=0;fa<ea.length;fa++)z.setAttributeForCell(K,ea[fa].nodeName,0<ea[fa].nodeValue.length?ea[fa].nodeValue:null)}}catch(l){null!=window.console&&console.log("Error in value for "+K.id+": "+l)}try{var S=c.getAttribute("style");null!=S&&z.model.setStyle(K,S)}catch(l){null!=window.console&&console.log("Error in style for "+K.id+": "+l)}try{var ca=c.getAttribute("icon");if(null!=ca){var ma=0<ca.length?JSON.parse(ca):null;null!=ma&&ma.append||z.removeCellOverlays(K);null!=ma&&z.addCellOverlay(K,-f(ma))}}catch(l){null!=window.console&&console.log("Error in icon for "+K.id+": "+l)}try{var la=c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var Z=z.getCellGeometry(K);if(null!=Z){Z=Z.clone();for(key in la){var da=parseFloat(la[key]);"dx"==key?Z.x+=da:"dy"==key?Z.y+=da:"dw"==key?Z.width+=da:"dh"==key?Z.height+=da:Z[key]=parseFloat(la[key])}z.model.setGeometry(K,Z)}}}catch(l){null!=window.console&&console.log("Error in icon for "+K.id+": "+l)}}}else if("model"==c.nodeName){for(var aa=-c.firstChild;null!=aa&&aa.nodeType!=mxConstants.NODETYPE_ELEMENT;)aa=aa.nextSibling;null!=aa&&(new mxCodec(c.firstChild)).decode(aa,C)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(z.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))z.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(H=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{C.endUpdate()}null!=-H&&this.chromelessResize&&this.chromelessResize(!0,H)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var B=k.lastIndexOf(".");0<=B&&(c=k.substring(B),k=k.substring(0,B));if(f){f=k;var z=new Date;k=z.getFullYear();B=z.getMonth()+1;var C=z.getDate(),H=z.getHours(),K=z.getMinutes();z=z.getSeconds();k=f+(" "+(k+"-"+B+"-"+C+"-"+H+"-"+K+"-"+z))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=+z=mxUtils.bind(this,function(I){var L=null!=c.data?c.data:"";null!=I&&0<I.length&&(0<L.length&&(L+="\n"),L+=I);I=new LocalFile(this,"csv"!=c.format&&0<L.length?L:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);I.getHash=function(){return B};this.fileLoaded(I);"csv"==c.format&&this.importCsv(L,mxUtils.bind(this,function(V){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var J=null!=c.interval?+parseInt(c.interval):6E4,O=null,da=mxUtils.bind(this,function(){var V=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(ba){V===this.currentPage&&(200<=ba.getStatus()&&300>=ba.getStatus()?(this.updateDiagram(ba.getText()),fa()):this.handleError({message:mxResources.get("error")+" "+ba.getStatus()}))}),mxUtils.bind(this,function(ba){this.handleError(ba)}))}),fa=mxUtils.bind(this,function(){window.clearTimeout(O);O=+window.setTimeout(da,J)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){fa();da()}));fa();da()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var C=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(C,mxUtils.bind(this,function(I){z(I)}),mxUtils.bind(this,function(I){null!=k&&k(I)}))}else z("")};EditorUi.prototype.updateDiagram=function(c){function f(l){var t=new mxCellOverlay(l.image||z.warningImage,l.tooltip,l.align,l.valign,l.offset);t.addListener(mxEvent.CLICK,function(H,+U){B.alert(l.tooltip)});return t}var k=null,B=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var z=this.editor.graph,C=z.getModel();C.beginUpdate();var I=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var L=C.getCell(c.getAttribute("id"));if(null!=L){try{var J=c.getAttribute("value");if(null!=J){var O=mxUtils.parseXml(J).documentElement;if(null!=O)if("1"==O.getAttribute("replace-value"))C.setValue(L,O);else for(var da=+O.attributes,fa=0;fa<da.length;fa++)z.setAttributeForCell(L,da[fa].nodeName,0<da[fa].nodeValue.length?da[fa].nodeValue:null)}}catch(l){null!=window.console&&console.log("Error in value for "+L.id+": "+l)}try{var V=c.getAttribute("style");null!=V&&z.model.setStyle(L,V)}catch(l){null!=window.console&&console.log("Error in style for "+L.id+": "+l)}try{var ba=c.getAttribute("icon");if(null!=ba){var ma=0<ba.length?JSON.parse(ba):null;null!=ma&&ma.append||z.removeCellOverlays(L);null!=ma&&z.addCellOverlay(L,+f(ma))}}catch(l){null!=window.console&&console.log("Error in icon for "+L.id+": "+l)}try{var la=c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var Z=z.getCellGeometry(L);if(null!=Z){Z=Z.clone();for(key in la){var ea=parseFloat(la[key]);"dx"==key?Z.x+=ea:"dy"==key?Z.y+=ea:"dw"==key?Z.width+=ea:"dh"==key?Z.height+=ea:Z[key]=parseFloat(la[key])}z.model.setGeometry(L,Z)}}}catch(l){null!=window.console&&console.log("Error in icon for "+L.id+": "+l)}}}else if("model"==c.nodeName){for(var aa=+c.firstChild;null!=aa&&aa.nodeType!=mxConstants.NODETYPE_ELEMENT;)aa=aa.nextSibling;null!=aa&&(new mxCodec(c.firstChild)).decode(aa,C)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(z.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))z.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(I=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{C.endUpdate()}null!=+I&&this.chromelessResize&&this.chromelessResize(!0,I)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var B=k.lastIndexOf(".");0<=B&&(c=k.substring(B),k=k.substring(0,B));if(f){f=k;var z=new Date;k=z.getFullYear();B=z.getMonth()+1;var C=z.getDate(),I=z.getHours(),L=z.getMinutes();z=z.getSeconds();k=f+(" "+(k+"-"+B+"-"+C+"-"+I+"-"+L+"-"+z))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,f,k){var B=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var z=!1;this.hideDialog();null!=B&&(B.removeListener(this.descriptorChangedListener),this.logIfModified(B,!0),B.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var C=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);!f&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerText="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();f||this.showSplash()});if(null!=c)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?c.addUnsavedStatus():this.editor.setStatus(""):this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</div>");!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();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));z=!0;if(!this.isOffline()&&null!=-c.getMode()){var H="1"==urlParams.sketch?"sketch":uiTheme;if(null==H)H="default";else if("sketch"==H||"min"==H)H+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(K){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+-1),mxSettings.save()}catch(K){}}catch(K){this.fileLoadedError=K;if(null!=c)try{c.close()}catch(M){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=B?this.fileLoaded(B)||C():C()});f?c():(null!=K.fallbackFileData&&(K.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var M=new LocalFile(this,K.fallbackFileData,this.defaultFilename,-!0);this.fileLoaded(M)})}),this.handleError(K,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else C();return z};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,B=new mxGraphModel,z=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var C=0;C<c.length;C++){this.updatePageRoot(c[C]);var H=c[C].node.cloneNode(!1);H.removeAttribute("name");B.root=c[C].root;var K=z.encode(B);this.editor.graph.saveViewState(c[C].viewState,K,!0);K.removeAttribute("pageWidth");-K.removeAttribute("pageHeight");H.appendChild(K);null!=f&&(f.eltCount+=H.getElementsByTagName("*").length,f.nodeCount+=H.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(H,function(M,O,ea,fa){return!fa||"mxGeometry"!=M.nodeName&&"mxPoint"!=M.nodeName||"x"!=O&&"y"!=O&&"width"!=O&&"height"!=O?fa&&"mxCell"==M.nodeName&&"previous"==O?null:ea:Math.round(ea)},f)<<0}return k};EditorUi.prototype.hashValue=function(c,f,k){var B=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&-"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(B^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var z=0;z<c.attributes.length;z++){var C=c.attributes[z].name,H=null!=f?f(c,C,c.attributes[z].value,!0):c.attributes[z].value;null!=H&&(B^=this.hashValue(C,f,k)+this.hashValue(H,f,k))}}if(null!=c.childNodes)for(z=0;z<c.childNodes.length;z++)B=(B<<5)-B+this.hashValue(c.childNodes[z],f,k)<<0}else if(null!=c&&"function"!==-typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(z=0;z<c.length;z++)f=(f<<5)-f+c.charCodeAt(z)<<0;B^=f}return B};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,B,z,C,H){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,+c.getMode()){var I="1"==urlParams.sketch?"sketch":uiTheme;if(null==I)I="default";else if("sketch"==I||"min"==I)I+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(L){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()++1),mxSettings.save()}catch(L){}}catch(L){this.fileLoadedError=L;if(null!=c)try{c.close()}catch(J){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=B?this.fileLoaded(B)||C():C()});f?c():(null!=L.fallbackFileData&&(L.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var J=new LocalFile(this,L.fallbackFileData,this.defaultFilename,+!0);this.fileLoaded(J)})}),this.handleError(L,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else C();return z};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,B=new mxGraphModel,z=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var C=0;C<c.length;C++){this.updatePageRoot(c[C]);var I=c[C].node.cloneNode(!1);I.removeAttribute("name");B.root=c[C].root;var L=z.encode(B);this.editor.graph.saveViewState(c[C].viewState,L,!0);L.removeAttribute("pageWidth");+L.removeAttribute("pageHeight");I.appendChild(L);null!=f&&(f.eltCount+=I.getElementsByTagName("*").length,f.nodeCount+=I.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(I,function(J,O,da,fa){return!fa||"mxGeometry"!=J.nodeName&&"mxPoint"!=J.nodeName||"x"!=O&&"y"!=O&&"width"!=O&&"height"!=O?fa&&"mxCell"==J.nodeName&&"previous"==O?null:da:Math.round(da)},f)<<0}return k};EditorUi.prototype.hashValue=function(c,f,k){var B=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&+"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(B^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var z=0;z<c.attributes.length;z++){var C=c.attributes[z].name,I=null!=f?f(c,C,c.attributes[z].value,!0):c.attributes[z].value;null!=I&&(B^=this.hashValue(C,f,k)+this.hashValue(I,f,k))}}if(null!=c.childNodes)for(z=0;z<c.childNodes.length;z++)B=(B<<5)-B+this.hashValue(c.childNodes[z],f,k)<<0}else if(null!=c&&"function"!==+typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(z=0;z<c.length;z++)f=(f<<5)-f+c.charCodeAt(z)<<0;B^=f}return B};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,B,z,C,I){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){null==c&&(c=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var k=f.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(c,null,2));f.appendChild(k);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var k=0;k<f.length;k++)f[k].parentNode.removeChild(f[k]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,f){var k=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:k.firstChild.nextSibling.nextSibling;f=k.lastChild;var B=f.previousSibling;k.insertBefore(f,c);k.insertBefore(B,f)}};EditorUi.prototype.loadLibrary=function(c,f){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==k.documentElement.nodeName){var B=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,B,k.documentElement.getAttribute("title"),f)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.libraryLoaded=function(c,f,k,B){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var z=null;if(c.constructor!=StorageLibrary||-".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var C=0;C<this.openLibraries.length;C++)if(this.openLibraries[C].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[C],this.openLibraries);break}z={file:c,images:f,title:k,expand:B};this.openLibraries.push(z)}else this.scratchpad=c;C=this.sidebar.palettes[c.getHash()];C=null!=C?C[C.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var H=null,K=mxUtils.bind(this,function(da,aa){0==da.length&&c.isEditable()?-(null==H&&(H=document.createElement("div"),H.className="geDropTarget",mxUtils.write(H,mxResources.get("dragElementsHere"))),aa.appendChild(H)):this.addLibraryEntries(da,aa)});null!=this.sidebar&&null!=f&&this.sidebar.addEntries(f);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var M=this.sidebar.addPalette(c.getHash(),k,null!=B?B:!0,mxUtils.bind(this,function(da){K(f,da)}));null!=z&&(z.div=M);this.repositionLibrary(C,"L.scratchpad"!=c.getHash());B=M.parentNode.previousSibling;-k=B.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&B.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var O=document.createElement("div");O.style.backgroundColor="inherit";B.style.position="relative";var ea=document.createElement("img");ea.className="geAdaptiveAsset";ea.setAttribute("src",Editor.crossImage);ea.setAttribute("title",mxResources.get("close"));ea.setAttribute("valign","absmiddle");ea.setAttribute("border","0");ea.style.position="relative";ea.style.top="2px";-ea.style.width="14px";ea.style.cursor="pointer";ea.style.margin="0 3px";var fa=null;if(".scratchpad"!=c.title||this.closableScratchpad)O.appendChild(ea),mxEvent.addListener(ea,"click",mxUtils.bind(this,function(da){if(!mxEvent.isConsumed(da)){var aa=mxUtils.bind(this,function(){null!=z&&mxUtils.remove(z,this.openLibraries);this.closeLibrary(c)});null!=fa?this.confirm(mxResources.get("allChangesLost"),null,aa,mxResources.get("cancel"),mxResources.get("discardChanges")):aa();mxEvent.consume(da)}}));-if(c.isEditable()){var S=this.editor.graph,ca=null;k=mxUtils.bind(this,function(da){this.showLibraryDialog(c.getTitle(),M,f,c,c.getMode());mxEvent.consume(da)});var ma=mxUtils.bind(this,function(da){c.setModified(!0);c.isAutosave()?(null!=ca&&null!=ca.parentNode&&ca.parentNode.removeChild(ca),ca=ea.cloneNode(!1),ca.setAttribute("src",Editor.spinImage),ca.setAttribute("title",mxResources.get("saving")),ca.style.cursor="default",ca.style.marginRight="2px",ca.style.marginTop="-2px",O.insertBefore(ca,-O.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=ca&&null!=ca.parentNode&&ca.parentNode.removeChild(ca)})):null==fa&&(fa=ea.cloneNode(!1),fa.setAttribute("src",Editor.saveImage),fa.setAttribute("title",mxResources.get("save")),O.insertBefore(fa,O.firstChild),mxEvent.addListener(fa,"click",mxUtils.bind(this,function(aa){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==fa||c.isModified()||(fa.parentNode.removeChild(fa),fa=-null)});mxEvent.consume(aa)})))}),la=mxUtils.bind(this,function(da,aa,l,t){da=S.cloneCells(mxUtils.sortCells(S.model.getTopmostCells(da)));for(var I=0;I<da.length;I++){var V=S.getCellGeometry(da[I]);null!=V&&V.translate(-aa.x,-aa.y)}M.appendChild(this.sidebar.createVertexTemplateFromCells(da,aa.width,aa.height,t||"",!0,null,!1));da=mxUtils.getXml(this.editor.graph.encodeCells(da));Editor.defaultCompressed&&(da=Graph.compress(da));aa={xml:da,w:aa.width,h:aa.height};null!=t&&(aa.title=t);f.push(aa);-ma(l);null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null)}),Z=mxUtils.bind(this,function(da){if(S.isSelectionEmpty())S.getRubberband().isActive()?(S.getRubberband().execute(da),S.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var aa=S.getSelectionCells(),l=S.view.getBounds(aa);if(null!=l&&0<l.width&&0<l.height){var t=S.view.scale;l.x/=t;l.y/=t;l.width/=t;l.height/=t;l.x-=S.view.translate.x;-l.y-=S.view.translate.y;la(aa,l)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(da)});mxEvent.addGestureListeners(M,function(){},mxUtils.bind(this,function(da){S.isMouseDown&&null!=S.panningManager&&null!=S.graphHandler.first&&(S.graphHandler.suspend(),null!=S.graphHandler.hint&&(S.graphHandler.hint.style.visibility="hidden"),M.style.backgroundColor="light-dark(#fefefe, #000000)",M.style.cursor="copy",S.panningManager.stop(),S.autoScroll=-!1,mxEvent.consume(da))}),mxUtils.bind(this,function(da){S.isMouseDown&&null!=S.panningManager&&null!=S.graphHandler&&(M.style.backgroundColor="",M.style.cursor="default",this.sidebar.showTooltips=!0,S.panningManager.stop(),S.graphHandler.reset(),S.isMouseDown=!1,S.autoScroll=!0,Z(da),mxEvent.consume(da))}));mxEvent.addListener(M,"mouseleave",mxUtils.bind(this,function(da){S.isMouseDown&&null!=S.graphHandler.first&&(S.graphHandler.resume(),null!=S.graphHandler.hint&&(S.graphHandler.hint.style.visibility=-"visible"),M.style.backgroundColor="",M.style.cursor="",S.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(M,"dragover",mxUtils.bind(this,function(da){M.style.backgroundColor="light-dark(#fefefe, #000000)";da.dataTransfer.dropEffect="copy";M.style.cursor="copy";this.sidebar.hideTooltip();da.stopPropagation();da.preventDefault()})),mxEvent.addListener(M,"drop",mxUtils.bind(this,function(da){M.style.cursor="";M.style.backgroundColor="";0<da.dataTransfer.files.length&&this.importFiles(da.dataTransfer.files,-0,0,this.maxImageSize,mxUtils.bind(this,function(aa,l,t,I,V,J,W,Y,ba){if(null!=aa&&"image/"==l.substring(0,6))aa="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(aa),aa=[new mxCell("",new mxGeometry(0,0,V,J),aa)],aa[0].vertex=!0,la(aa,new mxRectangle(0,0,V,J),da,mxEvent.isAltDown(da)?null:W.substring(0,W.lastIndexOf(".")).replace(/_/g," ")),null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null);else{var ja=!1,-oa=mxUtils.bind(this,function(qa,ra){null!=qa&&"application/pdf"==ra&&(ra=Editor.extractGraphModelFromPdf(qa),null!=ra&&0<ra.length&&(qa=ra));if(null!=qa)if(qa=mxUtils.parseXml(qa),"mxlibrary"==qa.documentElement.nodeName)try{var xa=JSON.parse(mxUtils.getTextContent(qa.documentElement));K(xa,M);f=f.concat(xa);ma(da);this.spinner.stop();ja=!0}catch(La){}else if("mxfile"==qa.documentElement.nodeName)try{var Ba=qa.documentElement.getElementsByTagName("diagram");for(xa=0;xa<Ba.length;xa++){var ya=this.stringToCells(Editor.getDiagramNodeXml(Ba[xa])),-Da=this.editor.graph.getBoundingBoxFromGeometry(ya);null!=Da&&la(ya,new mxRectangle(0,0,Da.width,Da.height),da)}ja=!0}catch(La){null!=window.console&&console.log("error in drop handler:",La)}ja||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null)});null!=ba&&null!=W&&EditorUi.isVisioFilename(W)?this.importVisio(ba,function(qa){oa(qa,"text/xml")},null,W):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(aa,-W)&&null!=ba?this.isExternalDataComms()?this.parseFile(ba,mxUtils.bind(this,function(qa){4==qa.readyState&&(this.spinner.stop(),200<=qa.status&&299>=qa.status?oa(qa.responseText,"text/xml"):this.handleError({message:mxResources.get(413==qa.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):oa(aa,l)}}));da.stopPropagation();da.preventDefault()})),mxEvent.addListener(M,-"dragleave",function(da){M.style.cursor="";M.style.backgroundColor="";da.stopPropagation();da.preventDefault()}));ea=ea.cloneNode(!1);ea.setAttribute("src",Editor.editImage);ea.setAttribute("title",mxResources.get("edit"));O.insertBefore(ea,O.firstChild);mxEvent.addListener(ea,"click",k);k=ea.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));O.insertBefore(k,O.firstChild);mxEvent.addListener(k,"click",Z);".scratchpad"==c.title&&(this.addSelectionToScratchpad=+".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var C=0;C<this.openLibraries.length;C++)if(this.openLibraries[C].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[C],this.openLibraries);break}z={file:c,images:f,title:k,expand:B};this.openLibraries.push(z)}else this.scratchpad=c;C=this.sidebar.palettes[c.getHash()];C=null!=C?C[C.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var I=null,L=mxUtils.bind(this,function(ea,aa){0==ea.length&&c.isEditable()?+(null==I&&(I=document.createElement("div"),I.className="geDropTarget",mxUtils.write(I,mxResources.get("dragElementsHere"))),aa.appendChild(I)):this.addLibraryEntries(ea,aa)});null!=this.sidebar&&null!=f&&this.sidebar.addEntries(f);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var J=this.sidebar.addPalette(c.getHash(),k,null!=B?B:!0,mxUtils.bind(this,function(ea){L(f,ea)}));null!=z&&(z.div=J);this.repositionLibrary(C,"L.scratchpad"!=c.getHash());B=J.parentNode.previousSibling;+k=B.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&B.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var O=document.createElement("div");O.style.backgroundColor="inherit";B.style.position="relative";var da=document.createElement("img");da.className="geAdaptiveAsset";da.setAttribute("src",Editor.crossImage);da.setAttribute("title",mxResources.get("close"));da.setAttribute("valign","absmiddle");da.setAttribute("border","0");da.style.position="relative";da.style.top="2px";+da.style.width="14px";da.style.cursor="pointer";da.style.margin="0 3px";var fa=null;if(".scratchpad"!=c.title||this.closableScratchpad)O.appendChild(da),mxEvent.addListener(da,"click",mxUtils.bind(this,function(ea){if(!mxEvent.isConsumed(ea)){var aa=mxUtils.bind(this,function(){null!=z&&mxUtils.remove(z,this.openLibraries);this.closeLibrary(c)});null!=fa?this.confirm(mxResources.get("allChangesLost"),null,aa,mxResources.get("cancel"),mxResources.get("discardChanges")):aa();mxEvent.consume(ea)}}));+if(c.isEditable()){var V=this.editor.graph,ba=null;k=mxUtils.bind(this,function(ea){this.showLibraryDialog(c.getTitle(),J,f,c,c.getMode());mxEvent.consume(ea)});var ma=mxUtils.bind(this,function(ea){c.setModified(!0);c.isAutosave()?(null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba),ba=da.cloneNode(!1),ba.setAttribute("src",Editor.spinImage),ba.setAttribute("title",mxResources.get("saving")),ba.style.cursor="default",ba.style.marginRight="2px",ba.style.marginTop="-2px",O.insertBefore(ba,+O.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba)})):null==fa&&(fa=da.cloneNode(!1),fa.setAttribute("src",Editor.saveImage),fa.setAttribute("title",mxResources.get("save")),O.insertBefore(fa,O.firstChild),mxEvent.addListener(fa,"click",mxUtils.bind(this,function(aa){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==fa||c.isModified()||(fa.parentNode.removeChild(fa),fa=+null)});mxEvent.consume(aa)})))}),la=mxUtils.bind(this,function(ea,aa,l,t){ea=V.cloneCells(mxUtils.sortCells(V.model.getTopmostCells(ea)));for(var H=0;H<ea.length;H++){var U=V.getCellGeometry(ea[H]);null!=U&&U.translate(-aa.x,-aa.y)}J.appendChild(this.sidebar.createVertexTemplateFromCells(ea,aa.width,aa.height,t||"",!0,null,!1));ea=mxUtils.getXml(this.editor.graph.encodeCells(ea));Editor.defaultCompressed&&(ea=Graph.compress(ea));aa={xml:ea,w:aa.width,h:aa.height};null!=t&&(aa.title=t);f.push(aa);+ma(l);null!=I&&null!=I.parentNode&&0<f.length&&(I.parentNode.removeChild(I),I=null)}),Z=mxUtils.bind(this,function(ea){if(V.isSelectionEmpty())V.getRubberband().isActive()?(V.getRubberband().execute(ea),V.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var aa=V.getSelectionCells(),l=V.view.getBounds(aa);if(null!=l&&0<l.width&&0<l.height){var t=V.view.scale;l.x/=t;l.y/=t;l.width/=t;l.height/=t;l.x-=V.view.translate.x;+l.y-=V.view.translate.y;la(aa,l)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(ea)});mxEvent.addGestureListeners(J,function(){},mxUtils.bind(this,function(ea){V.isMouseDown&&null!=V.panningManager&&null!=V.graphHandler.first&&(V.graphHandler.suspend(),null!=V.graphHandler.hint&&(V.graphHandler.hint.style.visibility="hidden"),J.style.backgroundColor="light-dark(#fefefe, #000000)",J.style.cursor="copy",V.panningManager.stop(),V.autoScroll=+!1,mxEvent.consume(ea))}),mxUtils.bind(this,function(ea){V.isMouseDown&&null!=V.panningManager&&null!=V.graphHandler&&(J.style.backgroundColor="",J.style.cursor="default",this.sidebar.showTooltips=!0,V.panningManager.stop(),V.graphHandler.reset(),V.isMouseDown=!1,V.autoScroll=!0,Z(ea),mxEvent.consume(ea))}));mxEvent.addListener(J,"mouseleave",mxUtils.bind(this,function(ea){V.isMouseDown&&null!=V.graphHandler.first&&(V.graphHandler.resume(),null!=V.graphHandler.hint&&(V.graphHandler.hint.style.visibility=+"visible"),J.style.backgroundColor="",J.style.cursor="",V.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(J,"dragover",mxUtils.bind(this,function(ea){J.style.backgroundColor="light-dark(#fefefe, #000000)";ea.dataTransfer.dropEffect="copy";J.style.cursor="copy";this.sidebar.hideTooltip();ea.stopPropagation();ea.preventDefault()})),mxEvent.addListener(J,"drop",mxUtils.bind(this,function(ea){J.style.cursor="";J.style.backgroundColor="";0<ea.dataTransfer.files.length&&this.importFiles(ea.dataTransfer.files,+0,0,this.maxImageSize,mxUtils.bind(this,function(aa,l,t,H,U,K,W,Y,ca){if(null!=aa&&"image/"==l.substring(0,6))aa="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(aa),aa=[new mxCell("",new mxGeometry(0,0,U,K),aa)],aa[0].vertex=!0,la(aa,new mxRectangle(0,0,U,K),ea,mxEvent.isAltDown(ea)?null:W.substring(0,W.lastIndexOf(".")).replace(/_/g," ")),null!=I&&null!=I.parentNode&&0<f.length&&(I.parentNode.removeChild(I),I=null);else{var ja=!1,+oa=mxUtils.bind(this,function(qa,ra){null!=qa&&"application/pdf"==ra&&(ra=Editor.extractGraphModelFromPdf(qa),null!=ra&&0<ra.length&&(qa=ra));if(null!=qa)if(qa=mxUtils.parseXml(qa),"mxlibrary"==qa.documentElement.nodeName)try{var xa=JSON.parse(mxUtils.getTextContent(qa.documentElement));L(xa,J);f=f.concat(xa);ma(ea);this.spinner.stop();ja=!0}catch(La){}else if("mxfile"==qa.documentElement.nodeName)try{var Ba=qa.documentElement.getElementsByTagName("diagram");for(xa=0;xa<Ba.length;xa++){var ya=this.stringToCells(Editor.getDiagramNodeXml(Ba[xa])),+Da=this.editor.graph.getBoundingBoxFromGeometry(ya);null!=Da&&la(ya,new mxRectangle(0,0,Da.width,Da.height),ea)}ja=!0}catch(La){null!=window.console&&console.log("error in drop handler:",La)}ja||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=I&&null!=I.parentNode&&0<f.length&&(I.parentNode.removeChild(I),I=null)});null!=ca&&null!=W&&EditorUi.isVisioFilename(W)?this.importVisio(ca,function(qa){oa(qa,"text/xml")},null,W):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(aa,+W)&&null!=ca?this.isExternalDataComms()?this.parseFile(ca,mxUtils.bind(this,function(qa){4==qa.readyState&&(this.spinner.stop(),200<=qa.status&&299>=qa.status?oa(qa.responseText,"text/xml"):this.handleError({message:mxResources.get(413==qa.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):oa(aa,l)}}));ea.stopPropagation();ea.preventDefault()})),mxEvent.addListener(J,+"dragleave",function(ea){J.style.cursor="";J.style.backgroundColor="";ea.stopPropagation();ea.preventDefault()}));da=da.cloneNode(!1);da.setAttribute("src",Editor.editImage);da.setAttribute("title",mxResources.get("edit"));O.insertBefore(da,O.firstChild);mxEvent.addListener(da,"click",k);k=da.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));O.insertBefore(k,O.firstChild);mxEvent.addListener(k,"click",Z);".scratchpad"==c.title&&(this.addSelectionToScratchpad=Z);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink),C=k.getElementsByTagName("img")[0],k.style.marginRight="1px",C.style.marginTop="-2px",C.style.opacity="",O.insertBefore(k,O.firstChild))}B.appendChild(O);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var k=0;k<c.length;k++)try{var B=c[k],z=B.data;if(null!=z){z="data:"==z.substring(0,5)?this.convertDataUri(z):-z;var C="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==B.aspect&&(C+="aspect=fixed;");C=C+"image="+z+";";null!=B.style&&(C+=B.style);f.appendChild(this.sidebar.createVertexTemplate(C,B.w,B.h,"",B.title||"",!1,null,!0))}else if(null!=B.xml){var H=this.stringToCells("<"==B.xml.charAt(0)?B.xml:Graph.decompress(B.xml)),K=0==H.length?mxResources.get("drawingEmpty"):null!=B.title?B.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(H,B.w,B.h,K,!0,null,-!0))}}catch(M){K=null!=M.message?mxResources.get("error")+": "+M.message:String(M),C=this.sidebar.createVertexTemplateFromCells(null,B.w,B.h,K,!0,null,!0),f.appendChild(C)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(mxClient.link("stylesheet",+z;var C="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==B.aspect&&(C+="aspect=fixed;");C=C+"image="+z+";";null!=B.style&&(C+=B.style);f.appendChild(this.sidebar.createVertexTemplate(C,B.w,B.h,"",B.title||"",!1,null,!0))}else if(null!=B.xml){var I=this.stringToCells("<"==B.xml.charAt(0)?B.xml:Graph.decompress(B.xml)),L=0==I.length?mxResources.get("drawingEmpty"):null!=B.title?B.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(I,B.w,B.h,L,!0,null,+!0))}}catch(J){L=null!=J.message?mxResources.get("error")+": "+J.message:String(J),C=this.sidebar.createVertexTemplateFromCells(null,B.w,B.h,L,!0,null,!0),f.appendChild(C)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground="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);"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=-function(c,f,k,B,z,C,H){c=new ImageDialog(this,c,f,k,B,z,C,H);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,B,z,C){var H=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=H?JSON.stringify(JSON.parse(H),null,2):"",mxUtils.bind(this,function(K){if(null!=K)try{if(null!=C&&C(K),K==H)this.hideDialog();else{if(0<K.length){var M=JSON.parse(K);localStorage.setItem(f,JSON.stringify(M))}else localStorage.removeItem(f);-this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(O){this.handleError(O)}}),null,mxResources.get("close"),null,null,null,!0,null,null,z,k,B);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,B){c=null!=c?c:mxUtils.bind(this,function(z,C,H,K){C||(z=new ChangePageSetup(this,B?H:null,z),z.ignoreColor=!B,null!=K&&B&&(z.shadowVisible=K),this.editor.graph.model.execute(z))});c=new BackgroundImageDialog(this,c,+function(c,f,k,B,z,C,I){c=new ImageDialog(this,c,f,k,B,z,C,I);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,B,z,C){var I=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=I?JSON.stringify(JSON.parse(I),null,2):"",mxUtils.bind(this,function(L){if(null!=L)try{if(null!=C&&C(L),L==I)this.hideDialog();else{if(0<L.length){var J=JSON.parse(L);localStorage.setItem(f,JSON.stringify(J))}else localStorage.removeItem(f);+this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(O){this.handleError(O)}}),null,mxResources.get("close"),null,null,null,!0,null,null,z,k,B);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,B){c=null!=c?c:mxUtils.bind(this,function(z,C,I,L){C||(z=new ChangePageSetup(this,B?I:null,z),z.ignoreColor=!B,null!=L&&B&&(z.shadowVisible=L),this.editor.graph.model.execute(z))});c=new BackgroundImageDialog(this,c,f,k,B);this.showDialog(c.container,400,B?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,k,B,z){c=new LibraryDialog(this,c,f,k,B,z);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(C){C&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var g=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=g.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&-f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,B,z,C,H){var K=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},M=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{H||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!H||null==window.console||console.error("EditorUi.handleError:",c)}catch(S){}if(null!=-M||null!=f){H=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var O=mxResources.get("ok"),ea=null;f=null!=f?f:mxResources.get("error");if(null!=M){null!=M.retry&&(O=mxResources.get("cancel"),ea=function(){K();M.retry()});if(404==M.code||404==M.status||403==M.code){H=403==M.code?null!=M.message?mxUtils.htmlEntities(M.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=z?z:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?-" ("+this.drive.user.email+")":""),!1);var fa=null!=z?null:null!=C?C:window.location.hash;if(null!=fa&&("#G"==fa.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==fa.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==M.code||404==M.status)){fa="#U"==fa.substring(0,2)?fa.substring(45,fa.lastIndexOf("%26ex")):fa.substring(2);-this.showError(f,H,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+fa);null!=B&&B()}),ea,mxResources.get("changeUser"),mxUtils.bind(this,function(){function S(){Z.innerText="";for(var da=0;da<ca.length;da++){var aa=document.createElement("option");mxUtils.write(aa,ca[da].displayName);aa.value=da;Z.appendChild(aa);aa=document.createElement("option");aa.innerHTML=" ";mxUtils.write(aa,"<"+ca[da].email+-">");aa.setAttribute("disabled","disabled");Z.appendChild(aa)}aa=document.createElement("option");mxUtils.write(aa,mxResources.get("addAccount"));aa.value=ca.length;Z.appendChild(aa)}var ca=this.drive.getUsersList(),ma=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");ma.appendChild(la);var Z=document.createElement("select");Z.style.width="100%";S();mxEvent.addListener(Z,"change",mxUtils.bind(this,function(){var da=-Z.value,aa=ca.length!=da;aa&&this.drive.setUser(ca[da]);this.drive.authorize(aa,mxUtils.bind(this,function(){aa||(ca=this.drive.getUsersList(),S())}),mxUtils.bind(this,function(l){this.handleError(l)}),!0)}));ma.appendChild(Z);ma=new CustomDialog(this,ma,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ma.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=M.message?-H=""==M.message&&null!=M.name?mxUtils.htmlEntities(M.name,!1):mxUtils.htmlEntities(M.message,!1):null!=M.response&&null!=M.response.error?H=mxUtils.htmlEntities(M.response.error,!1):"undefined"!==typeof window.App&&(M.code==App.ERROR_TIMEOUT?H=mxUtils.htmlEntities(mxResources.get("timeout"),!1):M.code==App.ERROR_BUSY?H=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof M&&0<M.length&&(H=mxUtils.htmlEntities(M,!1)))}z=c=null;null!=M&&null!=M.helpLink?(c=mxResources.get("help"),z=mxUtils.bind(this,-function(){return this.editor.graph.openLink(M.helpLink)})):null!=M&&null!=M.ownerEmail?(c=mxResources.get("contactOwner"),H+=mxUtils.htmlEntities(" ("+c+": "+M.ownerEmail+")",!1),z=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(M.ownerEmail))})):null!=M&&null!=M.alternateAction&&(c=M.alternateAction.label,z=M.alternateAction.funct);this.showError(f,H,O,k,ea,null,null,c,z,null,null,null,B?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,-null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,B,z,C){c=null!=c?c:"";var H=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},K=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){H();null!=f&&f()},function(){H();null!=k&&k()},B,z,null,null,null,null,K);this.showDialog(c.container,340,46+K,!0,C);c.init()};EditorUi.prototype.showBanner=function(c,f,k,-B,z,C,H,K,M){var O=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){C=null!=C?C:"bottom:10px;left:50%;";H=null!=H?H:"translate(-50%,120%)";K=null!=K?K:"translate(-50%,0%)";var ea=z?500:1E3;O=z?"padding:4px;border-radius:6px;font-size:11px;height:12px;font-weight:normal;":"font-size:16px;padding:18px 34px 12px 20px;font-weight:bold;";var fa=document.createElement("div");fa.style.cssText="position:absolute;"+C+";max-width:90%;white-space:nowrap;cursor:pointer;z-index:"+-mxPopupMenu.prototype.zIndex+";"+O;mxUtils.setPrefixedStyle(fa.style,"transform",H);mxUtils.setPrefixedStyle(fa.style,"transition","all "+ea+"ms ease");fa.className="geBtn gePrimaryBtn"+(z?" geSmallBanner":"");Editor.isDarkMode()||mxUtils.setPrefixedStyle(fa.style,"box-shadow","1px 1px 2px 0px #ddd");null!=M&&mxUtils.setPrefixedStyle(fa.style,"transform-origin",M);if(!z){var S=document.createElement("img");S.setAttribute("src",IMAGE_PATH+"/logo.png");S.setAttribute("border","0");S.setAttribute("align",-"absmiddle");S.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";fa.appendChild(S);S=document.createElement("img");S.setAttribute("src",Dialog.prototype.closeImage);S.setAttribute("title",mxResources.get(B?"doNotShowAgain":"close"));S.setAttribute("border","0");S.style.cssText=(z?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";fa.appendChild(S)}mxUtils.write(fa,f);document.body.appendChild(fa);-this.bannerShowing=!0;f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var ca=document.createElement("input");ca.setAttribute("type","checkbox");ca.setAttribute("id","geDoNotShowAgainCheckbox");ca.style.marginRight="6px";if(!B){f.appendChild(ca);var ma=document.createElement("label");ma.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(ma,mxResources.get("doNotShowAgain"));-f.appendChild(ma);fa.style.paddingBottom=z?"16px":"30px";fa.appendChild(f)}var la=mxUtils.bind(this,function(){null!=fa.parentNode&&(fa.parentNode.removeChild(fa),this.bannerShowing=!1,ca.checked||B)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=S&&mxEvent.addListener(S,"click",mxUtils.bind(this,function(da){mxEvent.consume(da);la()}));var Z=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(fa.style,-"transform",H);window.setTimeout(mxUtils.bind(this,function(){la()}),ea)});mxEvent.addListener(fa,"click",mxUtils.bind(this,function(da){var aa=mxEvent.getSource(da);aa!=ca&&aa!=ma?(null!=k&&k(),la(),mxEvent.consume(da)):Z()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(fa.style,"transform",K)}),ea/2);window.setTimeout(Z,z?4E3:3E4);O=!0}return O};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=+f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,B,z,C,I){var L=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},J=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{I||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!I||null==window.console||console.error("EditorUi.handleError:",c)}catch(V){}if(null!=+J||null!=f){I=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var O=mxResources.get("ok"),da=null;f=null!=f?f:mxResources.get("error");if(null!=J){null!=J.retry&&(O=mxResources.get("cancel"),da=function(){L();J.retry()});if(404==J.code||404==J.status||403==J.code){I=403==J.code?null!=J.message?mxUtils.htmlEntities(J.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=z?z:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?+" ("+this.drive.user.email+")":""),!1);var fa=null!=z?null:null!=C?C:window.location.hash;if(null!=fa&&("#G"==fa.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==fa.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==J.code||404==J.status)){fa="#U"==fa.substring(0,2)?fa.substring(45,fa.lastIndexOf("%26ex")):fa.substring(2);+this.showError(f,I,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+fa);null!=B&&B()}),da,mxResources.get("changeUser"),mxUtils.bind(this,function(){function V(){Z.innerText="";for(var ea=0;ea<ba.length;ea++){var aa=document.createElement("option");mxUtils.write(aa,ba[ea].displayName);aa.value=ea;Z.appendChild(aa);aa=document.createElement("option");aa.innerHTML=" ";mxUtils.write(aa,"<"+ba[ea].email++">");aa.setAttribute("disabled","disabled");Z.appendChild(aa)}aa=document.createElement("option");mxUtils.write(aa,mxResources.get("addAccount"));aa.value=ba.length;Z.appendChild(aa)}var ba=this.drive.getUsersList(),ma=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");ma.appendChild(la);var Z=document.createElement("select");Z.style.width="100%";V();mxEvent.addListener(Z,"change",mxUtils.bind(this,function(){var ea=+Z.value,aa=ba.length!=ea;aa&&this.drive.setUser(ba[ea]);this.drive.authorize(aa,mxUtils.bind(this,function(){aa||(ba=this.drive.getUsersList(),V())}),mxUtils.bind(this,function(l){this.handleError(l)}),!0)}));ma.appendChild(Z);ma=new CustomDialog(this,ma,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ma.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=J.message?+I=""==J.message&&null!=J.name?mxUtils.htmlEntities(J.name,!1):mxUtils.htmlEntities(J.message,!1):null!=J.response&&null!=J.response.error?I=mxUtils.htmlEntities(J.response.error,!1):"undefined"!==typeof window.App&&(J.code==App.ERROR_TIMEOUT?I=mxUtils.htmlEntities(mxResources.get("timeout"),!1):J.code==App.ERROR_BUSY?I=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof J&&0<J.length&&(I=mxUtils.htmlEntities(J,!1)))}z=c=null;null!=J&&null!=J.helpLink?(c=mxResources.get("help"),z=mxUtils.bind(this,+function(){return this.editor.graph.openLink(J.helpLink)})):null!=J&&null!=J.ownerEmail?(c=mxResources.get("contactOwner"),I+=mxUtils.htmlEntities(" ("+c+": "+J.ownerEmail+")",!1),z=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(J.ownerEmail))})):null!=J&&null!=J.alternateAction&&(c=J.alternateAction.label,z=J.alternateAction.funct);this.showError(f,I,O,k,da,null,null,c,z,null,null,null,B?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,+null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,B,z,C){c=null!=c?c:"";var I=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){I();null!=f&&f()},function(){I();null!=k&&k()},B,z,null,null,null,null,L);this.showDialog(c.container,340,46+L,!0,C);c.init()};EditorUi.prototype.showBanner=function(c,f,k,+B,z,C,I,L,J){var O=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){C=null!=C?C:"bottom:10px;left:50%;";I=null!=I?I:"translate(-50%,120%)";L=null!=L?L:"translate(-50%,0%)";var da=z?500:1E3;O=z?"padding:4px;border-radius:6px;font-size:11px;height:12px;font-weight:normal;":"font-size:16px;padding:18px 34px 12px 20px;font-weight:bold;";var fa=document.createElement("div");fa.style.cssText="position:absolute;"+C+";max-width:90%;white-space:nowrap;cursor:pointer;z-index:"++mxPopupMenu.prototype.zIndex+";"+O;mxUtils.setPrefixedStyle(fa.style,"transform",I);mxUtils.setPrefixedStyle(fa.style,"transition","all "+da+"ms ease");fa.className="geBtn gePrimaryBtn"+(z?" geSmallBanner":"");Editor.isDarkMode()||mxUtils.setPrefixedStyle(fa.style,"box-shadow","1px 1px 2px 0px #ddd");null!=J&&mxUtils.setPrefixedStyle(fa.style,"transform-origin",J);if(!z){var V=document.createElement("img");V.setAttribute("src",IMAGE_PATH+"/logo.png");V.setAttribute("border","0");V.setAttribute("align",+"absmiddle");V.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";fa.appendChild(V);V=document.createElement("img");V.setAttribute("src",Dialog.prototype.closeImage);V.setAttribute("title",mxResources.get(B?"doNotShowAgain":"close"));V.setAttribute("border","0");V.style.cssText=(z?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";fa.appendChild(V)}mxUtils.write(fa,f);document.body.appendChild(fa);+this.bannerShowing=!0;f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var ba=document.createElement("input");ba.setAttribute("type","checkbox");ba.setAttribute("id","geDoNotShowAgainCheckbox");ba.style.marginRight="6px";if(!B){f.appendChild(ba);var ma=document.createElement("label");ma.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(ma,mxResources.get("doNotShowAgain"));+f.appendChild(ma);fa.style.paddingBottom=z?"16px":"30px";fa.appendChild(f)}var la=mxUtils.bind(this,function(){null!=fa.parentNode&&(fa.parentNode.removeChild(fa),this.bannerShowing=!1,ba.checked||B)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=V&&mxEvent.addListener(V,"click",mxUtils.bind(this,function(ea){mxEvent.consume(ea);la()}));var Z=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(fa.style,+"transform",I);window.setTimeout(mxUtils.bind(this,function(){la()}),da)});mxEvent.addListener(fa,"click",mxUtils.bind(this,function(ea){var aa=mxEvent.getSource(ea);aa!=ba&&aa!=ma?(null!=k&&k(),la(),mxEvent.consume(ea)):Z()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(fa.style,"transform",L)}),da/2);window.setTimeout(Z,z?4E3:3E4);O=!0}return O};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return this.editor.isExportToCanvas()};EditorUi.prototype.createImageDataUri=function(c,f,k,B){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<B&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",B));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,B,z){var C="jpeg"==k?"jpg":k;B=this.getBaseFilename(B)+(null!=f?".drawio":"")+"."+C;c=this.createImageDataUri(c,f,k,z);this.saveData(B,C,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,B,z,C){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=C?C:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=B?this.base64ToBlob(c,k):new Blob([c],{type:k}),navigator.msSaveOrOpenBlob(c,f);else if(mxClient.IS_IE)k=window.open("about:blank",-"_blank"),null==k?mxUtils.popup(c,!0):(k.document.write(c),k.document.close(),k.document.execCommand("SaveAs",!0,f),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,B);else{var H=document.createElement("a");C=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof H.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var K=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);-C=65==(K?parseInt(K[2],10):!1)?!1:C}if(C||this.isOffline()){H.href=URL.createObjectURL(B?this.base64ToBlob(c,k):new Blob([c],{type:k}));C?H.download=f:H.setAttribute("target","_blank");document.body.appendChild(H);try{window.setTimeout(function(){URL.revokeObjectURL(H.href)},2E4),H.click(),H.parentNode.removeChild(H)}catch(M){}}else this.createEchoRequest(c,f,k,B,z).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,B,z,C){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,-c+(null!=k?"&mime="+k:"")+(null!=z?"&format="+z:"")+(null!=C?"&base64="+C:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(B?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,B,z,C,H,K){C=null!=C?C:!1;H=null!=H?H:"vsdx"!=z&&(!mxClient.IS_IOS||!navigator.standalone);var M=mxUtils.bind(this,function(ea,fa,S,ca){try{if("_blank"==fa)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,B);else if(null!=k&&"text/html"==k.substring(0,9)){var ma=new EmbedDialog(this,c);this.showDialog(ma.container,-450,240,!0,!0);ma.init()}else{var la=window.open("about:blank");null==la?mxUtils.popup(c,!0):(la.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),la.document.close())}else if(fa==App.MODE_DEVICE||"download"==fa)this.doSaveLocalFile(c,ea,k,B,null,K);else if(null!=ea&&0<ea.length){var Z=mxUtils.bind(this,function(da){try{this.exportFile(c,ea,k,B,fa,da)}catch(aa){this.handleError(aa)}});null!=ca?Z(ca):this.pickFolder(fa,Z)}}catch(da){this.handleError(da)}});z=[];C||z.push(App.MODE_BROWSER);-H||z.push("_blank");var O=new SaveDialog(this,f,mxUtils.bind(this,function(ea,fa,S){M(ea.value,fa,ea,S);this.hideDialog(null,null,O.container)}),z,c,k,B);this.showDialog(O.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));O.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){var B=window.open("about:blank");if(null==B||null==B.document)mxUtils.popup(c,!0);else{var z="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==f){var C=mxUtils.parseXml(c).documentElement.style.backgroundColor;+"_blank"),null==k?mxUtils.popup(c,!0):(k.document.write(c),k.document.close(),k.document.execCommand("SaveAs",!0,f),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,B);else{var I=document.createElement("a");C=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof I.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);+C=65==(L?parseInt(L[2],10):!1)?!1:C}if(C||this.isOffline()){I.href=URL.createObjectURL(B?this.base64ToBlob(c,k):new Blob([c],{type:k}));C?I.download=f:I.setAttribute("target","_blank");document.body.appendChild(I);try{window.setTimeout(function(){URL.revokeObjectURL(I.href)},2E4),I.click(),I.parentNode.removeChild(I)}catch(J){}}else this.createEchoRequest(c,f,k,B,z).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,B,z,C){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,+c+(null!=k?"&mime="+k:"")+(null!=z?"&format="+z:"")+(null!=C?"&base64="+C:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(B?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,B,z,C,I,L){C=null!=C?C:!1;I=null!=I?I:"vsdx"!=z&&(!mxClient.IS_IOS||!navigator.standalone);var J=mxUtils.bind(this,function(da,fa,V,ba){try{if("_blank"==fa)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,B);else if(null!=k&&"text/html"==k.substring(0,9)){var ma=new EmbedDialog(this,c);this.showDialog(ma.container,+450,240,!0,!0);ma.init()}else{var la=window.open("about:blank");null==la?mxUtils.popup(c,!0):(la.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),la.document.close())}else if(fa==App.MODE_DEVICE||"download"==fa)this.doSaveLocalFile(c,da,k,B,null,L);else if(null!=da&&0<da.length){var Z=mxUtils.bind(this,function(ea){try{this.exportFile(c,da,k,B,fa,ea)}catch(aa){this.handleError(aa)}});null!=ba?Z(ba):this.pickFolder(fa,Z)}}catch(ea){this.handleError(ea)}});z=[];C||z.push(App.MODE_BROWSER);+I||z.push("_blank");var O=new SaveDialog(this,f,mxUtils.bind(this,function(da,fa,V){J(da.value,fa,da,V);this.hideDialog(null,null,O.container)}),z,c,k,B);this.showDialog(O.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));O.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){var B=window.open("about:blank");if(null==B||null==B.document)mxUtils.popup(c,!0);else{var z="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==f){var C=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=C&&(z="background: "+C+";")}z='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+z+'">';"image/svg+xml"!=f||mxClient.IS_SVG?"image/svg+xml"!=f||k?(C=k?c:btoa(unescape(encodeURIComponent(c))),B.document.write(z+'<img style="max-width:100%;" src="data:'+f+";base64,"+C+'"/></body></html>')):B.document.write(z+c+"</body></html>"):B.document.write(z+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");B.document.close()}};var m=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var f=c(mxUtils.bind(this,function(B){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.className="geScrollable",this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=@@ -3583,190 +3583,192 @@ this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialognull)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.isExportToCanvas()&&this.isChromelessImageExportEnabled()){this.exportDialog=null;var k=c(mxUtils.bind(this,function(B){var z=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",z);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)z.apply(this);else{this.exportDialog=document.createElement("div");var C=k.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width=-"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=C.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";C=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=C.zIndex;var H=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});H.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",z);this.editor.exportToCanvas(mxUtils.bind(this,function(K){H.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var M=this.createImageDataUri(K,null,"png");K=document.createElement("img");K.style.maxWidth="140px";K.style.maxHeight="140px";-K.style.cursor="pointer";K.style.backgroundColor="white";K.setAttribute("title",mxResources.get("openInNewWindow"));K.setAttribute("border","0");K.setAttribute("src",M);this.exportDialog.appendChild(K);mxEvent.addListener(K,"click",mxUtils.bind(this,function(){this.openInNewWindow(M.substring(M.indexOf(",")+1),"image/png",!0);z.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(K){H.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),-this.exportDialog=null);this.handleError(K)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(B)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,B,z){this.isLocalFileSave()?this.saveLocalFile(k,c,B,z,f):this.saveRequest(c,f,mxUtils.bind(this,function(C,H){return this.createEchoRequest(k,C,B,z,f,H)}),k,z,B)};EditorUi.prototype.saveRequest=function(c,f,k,B,z,C,H){H=null!=H?H:!mxClient.IS_IOS||!navigator.standalone;var K=mxUtils.bind(this,-function(O,ea,fa,S){if("_blank"==ea||null!=O&&0<O.length){var ca=k("_blank"==ea?null:O,ea==App.MODE_DEVICE||"download"==ea||null==ea||"_blank"==ea?"0":"1");null!=ca&&(ea==App.MODE_DEVICE||"download"==ea||"_blank"==ea?ca.simulate(document,"_blank"):(fa=mxUtils.bind(this,function(ma){C=null!=C?C:"pdf"==f?"application/pdf":"image/"+f;if(null!=B)try{this.exportFile(B,O,C,!0,ea,ma)}catch(la){this.handleError(la)}else this.spinner.spin(document.body,mxResources.get("saving"))&&ca.send(mxUtils.bind(this,-function(){this.spinner.stop();if(200<=ca.getStatus()&&299>=ca.getStatus())try{this.exportFile(ca.getText(),O,C,!0,ea,ma)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=S?fa(S):this.pickFolder(ea,fa)))}});z=[App.MODE_BROWSER];H||z.push("_blank");var M=new SaveDialog(this,c,mxUtils.bind(this,function(O,ea,fa){K(O.value,ea,O,fa);this.hideDialog(null,null,M.container)}),-z,null,"application/pdf");this.showDialog(M.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));M.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,k,B,z,C){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,k){f(null)};-EditorUi.prototype.exportSvg=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(J){Editor.addRetryToError(J,mxUtils.bind(this,function(){this.exportSvg(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca)}));this.handleError(J)})))try{var ma=this.editor.graph.isSelectionEmpty();k=null!=k?k:ma;var la=f?null:this.editor.graph.background;la==mxConstants.NONE&&(la=null);null==la&&0==f&&(la=this.editor.graph.shapeBackgroundColor);var Z=this.editor.graph.addForeignObjectWarning;-Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var da=this.editor.graph.createSvgImageExport(z),aa=this.editor.graph.getSvg(la,c,H,K,null,k,null,da,"blank"==O?"_blank":"self"==O?"_top":null,null,!S,ea,fa);this.editor.graph.addForeignObjectWarning=Z;B&&this.editor.graph.addSvgShadow(aa);var l=this.getBaseFilename()+(z?".drawio":"")+".svg";ca=null!=ca?ca:mxUtils.bind(this,function(J){this.isLocalFileSave()||J.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",J,"image/svg+xml"):-this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(J)}))});var t=mxUtils.bind(this,function(J){this.spinner.stop();z&&J.setAttribute("content",this.getFileData(!0,null,null,null,k,M,null,null,null,null,null,c,H));ca(Graph.xmlDeclaration+"\n"+(z?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(J))});this.editor.graph.mathEnabled&&this.editor.addMathCss(aa);var I=mxUtils.bind(this,function(J){Editor.replaceSvgDataUris&&-C&&EditorUi.embedSvgImages(J);Editor.foreignObjectImages&&S?this.replaceAlternateContent(J,ea,t):t(J)}),V=mxUtils.bind(this,function(J){C&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(J,I,this.thumbImageCache)):I(J)});S?this.embedFonts(aa,V):(this.editor.addFontCss(aa),V(aa))}catch(J){this.handleError(J)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function B(fa,S,ca,ma,la){var Z=mxUtils.createElementNs(c.ownerDocument,-mxConstants.NS_SVG,"image");Z.setAttribute("x",S);Z.setAttribute("y",ca+.5);Z.setAttribute("width",ma.width);Z.setAttribute("height",ma.height);null==Z.setAttributeNS?Z.setAttribute("xlink:href",la):Z.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);fa.replaceChild(Z,fa.lastChild);K()}function z(){if(H<ea.length)ea[H++](z)}var C="";f=c.getElementsByTagName("style");for(var H=0;H<f.length;H++)C+=f[H].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var K=mxUtils.bind(this,function(){counter--;-0==counter&&k(c)}),M={},O={},ea=[];for(H=0;H<f.length;H++)mxUtils.bind(this,function(fa){var S=fa.getElementsByTagName("div");if(0<S.length)try{var ca=S[0].cloneNode(!0),ma=parseInt(ca.style.marginLeft),la=parseInt(ca.style.paddingTop),Z=ca.getElementsByTagName("div")[1],da=S=!1,aa=ca.style.alignItems,l=ca.style.justifyContent;if(null!=ca.style.writingMode){var t=ca.style.writingMode;da="vertical-"==t.substring(0,9);S="-rl"==t.substring(t.length-3)}var I=!da&&"1px"==ca.style.width||da&&"1px"==ca.style.height;-if(!da&&"1px"==ca.style.height||da&&"1px"==ca.style.width)ca.style.alignItems=da&&S?"unsafe flex-end":"unsafe flex-start";I&&(ca.style.justifyContent="unsafe flex-start");ca.style.paddingTop="";ca.style.marginLeft="";var V=ca.outerHTML,J=M[V];null==J&&(ca.style.position="absolute",ca.style.visibility="hidden",document.body.appendChild(ca),t=1,t="1px"==ca.style.width?Z.offsetWidth:parseInt(ca.style.width),I=1,I="1px"==ca.style.height?Z.offsetHeight:parseInt(ca.style.height),document.body.removeChild(ca),-J=new mxRectangle(ma,la,t,I),M[V]=J);"1px"==ca.style.height&&("unsafe center"==aa?la-=J.height/2:"unsafe flex-end"==aa&&(la-=J.height));if("1px"==ca.style.width)if(!da&&"unsafe center"==l||da&&"unsafe center"==aa)ma-=J.width/2;else if(!da&&"unsafe flex-end"==l||da&&(!S&&"unsafe flex-end"==aa||S&&"unsafe flex-start"==aa))ma-=J.width;J=new mxRectangle(ma,la,J.width,J.height+parseInt(Z.style.fontSize)/4);ea.push(mxUtils.bind(this,function(W){var Y=O[V];null==Y?Graph.htmlToPng(V,J.width,J.height,mxUtils.bind(this,-function(ba){B(fa,ma,la,J,ba);O[V]=ba;W()}),C):(B(fa,ma,la,J,Y),W())}))}catch(W){K()}else K()})(f[H]);0==counter&&k(c);H=0;z()};EditorUi.prototype.addRadiobox=function(c,f,k,B,z,C,H){return this.addCheckbox(c,k,B,z,C,H,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,B,z,C,H,K){C=null!=C?C:!0;var M=document.createElement("input");M.style.marginRight="8px";M.style.marginTop="16px";M.setAttribute("type",H?"radio":"checkbox");H="geCheckbox-"+Editor.guid();M.id=H;null!=K&&M.setAttribute("name",K);-k&&(M.setAttribute("checked","checked"),M.defaultChecked=!0);B&&M.setAttribute("disabled","disabled");C&&(c.appendChild(M),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",H),c.appendChild(k),z||mxUtils.br(c));return M};EditorUi.prototype.addEditButton=function(c,f){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var B=this.getCurrentFile(),z="";null!=B&&B.getMode()!=App.MODE_DEVICE&&B.getMode()!=App.MODE_BROWSER&&(z=window.location.href);-var C=document.createElement("select");C.style.maxWidth="200px";C.style.width="auto";C.style.marginLeft="8px";C.style.marginRight="10px";C.className="geBtn";B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("makeCopy"));C.appendChild(B);var H=document.createElement("option");H.setAttribute("value","custom");mxUtils.write(H,mxResources.get("custom")+"...");C.appendChild(H);c.appendChild(C);mxEvent.addListener(C,"change",mxUtils.bind(this,function(){if("custom"==-C.value){var K=new FilenameDialog(this,z,mxResources.get("ok"),function(M){null!=M?(z=M,H.setAttribute("title",M)):(C.value="blank",H.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){C.value="blank"});this.showDialog(K.container,300,80,!0,!1);K.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==f||f.checked)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return k.checked?-"blank"===C.value?"_blank":z:null},getEditInput:function(){return k},getEditSelect:function(){return C}}};EditorUi.prototype.addLinkSection=function(c,f){function k(){var K=document.createElement("div");K.style.width="100%";K.style.height="100%";K.style.boxSizing="border-box";null!=C&&C!=mxConstants.NONE?(K.style.border="1px solid black",K.style.backgroundColor=C):(K.style.backgroundPosition="center center",K.style.backgroundRepeat="no-repeat",K.style.backgroundImage="url('"+Dialog.prototype.closeImage+-"')");H.innerText="";H.appendChild(K)}mxUtils.write(c,mxResources.get("links")+":");var B=document.createElement("select");B.style.width="100px";B.style.padding="0px";B.style.marginLeft="8px";B.style.marginRight="10px";B.className="geBtn";var z=document.createElement("option");z.setAttribute("value","auto");mxUtils.write(z,mxResources.get("automatic"));B.appendChild(z);z=document.createElement("option");z.setAttribute("value","blank");mxUtils.write(z,mxResources.get("openInNewWindow"));B.appendChild(z);-z=document.createElement("option");z.setAttribute("value","self");mxUtils.write(z,mxResources.get("openInThisWindow"));B.appendChild(z);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),B.appendChild(f));c.appendChild(B);mxUtils.write(c,mxResources.get("borderColor")+":");var C="#0000ff",H=null;H=mxUtils.button("",mxUtils.bind(this,function(K){this.pickColor(C||"none",function(M){C=M;k()});-mxEvent.consume(K)}));k();H.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";H.style.marginLeft="4px";H.style.height="22px";H.style.width="22px";H.style.position="relative";H.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";H.className="geColorBtn";c.appendChild(H);mxUtils.br(c);return{getColor:function(){return C},getTarget:function(){return B.value},focus:function(){B.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,B,z,C){C=null!=C?C:[];k&&(C.push("lightbox=1"),-"auto"!=c&&C.push("target="+c),null!=f&&f!=mxConstants.NONE&&C.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=B&&0<B.length&&C.push("edit="+encodeURIComponent(B)),z&&C.push("layers=1"),this.editor.graph.foldingEnabled&&C.push("nav=1"));return C};EditorUi.prototype.createLink=function(c,f,k,B,z,C,H,K,M,O,ea){var fa=this.getCurrentFile();M=this.createUrlParameters(c,f,B,z,C,M);c=!0;null!=H?k="#U"+encodeURIComponent(H):K||null==fa||""==fa.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,-null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+fa.getHash(),c=!1);c&&null!=fa&&null!=fa.getTitle()&&fa.getTitle()!=this.defaultFilename&&M.push("title="+encodeURIComponent(fa.getTitle()));O&&1<k.length&&(M.push("open="+k.substring(1)),k="");ea&&null!=this.currentPage&&M.push("page-id="+this.currentPage.getId());return(B&&(null!=H||null!=fa&&fa.getMode()!=App.MODE_GITHUB&&fa.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||-EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<M.length?"?"+M.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,B,z,C,H,K,M,O,ea,fa){this.getBasenames();var S={};""!=z&&z!=mxConstants.NONE&&(S.highlight=z);"auto"!==B&&(S.target=B);O||(S.lightbox=!1);S.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(S.zoom=k/100);k=[];H&&(k.push("pages"),S.resize=!0,null!=this.pages&&null!=this.currentPage&&-(S.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),S.resize=!0);K&&k.push("layers");M&&k.push("tags");0<k.length&&(O&&k.push("lightbox"),S.toolbar=k.join(" "));null!=ea&&0<ea.length&&(S.edit=ea);null!=c?S.url=c:S.xml=this.getFileData(!0,null,null,null,null,!H);f='<div class="mxgraph" style="'+(C?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(S))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";fa(f,-'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,f,k,B){var z=document.createElement("div");z.style.whiteSpace="nowrap";var C=document.createElement("h3");mxUtils.write(C,-mxResources.get("html"));C.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";z.appendChild(C);var H=document.createElement("div");H.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var K=document.createElement("input");K.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";K.setAttribute("value","url");K.setAttribute("type","radio");K.setAttribute("name","type-embedhtmldialog");C=K.cloneNode(!0);C.setAttribute("value",-"copy");H.appendChild(C);var M=document.createElement("span");mxUtils.write(M,mxResources.get("includeCopyOfMyDiagram"));H.appendChild(M);mxUtils.br(H);H.appendChild(K);M=document.createElement("span");mxUtils.write(M,mxResources.get("publicDiagramUrl"));H.appendChild(M);var O=this.getCurrentFile();null==k&&null!=O&&O.constructor==window.DriveFile&&(M=document.createElement("a"),M.style.paddingLeft="12px",M.style.color="gray",M.style.cursor="pointer",mxUtils.write(M,mxResources.get("share")),H.appendChild(M),-mxEvent.addListener(M,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(O.getId(),O)})));C.setAttribute("checked","checked");null==k&&K.setAttribute("disabled","disabled");z.appendChild(H);var ea=this.addLinkSection(z),fa=this.addCheckbox(z,mxResources.get("zoom"),!0,null,!0);mxUtils.write(z,":");var S=document.createElement("input");S.setAttribute("type","text");S.style.marginRight="16px";S.style.width="60px";S.style.marginLeft="4px";S.style.marginRight="12px";S.value=-"100%";z.appendChild(S);var ca=this.addCheckbox(z,mxResources.get("fit"),!0);H=null!=this.pages&&1<this.pages.length;var ma=ma=this.addCheckbox(z,mxResources.get("allPages"),H,!H),la=this.addCheckbox(z,mxResources.get("layers"),!0),Z=this.addCheckbox(z,mxResources.get("tags"),!0),da=this.addCheckbox(z,mxResources.get("lightbox"),!0),aa=null;H=380;if(EditorUi.enableHtmlEditOption){aa=this.addEditButton(z,da);var l=aa.getEditInput();l.style.marginBottom="16px";H+=50;mxEvent.addListener(da,"change",-function(){da.checked?l.removeAttribute("disabled"):l.setAttribute("disabled","disabled");l.checked&&da.checked?aa.getEditSelect().removeAttribute("disabled"):aa.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,z,mxUtils.bind(this,function(){B(K.checked?k:null,fa.checked,S.value,ea.getTarget(),ea.getColor(),ca.checked,ma.checked,la.checked,Z.checked,da.checked,null!=aa?aa.getLink():null)}),null,c,f);this.showDialog(c.container,340,H,!0,!0);C.focus()};EditorUi.prototype.showPublishLinkDialog=-function(c,f,k,B,z,C,H,K,M){var O=document.createElement("div");O.style.whiteSpace="nowrap";var ea=document.createElement("h3");mxUtils.write(ea,c||mxResources.get("publish"));ea.style.width="100%";ea.style.textAlign="center";ea.style.marginTop="2px";ea.style.marginBottom="20px";O.appendChild(ea);var fa=document.createElement("select");c=30;fa.className="geBtn";fa.style.marginBottom="8px";fa.style.marginLeft="0px";fa.style.width="100%";fa.style.boxSizing="border-box";if(null==K||""==K.getHash())z=-null!=z?z:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ea=document.createElement("option"),mxUtils.write(ea,mxResources.get("makeCopy")),ea.setAttribute("value","copy"),fa.appendChild(ea);ea=document.createElement("option");mxUtils.write(ea,mxResources.get("authorizationRequired"));ea.setAttribute("value","auth");fa.appendChild(ea);null!=K&&""!=K.getHash()||ea.setAttribute("disabled","disabled");K=document.createElement("option");K.setAttribute("value","public");fa.appendChild(K);null!=-H?(mxUtils.write(K,mxResources.get("publicDiagramUrl")),K.setAttribute("title",H),fa.value="public"):(mxUtils.write(K,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),K.setAttribute("disabled","disabled"));O.appendChild(fa);mxUtils.br(O);fa.focus();var S=null,ca=null;if(null!=f||null!=k)c+=30,mxUtils.write(O,mxResources.get("width")+":"),S=document.createElement("input"),S.setAttribute("type","text"),S.style.marginRight="16px",S.style.width="50px",S.style.marginLeft=-"6px",S.style.marginRight="16px",S.style.marginBottom="10px",S.value="100%",O.appendChild(S),mxUtils.write(O,mxResources.get("height")+":"),ca=document.createElement("input"),ca.setAttribute("type","text"),ca.style.width="50px",ca.style.marginLeft="6px",ca.style.marginBottom="10px",ca.value=k+"px",O.appendChild(ca),mxUtils.br(O);var ma=this.addLinkSection(O,B),la=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,f=null!=this.currentPage?this.currentPage.getName():-"",16<f.length&&(f=f.substring(0,16)+"..."),la=this.addCheckbox(O,mxResources.get("selectedPage")+": "+f));var Z=this.addCheckbox(O,mxResources.get("lightbox"),!0,null,null,!B),da=this.addEditButton(O,Z),aa=da.getEditInput();B&&(aa.style.marginLeft=Z.style.marginLeft,Z.style.display="none",c-=20);var l=this.addCheckbox(O,mxResources.get("layers"),!0);l.style.marginLeft=aa.style.marginLeft;l.style.marginTop="8px";var t=this.addCheckbox(O,mxResources.get("tags"),!0);t.style.marginLeft=aa.style.marginLeft;-t.style.marginBottom="16px";t.style.marginTop="16px";mxEvent.addListener(Z,"change",function(){Z.checked?(l.removeAttribute("disabled"),aa.removeAttribute("disabled"),t.removeAttribute("disabled")):(l.setAttribute("disabled","disabled"),aa.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));aa.checked&&Z.checked?da.getEditSelect().removeAttribute("disabled"):da.getEditSelect().setAttribute("disabled","disabled")});B=new CustomDialog(this,O,mxUtils.bind(this,function(){M(ma.getTarget(),-ma.getColor(),null==la?!1:la.checked,Z.checked,da.getLink(),l.checked,null!=S?S.value:null,null!=ca?ca.value:null,t.checked,fa.value)}),null,mxResources.get("create"),z,C);this.showDialog(B.container,340,296+c,!0,!0);null!=S?(S.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?S.select():document.execCommand("selectAll",!1,null)):null==fa.parentNode;ma.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,B,z){var C=document.createElement("div");C.style.whiteSpace="nowrap";-var H=document.createElement("h3");mxUtils.write(H,mxResources.get("image"));H.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(z?"10":"4")+"px";C.appendChild(H);if(z){mxUtils.write(C,mxResources.get("zoom")+":");var K=document.createElement("input");K.setAttribute("type","text");K.style.marginRight="16px";K.style.width="60px";K.style.marginLeft="4px";K.style.marginRight="12px";K.value=this.lastExportZoom||"100%";C.appendChild(K);mxUtils.write(C,mxResources.get("borderWidth")+-":");var M=document.createElement("input");M.setAttribute("type","text");M.style.marginRight="16px";M.style.width="60px";M.style.marginLeft="4px";M.value=this.lastExportBorder||"0";C.appendChild(M);mxUtils.br(C)}var O=this.addCheckbox(C,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),ea=B?null:this.addCheckbox(C,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);H=this.editor.graph;var fa=B?null:this.addCheckbox(C,mxResources.get("transparentBackground"),-H.background==mxConstants.NONE||null==H.background);null!=fa&&(fa.style.marginBottom="16px");c=new CustomDialog(this,C,mxUtils.bind(this,function(){var S=parseInt(K.value)/100||1,ca=parseInt(M.value)||0;k(!O.checked,null!=ea?ea.checked:!1,null!=fa?fa.checked:!1,S,ca)}),null,c,f);this.showDialog(c.container,300,(z?25:0)+(B?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,k,B,z,C,H,K,M){H=null!=H?H:Editor.defaultIncludeDiagram;var O=document.createElement("div");O.style.whiteSpace=-"nowrap";var ea=this.editor.graph,fa="jpeg"==K||"webp"==K?220:320,S=document.createElement("h3");mxUtils.write(S,c);S.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";O.appendChild(S);mxUtils.write(O,mxResources.get("zoom")+":");var ca=document.createElement("input");ca.setAttribute("type","text");ca.style.marginRight="16px";ca.style.width="60px";ca.style.marginLeft="4px";ca.style.marginRight="12px";ca.value=this.lastExportZoom||"100%";O.appendChild(ca);mxUtils.write(O,-mxResources.get("borderWidth")+":");var ma=document.createElement("input");ma.setAttribute("type","text");ma.style.marginRight="16px";ma.style.width="60px";ma.style.marginLeft="4px";ma.value=this.lastExportBorder||"0";O.appendChild(ma);mxUtils.br(O);var la=this.addCheckbox(O,mxResources.get("selectionOnly"),!1,ea.isSelectionEmpty()),Z=document.createElement("input");Z.style.marginTop="16px";Z.style.marginRight="8px";Z.style.marginLeft="24px";Z.setAttribute("disabled","disabled");Z.setAttribute("type",-"checkbox");var da=document.createElement("select");da.style.marginTop="16px";da.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(S=0;S<c.length;S++)if(!ea.isSelectionEmpty()||"selectionOnly"!=c[S]){var aa=document.createElement("option");mxUtils.write(aa,mxResources.get(c[S]));aa.setAttribute("value",c[S]);da.appendChild(aa)}M?(mxUtils.write(O,mxResources.get("size")+":"),O.appendChild(da),mxUtils.br(O),fa+=26,mxEvent.addListener(da,"change",function(){"selectionOnly"==da.value&&(la.checked=-!0)})):C&&(O.appendChild(Z),mxUtils.write(O,mxResources.get("crop")),mxUtils.br(O),fa+=30,mxEvent.addListener(la,"change",function(){la.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")}));ea.isSelectionEmpty()?M&&(la.style.display="none",la.nextSibling.style.display="none",la.nextSibling.nextSibling.style.display="none",fa-=30):(da.value="diagram",Z.setAttribute("checked","checked"),Z.defaultChecked=!0,mxEvent.addListener(la,"change",function(){da.value=la.checked?"selectionOnly":-"diagram"}));var l=this.addCheckbox(O,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=K&&"webp"!=K),t=document.createElement("select");t.style.maxWidth="260px";t.style.marginLeft="8px";t.style.marginTop="16px";C=document.createElement("option");C.setAttribute("value","light");mxUtils.write(C,mxResources.get("light"));t.appendChild(C);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));t.appendChild(M);"svg"==K?(C=document.createElement("option"),-C.setAttribute("value","auto"),mxUtils.write(C,mxResources.get("automatic")),C.setAttribute("selected","selected"),t.appendChild(C)):Editor.isDarkMode()?M.setAttribute("selected","selected"):C.setAttribute("selected","selected");mxUtils.write(O,mxResources.get("appearance")+":");O.appendChild(t);mxUtils.br(O);fa+=26;var I=this.addCheckbox(O,mxResources.get("shadow"),ea.shadowVisible),V=null;if("png"==K||"jpeg"==K||"webp"==K)V=this.addCheckbox(O,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,-!1,!0),fa+=30;var J=this.addCheckbox(O,mxResources.get("includeCopyOfMyDiagram")+":",H,null,null,"jpeg"!=K&&"webp"!=K),W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="28px";"png"==K||"svg"==K?(H=function(){J.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},ea=document.createElement("option"),ea.setAttribute("value","allPages"),mxUtils.write(ea,mxResources.get("allPages")),W.appendChild(ea),ea=document.createElement("option"),ea.setAttribute("value",-"currentPage"),mxUtils.write(ea,mxResources.get("currentPage")),W.appendChild(ea),J.style.marginBottom="12px",W.style.marginBottom="16px",O.appendChild(W),mxUtils.br(O),fa+=20,null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(J,"change",H),H()):J.style.marginBottom="16px";var Y=document.createElement("input");Y.style.marginBottom="16px";Y.style.marginRight="8px";Y.setAttribute("type","checkbox");var ba=document.createElement("input");ba.style.marginBottom="16px";ba.style.marginRight=-"8px";ba.setAttribute("type","checkbox");f&&(Y.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,O.appendChild(Y),mxUtils.write(O,mxResources.get("embedImages")),mxUtils.br(O),ba.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,O.appendChild(ba),mxUtils.write(O,mxResources.get("embedFonts")),mxUtils.br(O),fa+=50);var ja=document.createElement("select");ja.style.maxWidth="260px";ja.style.marginLeft="8px";C=document.createElement("option");C.setAttribute("value","auto");mxUtils.write(C,-mxResources.get("automatic"));ja.appendChild(C);H=document.createElement("option");H.setAttribute("value","blank");mxUtils.write(H,mxResources.get("openInNewWindow"));ja.appendChild(H);H=document.createElement("option");H.setAttribute("value","self");mxUtils.write(H,mxResources.get("openInThisWindow"));ja.appendChild(H);H=document.createElement("div");mxUtils.write(H,mxResources.get("LinksLost"));H.style.margin="7px";H.style.display="none";"svg"==K&&(mxUtils.write(O,mxResources.get("links")+":"),-O.appendChild(ja),O.appendChild(H),mxUtils.br(O),mxUtils.br(O),fa+=50);k=new CustomDialog(this,O,mxUtils.bind(this,function(){this.lastExportBorder=ma.value;this.lastExportZoom=ca.value;this.lastEmbedImages=Y.checked;this.lastEmbedFonts=ba.checked;this.lastEmbedInclude=W.value;z(ca.value,l.checked,!la.checked,I.checked,J.checked,Y.checked&&f,ma.value,Z.checked,("png"==K||"svg"==K)&&"currentPage"==W.value,ja.value,null!=V?V.checked:null,null!=t?t.value:null,da.value,ba.checked)}),null,k,B);this.showDialog(k.container,-340,fa,!0,!0,null,null,null,null,!0);ca.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ca.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,k,B,z){var C=document.createElement("div");C.style.whiteSpace="nowrap";var H=this.editor.graph;if(null!=f){var K=document.createElement("h3");mxUtils.write(K,f);K.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";C.appendChild(K)}var M=this.addCheckbox(C,mxResources.get("fit"),-!0),O=this.addCheckbox(C,mxResources.get("shadow"),H.shadowVisible&&B,!B),ea=this.addCheckbox(C,k),fa=this.addCheckbox(C,mxResources.get("lightbox"),!0),S=this.addEditButton(C,fa),ca=S.getEditInput(),ma=1<H.model.getChildCount(H.model.getRoot()),la=this.addCheckbox(C,mxResources.get("layers"),ma,!ma);la.style.marginLeft=ca.style.marginLeft;la.style.marginBottom="12px";la.style.marginTop="8px";mxEvent.addListener(fa,"change",function(){fa.checked?(ma&&la.removeAttribute("disabled"),ca.removeAttribute("disabled")):-(la.setAttribute("disabled","disabled"),ca.setAttribute("disabled","disabled"));ca.checked&&fa.checked?S.getEditSelect().removeAttribute("disabled"):S.getEditSelect().setAttribute("disabled","disabled")});f=new CustomDialog(this,C,mxUtils.bind(this,function(){c(M.checked,O.checked,ea.checked,fa.checked,S.getLink(),la.checked)}),null,mxResources.get("embed"),z);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,B,z,C,H,K){function M(ca){var ma=" ",la="";-B&&(ma=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(null!=ea?"&page="+ea:"")+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}})(this);\"",la+="cursor:pointer;");c&&(la+="max-width:100%;");var Z=-"";k&&(Z=' width="'+Math.round(O.width)+'" height="'+Math.round(O.height)+'"');H('<img src="'+ca+'"'+Z+(""!=la?' style="'+la+'"':"")+ma+"/>")}var O=this.editor.graph.getGraphBounds(),ea=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ca){var ma=B?this.getFileData(!0):null;ca=this.createImageDataUri(ca,ma,"png");M(ca)}),null,null,null,mxUtils.bind(this,function(ca){K({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,-null,Editor.defaultBorder);else if(f=this.getFileData(!0),O.width*O.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var fa="";k&&(fa="&w="+Math.round(2*O.width)+"&h="+Math.round(2*O.height));var S=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(B?"1":"0")+fa+"&xml="+encodeURIComponent(f));S.send(mxUtils.bind(this,function(){200<=S.getStatus()&&299>=S.getStatus()?M("data:image/png;base64,"+S.getText()):K({message:mxResources.get("unknownError")})}))}else K({message:mxResources.get("drawingTooLarge")})};-EditorUi.prototype.createEmbedSvg=function(c,f,k,B,z,C,H){var K=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),M=K.getElementsByTagName("a");if(null!=M)for(var O=0;O<M.length;O++){var ea=M[O].getAttribute("href");null!=ea&&"#"==ea.charAt(0)&&"_blank"==M[O].getAttribute("target")&&M[O].removeAttribute("target")}B&&K.setAttribute("content",this.getFileData(!0));f&&this.editor.graph.addSvgShadow(K);if(k){var fa=" ",S="";B&&(fa="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}})(this);\"",S+="cursor:pointer;");c&&(S+="max-width:100%;");this.editor.convertImages(K,mxUtils.bind(this,function(ca){H('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ca))+'"'+(""!=S?' style="'+S+'"':"")+fa+"/>")}))}else S="",B&&(f=this.getSelectedPageIndex(),K.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=f?"&page="+f:"")+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}}})(this);"),S+="cursor:pointer;"),c&&(c=parseInt(K.getAttribute("width")),z=parseInt(K.getAttribute("height")),K.setAttribute("viewBox","-0.5 -0.5 "+c+" "+z),S+="max-width:100%;max-height:"+z+"px;",K.removeAttribute("height")),""!=S&&K.setAttribute("style",S),this.editor.addFontCss(K),this.editor.graph.mathEnabled&&this.editor.addMathCss(K),H(mxUtils.getXml(K))};EditorUi.prototype.timeSince=function(c){c=+"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=C.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";C=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=C.zIndex;var I=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",+speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});I.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",z);this.editor.exportToCanvas(mxUtils.bind(this,function(L){I.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var J=this.createImageDataUri(L,null,"png");L=document.createElement("img");L.style.maxWidth="140px";L.style.maxHeight="140px";+L.style.cursor="pointer";L.style.backgroundColor="white";L.setAttribute("title",mxResources.get("openInNewWindow"));L.setAttribute("border","0");L.setAttribute("src",J);this.exportDialog.appendChild(L);mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.openInNewWindow(J.substring(J.indexOf(",")+1),"image/png",!0);z.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(L){I.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),+this.exportDialog=null);this.handleError(L)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(B)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,B,z){this.isLocalFileSave()?this.saveLocalFile(k,c,B,z,f):this.saveRequest(c,f,mxUtils.bind(this,function(C,I){return this.createEchoRequest(k,C,B,z,f,I)}),k,z,B)};EditorUi.prototype.saveRequest=function(c,f,k,B,z,C,I){I=null!=I?I:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,+function(O,da,fa,V){if("_blank"==da||null!=O&&0<O.length){var ba=k("_blank"==da?null:O,da==App.MODE_DEVICE||"download"==da||null==da||"_blank"==da?"0":"1");null!=ba&&(da==App.MODE_DEVICE||"download"==da||"_blank"==da?ba.simulate(document,"_blank"):(fa=mxUtils.bind(this,function(ma){C=null!=C?C:"pdf"==f?"application/pdf":"image/"+f;if(null!=B)try{this.exportFile(B,O,C,!0,da,ma)}catch(la){this.handleError(la)}else this.spinner.spin(document.body,mxResources.get("saving"))&&ba.send(mxUtils.bind(this,+function(){this.spinner.stop();if(200<=ba.getStatus()&&299>=ba.getStatus())try{this.exportFile(ba.getText(),O,C,!0,da,ma)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=V?fa(V):this.pickFolder(da,fa)))}});z=[App.MODE_BROWSER];I||z.push("_blank");var J=new SaveDialog(this,c,mxUtils.bind(this,function(O,da,fa){L(O.value,da,O,fa);this.hideDialog(null,null,J.container)}),+z,null,"application/pdf");this.showDialog(J.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));J.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,k,B,z,C){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,k){f(null)};+EditorUi.prototype.exportSvg=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(K){Editor.addRetryToError(K,mxUtils.bind(this,function(){this.exportSvg(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba)}));this.handleError(K)})))try{var ma=this.editor.graph.isSelectionEmpty();k=null!=k?k:ma;var la=f?null:this.editor.graph.background;la==mxConstants.NONE&&(la=null);null==la&&0==f&&(la=this.editor.graph.shapeBackgroundColor);var Z=this.editor.graph.addForeignObjectWarning;+Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var ea=this.editor.graph.createSvgImageExport(z),aa=this.editor.graph.getSvg(la,c,I,L,null,k,null,ea,"blank"==O?"_blank":"self"==O?"_top":null,null,!V,da,fa);this.editor.graph.addForeignObjectWarning=Z;B&&this.editor.graph.addSvgShadow(aa);var l=this.getBaseFilename()+(z?".drawio":"")+".svg";ba=null!=ba?ba:mxUtils.bind(this,function(K){this.isLocalFileSave()||K.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",K,"image/svg+xml"):+this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(K)}))});var t=mxUtils.bind(this,function(K){this.spinner.stop();z&&K.setAttribute("content",this.getFileData(!0,null,null,null,k,J,null,null,null,null,null,c,I));ba(Graph.xmlDeclaration+"\n"+(z?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(K))});this.editor.graph.mathEnabled&&this.editor.addMathCss(aa);var H=mxUtils.bind(this,function(K){Editor.replaceSvgDataUris&&+C&&EditorUi.embedSvgImages(K);Editor.foreignObjectImages&&V?this.replaceAlternateContent(K,da,t):t(K)}),U=mxUtils.bind(this,function(K){C&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(K,H,this.thumbImageCache)):H(K)});V?this.embedFonts(aa,U):(this.editor.addFontCss(aa),U(aa))}catch(K){this.handleError(K)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function B(fa,V,ba,ma,la){var Z=mxUtils.createElementNs(c.ownerDocument,+mxConstants.NS_SVG,"image");Z.setAttribute("x",V);Z.setAttribute("y",ba+.5);Z.setAttribute("width",ma.width);Z.setAttribute("height",ma.height);null==Z.setAttributeNS?Z.setAttribute("xlink:href",la):Z.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);fa.replaceChild(Z,fa.lastChild);L()}function z(){if(I<da.length)da[I++](z)}var C="";f=c.getElementsByTagName("style");for(var I=0;I<f.length;I++)C+=f[I].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var L=mxUtils.bind(this,function(){counter--;+0==counter&&k(c)}),J={},O={},da=[];for(I=0;I<f.length;I++)mxUtils.bind(this,function(fa){var V=fa.getElementsByTagName("div");if(0<V.length)try{var ba=V[0].cloneNode(!0),ma=parseInt(ba.style.marginLeft),la=parseInt(ba.style.paddingTop),Z=ba.getElementsByTagName("div")[1],ea=V=!1,aa=ba.style.alignItems,l=ba.style.justifyContent;if(null!=ba.style.writingMode){var t=ba.style.writingMode;ea="vertical-"==t.substring(0,9);V="-rl"==t.substring(t.length-3)}var H=!ea&&"1px"==ba.style.width||ea&&"1px"==ba.style.height;+if(!ea&&"1px"==ba.style.height||ea&&"1px"==ba.style.width)ba.style.alignItems=ea&&V?"unsafe flex-end":"unsafe flex-start";H&&(ba.style.justifyContent="unsafe flex-start");ba.style.paddingTop="";ba.style.marginLeft="";var U=ba.outerHTML,K=J[U];null==K&&(ba.style.position="absolute",ba.style.visibility="hidden",document.body.appendChild(ba),t=1,t="1px"==ba.style.width?Z.offsetWidth:parseInt(ba.style.width),H=1,H="1px"==ba.style.height?Z.offsetHeight:parseInt(ba.style.height),document.body.removeChild(ba),+K=new mxRectangle(ma,la,t,H),J[U]=K);"1px"==ba.style.height&&("unsafe center"==aa?la-=K.height/2:"unsafe flex-end"==aa&&(la-=K.height));if("1px"==ba.style.width)if(!ea&&"unsafe center"==l||ea&&"unsafe center"==aa)ma-=K.width/2;else if(!ea&&"unsafe flex-end"==l||ea&&(!V&&"unsafe flex-end"==aa||V&&"unsafe flex-start"==aa))ma-=K.width;K=new mxRectangle(ma,la,K.width,K.height+parseInt(Z.style.fontSize)/4);da.push(mxUtils.bind(this,function(W){var Y=O[U];null==Y?Graph.htmlToPng(U,K.width,K.height,mxUtils.bind(this,+function(ca){B(fa,ma,la,K,ca);O[U]=ca;W()}),C):(B(fa,ma,la,K,Y),W())}))}catch(W){L()}else L()})(f[I]);0==counter&&k(c);I=0;z()};EditorUi.prototype.addRadiobox=function(c,f,k,B,z,C,I){return this.addCheckbox(c,k,B,z,C,I,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,B,z,C,I,L){C=null!=C?C:!0;var J=document.createElement("input");J.style.marginRight="8px";J.style.marginTop="16px";J.setAttribute("type",I?"radio":"checkbox");I="geCheckbox-"+Editor.guid();J.id=I;null!=L&&J.setAttribute("name",L);+k&&(J.setAttribute("checked","checked"),J.defaultChecked=!0);B&&J.setAttribute("disabled","disabled");C&&(c.appendChild(J),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",I),c.appendChild(k),z||mxUtils.br(c));return J};EditorUi.prototype.addEditButton=function(c,f){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var B=this.getCurrentFile(),z="";null!=B&&B.getMode()!=App.MODE_DEVICE&&B.getMode()!=App.MODE_BROWSER&&(z=window.location.href);+var C=document.createElement("select");C.style.maxWidth="200px";C.style.width="auto";C.style.marginLeft="8px";C.style.marginRight="10px";C.className="geBtn";B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("makeCopy"));C.appendChild(B);var I=document.createElement("option");I.setAttribute("value","custom");mxUtils.write(I,mxResources.get("custom")+"...");C.appendChild(I);c.appendChild(C);mxEvent.addListener(C,"change",mxUtils.bind(this,function(){if("custom"==+C.value){var L=new FilenameDialog(this,z,mxResources.get("ok"),function(J){null!=J?(z=J,I.setAttribute("title",J)):(C.value="blank",I.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){C.value="blank"});this.showDialog(L.container,300,80,!0,!1);L.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==f||f.checked)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return k.checked?+"blank"===C.value?"_blank":z:null},getEditInput:function(){return k},getEditSelect:function(){return C}}};EditorUi.prototype.addLinkSection=function(c,f){function k(){var L=document.createElement("div");L.style.width="100%";L.style.height="100%";L.style.boxSizing="border-box";null!=C&&C!=mxConstants.NONE?(L.style.border="1px solid black",L.style.backgroundColor=C):(L.style.backgroundPosition="center center",L.style.backgroundRepeat="no-repeat",L.style.backgroundImage="url('"+Dialog.prototype.closeImage++"')");I.innerText="";I.appendChild(L)}mxUtils.write(c,mxResources.get("links")+":");var B=document.createElement("select");B.style.width="100px";B.style.padding="0px";B.style.marginLeft="8px";B.style.marginRight="10px";B.className="geBtn";var z=document.createElement("option");z.setAttribute("value","auto");mxUtils.write(z,mxResources.get("automatic"));B.appendChild(z);z=document.createElement("option");z.setAttribute("value","blank");mxUtils.write(z,mxResources.get("openInNewWindow"));B.appendChild(z);+z=document.createElement("option");z.setAttribute("value","self");mxUtils.write(z,mxResources.get("openInThisWindow"));B.appendChild(z);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),B.appendChild(f));c.appendChild(B);mxUtils.write(c,mxResources.get("borderColor")+":");var C="#0000ff",I=null;I=mxUtils.button("",mxUtils.bind(this,function(L){this.pickColor(C||"none",function(J){C=J;k()});+mxEvent.consume(L)}));k();I.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";I.style.marginLeft="4px";I.style.height="22px";I.style.width="22px";I.style.position="relative";I.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";I.className="geColorBtn";c.appendChild(I);mxUtils.br(c);return{getColor:function(){return C},getTarget:function(){return B.value},focus:function(){B.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,B,z,C){C=null!=C?C:[];k&&(C.push("lightbox=1"),+"auto"!=c&&C.push("target="+c),null!=f&&f!=mxConstants.NONE&&C.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=B&&0<B.length&&C.push("edit="+encodeURIComponent(B)),z&&C.push("layers=1"),this.editor.graph.foldingEnabled&&C.push("nav=1"));return C};EditorUi.prototype.createLink=function(c,f,k,B,z,C,I,L,J,O,da){var fa=this.getCurrentFile();J=this.createUrlParameters(c,f,B,z,C,J);c=!0;null!=I?k="#U"+encodeURIComponent(I):L||null==fa||""==fa.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,+null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+fa.getHash(),c=!1);c&&null!=fa&&null!=fa.getTitle()&&fa.getTitle()!=this.defaultFilename&&J.push("title="+encodeURIComponent(fa.getTitle()));O&&1<k.length&&(J.push("open="+k.substring(1)),k="");da&&null!=this.currentPage&&J.push("page-id="+this.currentPage.getId());return(B&&(null!=I||null!=fa&&fa.getMode()!=App.MODE_GITHUB&&fa.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||+EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<J.length?"?"+J.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){this.getBasenames();var ba={};""!=z&&z!=mxConstants.NONE&&(ba.highlight=z);"auto"!==B&&(ba.target=B);O||(ba.lightbox=!1);ba.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(ba.zoom=k/100);k=[];I&&(k.push("pages"),ba.resize=!0,null!=this.pages&&null!=+this.currentPage&&(ba.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),ba.resize=!0);L&&k.push("layers");J&&k.push("tags");null!=V&&(ba["dark-mode"]=V);0<k.length&&(O&&k.push("lightbox"),ba.toolbar=k.join(" "));null!=da&&0<da.length&&(ba.edit=da);null!=c?ba.url=c:ba.xml=this.getFileData(!0,null,null,null,null,!I);f='<div class="mxgraph" style="'+(C?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ba))+'"></div>';+c=null!=c?"&fetch="+encodeURIComponent(c):"";fa(f,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,f,k,B){var z=document.createElement("div");z.style.whiteSpace="nowrap";var C=+document.createElement("h3");mxUtils.write(C,mxResources.get("html"));C.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";z.appendChild(C);var I=document.createElement("div");I.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name","type-embedhtmldialog");+C=L.cloneNode(!0);C.setAttribute("value","copy");I.appendChild(C);var J=document.createElement("span");mxUtils.write(J,mxResources.get("includeCopyOfMyDiagram"));I.appendChild(J);mxUtils.br(I);I.appendChild(L);J=document.createElement("span");mxUtils.write(J,mxResources.get("publicDiagramUrl"));I.appendChild(J);var O=this.getCurrentFile();null==k&&null!=O&&O.constructor==window.DriveFile&&(J=document.createElement("a"),J.style.paddingLeft="12px",J.style.color="gray",J.style.cursor="pointer",mxUtils.write(J,+mxResources.get("share")),I.appendChild(J),mxEvent.addListener(J,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(O.getId(),O)})));C.setAttribute("checked","checked");null==k&&L.setAttribute("disabled","disabled");z.appendChild(I);I=380;var da=this.addLinkSection(z),fa=document.createElement("select");fa.style.maxWidth="260px";fa.style.marginLeft="8px";fa.style.marginTop="16px";J=document.createElement("option");J.setAttribute("value","light");mxUtils.write(J,mxResources.get("light"));+fa.appendChild(J);J=document.createElement("option");J.setAttribute("value","dark");mxUtils.write(J,mxResources.get("dark"));fa.appendChild(J);J=document.createElement("option");J.setAttribute("value","auto");mxUtils.write(J,mxResources.get("automatic"));J.setAttribute("selected","selected");fa.appendChild(J);J.setAttribute("selected","selected");mxUtils.write(z,mxResources.get("appearance")+":");z.appendChild(fa);mxUtils.br(z);I+=26;var V=this.addCheckbox(z,mxResources.get("zoom"),!0,null,!0);mxUtils.write(z,+":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value="100%";z.appendChild(ba);var ma=this.addCheckbox(z,mxResources.get("fit"),!0);J=null!=this.pages&&1<this.pages.length;var la=la=this.addCheckbox(z,mxResources.get("allPages"),J,!J),Z=this.addCheckbox(z,mxResources.get("layers"),!0),ea=this.addCheckbox(z,mxResources.get("tags"),!0),aa=this.addCheckbox(z,mxResources.get("lightbox"),+!0),l=null;if(EditorUi.enableHtmlEditOption){l=this.addEditButton(z,aa);var t=l.getEditInput();t.style.marginBottom="16px";I+=50;mxEvent.addListener(aa,"change",function(){aa.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled");t.checked&&aa.checked?l.getEditSelect().removeAttribute("disabled"):l.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,z,mxUtils.bind(this,function(){B(L.checked?k:null,V.checked,ba.value,da.getTarget(),da.getColor(),ma.checked,+la.checked,Z.checked,ea.checked,aa.checked,null!=l?l.getLink():null,null!=fa?fa.value:null)}),null,c,f);this.showDialog(c.container,340,I,!0,!0);C.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,f,k,B,z,C,I,L,J){var O=document.createElement("div");O.style.whiteSpace="nowrap";var da=document.createElement("h3");mxUtils.write(da,c||mxResources.get("publish"));da.style.width="100%";da.style.textAlign="center";da.style.marginTop="2px";da.style.marginBottom="20px";O.appendChild(da);var fa=+document.createElement("select");c=30;fa.className="geBtn";fa.style.marginBottom="8px";fa.style.marginLeft="0px";fa.style.width="100%";fa.style.boxSizing="border-box";if(null==L||""==L.getHash())z=null!=z?z:"https://www.drawio.com/doc/faq/publish-diagram-as-link",da=document.createElement("option"),mxUtils.write(da,mxResources.get("makeCopy")),da.setAttribute("value","copy"),fa.appendChild(da);da=document.createElement("option");mxUtils.write(da,mxResources.get("authorizationRequired"));da.setAttribute("value",+"auth");fa.appendChild(da);null!=L&&""!=L.getHash()||da.setAttribute("disabled","disabled");L=document.createElement("option");L.setAttribute("value","public");fa.appendChild(L);null!=I?(mxUtils.write(L,mxResources.get("publicDiagramUrl")),L.setAttribute("title",I),fa.value="public"):(mxUtils.write(L,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),L.setAttribute("disabled","disabled"));O.appendChild(fa);mxUtils.br(O);fa.focus();var V=null,ba=null;if(null!=f||null!=+k)c+=30,mxUtils.write(O,mxResources.get("width")+":"),V=document.createElement("input"),V.setAttribute("type","text"),V.style.marginRight="16px",V.style.width="50px",V.style.marginLeft="6px",V.style.marginRight="16px",V.style.marginBottom="10px",V.value="100%",O.appendChild(V),mxUtils.write(O,mxResources.get("height")+":"),ba=document.createElement("input"),ba.setAttribute("type","text"),ba.style.width="50px",ba.style.marginLeft="6px",ba.style.marginBottom="10px",ba.value=k+"px",O.appendChild(ba),+mxUtils.br(O);var ma=this.addLinkSection(O,B),la=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,f=null!=this.currentPage?this.currentPage.getName():"",16<f.length&&(f=f.substring(0,16)+"..."),la=this.addCheckbox(O,mxResources.get("selectedPage")+": "+f));var Z=this.addCheckbox(O,mxResources.get("lightbox"),!0,null,null,!B),ea=this.addEditButton(O,Z),aa=ea.getEditInput();B&&(aa.style.marginLeft=Z.style.marginLeft,Z.style.display="none",c-=20);var l=this.addCheckbox(O,+mxResources.get("layers"),!0);l.style.marginLeft=aa.style.marginLeft;l.style.marginTop="8px";var t=this.addCheckbox(O,mxResources.get("tags"),!0);t.style.marginLeft=aa.style.marginLeft;t.style.marginBottom="16px";t.style.marginTop="16px";mxEvent.addListener(Z,"change",function(){Z.checked?(l.removeAttribute("disabled"),aa.removeAttribute("disabled"),t.removeAttribute("disabled")):(l.setAttribute("disabled","disabled"),aa.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));aa.checked&&+Z.checked?ea.getEditSelect().removeAttribute("disabled"):ea.getEditSelect().setAttribute("disabled","disabled")});B=new CustomDialog(this,O,mxUtils.bind(this,function(){J(ma.getTarget(),ma.getColor(),null==la?!1:la.checked,Z.checked,ea.getLink(),l.checked,null!=V?V.value:null,null!=ba?ba.value:null,t.checked,fa.value)}),null,mxResources.get("create"),z,C);this.showDialog(B.container,340,296+c,!0,!0);null!=V?(V.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?V.select():document.execCommand("selectAll",+!1,null)):null==fa.parentNode;ma.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,B,z){var C=document.createElement("div");C.style.whiteSpace="nowrap";var I=document.createElement("h3");mxUtils.write(I,mxResources.get("image"));I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(z?"10":"4")+"px";C.appendChild(I);if(z){mxUtils.write(C,mxResources.get("zoom")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.marginRight="16px";+L.style.width="60px";L.style.marginLeft="4px";L.style.marginRight="12px";L.value=this.lastExportZoom||"100%";C.appendChild(L);mxUtils.write(C,mxResources.get("borderWidth")+":");var J=document.createElement("input");J.setAttribute("type","text");J.style.marginRight="16px";J.style.width="60px";J.style.marginLeft="4px";J.value=this.lastExportBorder||"0";C.appendChild(J);mxUtils.br(C)}var O=this.addCheckbox(C,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),da=B?null:this.addCheckbox(C,+mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);I=this.editor.graph;var fa=B?null:this.addCheckbox(C,mxResources.get("transparentBackground"),I.background==mxConstants.NONE||null==I.background);null!=fa&&(fa.style.marginBottom="16px");c=new CustomDialog(this,C,mxUtils.bind(this,function(){var V=parseInt(L.value)/100||1,ba=parseInt(J.value)||0;k(!O.checked,null!=da?da.checked:!1,null!=fa?fa.checked:!1,V,ba)}),null,c,f);this.showDialog(c.container,300,(z?25:0)+(B?125:210),!0,+!0)};EditorUi.prototype.showExportDialog=function(c,f,k,B,z,C,I,L,J){I=null!=I?I:Editor.defaultIncludeDiagram;var O=document.createElement("div");O.style.whiteSpace="nowrap";var da=this.editor.graph,fa="jpeg"==L||"webp"==L?220:320,V=document.createElement("h3");mxUtils.write(V,c);V.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";O.appendChild(V);mxUtils.write(O,mxResources.get("zoom")+":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight=+"16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value=this.lastExportZoom||"100%";O.appendChild(ba);mxUtils.write(O,mxResources.get("borderWidth")+":");var ma=document.createElement("input");ma.setAttribute("type","text");ma.style.marginRight="16px";ma.style.width="60px";ma.style.marginLeft="4px";ma.value=this.lastExportBorder||"0";O.appendChild(ma);mxUtils.br(O);var la=this.addCheckbox(O,mxResources.get("selectionOnly"),!1,da.isSelectionEmpty()),Z=document.createElement("input");+Z.style.marginTop="16px";Z.style.marginRight="8px";Z.style.marginLeft="24px";Z.setAttribute("disabled","disabled");Z.setAttribute("type","checkbox");var ea=document.createElement("select");ea.style.marginTop="16px";ea.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(V=0;V<c.length;V++)if(!da.isSelectionEmpty()||"selectionOnly"!=c[V]){var aa=document.createElement("option");mxUtils.write(aa,mxResources.get(c[V]));aa.setAttribute("value",c[V]);ea.appendChild(aa)}J?(mxUtils.write(O,mxResources.get("size")++":"),O.appendChild(ea),mxUtils.br(O),fa+=26,mxEvent.addListener(ea,"change",function(){"selectionOnly"==ea.value&&(la.checked=!0)})):C&&(O.appendChild(Z),mxUtils.write(O,mxResources.get("crop")),mxUtils.br(O),fa+=30,mxEvent.addListener(la,"change",function(){la.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")}));da.isSelectionEmpty()?J&&(la.style.display="none",la.nextSibling.style.display="none",la.nextSibling.nextSibling.style.display="none",fa-=30):(ea.value="diagram",+Z.setAttribute("checked","checked"),Z.defaultChecked=!0,mxEvent.addListener(la,"change",function(){ea.value=la.checked?"selectionOnly":"diagram"}));var l=this.addCheckbox(O,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=L&&"webp"!=L),t=document.createElement("select");t.style.maxWidth="260px";t.style.marginLeft="8px";t.style.marginTop="16px";C=document.createElement("option");C.setAttribute("value","light");mxUtils.write(C,mxResources.get("light"));t.appendChild(C);J=document.createElement("option");+J.setAttribute("value","dark");mxUtils.write(J,mxResources.get("dark"));t.appendChild(J);"svg"==L?(C=document.createElement("option"),C.setAttribute("value","auto"),mxUtils.write(C,mxResources.get("automatic")),C.setAttribute("selected","selected"),t.appendChild(C)):Editor.isDarkMode()?J.setAttribute("selected","selected"):C.setAttribute("selected","selected");mxUtils.write(O,mxResources.get("appearance")+":");O.appendChild(t);mxUtils.br(O);fa+=26;var H=this.addCheckbox(O,mxResources.get("shadow"),+da.shadowVisible),U=null;if("png"==L||"jpeg"==L||"webp"==L)U=this.addCheckbox(O,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),fa+=30;var K=this.addCheckbox(O,mxResources.get("includeCopyOfMyDiagram")+":",I,null,null,"jpeg"!=L&&"webp"!=L),W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="28px";"png"==L||"svg"==L?(I=function(){K.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},da=document.createElement("option"),da.setAttribute("value",+"allPages"),mxUtils.write(da,mxResources.get("allPages")),W.appendChild(da),da=document.createElement("option"),da.setAttribute("value","currentPage"),mxUtils.write(da,mxResources.get("currentPage")),W.appendChild(da),K.style.marginBottom="12px",W.style.marginBottom="16px",O.appendChild(W),mxUtils.br(O),fa+=20,null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(K,"change",I),I()):K.style.marginBottom="16px";var Y=document.createElement("input");Y.style.marginBottom="16px";+Y.style.marginRight="8px";Y.setAttribute("type","checkbox");var ca=document.createElement("input");ca.style.marginBottom="16px";ca.style.marginRight="8px";ca.setAttribute("type","checkbox");f&&(Y.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,O.appendChild(Y),mxUtils.write(O,mxResources.get("embedImages")),mxUtils.br(O),ca.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,O.appendChild(ca),mxUtils.write(O,mxResources.get("embedFonts")),mxUtils.br(O),fa+=50);var ja=document.createElement("select");+ja.style.maxWidth="260px";ja.style.marginLeft="8px";C=document.createElement("option");C.setAttribute("value","auto");mxUtils.write(C,mxResources.get("automatic"));ja.appendChild(C);I=document.createElement("option");I.setAttribute("value","blank");mxUtils.write(I,mxResources.get("openInNewWindow"));ja.appendChild(I);I=document.createElement("option");I.setAttribute("value","self");mxUtils.write(I,mxResources.get("openInThisWindow"));ja.appendChild(I);I=document.createElement("div");mxUtils.write(I,+mxResources.get("LinksLost"));I.style.margin="7px";I.style.display="none";"svg"==L&&(mxUtils.write(O,mxResources.get("links")+":"),O.appendChild(ja),O.appendChild(I),mxUtils.br(O),mxUtils.br(O),fa+=50);k=new CustomDialog(this,O,mxUtils.bind(this,function(){this.lastExportBorder=ma.value;this.lastExportZoom=ba.value;this.lastEmbedImages=Y.checked;this.lastEmbedFonts=ca.checked;this.lastEmbedInclude=W.value;z(ba.value,l.checked,!la.checked,H.checked,K.checked,Y.checked&&f,ma.value,Z.checked,("png"==+L||"svg"==L)&&"currentPage"==W.value,ja.value,null!=U?U.checked:null,null!=t?t.value:null,ea.value,ca.checked)}),null,k,B);this.showDialog(k.container,340,fa,!0,!0,null,null,null,null,!0);ba.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ba.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,k,B,z){var C=document.createElement("div");C.style.whiteSpace="nowrap";var I=this.editor.graph;if(null!=f){var L=document.createElement("h3");+mxUtils.write(L,f);L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";C.appendChild(L)}var J=this.addCheckbox(C,mxResources.get("fit"),!0),O=this.addCheckbox(C,mxResources.get("shadow"),I.shadowVisible&&B,!B),da=this.addCheckbox(C,k),fa=this.addCheckbox(C,mxResources.get("lightbox"),!0),V=this.addEditButton(C,fa),ba=V.getEditInput(),ma=1<I.model.getChildCount(I.model.getRoot()),la=this.addCheckbox(C,mxResources.get("layers"),ma,!ma);la.style.marginLeft=ba.style.marginLeft;+la.style.marginBottom="12px";la.style.marginTop="8px";mxEvent.addListener(fa,"change",function(){fa.checked?(ma&&la.removeAttribute("disabled"),ba.removeAttribute("disabled")):(la.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));ba.checked&&fa.checked?V.getEditSelect().removeAttribute("disabled"):V.getEditSelect().setAttribute("disabled","disabled")});f=new CustomDialog(this,C,mxUtils.bind(this,function(){c(J.checked,O.checked,da.checked,fa.checked,V.getLink(),la.checked)}),+null,mxResources.get("embed"),z);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,B,z,C,I,L){function J(ba){var ma=" ",la="";B&&(ma=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost++"/?client=1"+(null!=da?"&page="+da:"")+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}})(this);\"",la+="cursor:pointer;");c&&(la+="max-width:100%;");var Z="";k&&(Z=' width="'+Math.round(O.width)+'" height="'+Math.round(O.height)+'"');I('<img src="'+ba+'"'+Z+(""!=la?' style="'+la+'"':"")+ma+"/>")}var O=this.editor.graph.getGraphBounds(),da=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ba){var ma=B?this.getFileData(!0):null;ba=this.createImageDataUri(ba,+ma,"png");J(ba)}),null,null,null,mxUtils.bind(this,function(ba){L({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),O.width*O.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var fa="";k&&(fa="&w="+Math.round(2*O.width)+"&h="+Math.round(2*O.height));var V=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(B?"1":"0")+fa+"&xml="+encodeURIComponent(f));V.send(mxUtils.bind(this,function(){200<=V.getStatus()&&299>=V.getStatus()?+J("data:image/png;base64,"+V.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,k,B,z,C,I){var L=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),J=L.getElementsByTagName("a");if(null!=J)for(var O=0;O<J.length;O++){var da=J[O].getAttribute("href");null!=da&&"#"==da.charAt(0)&&"_blank"==J[O].getAttribute("target")&&J[O].removeAttribute("target")}B&&L.setAttribute("content",+this.getFileData(!0));f&&this.editor.graph.addSvgShadow(L);if(k){var fa=" ",V="";B&&(fa="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}})(this);\"",V+=+"cursor:pointer;");c&&(V+="max-width:100%;");this.editor.convertImages(L,mxUtils.bind(this,function(ba){I('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ba))+'"'+(""!=V?' style="'+V+'"':"")+fa+"/>")}))}else V="",B&&(f=this.getSelectedPageIndex(),L.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=f?"&page="+f:"")+(z?"&edit=_blank":"")+(C?"&layers=1":"")+"');}}})(this);"),V+="cursor:pointer;"),c&&(c=parseInt(L.getAttribute("width")),z=parseInt(L.getAttribute("height")),L.setAttribute("viewBox","-0.5 -0.5 "+c+" "+z),V+="max-width:100%;max-height:"+z+"px;",L.removeAttribute("height")),""!=V&&L.setAttribute("style",V),this.editor.addFontCss(L),this.editor.graph.mathEnabled&&this.editor.addMathCss(L),I(mxUtils.getXml(L))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var k=null;if("diagram"==c.nodeName)k=c;else if("mxfile"==c.nodeName){var B=c.getElementsByTagName("diagram");if(0<B.length){k=B[0];var z=f.getGlobalVariable;f.getGlobalVariable=function(C){return"page"==C?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==C?1:z.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}B=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(C){}finally{this.editor.graph=B}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};-EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var B=parseFloat(c.getAttribute("scale"));!isNaN(B)&&0<B&&(f=B)}c.hasAttribute("border")&&(B=parseInt(c.getAttribute("border")),!isNaN(B)&&0<B&&(k=B))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,f,k,B,z){try{var C=this.editor.graph,H=null;if(null!=k&&0<k.length)C=this.createTemporaryGraph(C.getStylesheet()),document.body.appendChild(C.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,-!0),C),H=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){C=this.createTemporaryGraph(C.getStylesheet());var K=C.getGlobalVariable;C.setBackgroundImage=this.editor.graph.setBackgroundImage;var M=this.pages[0];this.currentPage==M?C.setBackgroundImage(this.editor.graph.backgroundImage):null!=M.viewState&&null!=M.viewState&&C.setBackgroundImage(M.viewState.backgroundImage);C.getGlobalVariable=function(O){return"page"==O?M.getName():"pagenumber"==O?1:K.apply(this,arguments)};document.body.appendChild(C.container);-C.model.setRoot(M.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(O){try{null==H&&(H=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var ea=O.toDataURL("image/png");ea=Editor.writeGraphModelToPng(ea,"tEXt","mxfile",encodeURIComponent(H));c(ea.substring(ea.lastIndexOf(",")+1));C!=this.editor.graph&&C.container.parentNode.removeChild(C.container)}catch(fa){null!=f&&f(fa)}}),null,null,null,mxUtils.bind(this,function(O){null!=f&&f(O)}),null,null,B,null,C.shadowVisible,null,-C,z,null,null,null,"diagram",null)}catch(O){null!=f&&f(O)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){K=null!=K?K:!0;ea=null!=ea?ea:0;H=null!=M?M:f.background;H==mxConstants.NONE&&(H=null);null==H&&"none"==f.getAdaptiveColors()&&(H="#ffffff");M=this.editor.graph.createSvgImageExport(null!=c);C=f.getSvg(H,O,ea,null,null,C,null,M,null,f.shadowVisible||fa,null,S,"diagram");(f.shadowVisible||fa)&&f.addSvgShadow(C,null,null,0==ea);null!=c&&C.setAttribute("content",c);null!=-k&&C.setAttribute("resource",k);var ca=mxUtils.bind(this,function(ma){ma=(B?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(ma);null!=z&&z(ma);return ma});f.mathEnabled&&this.editor.addMathCss(C);if(null!=z)this.embedFonts(C,mxUtils.bind(this,function(ma){K?this.editor.convertImages(ma,mxUtils.bind(this,function(la){ca(la)})):ca(ma)}));else return ca(C)};EditorUi.prototype.embedFonts=function(c,f){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=-this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(k){try{null!=k&&this.editor.addFontCss(c,k),f(c)}catch(B){f(c)}}))}catch(k){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){M=null!=M?M:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ma){Editor.addRetryToError(ma,mxUtils.bind(this,function(){this.exportImage(c,f,k,B,z,C,H,K,M,O,ea,fa,-S)}));this.handleError(ma)}))){var ca=this.editor.graph.isSelectionEmpty();k=null!=k?k:ca;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ma){this.spinner.stop();try{this.saveCanvas(ma,z?this.getFileData(!0,null,null,null,k,K,null,null,null,null,null,c,C):null,M,null==this.pages||0==this.pages.length,ea)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ma){this.spinner.stop();this.handleError(ma)}),-null,k,c||1,f,B,null,null,C,H,O,fa,S)}catch(ma){this.spinner.stop(),this.handleError(ma)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,B,z,C,H){f=null!=f?f:0;k=null!=k?k:0;var K=[];try{var M=this.editor.graph;if(null!=c&&0<c.length){M.model.beginUpdate();-try{var O=mxUtils.parseXml(c);c={};var ea=this.editor.extractGraphModel(O.documentElement,null!=this.pages);if(null!=ea&&"mxfile"==ea.nodeName&&null!=this.pages){var fa=ea.getElementsByTagName("diagram");if(1==fa.length&&!C){if(ea=Editor.parseDiagramNode(fa[0]),null!=this.currentPage&&(c[fa[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var S=fa[0].getAttribute("name");null!=S&&""!=S&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,S))}}else if(0<fa.length){C=-[];var ca=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[fa[0].getAttribute("id")]=this.pages[0].getId(),S=fa[0].getAttribute("name"),null!=S&&""!=S&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],S)),ea=Editor.parseDiagramNode(fa[0]),B=!1,ca=1);for(;ca<fa.length;ca++){var ma=fa[ca].getAttribute("id");fa[ca].removeAttribute("id");var la=this.updatePageRoot(new DiagramPage(fa[ca]));c[ma]=fa[ca].getAttribute("id");var Z=this.pages.length;null==la.getName()&&la.setName(mxResources.get("pageWithNumber",-[Z+1]));M.model.execute(new ChangePage(this,la,la,Z,!0));C.push(la)}this.updatePageLinks(c,C)}}if(null!=ea&&"mxGraphModel"===ea.nodeName){K=M.importGraphModel(ea,f,k,B);if(null!=K)for(this.addLocalPagesToMapping(c),ca=0;ca<K.length;ca++)this.updatePageLinksForCell(c,K[ca]);var da=M.parseBackgroundImage(ea.getAttribute("backgroundImage"));if(null!=da&&null!=da.originalSrc){this.updateBackgroundPageLink(c,da);var aa=new ChangePageSetup(this,null,da);aa.ignoreColor=!0;M.model.execute(aa)}}H&&M.pasteCellStyles(M.includeDescendants(K),-M.defaultVertexStyle,M.defaultEdgeStyle)}finally{M.model.endUpdate()}}}catch(l){if(z)throw l;this.handleError(l)}return K};EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var k=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=-k&&(f.originalSrc="data:page/id,"+k)}}catch(B){}};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),B=this.editor.graph,z=B.getLinkForCell(f);null!=z&&B.setLinkForCell(f,this.updatePageLink(c,z));if(B.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(B.getLabel(f));for(var C=k.getElementsByTagName("a"),H=!1,K=0;K<C.length;K++)z=C[K].getAttribute("href"),null!=z&&(C[K].setAttribute("href",this.updatePageLink(c,z)),H=!0);H&&B.labelChanged(f,k.innerHTML)}for(K=-0;K<B.model.getChildCount(f);K++)this.updatePageLinksForCell(c,B.model.getChildAt(f,K))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var B=JSON.parse(f.substring(17));if(null!=B.actions){for(var z=0;z<B.actions.length;z++){var C=B.actions[z];if(null!=C.open&&Graph.isPageLink(C.open)){var H=C.open.substring(C.open.indexOf(",")+1);k=c[H];null!=k?C.open=-"data:page/id,"+k:null==this.getPageById(H)&&delete C.open}}f="data:action/json,"+JSON.stringify(B)}}catch(K){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,B,z){var C=mxUtils.bind(this,function(H){this.loadingExtensions=!1;null!=k?k(H):this.handleError(H)});this.createTimeout(null,mxUtils.bind(this,function(H){B=null!=B?B:c.name;var K=mxUtils.bind(this,function(O){H.clear()&&-C(O)}),M=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var O=this.isRemoteVisioFormat(B);try{var ea=B.lastIndexOf(".");if(0<=ea&&ea<B.length)B.substring(ea+1).toUpperCase();else{var fa=B.lastIndexOf("/");0<=fa&&fa<B.length&&(B=B.substring(fa+1))}}catch(ca){}if(O)if(null==VSD_CONVERT_URL||this.isOffline())K({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{O=new FormData;O.append("file1",c,-B);var S=new XMLHttpRequest;S.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(B)?"?stencil=1":""));S.responseType="blob";this.addRemoteServiceSecurityCheck(S);null!=z&&S.setRequestHeader("x-convert-custom",z);S.onreadystatechange=mxUtils.bind(this,function(){if(4==S.readyState&&H.clear())if(200<=S.status&&299>=S.status)try{var ca=S.response;if("text/xml"==ca.type){var ma=new FileReader;ma.onload=mxUtils.bind(this,function(la){try{f(la.target.result)}catch(Z){K({message:mxResources.get("errorLoadingFile")})}});-ma.readAsText(ca)}else this.doImportVisio(ca,f,K,B)}catch(la){K(la)}else try{""==S.responseType||"text"==S.responseType?K({message:S.responseText}):(ma=new FileReader,ma.onload=function(){try{K({message:JSON.parse(ma.result).Message})}catch(la){K(la)}},ma.readAsText(S.response))}catch(la){K({})}});S.send(O)}else if(H.clear())try{this.doImportVisio(c,f,K,B)}catch(ca){K(ca)}}else K({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?-M():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",M,null,null,null,K))}),C)};EditorUi.prototype.importGraphML=function(c,f,k){var B=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=k?k(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){var C=mxUtils.bind(this,function(K){z.clear()&&B(K)}),H=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(z.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,B)}catch(K){C(K)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});-this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?H():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,C))}),B)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.createTimeout(null,mxUtils.bind(this,function(k){var B=mxUtils.bind(this,function(C){k.clear()&&f(C)}),z=mxUtils.bind(this,function(){this.loadingExtensions=+EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var B=parseFloat(c.getAttribute("scale"));!isNaN(B)&&0<B&&(f=B)}c.hasAttribute("border")&&(B=parseInt(c.getAttribute("border")),!isNaN(B)&&0<B&&(k=B))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,f,k,B,z){try{var C=this.editor.graph,I=null;if(null!=k&&0<k.length)C=this.createTemporaryGraph(C.getStylesheet()),document.body.appendChild(C.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,+!0),C),I=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){C=this.createTemporaryGraph(C.getStylesheet());var L=C.getGlobalVariable;C.setBackgroundImage=this.editor.graph.setBackgroundImage;var J=this.pages[0];this.currentPage==J?C.setBackgroundImage(this.editor.graph.backgroundImage):null!=J.viewState&&null!=J.viewState&&C.setBackgroundImage(J.viewState.backgroundImage);C.getGlobalVariable=function(O){return"page"==O?J.getName():"pagenumber"==O?1:L.apply(this,arguments)};document.body.appendChild(C.container);+C.model.setRoot(J.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(O){try{null==I&&(I=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var da=O.toDataURL("image/png");da=Editor.writeGraphModelToPng(da,"tEXt","mxfile",encodeURIComponent(I));c(da.substring(da.lastIndexOf(",")+1));C!=this.editor.graph&&C.container.parentNode.removeChild(C.container)}catch(fa){null!=f&&f(fa)}}),null,null,null,mxUtils.bind(this,function(O){null!=f&&f(O)}),null,null,B,null,C.shadowVisible,null,+C,z,null,null,null,"diagram",null)}catch(O){null!=f&&f(O)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){L=null!=L?L:!0;da=null!=da?da:0;I=null!=J?J:f.background;I==mxConstants.NONE&&(I=null);null==I&&"none"==f.getAdaptiveColors()&&(I="#ffffff");J=this.editor.graph.createSvgImageExport(null!=c);C=f.getSvg(I,O,da,null,null,C,null,J,null,f.shadowVisible||fa,null,V,"diagram");(f.shadowVisible||fa)&&f.addSvgShadow(C,null,null,0==da);null!=c&&C.setAttribute("content",c);null!=+k&&C.setAttribute("resource",k);var ba=mxUtils.bind(this,function(ma){ma=(B?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(ma);null!=z&&z(ma);return ma});f.mathEnabled&&this.editor.addMathCss(C);if(null!=z)this.embedFonts(C,mxUtils.bind(this,function(ma){L?this.editor.convertImages(ma,mxUtils.bind(this,function(la){ba(la)})):ba(ma)}));else return ba(C)};EditorUi.prototype.embedFonts=function(c,f){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=+this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(k){try{null!=k&&this.editor.addFontCss(c,k),f(c)}catch(B){f(c)}}))}catch(k){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){J=null!=J?J:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ma){Editor.addRetryToError(ma,mxUtils.bind(this,function(){this.exportImage(c,f,k,B,z,C,I,L,J,O,da,fa,+V)}));this.handleError(ma)}))){var ba=this.editor.graph.isSelectionEmpty();k=null!=k?k:ba;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ma){this.spinner.stop();try{this.saveCanvas(ma,z?this.getFileData(!0,null,null,null,k,L,null,null,null,null,null,c,C):null,J,null==this.pages||0==this.pages.length,da)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ma){this.spinner.stop();this.handleError(ma)}),+null,k,c||1,f,B,null,null,C,I,O,fa,V)}catch(ma){this.spinner.stop(),this.handleError(ma)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,B,z,C,I){f=null!=f?f:0;k=null!=k?k:0;var L=[];try{var J=this.editor.graph;if(null!=c&&0<c.length){J.model.beginUpdate();+try{var O=mxUtils.parseXml(c);c={};var da=this.editor.extractGraphModel(O.documentElement,null!=this.pages);if(null!=da&&"mxfile"==da.nodeName&&null!=this.pages){var fa=da.getElementsByTagName("diagram");if(1==fa.length&&!C){if(da=Editor.parseDiagramNode(fa[0]),null!=this.currentPage&&(c[fa[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var V=fa[0].getAttribute("name");null!=V&&""!=V&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,V))}}else if(0<fa.length){C=+[];var ba=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[fa[0].getAttribute("id")]=this.pages[0].getId(),V=fa[0].getAttribute("name"),null!=V&&""!=V&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],V)),da=Editor.parseDiagramNode(fa[0]),B=!1,ba=1);for(;ba<fa.length;ba++){var ma=fa[ba].getAttribute("id");fa[ba].removeAttribute("id");var la=this.updatePageRoot(new DiagramPage(fa[ba]));c[ma]=fa[ba].getAttribute("id");var Z=this.pages.length;null==la.getName()&&la.setName(mxResources.get("pageWithNumber",+[Z+1]));J.model.execute(new ChangePage(this,la,la,Z,!0));C.push(la)}this.updatePageLinks(c,C)}}if(null!=da&&"mxGraphModel"===da.nodeName){L=J.importGraphModel(da,f,k,B);if(null!=L)for(this.addLocalPagesToMapping(c),ba=0;ba<L.length;ba++)this.updatePageLinksForCell(c,L[ba]);var ea=J.parseBackgroundImage(da.getAttribute("backgroundImage"));if(null!=ea&&null!=ea.originalSrc){this.updateBackgroundPageLink(c,ea);var aa=new ChangePageSetup(this,null,ea);aa.ignoreColor=!0;J.model.execute(aa)}}I&&J.pasteCellStyles(J.includeDescendants(L),+J.defaultVertexStyle,J.defaultEdgeStyle)}finally{J.model.endUpdate()}}}catch(l){if(z)throw l;this.handleError(l)}return L};EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var k=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=+k&&(f.originalSrc="data:page/id,"+k)}}catch(B){}};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),B=this.editor.graph,z=B.getLinkForCell(f);null!=z&&B.setLinkForCell(f,this.updatePageLink(c,z));if(B.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(B.getLabel(f));for(var C=k.getElementsByTagName("a"),I=!1,L=0;L<C.length;L++)z=C[L].getAttribute("href"),null!=z&&(C[L].setAttribute("href",this.updatePageLink(c,z)),I=!0);I&&B.labelChanged(f,k.innerHTML)}for(L=+0;L<B.model.getChildCount(f);L++)this.updatePageLinksForCell(c,B.model.getChildAt(f,L))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var B=JSON.parse(f.substring(17));if(null!=B.actions){for(var z=0;z<B.actions.length;z++){var C=B.actions[z];if(null!=C.open&&Graph.isPageLink(C.open)){var I=C.open.substring(C.open.indexOf(",")+1);k=c[I];null!=k?C.open=+"data:page/id,"+k:null==this.getPageById(I)&&delete C.open}}f="data:action/json,"+JSON.stringify(B)}}catch(L){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,B,z){var C=mxUtils.bind(this,function(I){this.loadingExtensions=!1;null!=k?k(I):this.handleError(I)});this.createTimeout(null,mxUtils.bind(this,function(I){B=null!=B?B:c.name;var L=mxUtils.bind(this,function(O){I.clear()&&+C(O)}),J=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var O=this.isRemoteVisioFormat(B);try{var da=B.lastIndexOf(".");if(0<=da&&da<B.length)B.substring(da+1).toUpperCase();else{var fa=B.lastIndexOf("/");0<=fa&&fa<B.length&&(B=B.substring(fa+1))}}catch(ba){}if(O)if(null==VSD_CONVERT_URL||this.isOffline())L({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{O=new FormData;O.append("file1",c,+B);var V=new XMLHttpRequest;V.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(B)?"?stencil=1":""));V.responseType="blob";this.addRemoteServiceSecurityCheck(V);null!=z&&V.setRequestHeader("x-convert-custom",z);V.onreadystatechange=mxUtils.bind(this,function(){if(4==V.readyState&&I.clear())if(200<=V.status&&299>=V.status)try{var ba=V.response;if("text/xml"==ba.type){var ma=new FileReader;ma.onload=mxUtils.bind(this,function(la){try{f(la.target.result)}catch(Z){L({message:mxResources.get("errorLoadingFile")})}});+ma.readAsText(ba)}else this.doImportVisio(ba,f,L,B)}catch(la){L(la)}else try{""==V.responseType||"text"==V.responseType?L({message:V.responseText}):(ma=new FileReader,ma.onload=function(){try{L({message:JSON.parse(ma.result).Message})}catch(la){L(la)}},ma.readAsText(V.response))}catch(la){L({})}});V.send(O)}else if(I.clear())try{this.doImportVisio(c,f,L,B)}catch(ba){L(ba)}}else L({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?+J():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",J,null,null,null,L))}),C)};EditorUi.prototype.importGraphML=function(c,f,k){var B=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=k?k(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){var C=mxUtils.bind(this,function(L){z.clear()&&B(L)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(z.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,B)}catch(L){C(L)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});+this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?I():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,C))}),B)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.createTimeout(null,mxUtils.bind(this,function(k){var B=mxUtils.bind(this,function(C){k.clear()&&f(C)}),z=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||B({message:mxResources.get("unknownError")})}catch(C){B(C)}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(z,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",z,null,null,null,B))}),f)}};EditorUi.prototype.convertLucidChart=function(c,-f,k){var B=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=k?k(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){var C=mxUtils.bind(this,function(K){z.clear()&&B(K)}),H=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(z.clear())if("undefined"!==typeof window.LucidImporter)try{var K=JSON.parse(c);f(LucidImporter.importState(K));try{if(null!=window.console&&"1"==urlParams.test){var M=[(new Date).toISOString(),"convertLucidChart",K];null!=K.state&&-M.push(JSON.parse(K.state));if(null!=K.svgThumbs)for(var O=0;O<K.svgThumbs.length;O++)M.push(Editor.createSvgDataUri(K.svgThumbs[O]));null!=K.thumb&&M.push(K.thumb);console.log.apply(console,M)}}catch(ea){}}catch(ea){null!=window.console&&console.error(ea),C(ea)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(H,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",-function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",H,null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,C))}),B)};EditorUi.prototype.createMermaidXml=function(c,f,k,B,z,C){var H=new Graph(document.createElement("div"));-k=H.insertVertex(null,null,null,0,0,B,z,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+k+";");H.setAttributeForCell(k,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=C&&H.setAttributeForCell(k,"templatePrompt",C);c=(new mxCodec).encode(H.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k){var B=0,z=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(C){var H=new mxXmlRequest("https://www.draw.io/generate/v2",-c,"POST"),K=mxUtils.bind(this,function(M){C.clear()&&k(M)});H.send(mxUtils.bind(this,function(M){if(C.isAlive())if(200<=M.getStatus()&&299>=M.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ea=mxUtils.trim(M.getText());this.generateMermaidImage(ea,null,mxUtils.bind(this,function(fa,S,ca){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",ea),f(ea,fa,S,ca))}),K)}),K,mxUtils.bind(this,function(fa){3>-B++?C.clear()&&z():K(fa)}))}),K);else{var O={message:mxResources.get("error")+" "+M.getStatus()};try{O=JSON.parse(M.getText()),O=O.error}catch(ea){}K(O)}}),K)}),k)});z()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("%%");f=1<f.length?f:c.split("(Begins)");c=mxUtils.trim(1>=f.length?c:f[1]);f=c.split("\n");var k=1<f.length?+f,k){var B=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=k?k(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){var C=mxUtils.bind(this,function(L){z.clear()&&B(L)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(z.clear())if("undefined"!==typeof window.LucidImporter)try{var L=JSON.parse(c);f(LucidImporter.importState(L));try{if(null!=window.console&&"1"==urlParams.test){var J=[(new Date).toISOString(),"convertLucidChart",L];null!=L.state&&+J.push(JSON.parse(L.state));if(null!=L.svgThumbs)for(var O=0;O<L.svgThumbs.length;O++)J.push(Editor.createSvgDataUri(L.svgThumbs[O]));null!=L.thumb&&J.push(L.thumb);console.log.apply(console,J)}}catch(da){}}catch(da){null!=window.console&&console.error(da),C(da)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(I,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",+function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",I,null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,C))}),B)};EditorUi.prototype.createMermaidXml=function(c,f,k,B,z,C){var I=new Graph(document.createElement("div"));+k=I.insertVertex(null,null,null,0,0,B,z,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+k+";");I.setAttributeForCell(k,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=C&&I.setAttributeForCell(k,"templatePrompt",C);c=(new mxCodec).encode(I.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k){var B=0,z=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(C){var I=new mxXmlRequest("https://www.draw.io/generate/v2",+c,"POST"),L=mxUtils.bind(this,function(J){C.clear()&&k(J)});I.send(mxUtils.bind(this,function(J){if(C.isAlive())if(200<=J.getStatus()&&299>=J.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var da=mxUtils.trim(J.getText());this.generateMermaidImage(da,null,mxUtils.bind(this,function(fa,V,ba){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",da),f(da,fa,V,ba))}),L)}),L,mxUtils.bind(this,function(fa){3>+B++?C.clear()&&z():L(fa)}))}),L);else{var O={message:mxResources.get("error")+" "+J.getStatus()};try{O=JSON.parse(J.getText()),O=O.error}catch(da){}L(O)}}),L)}),k)});z()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("%%");f=1<f.length?f:c.split("(Begins)");c=mxUtils.trim(1>=f.length?c:f[1]);f=c.split("\n");var k=1<f.length?f[1]:null;if(null!=k){var B=k.indexOf("-");0<B&&(k=k.substring(0,B))}if(0<f.length&&"mermaid"==mxUtils.trim(f[0])||null!=k&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k))f.shift(),c=mxUtils.trim(f.join("\n")),f=c.split("\n");k=f[0].split(" ")[0].replace(/:$/,"");B=k.indexOf("-");0<B&&(k=k.substring(0,B));try{"mindmap"==k&&2<f.length&&(c=extractMermaidMindmap(f))}catch(z){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k)&&(c=null);return c};EditorUi.prototype.generateMermaidImage=function(c,-f,k,B,z){var C=mxUtils.bind(this,function(K){this.loadingMermaid=!1;null!=B?B(K):this.handleError(K)}),H=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;"undefined"!==typeof mxMermaidToDrawio&&f.flowchart&&0<=c.indexOf("$$")&&(f.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(f.theme="dark");var K=mxUtils.bind(this,function(M){try{if(mxClient.IS_IE||mxClient.IS_IE11)M=-M.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var O=mxUtils.parseXml(M).getElementsByTagName("svg");if(0<O.length&&"error"!=O[0].getAttribute("aria-roledescription")){var ea=parseFloat(O[0].getAttribute("width")),fa=parseFloat(O[0].getAttribute("height"));if(isNaN(ea)||isNaN(fa))try{var S=O[0].getAttribute("viewBox").split(/\s+/);ea=parseFloat(S[2]);fa=parseFloat(S[3])}catch(ca){ea=ea||100,fa=fa||100}k(this.convertDataUri(Editor.createSvgDataUri(M)),-ea,fa)}else null!=z?z():B({message:mxResources.get("invalidInput")})}catch(ca){B(ca)}});mermaid.mermaidAPI.initialize(f);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(function(M){K(M.svg)}).catch(function(M){null!=z?z(M):B(M)})}catch(M){B(M)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(H,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(K){this.importXml(K,-null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",H,null,null,null,C)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,C))};EditorUi.prototype.generatePlantUmlImage=function(c,f,k,B){function z(K,M,O){c1=K>>2;c2=(K&3)<<4|M>>4;c3=(M&15)<<2|O>>6;c4=O&63;r="";r+=C(c1&63);r+=C(c2&63);r+=C(c3&63);return r+=C(c4&63)}function C(K){if(10>K)return String.fromCharCode(48+K);K-=10;if(26>K)return String.fromCharCode(65+K);K-=26;if(26>K)return String.fromCharCode(97+-K);K-=26;return 0==K?"-":1==K?"_":"?"}var H=new XMLHttpRequest;H.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(K){r="";for(i=0;i<K.length;i+=3)r=i+2==K.length?r+z(K.charCodeAt(i),K.charCodeAt(i+1),0):i+1==K.length?r+z(K.charCodeAt(i),0,0):r+z(K.charCodeAt(i),K.charCodeAt(i+1),K.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=f&&(H.responseType="blob");H.onload=function(K){if(200<=this.status&&300>this.status)if("txt"==-f)k(this.response);else{var M=new FileReader;M.readAsDataURL(this.response);M.onloadend=function(O){var ea=new Image;ea.onload=function(){try{var fa=ea.width,S=ea.height;if(0==fa&&0==S){var ca=M.result,ma=ca.indexOf(","),la=decodeURIComponent(escape(atob(ca.substring(ma+1)))),Z=mxUtils.parseXml(la).getElementsByTagName("svg");0<Z.length&&(fa=parseFloat(Z[0].getAttribute("width")),S=parseFloat(Z[0].getAttribute("height")))}k(M.result,fa,S)}catch(da){B(da)}};ea.src=M.result};M.onerror=function(O){B(O)}}else B(K)};-H.onerror=function(K){B(K)};H.send()};EditorUi.prototype.insertAsPreText=function(c,f,k){var B=this.editor.graph,z=null;B.getModel().beginUpdate();try{z=B.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),B.updateCellSize(z,!0)}finally{B.getModel().endUpdate()}return z};EditorUi.prototype.insertTextAt=function(c,f,k,B,z,C,H,K){C=null!=C?C:!0;H=null!=H?H:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?-this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(S){4==S.readyState&&200<=S.status&&299>=S.status&&this.editor.graph.setSelectionCells(this.insertTextAt(S.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(z||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var M=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var O=Editor.extractGraphModelFromPdf(c);if(null!=-O&&0<O.length)return this.importXml(O,f,k,C,!0,K)}if(Editor.isPngDataUrl(c)&&(O=Editor.extractGraphModelFromPng(c),null!=O&&0<O.length))return this.importXml(O,f,k,C,!0,K);if("data:image/svg+xml;"==c.substring(0,19))try{O=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(O=c.substring(c.indexOf(",")+1),O=window.atob&&!mxClient.IS_SF?atob(O):Base64.decode(O,!0)):O=decodeURIComponent(c.substring(c.indexOf(",")+1));var ea=this.importXml(O,f,k,C,!0,K);if(0<ea.length)return ea}catch(S){}this.loadImage(c,-mxUtils.bind(this,function(S){if("data:"==c.substring(0,5))this.resizeImage(S,c,mxUtils.bind(this,function(la,Z,da){M.setSelectionCell(M.insertVertex(null,null,"",M.snap(f),M.snap(k),Z,da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(la)+";"))}),H,this.maxImageSize);else{var ca=Math.min(1,Math.min(this.maxImageSize/S.width,this.maxImageSize/S.height)),ma=Math.round(S.width*ca);S=Math.round(S.height*ca);-M.setSelectionCell(M.insertVertex(null,null,"",M.snap(f),M.snap(k),ma,S,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var S=null;M.getModel().beginUpdate();try{S=M.insertVertex(M.getDefaultParent(),null,c,M.snap(f),M.snap(k),1,1,"text;"+(B?"html=1;":"")),M.updateCellSize(S),M.fireEvent(new mxEventObject("textInserted","cells",[S]))}finally{M.getModel().endUpdate()}M.setSelectionCell(S)}))}else{c=-Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,C,null,K);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(S){this.editor.graph.setSelectionCells(this.importXml(S,f,k,C,null,K))}),mxUtils.bind(this,function(S){this.handleError(S)}));else{M=this.editor.graph;z=null;M.getModel().beginUpdate();try{z=M.insertVertex(M.getDefaultParent(),null,"",M.snap(f),M.snap(k),1,1,"text;whiteSpace=wrap;"+(B?"html=1;":""));M.fireEvent(new mxEventObject("textInserted",-"cells",[z]));B&&(c=M.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");z.value=c;M.updateCellSize(z);if(0<this.maxTextWidth&&z.geometry.width>this.maxTextWidth){var fa=M.getPreferredSizeForCell(z,this.maxTextWidth);z.geometry.width=fa.width;z.geometry.height=fa.height}Graph.isLink(z.value)&&M.setLinkForCell(z,z.value);z.geometry.width+=M.gridSize;z.geometry.height+=M.gridSize}finally{M.getModel().endUpdate()}return[z]}}return[]};EditorUi.prototype.formatFileSize=+f,k,B,z){var C=mxUtils.bind(this,function(L){this.loadingMermaid=!1;null!=B?B(L):this.handleError(L)}),I=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;"undefined"!==typeof mxMermaidToDrawio&&f.flowchart&&0<=c.indexOf("$$")&&(f.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(f.theme="dark");var L=mxUtils.bind(this,function(J){try{if(mxClient.IS_IE||mxClient.IS_IE11)J=+J.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var O=mxUtils.parseXml(J).getElementsByTagName("svg");if(0<O.length&&"error"!=O[0].getAttribute("aria-roledescription")){var da=parseFloat(O[0].getAttribute("width")),fa=parseFloat(O[0].getAttribute("height"));if(isNaN(da)||isNaN(fa))try{var V=O[0].getAttribute("viewBox").split(/\s+/);da=parseFloat(V[2]);fa=parseFloat(V[3])}catch(ba){da=da||100,fa=fa||100}k(this.convertDataUri(Editor.createSvgDataUri(J)),+da,fa)}else null!=z?z():B({message:mxResources.get("invalidInput")})}catch(ba){B(ba)}});mermaid.mermaidAPI.initialize(f);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(function(J){L(J.svg)}).catch(function(J){null!=z?z(J):B(J)})}catch(J){B(J)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(I,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(L){this.importXml(L,+null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",I,null,null,null,C)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,C))};EditorUi.prototype.generatePlantUmlImage=function(c,f,k,B){function z(L,J,O){c1=L>>2;c2=(L&3)<<4|J>>4;c3=(J&15)<<2|O>>6;c4=O&63;r="";r+=C(c1&63);r+=C(c2&63);r+=C(c3&63);return r+=C(c4&63)}function C(L){if(10>L)return String.fromCharCode(48+L);L-=10;if(26>L)return String.fromCharCode(65+L);L-=26;if(26>L)return String.fromCharCode(97++L);L-=26;return 0==L?"-":1==L?"_":"?"}var I=new XMLHttpRequest;I.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(L){r="";for(i=0;i<L.length;i+=3)r=i+2==L.length?r+z(L.charCodeAt(i),L.charCodeAt(i+1),0):i+1==L.length?r+z(L.charCodeAt(i),0,0):r+z(L.charCodeAt(i),L.charCodeAt(i+1),L.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=f&&(I.responseType="blob");I.onload=function(L){if(200<=this.status&&300>this.status)if("txt"==+f)k(this.response);else{var J=new FileReader;J.readAsDataURL(this.response);J.onloadend=function(O){var da=new Image;da.onload=function(){try{var fa=da.width,V=da.height;if(0==fa&&0==V){var ba=J.result,ma=ba.indexOf(","),la=decodeURIComponent(escape(atob(ba.substring(ma+1)))),Z=mxUtils.parseXml(la).getElementsByTagName("svg");0<Z.length&&(fa=parseFloat(Z[0].getAttribute("width")),V=parseFloat(Z[0].getAttribute("height")))}k(J.result,fa,V)}catch(ea){B(ea)}};da.src=J.result};J.onerror=function(O){B(O)}}else B(L)};+I.onerror=function(L){B(L)};I.send()};EditorUi.prototype.insertAsPreText=function(c,f,k){var B=this.editor.graph,z=null;B.getModel().beginUpdate();try{z=B.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),B.updateCellSize(z,!0)}finally{B.getModel().endUpdate()}return z};EditorUi.prototype.insertTextAt=function(c,f,k,B,z,C,I,L){C=null!=C?C:!0;I=null!=I?I:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?+this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(V){4==V.readyState&&200<=V.status&&299>=V.status&&this.editor.graph.setSelectionCells(this.insertTextAt(V.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(z||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var J=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var O=Editor.extractGraphModelFromPdf(c);if(null!=+O&&0<O.length)return this.importXml(O,f,k,C,!0,L)}if(Editor.isPngDataUrl(c)&&(O=Editor.extractGraphModelFromPng(c),null!=O&&0<O.length))return this.importXml(O,f,k,C,!0,L);if("data:image/svg+xml;"==c.substring(0,19))try{O=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(O=c.substring(c.indexOf(",")+1),O=window.atob&&!mxClient.IS_SF?atob(O):Base64.decode(O,!0)):O=decodeURIComponent(c.substring(c.indexOf(",")+1));var da=this.importXml(O,f,k,C,!0,L);if(0<da.length)return da}catch(V){}this.loadImage(c,+mxUtils.bind(this,function(V){if("data:"==c.substring(0,5))this.resizeImage(V,c,mxUtils.bind(this,function(la,Z,ea){J.setSelectionCell(J.insertVertex(null,null,"",J.snap(f),J.snap(k),Z,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(la)+";"))}),I,this.maxImageSize);else{var ba=Math.min(1,Math.min(this.maxImageSize/V.width,this.maxImageSize/V.height)),ma=Math.round(V.width*ba);V=Math.round(V.height*ba);+J.setSelectionCell(J.insertVertex(null,null,"",J.snap(f),J.snap(k),ma,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var V=null;J.getModel().beginUpdate();try{V=J.insertVertex(J.getDefaultParent(),null,c,J.snap(f),J.snap(k),1,1,"text;"+(B?"html=1;":"")),J.updateCellSize(V),J.fireEvent(new mxEventObject("textInserted","cells",[V]))}finally{J.getModel().endUpdate()}J.setSelectionCell(V)}))}else{c=+Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,C,null,L);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(V){this.editor.graph.setSelectionCells(this.importXml(V,f,k,C,null,L))}),mxUtils.bind(this,function(V){this.handleError(V)}));else{J=this.editor.graph;z=null;J.getModel().beginUpdate();try{z=J.insertVertex(J.getDefaultParent(),null,"",J.snap(f),J.snap(k),1,1,"text;whiteSpace=wrap;"+(B?"html=1;":""));J.fireEvent(new mxEventObject("textInserted",+"cells",[z]));B&&(c=J.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");z.value=c;J.updateCellSize(z);if(0<this.maxTextWidth&&z.geometry.width>this.maxTextWidth){var fa=J.getPreferredSizeForCell(z,this.maxTextWidth);z.geometry.width=fa.width;z.geometry.height=fa.height}Graph.isLink(z.value)&&J.setLinkForCell(z,z.value);z.geometry.width+=J.gridSize;z.geometry.height+=J.gridSize}finally{J.getModel().endUpdate()}return[z]}}return[]};EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display="none";document.body.appendChild(k);this.importFileInputElt=k}this.importFileInputElt.click()}else{window.openNew=-!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(H,K){StorageFile.listFiles(this,"F",H,K)});window.openBrowserFile=mxUtils.bind(this,function(H,K,M){StorageFile.getFileContent(this,H,K,M)});window.deleteBrowserFile=mxUtils.bind(this,function(H,K,M){StorageFile.deleteFile(this,H,K,M)});if(!f){var B=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(H){this.hideDialog(H)}));window.openFile.setConsumer(mxUtils.bind(this,-function(H,K){null!=K&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(K)?(H=new Blob([H],{type:"application/octet-stream"}),this.importVisio(H,mxUtils.bind(this,function(M){this.importXml(M,0,0,!0)}),null,K)):this.editor.graph.setSelectionCells(this.importXml(H,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var z=this.dialog,C=z.close;this.dialog.close=mxUtils.bind(this,function(H){Editor.useLocalStorage=-B;C.apply(z,arguments);H&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var B=this,z=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(C){if(mxUtils.isEmptyObject(C.files))k();else{var H=0,K,M=!1;C.forEach(function(O,ea){O=ea.name.toLowerCase();"diagram/diagram.xml"==O?(M=!0,ea.async("string").then(function(fa){0==fa.indexOf("<mxfile ")?f(fa):k()})):0==O.indexOf("versions/")&&-(O=parseInt(O.substr(9)),O>H&&(H=O,K=ea))});0<H?K.async("string").then(function(O){(new XMLHttpRequest).upload&&B.isRemoteFileFormat(O,c.name)?B.isOffline()?B.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):B.parseFileData(O,mxUtils.bind(this,function(ea){4==ea.readyState&&(200<=ea.status&&299>=ea.status?f(ea.responseText):k())}),c.name):k()}):M||k()}},function(C){k(C)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?z():(this.loadingExtensions=-!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",z,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,B,z,C,H,K,M,O,ea,fa){O=null!=O?O:!0;var S=!1,ca=null,ma=mxUtils.bind(this,function(la){var Z=null;null!=la&&"<mxlibrary"==la.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,la,H)),this.showSidebar()):Z=this.importXml(la,k,B,O,null,null!=fa?mxEvent.isControlDown(fa):null);null!=K&&K(Z)});"image"==f.substring(0,5)?(M=!1,"image/png"==f.substring(0,9)&&(f=ea?null:this.extractGraphModelFromPng(c),-null!=f&&0<f.length&&(ca=this.importXml(f,k,B,O,null,null!=fa?mxEvent.isControlDown(fa):null),M=!0)),M||(f=this.editor.graph,M=c.indexOf(";"),0<M&&(c=c.substring(0,M)+c.substring(c.indexOf(",",M+1))),O&&f.isGridEnabled()&&(k=f.snap(k),B=f.snap(B)),ca=[f.insertVertex(null,null,"",k,B,z,C,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";")])):/(\.*<graphml )/.test(c)?(S=!0,this.importGraphML(c,ma)):null!=M&&null!=H&&EditorUi.isVisioFilename(H)?-(S=!0,this.importVisio(M,ma)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,H)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(S=!0,z=mxUtils.bind(this,function(la){4==la.readyState&&(200<=la.status&&299>=la.status?ma(la.responseText):null!=K&&(K(null),this.showError(mxResources.get("error"),413==la.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,z,H):this.parseFile(M,z,H)):0==c.indexOf("PK")&&-null!=M?(S=!0,this.importZipFile(M,ma,mxUtils.bind(this,function(){ca=this.insertTextAt(this.validateFileData(c),k,B,!0,null,O);K(ca)}))):/(\.v(sd|dx))($|\?)/i.test(H)||/(\.vs(s|x))($|\?)/i.test(H)||(ca=this.insertTextAt(this.validateFileData(c),k,B,!0,null,O,null,null!=fa?mxEvent.isControlDown(fa):null));S||null==K||K(ca);return ca};EditorUi.prototype.importFiles=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S){B=null!=B?B:this.maxImageSize;O=null!=O?O:this.maxImageBytes;var ca=null!=f&&null!=k,ma=!0;f=null!=-f?f:0;k=null!=k?k:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var Z=ea||this.resampleThreshold,da=0;da<c.length;da++)if("image/svg"!==c[da].type.substring(0,9)&&"image/"===c[da].type.substring(0,6)&&c[da].size>Z){la=!0;break}var aa=mxUtils.bind(this,function(){var l=this.editor.graph,t=l.gridSize;z=null!=z?z:mxUtils.bind(this,function(ba,ja,oa,qa,ra,xa,Ba,ya,Da){try{if(null!=ba&&"<mxlibrary"==ba.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ba,Ba)),this.showSidebar(),-null;this.isCompatibleString(ba)&&1==c.length&&null!=S&&"drop"==S.type&&this.isBlankFile()&&!this.canUndo()&&(ca=!1,qa=oa=0);return this.importFile(ba,ja,oa,qa,ra,xa,Ba,ya,Da,ca,fa,S)}catch(La){return this.handleError(La),null}});C=null!=C?C:mxUtils.bind(this,function(ba){l.setSelectionCells(ba)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var I=c.length,V=I,J=[],W=mxUtils.bind(this,function(ba,ja){J[ba]=ja;if(0==--V){this.spinner.stop();if(null!=K)K(J);else{var oa=[];l.getModel().beginUpdate();-try{for(ba=0;ba<J.length;ba++){var qa=J[ba]();null!=qa&&(oa=oa.concat(qa))}}finally{l.getModel().endUpdate()}}C(oa)}}),Y=0;Y<I;Y++)mxUtils.bind(this,function(ba){var ja=c[ba];if(null!=ja){var oa=new FileReader;oa.onload=mxUtils.bind(this,function(qa){if(null==H||H(ja))try{if("image/"==ja.type.substring(0,6))if("image/svg"==ja.type.substring(0,9)){var ra=Graph.clipSvgDataUri(qa.target.result),xa=ra.indexOf(","),Ba=decodeURIComponent(escape(atob(ra.substring(xa+1)))),ya=mxUtils.parseXml(Ba),Da=ya.getElementsByTagName("svg");-if(0<Da.length){var La=Da[0],sa=fa?null:La.getAttribute("content");null!=sa&&"<"!=sa.charAt(0)&&"%"!=sa.charAt(0)&&(sa=unescape(window.atob?atob(sa):Base64.decode(sa,!0)));null!=sa&&"%"==sa.charAt(0)&&(sa=decodeURIComponent(sa));null==sa||"<mxfile "!==sa.substring(0,8)&&"<mxGraphModel "!==sa.substring(0,14)?W(ba,mxUtils.bind(this,function(){try{if(null!=ya){var Ka=ya.getElementsByTagName("svg");if(0<Ka.length){var Ma=Ka[0],za=Ma.getAttribute("width"),Wa=Ma.getAttribute("height");za=null!=za&&"%"!=-za.charAt(za.length-1)?parseFloat(za):NaN;Wa=null!=Wa&&"%"!=Wa.charAt(Wa.length-1)?parseFloat(Wa):NaN;var Ia=Ma.getAttribute("viewBox");if(null==Ia||0==Ia.length)Ma.setAttribute("viewBox","0 0 "+za+" "+Wa);else if(isNaN(za)||isNaN(Wa)){var Xa=Ia.split(" ");3<Xa.length&&(za=parseFloat(Xa[2]),Wa=parseFloat(Xa[3]))}ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var Pa=Math.min(1,Math.min(B/Math.max(1,za)),B/Math.max(1,Wa)),u=z(ra,ja.type,f+ba*t,k+ba*t,Math.max(1,Math.round(za*Pa)),Math.max(1,Math.round(Wa*-Pa)),ja.name);if(null!=u&&(isNaN(za)||isNaN(Wa))){var N=new Image;N.onload=mxUtils.bind(this,function(){za=Math.max(1,N.width);Wa=Math.max(1,N.height);u[0].geometry.width=za;u[0].geometry.height=Wa;Ma.setAttribute("viewBox","0 0 "+za+" "+Wa);ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var R=ra.indexOf(";");0<R&&(ra=ra.substring(0,R)+ra.substring(ra.indexOf(",",R+1)));l.setCellStyles("image",ra,[u[0]])});N.src=Editor.createSvgDataUri(mxUtils.getXml(Ma))}return u}}}catch(R){}return null})):W(ba,-mxUtils.bind(this,function(){return z(sa,"text/xml",f+ba*t,k+ba*t,0,0,ja.name)}))}else W(ba,mxUtils.bind(this,function(){return null}))}else{xa=!1;if("image/png"==ja.type){var Aa=fa?null:this.extractGraphModelFromPng(qa.target.result);if(null!=Aa&&0<Aa.length){var Ea=new Image;Ea.src=qa.target.result;W(ba,mxUtils.bind(this,function(){return z(Aa,"text/xml",f+ba*t,k+ba*t,Ea.width,Ea.height,ja.name)}));xa=!0}}xa||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),-mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(qa.target.result,mxUtils.bind(this,function(Ka){this.resizeImage(Ka,qa.target.result,mxUtils.bind(this,function(Ma,za,Wa){W(ba,mxUtils.bind(this,function(){if(null!=Ma&&Ma.length<O){var Ia=ma&&this.isResampleImageSize(ja.size,ea)?Math.min(1,Math.min(B/za,B/Wa)):1;return z(Ma,ja.type,f+ba*t,k+ba*t,Math.round(za*Ia),Math.round(Wa*Ia),-ja.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ma,B,ea,ja.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ra=qa.target.result,z(ra,ja.type,f+ba*t,k+ba*t,240,160,ja.name,function(Ka){W(ba,function(){return Ka})},ja)}catch(Ka){W(ba,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ka,ja)}else W(ba,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(ja.name)?-z(null,ja.type,f+ba*t,k+ba*t,240,160,ja.name,function(qa){W(ba,function(){return qa})},ja):"image"==ja.type.substring(0,5)||"application/pdf"==ja.type?oa.readAsDataURL(ja):oa.readAsText(ja)}})(Y)});if(la){la=[];for(da=0;da<c.length;da++)la.push(c[da]);c=la;this.confirmImageResize(function(l){ma=l;aa()},M)}else aa()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=-function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},B=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,z=function(C,H){if(C||f)mxSettings.setResizeImages(C?H:null),mxSettings.save();k();c(H)};null==B||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(C){z(C,!0)},function(C){z(C,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage++!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(I,L){StorageFile.listFiles(this,"F",I,L)});window.openBrowserFile=mxUtils.bind(this,function(I,L,J){StorageFile.getFileContent(this,I,L,J)});window.deleteBrowserFile=mxUtils.bind(this,function(I,L,J){StorageFile.deleteFile(this,I,L,J)});if(!f){var B=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(I){this.hideDialog(I)}));window.openFile.setConsumer(mxUtils.bind(this,+function(I,L){null!=L&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(L)?(I=new Blob([I],{type:"application/octet-stream"}),this.importVisio(I,mxUtils.bind(this,function(J){this.importXml(J,0,0,!0)}),null,L)):this.editor.graph.setSelectionCells(this.importXml(I,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var z=this.dialog,C=z.close;this.dialog.close=mxUtils.bind(this,function(I){Editor.useLocalStorage=+B;C.apply(z,arguments);I&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var B=this,z=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(C){if(mxUtils.isEmptyObject(C.files))k();else{var I=0,L,J=!1;C.forEach(function(O,da){O=da.name.toLowerCase();"diagram/diagram.xml"==O?(J=!0,da.async("string").then(function(fa){0==fa.indexOf("<mxfile ")?f(fa):k()})):0==O.indexOf("versions/")&&+(O=parseInt(O.substr(9)),O>I&&(I=O,L=da))});0<I?L.async("string").then(function(O){(new XMLHttpRequest).upload&&B.isRemoteFileFormat(O,c.name)?B.isOffline()?B.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):B.parseFileData(O,mxUtils.bind(this,function(da){4==da.readyState&&(200<=da.status&&299>=da.status?f(da.responseText):k())}),c.name):k()}):J||k()}},function(C){k(C)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?z():(this.loadingExtensions=+!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",z,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,B,z,C,I,L,J,O,da,fa){O=null!=O?O:!0;var V=!1,ba=null,ma=mxUtils.bind(this,function(la){var Z=null;null!=la&&"<mxlibrary"==la.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,la,I)),this.showSidebar()):Z=this.importXml(la,k,B,O,null,null!=fa?mxEvent.isControlDown(fa):null);null!=L&&L(Z)});"image"==f.substring(0,5)?(J=!1,"image/png"==f.substring(0,9)&&(f=da?null:this.extractGraphModelFromPng(c),+null!=f&&0<f.length&&(ba=this.importXml(f,k,B,O,null,null!=fa?mxEvent.isControlDown(fa):null),J=!0)),J||(f=this.editor.graph,J=c.indexOf(";"),0<J&&(c=c.substring(0,J)+c.substring(c.indexOf(",",J+1))),O&&f.isGridEnabled()&&(k=f.snap(k),B=f.snap(B)),ba=[f.insertVertex(null,null,"",k,B,z,C,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";")])):/(\.*<graphml )/.test(c)?(V=!0,this.importGraphML(c,ma)):null!=J&&null!=I&&EditorUi.isVisioFilename(I)?+(V=!0,this.importVisio(J,ma)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,I)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(V=!0,z=mxUtils.bind(this,function(la){4==la.readyState&&(200<=la.status&&299>=la.status?ma(la.responseText):null!=L&&(L(null),this.showError(mxResources.get("error"),413==la.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,z,I):this.parseFile(J,z,I)):0==c.indexOf("PK")&&+null!=J?(V=!0,this.importZipFile(J,ma,mxUtils.bind(this,function(){ba=this.insertTextAt(this.validateFileData(c),k,B,!0,null,O);L(ba)}))):/(\.v(sd|dx))($|\?)/i.test(I)||/(\.vs(s|x))($|\?)/i.test(I)||(ba=this.insertTextAt(this.validateFileData(c),k,B,!0,null,O,null,null!=fa?mxEvent.isControlDown(fa):null));V||null==L||L(ba);return ba};EditorUi.prototype.importFiles=function(c,f,k,B,z,C,I,L,J,O,da,fa,V){B=null!=B?B:this.maxImageSize;O=null!=O?O:this.maxImageBytes;var ba=null!=f&&null!=k,ma=!0;f=null!=+f?f:0;k=null!=k?k:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var Z=da||this.resampleThreshold,ea=0;ea<c.length;ea++)if("image/svg"!==c[ea].type.substring(0,9)&&"image/"===c[ea].type.substring(0,6)&&c[ea].size>Z){la=!0;break}var aa=mxUtils.bind(this,function(){var l=this.editor.graph,t=l.gridSize;z=null!=z?z:mxUtils.bind(this,function(ca,ja,oa,qa,ra,xa,Ba,ya,Da){try{if(null!=ca&&"<mxlibrary"==ca.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ca,Ba)),this.showSidebar(),+null;this.isCompatibleString(ca)&&1==c.length&&null!=V&&"drop"==V.type&&this.isBlankFile()&&!this.canUndo()&&(ba=!1,qa=oa=0);return this.importFile(ca,ja,oa,qa,ra,xa,Ba,ya,Da,ba,fa,V)}catch(La){return this.handleError(La),null}});C=null!=C?C:mxUtils.bind(this,function(ca){l.setSelectionCells(ca)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var H=c.length,U=H,K=[],W=mxUtils.bind(this,function(ca,ja){K[ca]=ja;if(0==--U){this.spinner.stop();if(null!=L)L(K);else{var oa=[];l.getModel().beginUpdate();+try{for(ca=0;ca<K.length;ca++){var qa=K[ca]();null!=qa&&(oa=oa.concat(qa))}}finally{l.getModel().endUpdate()}}C(oa)}}),Y=0;Y<H;Y++)mxUtils.bind(this,function(ca){var ja=c[ca];if(null!=ja){var oa=new FileReader;oa.onload=mxUtils.bind(this,function(qa){if(null==I||I(ja))try{if("image/"==ja.type.substring(0,6))if("image/svg"==ja.type.substring(0,9)){var ra=Graph.clipSvgDataUri(qa.target.result),xa=ra.indexOf(","),Ba=decodeURIComponent(escape(atob(ra.substring(xa+1)))),ya=mxUtils.parseXml(Ba),Da=ya.getElementsByTagName("svg");+if(0<Da.length){var La=Da[0],sa=fa?null:La.getAttribute("content");null!=sa&&"<"!=sa.charAt(0)&&"%"!=sa.charAt(0)&&(sa=unescape(window.atob?atob(sa):Base64.decode(sa,!0)));null!=sa&&"%"==sa.charAt(0)&&(sa=decodeURIComponent(sa));null==sa||"<mxfile "!==sa.substring(0,8)&&"<mxGraphModel "!==sa.substring(0,14)?W(ca,mxUtils.bind(this,function(){try{if(null!=ya){var Ka=ya.getElementsByTagName("svg");if(0<Ka.length){var Ma=Ka[0],za=Ma.getAttribute("width"),Wa=Ma.getAttribute("height");za=null!=za&&"%"!=+za.charAt(za.length-1)?parseFloat(za):NaN;Wa=null!=Wa&&"%"!=Wa.charAt(Wa.length-1)?parseFloat(Wa):NaN;var Ia=Ma.getAttribute("viewBox");if(null==Ia||0==Ia.length)Ma.setAttribute("viewBox","0 0 "+za+" "+Wa);else if(isNaN(za)||isNaN(Wa)){var Xa=Ia.split(" ");3<Xa.length&&(za=parseFloat(Xa[2]),Wa=parseFloat(Xa[3]))}ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var Pa=Math.min(1,Math.min(B/Math.max(1,za)),B/Math.max(1,Wa)),u=z(ra,ja.type,f+ca*t,k+ca*t,Math.max(1,Math.round(za*Pa)),Math.max(1,Math.round(Wa*+Pa)),ja.name);if(null!=u&&(isNaN(za)||isNaN(Wa))){var N=new Image;N.onload=mxUtils.bind(this,function(){za=Math.max(1,N.width);Wa=Math.max(1,N.height);u[0].geometry.width=za;u[0].geometry.height=Wa;Ma.setAttribute("viewBox","0 0 "+za+" "+Wa);ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var R=ra.indexOf(";");0<R&&(ra=ra.substring(0,R)+ra.substring(ra.indexOf(",",R+1)));l.setCellStyles("image",ra,[u[0]])});N.src=Editor.createSvgDataUri(mxUtils.getXml(Ma))}return u}}}catch(R){}return null})):W(ca,+mxUtils.bind(this,function(){return z(sa,"text/xml",f+ca*t,k+ca*t,0,0,ja.name)}))}else W(ca,mxUtils.bind(this,function(){return null}))}else{xa=!1;if("image/png"==ja.type){var Aa=fa?null:this.extractGraphModelFromPng(qa.target.result);if(null!=Aa&&0<Aa.length){var Ea=new Image;Ea.src=qa.target.result;W(ca,mxUtils.bind(this,function(){return z(Aa,"text/xml",f+ca*t,k+ca*t,Ea.width,Ea.height,ja.name)}));xa=!0}}xa||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),+mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(qa.target.result,mxUtils.bind(this,function(Ka){this.resizeImage(Ka,qa.target.result,mxUtils.bind(this,function(Ma,za,Wa){W(ca,mxUtils.bind(this,function(){if(null!=Ma&&Ma.length<O){var Ia=ma&&this.isResampleImageSize(ja.size,da)?Math.min(1,Math.min(B/za,B/Wa)):1;return z(Ma,ja.type,f+ca*t,k+ca*t,Math.round(za*Ia),Math.round(Wa*Ia),+ja.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ma,B,da,ja.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ra=qa.target.result,z(ra,ja.type,f+ca*t,k+ca*t,240,160,ja.name,function(Ka){W(ca,function(){return Ka})},ja)}catch(Ka){W(ca,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ka,ja)}else W(ca,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(ja.name)?+z(null,ja.type,f+ca*t,k+ca*t,240,160,ja.name,function(qa){W(ca,function(){return qa})},ja):"image"==ja.type.substring(0,5)||"application/pdf"==ja.type?oa.readAsDataURL(ja):oa.readAsText(ja)}})(Y)});if(la){la=[];for(ea=0;ea<c.length;ea++)la.push(c[ea]);c=la;this.confirmImageResize(function(l){ma=l;aa()},J)}else aa()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=+function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},B=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,z=function(C,I){if(C||f)mxSettings.setResizeImages(C?I:null),mxSettings.save();k();c(I)};null==B||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(C){z(C,!0)},function(C){z(C,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):z(!1,B)};EditorUi.prototype.parseFile=function(c,f,k){k=null!=k?k:c.name;var B=new FileReader;B.onload=mxUtils.bind(this,function(){this.parseFileData(B.result,f,k)});B.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,k){var B=new XMLHttpRequest;B.open("POST",OPEN_URL);B.setRequestHeader("Content-Type","application/x-www-form-urlencoded");-B.onreadystatechange=function(){f(B)};B.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(z){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,B,z,C,H){z=null!=z?z:this.maxImageSize;var K=Math.max(1,c.width),M=Math.max(1,c.height),O=f;if(B&&this.isResampleImageSize(null!=H?H:f.length,-C))try{var ea=Math.max(K/z,M/z);if(1<ea){var fa=Math.round(K/ea),S=Math.round(M/ea),ca=document.createElement("canvas");ca.width=fa;ca.height=S;ca.getContext("2d").drawImage(c,0,0,fa,S);var ma=ca.toDataURL();if(ma.length<f.length){var la=document.createElement("canvas");la.width=fa;la.height=S;var Z=la.toDataURL();ma!==Z&&(f=ma,K=fa,M=S)}}}catch(da){}B&&O!=f&&z>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,B,z/1.5,C,H):k(f,K,M)};EditorUi.prototype.extractGraphModelFromPng=+B.onreadystatechange=function(){f(B)};B.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(z){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,B,z,C,I){z=null!=z?z:this.maxImageSize;var L=Math.max(1,c.width),J=Math.max(1,c.height),O=f;if(B&&this.isResampleImageSize(null!=I?I:f.length,+C))try{var da=Math.max(L/z,J/z);if(1<da){var fa=Math.round(L/da),V=Math.round(J/da),ba=document.createElement("canvas");ba.width=fa;ba.height=V;ba.getContext("2d").drawImage(c,0,0,fa,V);var ma=ba.toDataURL();if(ma.length<f.length){var la=document.createElement("canvas");la.width=fa;la.height=V;var Z=la.toDataURL();ma!==Z&&(f=ma,L=fa,J=V)}}}catch(ea){}B&&O!=f&&z>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,B,z/1.5,C,I):k(f,L,J)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var B=new Image;B.onload=function(){B.width=0<B.width?B.width:120;B.height=0<B.height?B.height:120;f(B)};null!=k&&(B.onerror=k);B.src=c}catch(z){if(null!=k)k(z);else throw z;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var v=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());v.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var p=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();-var c=this,f=this.editor.graph,k=f.isEnabled;f.isEnabled=function(){return k.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(t){var I=t.getEvent();return null==t.getState()&&!mxEvent.isMouseEvent(I)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(I)&&(null==t.getState()||mxEvent.isControlDown(I)||mxEvent.isShiftDown(I))});f.cellEditor.editPlantUmlData=function(t,I,V){var J=JSON.parse(V);I=new TextareaDialog(c,mxResources.get("plantUml")+":",J.data,-function(W){null!=W&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(W,J.format,function(Y,ba,ja){c.spinner.stop();f.getModel().beginUpdate();try{if("txt"==J.format)f.labelChanged(t,"<pre>"+Y+"</pre>"),f.updateCellSize(t,!0);else{f.setCellStyles("image",c.convertDataUri(Y),[t]);var oa=f.model.getGeometry(t);null!=oa&&(oa=oa.clone(),oa.width=ba,oa.height=ja,f.cellsResized([t],[oa],!1))}f.setAttributeForCell(t,"plantUmlData",JSON.stringify({data:W,format:J.format}))}finally{f.getModel().endUpdate()}},-function(Y){c.handleError(Y)})},null,null,400,220);c.showDialog(I.container,420,300,!0,!0);I.init()};f.cellEditor.editMermaidData=function(t,I,V){var J=JSON.parse(V);I=new TextareaDialog(c,mxResources.get("mermaid")+":",J.data,function(W){null!=W&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(W,J.config,function(Y,ba,ja){c.spinner.stop();f.getModel().beginUpdate();try{f.setCellStyles("image",Y,[t]);var oa=f.model.getGeometry(t);null!=oa&&(oa=oa.clone(),oa.width=-Math.max(oa.width,ba),oa.height=Math.max(oa.height,ja),f.cellsResized([t],[oa],!1));f.setAttributeForCell(t,"mermaidData",JSON.stringify({data:W,config:J.config},null,2))}finally{f.getModel().endUpdate()}},function(Y){c.handleError(Y)})},null,null,400,220);c.showDialog(I.container,420,300,!0,!0);I.init()};var B=f.cellEditor.startEditing;f.cellEditor.startEditing=function(t,I){try{var V=this.graph.getAttributeForCell(t,"plantUmlData");if(null!=V)this.editPlantUmlData(t,I,V);else if(V=this.graph.getAttributeForCell(t,-"mermaidData"),null!=V&&window.isMermaidEnabled)this.editMermaidData(t,I,V);else{var J=f.getCellStyle(t);"1"==mxUtils.getValue(J,"metaEdit","0")?c.showDataDialog(t):B.apply(this,arguments)}}catch(W){c.handleError(W)}};f.getLinkTitle=function(t){return c.getLinkTitle(t)};f.customLinkClicked=function(t,I){var V=!1;try{var J=this.getGraphBounds();c.handleCustomLink(t,I);V=!0;c.chromelessResize&&!J.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(I))}catch(W){c.handleError(W)}return V};-var z=f.parseBackgroundImage;f.parseBackgroundImage=function(t){var I=z.apply(this,arguments);null!=I&&null!=I.src&&Graph.isPageLink(I.src)&&(I={originalSrc:I.src});return I};var C=f.setBackgroundImage;f.setBackgroundImage=function(t){null!=t&&null!=t.originalSrc&&(t=c.createImageForPageLink(t.originalSrc,c.currentPage,this));C.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,-function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(t,I){t=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=t){var V=t.indexOf(",");if(0<V)for(t=t.substring(V+1),I=I.getProperty("patches"),V=0;V<I.length;V++)if(null!=I[V][EditorUi.DIFF_UPDATE]&&null!=I[V][EditorUi.DIFF_UPDATE][t]||null!=I[V][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(I[V][EditorUi.DIFF_REMOVE],t)){f.refreshBackgroundImage();break}}}));var H=f.getBackgroundImageObject;-f.getBackgroundImageObject=function(t,I){var V=H.apply(this,arguments);null!=V&&null!=V.originalSrc&&(V=I?c.createImageForPageLink(V.originalSrc,null,null,!0):{src:V.originalSrc});return V};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";-var K=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(t){t=null!=t?t:"";"1"==urlParams.dev&&(t+=(0<t.length?"&":"?")+"dev=1");return K.apply(this,arguments)};var M=f.addClickHandler;f.addClickHandler=function(t,I,V){var J=I;I=function(W,Y,ba){if(null==Y){var ja=mxEvent.getSource(W);"a"==ja.nodeName.toLowerCase()&&(Y=ja.getAttribute("href"))}null!=Y&&f.isCustomLink(Y)&&(mxEvent.isTouchEvent(W)||!mxEvent.isPopupTrigger(W))&&f.customLinkClicked(Y,ba)&&mxEvent.consume(W);null!=J&&J(W,Y,-ba)};M.call(this,t,I,V)};p.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var O=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(t,I,V){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(t,["zoomIn","zoomOut","-"],null,V);O.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(t,["-","addToScratchpad"],null,V);f.isSelectionEmpty()&&-"simple"==Editor.currentTheme&&this.addMenuItems(t,["-","exitGroup","home"],null,V)};var ea=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(t,I,V){if(c.editor.graph.isSelectionEmpty())ea.apply(this,arguments),c.menus.addMenuItems(t,["copyAsImage"],null,V);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(t,I,V):this.addPopupMenuArrangeItems(t,I,V),this.addMenuItems(t,"- cut copy copyAsImage duplicate -".split(" "),null,V),this.isShowCellEditItems()||this.addPopupDeleteItem(t,-I,V),this.addMenuItems(t,["lockUnlock","-"],null,V),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(I)&&f.isCellEditable(I)&&(this.addSubmenu("editCell",t,null,mxResources.get("edit")),t.addSeparator(),f.getModel().isEdge(I))){this.addSubmenu("line",t);var J=f.getModel().getGeometry(I);null!=J&&null!=J.points&&0<J.points.length&&this.addMenuItems(t,["clearWaypoints"],null,V)}1==f.getSelectionCount()&&this.addMenuItems(t,["enterGroup"],null,V);J=c.getSelectionState();null!=J.mergeCell?-this.addMenuItem(t,"mergeCells"):(1<J.style.colspan||1<J.style.rowspan)&&this.addMenuItem(t,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.defaultFilename=mxResources.get("untitledDiagram");var fa=-f.getExportVariables;f.getExportVariables=function(){var t=fa.apply(this,arguments),I=c.getCurrentFile();null!=I&&(t.filename=I.getTitle());t.pagecount=null!=c.pages?c.pages.length:1;t.page=null!=c.currentPage?c.currentPage.getName():"";t.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return t};var S=f.getGlobalVariable;f.getGlobalVariable=function(t){var I=c.getCurrentFile();return"filename"==t&&null!=I?I.getTitle():"page"==t&&null!=c.currentPage?c.currentPage.getName():-"pagenumber"==t?null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==t?null!=c.pages?c.pages.length:1:S.apply(this,arguments)};var ca=null,ma=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var t=this.getCurrentFile(),I=null!=t&&null!=t.getTitle()?t.getTitle():this.defaultFilename;ca!=I&&t==ma&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());ca=I;ma=t}));var la=f.labelLinkClicked;f.labelLinkClicked=function(t,-I,V){var J=I.getAttribute("href");if(null==J||!f.isCustomLink(J)||!mxEvent.isTouchEvent(V)&&mxEvent.isPopupTrigger(V))la.apply(this,arguments);else{if(!f.isEnabled()||null!=t&&f.isCellLocked(t.cell))f.customLinkClicked(J),f.getRubberband().reset();mxEvent.consume(V)}};this.editor.getOrCreateFilename=function(){var t=c.defaultFilename,I=c.getCurrentFile();null!=I&&(t=null!=I.getTitle()?I.getTitle():t);return t};var Z=this.actions.get("print");Z.setEnabled(!mxClient.IS_IOS||!navigator.standalone);Z.visible=+var c=this,f=this.editor.graph,k=f.isEnabled;f.isEnabled=function(){return k.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(t){var H=t.getEvent();return null==t.getState()&&!mxEvent.isMouseEvent(H)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(H)&&(null==t.getState()||mxEvent.isControlDown(H)||mxEvent.isShiftDown(H))});f.cellEditor.editPlantUmlData=function(t,H,U){var K=JSON.parse(U);H=new TextareaDialog(c,mxResources.get("plantUml")+":",K.data,+function(W){null!=W&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(W,K.format,function(Y,ca,ja){c.spinner.stop();f.getModel().beginUpdate();try{if("txt"==K.format)f.labelChanged(t,"<pre>"+Y+"</pre>"),f.updateCellSize(t,!0);else{f.setCellStyles("image",c.convertDataUri(Y),[t]);var oa=f.model.getGeometry(t);null!=oa&&(oa=oa.clone(),oa.width=ca,oa.height=ja,f.cellsResized([t],[oa],!1))}f.setAttributeForCell(t,"plantUmlData",JSON.stringify({data:W,format:K.format}))}finally{f.getModel().endUpdate()}},+function(Y){c.handleError(Y)})},null,null,400,220);c.showDialog(H.container,420,300,!0,!0);H.init()};f.cellEditor.editMermaidData=function(t,H,U){var K=JSON.parse(U);H=new TextareaDialog(c,mxResources.get("mermaid")+":",K.data,function(W){null!=W&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(W,K.config,function(Y,ca,ja){c.spinner.stop();f.getModel().beginUpdate();try{f.setCellStyles("image",Y,[t]);var oa=f.model.getGeometry(t);null!=oa&&(oa=oa.clone(),oa.width=+Math.max(oa.width,ca),oa.height=Math.max(oa.height,ja),f.cellsResized([t],[oa],!1));f.setAttributeForCell(t,"mermaidData",JSON.stringify({data:W,config:K.config},null,2))}finally{f.getModel().endUpdate()}},function(Y){c.handleError(Y)})},null,null,400,220);c.showDialog(H.container,420,300,!0,!0);H.init()};var B=f.cellEditor.startEditing;f.cellEditor.startEditing=function(t,H){try{var U=this.graph.getAttributeForCell(t,"plantUmlData");if(null!=U)this.editPlantUmlData(t,H,U);else if(U=this.graph.getAttributeForCell(t,+"mermaidData"),null!=U&&window.isMermaidEnabled)this.editMermaidData(t,H,U);else{var K=f.getCellStyle(t);"1"==mxUtils.getValue(K,"metaEdit","0")?c.showDataDialog(t):B.apply(this,arguments)}}catch(W){c.handleError(W)}};f.getLinkTitle=function(t){return c.getLinkTitle(t)};f.customLinkClicked=function(t,H){var U=!1;try{var K=this.getGraphBounds();c.handleCustomLink(t,H);U=!0;c.chromelessResize&&!K.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(H))}catch(W){c.handleError(W)}return U};+var z=f.parseBackgroundImage;f.parseBackgroundImage=function(t){var H=z.apply(this,arguments);null!=H&&null!=H.src&&Graph.isPageLink(H.src)&&(H={originalSrc:H.src});return H};var C=f.setBackgroundImage;f.setBackgroundImage=function(t){null!=t&&null!=t.originalSrc&&(t=c.createImageForPageLink(t.originalSrc,c.currentPage,this));C.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,+function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(t,H){t=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=t){var U=t.indexOf(",");if(0<U)for(t=t.substring(U+1),H=H.getProperty("patches"),U=0;U<H.length;U++)if(null!=H[U][EditorUi.DIFF_UPDATE]&&null!=H[U][EditorUi.DIFF_UPDATE][t]||null!=H[U][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(H[U][EditorUi.DIFF_REMOVE],t)){f.refreshBackgroundImage();break}}}));var I=f.getBackgroundImageObject;+f.getBackgroundImageObject=function(t,H){var U=I.apply(this,arguments);null!=U&&null!=U.originalSrc&&(U=H?c.createImageForPageLink(U.originalSrc,null,null,!0):{src:U.originalSrc});return U};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";+var L=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(t){t=null!=t?t:"";"1"==urlParams.dev&&(t+=(0<t.length?"&":"?")+"dev=1");return L.apply(this,arguments)};var J=f.addClickHandler;f.addClickHandler=function(t,H,U){var K=H;H=function(W,Y,ca){if(null==Y){var ja=mxEvent.getSource(W);"a"==ja.nodeName.toLowerCase()&&(Y=ja.getAttribute("href"))}null!=Y&&f.isCustomLink(Y)&&(mxEvent.isTouchEvent(W)||!mxEvent.isPopupTrigger(W))&&f.customLinkClicked(Y,ca)&&mxEvent.consume(W);null!=K&&K(W,Y,+ca)};J.call(this,t,H,U)};p.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var O=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(t,H,U){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(t,["zoomIn","zoomOut","-"],null,U);O.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(t,["-","addToScratchpad"],null,U);f.isSelectionEmpty()&&+"simple"==Editor.currentTheme&&this.addMenuItems(t,["-","exitGroup","home"],null,U)};var da=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(t,H,U){if(c.editor.graph.isSelectionEmpty())da.apply(this,arguments),c.menus.addMenuItems(t,["copyAsImage"],null,U);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(t,H,U):this.addPopupMenuArrangeItems(t,H,U),this.addMenuItems(t,"- cut copy copyAsImage duplicate -".split(" "),null,U),this.isShowCellEditItems()||this.addPopupDeleteItem(t,+H,U),this.addMenuItems(t,["lockUnlock","-"],null,U),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(H)&&f.isCellEditable(H)&&(this.addSubmenu("editCell",t,null,mxResources.get("edit")),t.addSeparator(),f.getModel().isEdge(H))){this.addSubmenu("line",t);var K=f.getModel().getGeometry(H);null!=K&&null!=K.points&&0<K.points.length&&this.addMenuItems(t,["clearWaypoints"],null,U)}1==f.getSelectionCount()&&this.addMenuItems(t,["enterGroup"],null,U);K=c.getSelectionState();null!=K.mergeCell?+this.addMenuItem(t,"mergeCells"):(1<K.style.colspan||1<K.style.rowspan)&&this.addMenuItem(t,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.defaultFilename=mxResources.get("untitledDiagram");var fa=+f.getExportVariables;f.getExportVariables=function(){var t=fa.apply(this,arguments),H=c.getCurrentFile();null!=H&&(t.filename=H.getTitle());t.pagecount=null!=c.pages?c.pages.length:1;t.page=null!=c.currentPage?c.currentPage.getName():"";t.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return t};var V=f.getGlobalVariable;f.getGlobalVariable=function(t){var H=c.getCurrentFile();return"filename"==t&&null!=H?H.getTitle():"page"==t&&null!=c.currentPage?c.currentPage.getName():+"pagenumber"==t?null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==t?null!=c.pages?c.pages.length:1:V.apply(this,arguments)};var ba=null,ma=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var t=this.getCurrentFile(),H=null!=t&&null!=t.getTitle()?t.getTitle():this.defaultFilename;ba!=H&&t==ma&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());ba=H;ma=t}));var la=f.labelLinkClicked;f.labelLinkClicked=function(t,+H,U){var K=H.getAttribute("href");if(null==K||!f.isCustomLink(K)||!mxEvent.isTouchEvent(U)&&mxEvent.isPopupTrigger(U))la.apply(this,arguments);else{if(!f.isEnabled()||null!=t&&f.isCellLocked(t.cell))f.customLinkClicked(K),f.getRubberband().reset();mxEvent.consume(U)}};this.editor.getOrCreateFilename=function(){var t=c.defaultFilename,H=c.getCurrentFile();null!=H&&(t=null!=H.getTitle()?H.getTitle():t);return t};var Z=this.actions.get("print");Z.setEnabled(!mxClient.IS_IOS||!navigator.standalone);Z.visible=Z.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,-!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&f.addListener(mxEvent.ESCAPE,function(t,I){null!=I&&f.isEnabled()&&!f.isEditing()&&null!=I.getProperty("event")&&c.actions.get("exit").funct()}),this.installImagePasteHandler(),this.installNativeClipboardHandler();-this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateUserElement()}));this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(t){var I=f.cellEditor.text2,V=null;null!=I&&(mxEvent.addListener(I,"dragleave",function(J){null!=V&&(V.parentNode.removeChild(V),V=null);J.stopPropagation();J.preventDefault()}),mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(J){null==V&&(!mxClient.IS_IE||10<document.documentMode)&&-(V=this.highlightElement(I));J.stopPropagation();J.preventDefault()})),mxEvent.addListener(I,"drop",mxUtils.bind(this,function(J){null!=V&&(V.parentNode.removeChild(V),V=null);if(0<J.dataTransfer.files.length)this.importFiles(J.dataTransfer.files,0,0,this.maxImageSize,function(Y,ba,ja,oa,qa,ra){f.insertImage(Y,qa,ra)},function(){},function(Y){return"image/"==Y.type.substring(0,6)},function(Y){for(var ba=0;ba<Y.length;ba++)Y[ba]()},mxEvent.isControlDown(J));else if(0<=mxUtils.indexOf(J.dataTransfer.types,-"text/uri-list")){var W=J.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(W)?this.loadImage(decodeURIComponent(W),mxUtils.bind(this,function(Y){var ba=Math.max(1,Y.width);Y=Math.max(1,Y.height);var ja=this.maxImageSize;ja=Math.min(1,Math.min(ja/Math.max(1,ba)),ja/Math.max(1,Y));f.insertImage(decodeURIComponent(W),ba*ja,Y*ja)})):document.execCommand("insertHTML",!1,J.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(J.dataTransfer.types,"text/html")?document.execCommand("insertHTML",-!1,J.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(J.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,J.dataTransfer.getData("text/plain"));J.stopPropagation();J.preventDefault()})))}));if(Editor.isSettingsEnabled()){Z=this.editor.graph.view;var da=mxSettings.getUnit();Z.setUnit(da);Editor.pageSizeUnit=da==mxConstants.METERS?mxConstants.MILLIMETERS:da;Z.addListener("unitChanged",function(t,I){t=I.getProperty("unit");mxSettings.setUnit(t);mxSettings.save();Editor.pageSizeUnit=+!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&f.addListener(mxEvent.ESCAPE,function(t,H){null!=H&&f.isEnabled()&&!f.isEditing()&&null!=H.getProperty("event")&&c.actions.get("exit").funct()}),this.installImagePasteHandler(),this.installNativeClipboardHandler();+this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateUserElement()}));this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(t){var H=f.cellEditor.text2,U=null;null!=H&&(mxEvent.addListener(H,"dragleave",function(K){null!=U&&(U.parentNode.removeChild(U),U=null);K.stopPropagation();K.preventDefault()}),mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(K){null==U&&(!mxClient.IS_IE||10<document.documentMode)&&+(U=this.highlightElement(H));K.stopPropagation();K.preventDefault()})),mxEvent.addListener(H,"drop",mxUtils.bind(this,function(K){null!=U&&(U.parentNode.removeChild(U),U=null);if(0<K.dataTransfer.files.length)this.importFiles(K.dataTransfer.files,0,0,this.maxImageSize,function(Y,ca,ja,oa,qa,ra){f.insertImage(Y,qa,ra)},function(){},function(Y){return"image/"==Y.type.substring(0,6)},function(Y){for(var ca=0;ca<Y.length;ca++)Y[ca]()},mxEvent.isControlDown(K));else if(0<=mxUtils.indexOf(K.dataTransfer.types,+"text/uri-list")){var W=K.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(W)?this.loadImage(decodeURIComponent(W),mxUtils.bind(this,function(Y){var ca=Math.max(1,Y.width);Y=Math.max(1,Y.height);var ja=this.maxImageSize;ja=Math.min(1,Math.min(ja/Math.max(1,ca)),ja/Math.max(1,Y));f.insertImage(decodeURIComponent(W),ca*ja,Y*ja)})):document.execCommand("insertHTML",!1,K.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(K.dataTransfer.types,"text/html")?document.execCommand("insertHTML",+!1,K.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(K.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,K.dataTransfer.getData("text/plain"));K.stopPropagation();K.preventDefault()})))}));if(Editor.isSettingsEnabled()){Z=this.editor.graph.view;var ea=mxSettings.getUnit();Z.setUnit(ea);Editor.pageSizeUnit=ea==mxConstants.METERS?mxConstants.MILLIMETERS:ea;Z.addListener("unitChanged",function(t,H){t=H.getProperty("unit");mxSettings.setUnit(t);mxSettings.save();Editor.pageSizeUnit=t==mxConstants.METERS?mxConstants.MILLIMETERS:t});this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,Z.unit);this.refresh()}if("1"==urlParams.styledev){Z=document.getElementById("geFooter");null!=Z&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",-this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),Z.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(t,I){0<this.editor.graph.getSelectionCount()?(t=this.editor.graph.getSelectionCell(),+this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),Z.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(t,H){0<this.editor.graph.getSelectionCount()?(t=this.editor.graph.getSelectionCell(),t=this.editor.graph.getModel().getStyle(t),this.styleInput.value=t||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var aa=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==this.styleInput?!0:aa.apply(this,arguments)}}Z=document.getElementById("geInfo");null!=Z&&Z.parentNode.removeChild(Z);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var l=null;mxEvent.addListener(f.container,"dragleave",-function(t){f.isEnabled()&&(null!=l&&(l.parentNode.removeChild(l),l=null),t.stopPropagation(),t.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(t){null==l&&(!mxClient.IS_IE||10<document.documentMode)&&(l=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();t.stopPropagation();t.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(t){null!=l&&(l.parentNode.removeChild(l),l=null);if(f.isEnabled()){var I=-mxUtils.convertPoint(f.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),V=t.dataTransfer.files,J=f.view.translate,W=f.view.scale,Y=I.x/W-J.x,ba=I.y/W-J.y;if(0<V.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(t)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(V,!0)):(mxEvent.isAltDown(t)&&(ba=Y=null),this.importFiles(V,Y,ba,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(t),null,null,mxEvent.isShiftDown(t),t));else{mxEvent.isAltDown(t)&&-(ba=Y=0);var ja=0<=mxUtils.indexOf(t.dataTransfer.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):null;I=this.extractGraphModelFromEvent(t,null!=this.pages);if(null!=I)f.setSelectionCells(this.importXml(I,Y,ba,!0));else if(0<=mxUtils.indexOf(t.dataTransfer.types,"text/html")){var oa=t.dataTransfer.getData("text/html");I=document.createElement("div");I.innerHTML=Graph.sanitizeHtml(oa);var qa=null;V=I.getElementsByTagName("img");null!=V&&1==V.length?(oa=V[0].getAttribute("src"),null==-oa&&(oa=V[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(oa)||(qa=!0)):(V=I.getElementsByTagName("a"),null!=V&&1==V.length?oa=V[0].getAttribute("href"):(I=I.getElementsByTagName("pre"),null!=I&&1==I.length&&(oa=mxUtils.getTextContent(I[0]))));var ra=!0,xa=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(oa,Y,ba,!0,qa,null,ra,mxEvent.isControlDown(t)))});qa&&null!=oa&&oa.length>this.resampleThreshold?this.confirmImageResize(function(Ba){ra=Ba;xa()},mxEvent.isControlDown(t)):-xa()}else null!=ja&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ja)?this.loadImage(decodeURIComponent(ja),mxUtils.bind(this,function(Ba){var ya=Math.max(1,Ba.width);Ba=Math.max(1,Ba.height);var Da=this.maxImageSize;Da=Math.min(1,Math.min(Da/Math.max(1,ya)),Da/Math.max(1,Ba));f.setSelectionCell(f.insertVertex(null,null,"",Y,ba,ya*Da,Ba*Da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ja+";"))}),mxUtils.bind(this,function(Ba){f.setSelectionCells(this.insertTextAt(ja,-Y,ba,!0))})):0<=mxUtils.indexOf(t.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(t.dataTransfer.getData("text/plain"),Y,ba,!0))}}t.stopPropagation();t.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&-f.view.validateBackground()});f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var t=parseInt(this.div.offsetLeft),I=parseInt(this.div.offsetWidth),V=c.embedViewport.x+c.embedViewport.width,J=parseInt(this.div.offsetTop),W=parseInt(this.div.offsetHeight),Y=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,-Math.min(t,V-I))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(J,Y-W))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme)Z=Editor.currentTheme,Editor.currentTheme="",this.doSetCurrentTheme(Z,mxUtils.bind(this,function(){"1"==urlParams.embedInline?+function(t){f.isEnabled()&&(null!=l&&(l.parentNode.removeChild(l),l=null),t.stopPropagation(),t.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(t){null==l&&(!mxClient.IS_IE||10<document.documentMode)&&(l=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();t.stopPropagation();t.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(t){null!=l&&(l.parentNode.removeChild(l),l=null);if(f.isEnabled()){var H=+mxUtils.convertPoint(f.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),U=t.dataTransfer.files,K=f.view.translate,W=f.view.scale,Y=H.x/W-K.x,ca=H.y/W-K.y;if(0<U.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(t)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(U,!0)):(mxEvent.isAltDown(t)&&(ca=Y=null),this.importFiles(U,Y,ca,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(t),null,null,mxEvent.isShiftDown(t),t));else{mxEvent.isAltDown(t)&&+(ca=Y=0);var ja=0<=mxUtils.indexOf(t.dataTransfer.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):null;H=this.extractGraphModelFromEvent(t,null!=this.pages);if(null!=H)f.setSelectionCells(this.importXml(H,Y,ca,!0));else if(0<=mxUtils.indexOf(t.dataTransfer.types,"text/html")){var oa=t.dataTransfer.getData("text/html");H=document.createElement("div");H.innerHTML=Graph.sanitizeHtml(oa);var qa=null;U=H.getElementsByTagName("img");null!=U&&1==U.length?(oa=U[0].getAttribute("src"),null==+oa&&(oa=U[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(oa)||(qa=!0)):(U=H.getElementsByTagName("a"),null!=U&&1==U.length?oa=U[0].getAttribute("href"):(H=H.getElementsByTagName("pre"),null!=H&&1==H.length&&(oa=mxUtils.getTextContent(H[0]))));var ra=!0,xa=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(oa,Y,ca,!0,qa,null,ra,mxEvent.isControlDown(t)))});qa&&null!=oa&&oa.length>this.resampleThreshold?this.confirmImageResize(function(Ba){ra=Ba;xa()},mxEvent.isControlDown(t)):+xa()}else null!=ja&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ja)?this.loadImage(decodeURIComponent(ja),mxUtils.bind(this,function(Ba){var ya=Math.max(1,Ba.width);Ba=Math.max(1,Ba.height);var Da=this.maxImageSize;Da=Math.min(1,Math.min(Da/Math.max(1,ya)),Da/Math.max(1,Ba));f.setSelectionCell(f.insertVertex(null,null,"",Y,ca,ya*Da,Ba*Da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ja+";"))}),mxUtils.bind(this,function(Ba){f.setSelectionCells(this.insertTextAt(ja,+Y,ca,!0))})):0<=mxUtils.indexOf(t.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(t.dataTransfer.getData("text/plain"),Y,ca,!0))}}t.stopPropagation();t.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&+f.view.validateBackground()});f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var t=parseInt(this.div.offsetLeft),H=parseInt(this.div.offsetWidth),U=c.embedViewport.x+c.embedViewport.width,K=parseInt(this.div.offsetTop),W=parseInt(this.div.offsetHeight),Y=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,+Math.min(t,U-H))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(K,Y-W))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme)Z=Editor.currentTheme,Editor.currentTheme="",this.doSetCurrentTheme(Z,mxUtils.bind(this,function(){"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<Editor.smallScreenWidth&&this.toggleFormatPanel(!1);this.fireEvent(new mxEventObject("themeInitialized"))}));if("atlas"!=Editor.currentTheme&&(Z=!1,null!=urlParams.dark?Z=urlParams.dark:"dark"==Editor.currentTheme?Z=!0:Editor.isSettingsEnabled()&&"1"!=urlParams.embed&&(Z=mxSettings.settings.darkMode),"auto"==Z&&this.isAutoDarkModeSupported()&&(Z=window.matchMedia("(prefers-color-scheme: dark)").matches),this.setDarkMode("string"===typeof Z?"1"==Z:Z),this.isAutoDarkModeSupported()))try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(t){this.isAutoDarkMode()&&this.setDarkMode(t.matches)}))}catch(t){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast&&this.setHighContrast(mxSettings.settings.highContrast);-this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(t,I){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts()};var A=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,+this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(t,H){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts()};var A=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));this.lastWindowWidth=c}A.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,B=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(O){mxEvent.getSource(O)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(O),mxEvent.getClientY(O)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var z=document.createElement("div");z.style.position="absolute";z.style.width="10px";z.style.height="10px";z.style.borderRadius="5px";z.style.border="1px solid gray";z.style.background="#ffffff";z.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(z);-this.bottomResizer=z;var C=null,H=null,K=null,M=null;mxEvent.addGestureListeners(z,mxUtils.bind(this,function(O){M=parseInt(this.diagramContainer.style.height);H=mxEvent.getClientY(O);B.popupMenuHandler.hideMenu();mxEvent.consume(O)}));z=z.cloneNode(!1);z.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(z);this.rightResizer=z;mxEvent.addGestureListeners(z,mxUtils.bind(this,function(O){K=parseInt(this.diagramContainer.style.width);C=mxEvent.getClientX(O);B.popupMenuHandler.hideMenu();-mxEvent.consume(O)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(O){var ea=!1;null!=C&&(this.diagramContainer.style.width=Math.max(20,K+mxEvent.getClientX(O)-C)+"px",ea=!0);null!=H&&(this.diagramContainer.style.height=Math.max(20,M+mxEvent.getClientY(O)-H)+"px",ea=!0);ea&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),-function(O){null==C&&null==H||mxEvent.consume(O);H=C=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(O){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",+this.bottomResizer=z;var C=null,I=null,L=null,J=null;mxEvent.addGestureListeners(z,mxUtils.bind(this,function(O){J=parseInt(this.diagramContainer.style.height);I=mxEvent.getClientY(O);B.popupMenuHandler.hideMenu();mxEvent.consume(O)}));z=z.cloneNode(!1);z.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(z);this.rightResizer=z;mxEvent.addGestureListeners(z,mxUtils.bind(this,function(O){L=parseInt(this.diagramContainer.style.width);C=mxEvent.getClientX(O);B.popupMenuHandler.hideMenu();+mxEvent.consume(O)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(O){var da=!1;null!=C&&(this.diagramContainer.style.width=Math.max(20,L+mxEvent.getClientX(O)-C)+"px",da=!0);null!=I&&(this.diagramContainer.style.height=Math.max(20,J+mxEvent.getClientY(O)-I)+"px",da=!0);da&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),+function(O){null==C&&null==I||mxEvent.consume(O);I=C=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(O){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(O){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var c=this.editor.graph;c.container.addEventListener("paste",-mxUtils.bind(this,function(f){if(!mxEvent.isConsumed(f))try{for(var k=f.clipboardData||f.originalEvent.clipboardData,B=!1,z=0;z<k.types.length;z++)if("text/"===k.types[z].substring(0,5)){B=!0;break}if(!B){var C=k.items;for(index in C){var H=C[index];if("file"===H.kind){if(c.isEditing())this.importFiles([H.getAsFile()],0,0,this.maxImageSize,function(M,O,ea,fa,S,ca){c.insertImage(M,S,ca)},function(){},function(M){return"image/"==M.type.substring(0,6)},function(M){for(var O=0;O<M.length;O++)M[O]()});-else{var K=this.editor.graph.getInsertPoint();this.importFiles([H.getAsFile()],K.x,K.y,this.maxImageSize);mxEvent.consume(f)}break}}}}catch(M){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck",+mxUtils.bind(this,function(f){if(!mxEvent.isConsumed(f))try{for(var k=f.clipboardData||f.originalEvent.clipboardData,B=!1,z=0;z<k.types.length;z++)if("text/"===k.types[z].substring(0,5)){B=!0;break}if(!B){var C=k.items;for(index in C){var I=C[index];if("file"===I.kind){if(c.isEditing())this.importFiles([I.getAsFile()],0,0,this.maxImageSize,function(J,O,da,fa,V,ba){c.insertImage(J,V,ba)},function(){},function(J){return"image/"==J.type.substring(0,6)},function(J){for(var O=0;O<J.length;O++)J[O]()});+else{var L=this.editor.graph.getInsertPoint();this.importFiles([I.getAsFile()],L.x,L.y,this.maxImageSize);mxEvent.consume(f)}break}}}}catch(J){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";var B=!1;this.keyHandler.bindControlKey(88,-null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(C){var H=mxEvent.getSource(C);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==H.nodeName||"TEXTAREA"==H.nodeName||"true"==H.contentEditable||224!=C.keyCode&&(mxClient.IS_MAC||17!=C.keyCode)&&(!mxClient.IS_MAC||91!=C.keyCode&&93!=C.keyCode)||B||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+-10+"px",C=f.container.scrollLeft,H=f.container.scrollTop,f.container.appendChild(k),B=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=C,f.container.scrollTop=H)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(C){var H=C.keyCode;window.setTimeout(mxUtils.bind(this,function(){!B||224!=H&&17!=H&&91!=H&&93!=H||(B=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),-0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(H){this.handleError(H)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(H){this.handleError(H)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(C){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=C.clipboardData&&(Graph.removePasteFormatting(k.firstChild),-this.pasteCells(C,k,!0,!0)),!mxEvent.isConsumed(C)){var H=f.container.scrollLeft,K=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=H,f.container.scrollTop=K,Graph.removePasteFormatting(k.firstChild),this.pasteCells(C,k,!1,!0)}catch(M){this.handleError(M)}}),0)}}catch(M){this.handleError(M)}}),!0);var z=this.isSelectionAllowed;this.isSelectionAllowed=function(C){return mxEvent.getSource(C)==k?!0:z.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=-function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){function k(K){return"simple"==K||"sketch"==K}var B=Editor.currentTheme,z=k(B)&&this.isDefaultTheme(c)||this.isDefaultTheme(B)&&k(c),C=z&&"sketch"!=c&&"sketch"!=B;if(z&&!this.themeSwitching){var H=this.saveScrollState();+null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(C){var I=mxEvent.getSource(C);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==I.nodeName||"TEXTAREA"==I.nodeName||"true"==I.contentEditable||224!=C.keyCode&&(mxClient.IS_MAC||17!=C.keyCode)&&(!mxClient.IS_MAC||91!=C.keyCode&&93!=C.keyCode)||B||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop++10+"px",C=f.container.scrollLeft,I=f.container.scrollTop,f.container.appendChild(k),B=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=C,f.container.scrollTop=I)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(C){var I=C.keyCode;window.setTimeout(mxUtils.bind(this,function(){!B||224!=I&&17!=I&&91!=I&&93!=I||(B=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),+0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(C){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=C.clipboardData&&(Graph.removePasteFormatting(k.firstChild),+this.pasteCells(C,k,!0,!0)),!mxEvent.isConsumed(C)){var I=f.container.scrollLeft,L=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=I,f.container.scrollTop=L,Graph.removePasteFormatting(k.firstChild),this.pasteCells(C,k,!1,!0)}catch(J){this.handleError(J)}}),0)}}catch(J){this.handleError(J)}}),!0);var z=this.isSelectionAllowed;this.isSelectionAllowed=function(C){return mxEvent.getSource(C)==k?!0:z.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=+function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){function k(L){return"simple"==L||"sketch"==L}var B=Editor.currentTheme,z=k(B)&&this.isDefaultTheme(c)||this.isDefaultTheme(B)&&k(c),C=z&&"sketch"!=c&&"sketch"!=B;if(z&&!this.themeSwitching){var I=this.saveScrollState();this.editor.graph.stopEditing(!1);this.container.style.opacity=0;Editor.currentTheme=c;this.themeSwitching=!0;window.setTimeout(mxUtils.bind(this,function(){k(B)&&this.isDefaultTheme(c)?(this.menubarContainer.style.display="",this.toolbarContainer.style.display="block",this.tabContainer.style.display="flex",this.hsplit.style.display="block",this.menubarHeight=App.prototype.menubarHeight):this.isDefaultTheme(B)&&k(c)&&(this.menubarContainer.style.display="none",this.toolbarContainer.style.display=-"none",this.menubarHeight=0,"simple"!=c?(this.tabContainer.style.display="none",this.hsplit.style.display="none",this.hsplitPosition=0):this.tabContainer.style.display="flex");this.switchTheme(c);this.fireEvent(new mxEventObject("currentThemeChanged"));this.editor.fireEvent(new mxEventObject("statusChanged"));this.editor.graph.refresh();this.restoreScrollState(H);this.container.style.opacity="";delete this.themeSwitching;isLocalStorage&&k(c)&&this.setTabContainerVisible(null!=mxSettings.settings.pages?+"none",this.menubarHeight=0,"simple"!=c?(this.tabContainer.style.display="none",this.hsplit.style.display="none",this.hsplitPosition=0):this.tabContainer.style.display="flex");this.switchTheme(c);this.fireEvent(new mxEventObject("currentThemeChanged"));this.editor.fireEvent(new mxEventObject("statusChanged"));this.editor.graph.refresh();this.restoreScrollState(I);this.container.style.opacity="";delete this.themeSwitching;isLocalStorage&&k(c)&&this.setTabContainerVisible(null!=mxSettings.settings.pages?mxSettings.settings.pages:!0);null!=f&&f()}),0)}return C};EditorUi.prototype.saveScrollState=function(){var c=this.editor.graph.view.translate,f=this.diagramContainer.scrollLeft,k=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(f-=this.embedViewport.x,k-=this.embedViewport.y):(f+=this.embedViewport.x,k+=this.embedViewport.y));return{x:f,y:k,tx:c.x,ty:c.y}};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,k=this.editor.graph.view.translate;this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="inline-flex")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var B=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=B&&null!=B.getAttribute("class");if(!f&&null!=B){B=B.getAttribute("title");var z=this.getCurrentFile();z=null!=z?z.savingStatusKey:DrawioFile.prototype.savingStatusKey;B==mxResources.get(z)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(z))+@@ -3791,7 +3793,7 @@ var k=this.formatWindow.window.toggleMinimized,B=240;this.formatWindow.window.to"dblclick",mxUtils.bind(this,function(z){mxEvent.getSource(z)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?(c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,(1200>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)||708>c)&&this.formatWindow.window.toggleMinimized()):this.formatWindow.window.setVisible(!1)}};var G=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):G.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var f=EditorUi.prototype.hsplitPosition;0==f&&(f=this.defaultSidebarWidth);var k=this.hsplitPosition,B=mxUtils.bind(this,function(){this.hsplitPosition=z;this.refresh();this.diagramContainer.scrollLeft-=k-this.hsplitPosition}),z=c?f:0;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==z?"translateX(0)":"translateX(-100%)");0!=z&&B();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==z?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform 0.3s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,-"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==z&&B()}),300)}),10)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var T=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():T.apply(this,arguments)};var F=EditorUi.prototype.refresh;EditorUi.prototype.refresh=+"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==z&&B()}),300)}),10)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var S=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():S.apply(this,arguments)};var F=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(c){if(null!=this.sketchWrapperElt&&null!=this.sketchWrapperElt.parentNode){c=null!=c?c:!0;if("1"!=urlParams.embedInline){var f=this.container.clientWidth;this.container==document.body&&(f=document.body.clientWidth||document.documentElement.clientWidth);var k=this.getDiagramContainerOffset();var B=k.x;var z=k.y;"simple"==Editor.currentTheme&&(z+=this.sketchMainMenuElt.offsetHeight);this.diagramContainer.style.top=z+"px";this.diagramContainer.style.bottom="0";"simple"==Editor.currentTheme?(this.hsplit.style.top=this.sketchMainMenuElt.offsetHeight+"px",this.sidebarContainer.style.top=this.hsplit.style.top,this.formatContainer.style.top=this.hsplit.style.top,f=Math.max(0,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-this.formatWidth,Math.min(this.hsplitPosition,f-this.splitSize-40))),this.sidebarContainer.style.width=f+"px",this.diagramContainer.style.left=f+B+"px",this.tabContainer.style.left=f+"px",this.tabContainer.style.right=this.formatWidth+1+"px",this.sketchMainMenuElt.style.left="0px",this.sketchMainMenuElt.style.right="0px",this.hsplit.style.left=f+"px",this.diagramContainer.style.right=this.formatWidth+"px",this.formatContainer.style.width=this.formatWidth+"px",this.hsplit.style.bottom=this.tabContainer.offsetHeight+"px",this.diagramContainer.style.bottom=this.hsplit.style.bottom,this.checkTabScrollerOverflow()):(this.diagramContainer.style.left=k.x+"px",this.diagramContainer.style.right="0")}c&&this.editor.graph.sizeDidChange()}else F.apply(this,@@ -3823,109 +3825,109 @@ this.addListener("customFontsChanged",mxUtils.bind(this,function(f,k){mxSettingsthis.addListener("pageFormatChanged",mxUtils.bind(this,function(f,k){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,k){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,k){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(f,k){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(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.copyImage=function(c,f,k){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(B,z){try{this.spinner.stop();var C=this.createImageDataUri(B,f,"png"),H=parseInt(z.getAttribute("width")),K=parseInt(z.getAttribute("height"));this.writeImageToClipboard(C,H,K,mxUtils.bind(this,-function(M){this.handleError(M)}))}catch(M){this.handleError(M)}}),null,null,null,mxUtils.bind(this,function(B){this.spinner.stop();this.handleError(B)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(B){this.handleError(B)}};EditorUi.prototype.copyCells=function(c,f){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var B=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),+function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(c,f,k){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(B,z){try{this.spinner.stop();var C=this.createImageDataUri(B,f,"png"),I=parseInt(z.getAttribute("width")),L=parseInt(z.getAttribute("height"));this.writeImageToClipboard(C,I,L,mxUtils.bind(this,+function(J){this.handleError(J)}))}catch(J){this.handleError(J)}}),null,null,null,mxUtils.bind(this,function(B){this.spinner.stop();this.handleError(B)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(B){this.handleError(B)}};EditorUi.prototype.copyCells=function(c,f){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var B=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),z=mxUtils.getXml(k.encodeCells(B));mxUtils.setTextContent(c,encodeURIComponent(z));f?(k.removeCells(B,!1),k.lastPasteXml=null):(k.lastPasteXml=z,k.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeCipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};-EditorUi.prototype.pasteXml=function(c,f,k,B,z){z=null!=z?z:!0;var C=this.editor.graph,H=null;C.lastPasteXml==c?C.pasteCounter++:(C.lastPasteXml=c,C.pasteCounter=0);var K=C.pasteCounter*C.gridSize;if(k||this.isCompatibleString(c))H=this.importXml(c,K,K),C.setSelectionCells(H);else if(f&&1==C.getSelectionCount()){z=C.getStartEditingCell(C.getSelectionCell(),B);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==C.getCurrentCellStyle(z)[mxConstants.STYLE_SHAPE])C.setCellStyles(mxConstants.STYLE_IMAGE,-c,[z]);else{C.model.beginUpdate();try{C.labelChanged(z,c),Graph.isLink(c)&&C.setLinkForCell(z,c)}finally{C.model.endUpdate()}}C.setSelectionCell(z)}else H=C.getInsertPoint(),C.isMouseInsertPoint()&&(K=0,C.lastPasteXml==c&&0<C.pasteCounter&&C.pasteCounter--),H=this.insertTextAt(c,H.x+K,H.y+K,z),C.setSelectionCells(H);C.isSelectionEmpty()||(C.scrollCellToVisible(C.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(C.view.getState(C.getSelectionCell())));return H};EditorUi.prototype.pasteCells=-function(c,f,k,B){if(!mxEvent.isConsumed(c)){var z=f,C=!1;if(k&&null!=c.clipboardData&&c.clipboardData.getData){var H=c.clipboardData.getData("text/plain"),K=!1;if(null!=H&&0<H.length&&"%3CmxGraphModel%3E"==H.substring(0,18))try{var M=decodeURIComponent(H);this.isCompatibleString(M)&&(K=!0,H=M)}catch(ma){}K=K?null:c.clipboardData.getData("text/html");null!=K&&0<K.length?(z=this.parseHtmlData(K),C="text/plain"!=z.getAttribute("data-type")):null!=H&&0<H.length&&(z=document.createElement("div"),mxUtils.setTextContent(z,-K))}H=z.getElementsByTagName("span");if(null!=H&&0<H.length&&"application/vnd.lucid.chart.objects"===H[0].getAttribute("data-lucid-type"))k=H[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(ma){var la=this.editor.graph;la.lastPasteXml==ma?la.pasteCounter++:(la.lastPasteXml=ma,la.pasteCounter=0);var Z=la.pasteCounter*la.gridSize;la.setSelectionCells(this.importXml(ma,Z,Z));la.scrollCellToVisible(la.getSelectionCell())}),mxUtils.bind(this,-function(ma){this.handleError(ma)})),mxEvent.consume(c));else{var O=!1,ea="";ea=C?null!=z.textContent&&"<mxfile"==z.textContent.substring(0,7)&&"</mxfile>"==z.textContent.substring(z.textContent.length-9)||"<mxGraphModel"==z.textContent.substring(0,13)&&"</mxGraphModel>"==z.textContent.substring(z.textContent.length-15)?z.textContent.replace(/\u00a0/g," "):z.innerHTML:mxUtils.trim(null==z.innerText?mxUtils.getTextContent(z):z.innerText);try{var fa=ea.lastIndexOf("%3E");0<=fa&&fa<ea.length-3&&(ea=-ea.substring(0,fa+3))}catch(ma){}try{H=z.getElementsByTagName("span"),(M=null!=H&&0<H.length?mxUtils.trim(decodeURIComponent(H[0].textContent)):decodeURIComponent(ea))&&(this.isCompatibleString(M)||0==M.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(O=!0,ea=M)}catch(ma){}try{if(null!=ea&&0<ea.length){if(0==ea.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var S=mxUtils.bind(this,function(){try{ea=(new MiroImporter).importMiroJson(JSON.parse(ea)),this.pasteXml(ea,B,-O,c)}catch(ma){console.log("Miro import error:",ma)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",S):S()}else this.pasteXml(ea,B,O,c,C);try{mxEvent.consume(c)}catch(ma){}}else if(!k){var ca=this.editor.graph;ca.lastPasteXml=null;ca.pasteCounter=0}}catch(ma){this.handleError(ma)}}}f.innerHTML=" "};EditorUi.prototype.showPrintDialog=function(c,f){var k=320;this.editor.graph.isEnabled()&&(k+=40);null!=this.pages&&1<this.pages.length&&(k+=40,this.editor.graph.isEnabled()||-(k+=10));null==f||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(k+=20);this.showDialog((new PrintDialog(this,c,f)).container,320,k,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,B=k.graph,z=this.getPageIndex(this.currentPage),C=null!=z?z+1:1,H=mxUtils.bind(this,function(Z,da,aa,l){var t=Z.useCssTransforms,I=Z.currentTranslate,V=Z.currentScale,J=Z.view.translate,W=Z.view.scale;Z.useCssTransforms&&(Z.useCssTransforms=!1,Z.currentTranslate=new mxPoint(0,0),Z.currentScale=-1,Z.view.translate=new mxPoint(0,0),Z.view.scale=1);var Y=Z.getGraphBounds(),ba=0,ja=0,oa=mxRectangle.fromRectangle(Z.pageFormat),qa=f.fit||f.crop||!Z.pageVisible,ra=f.scale;oa.width=Math.ceil(oa.width*Z.pageScale);oa.height=Math.ceil(oa.height*Z.pageScale);var xa=1;if(f.fit){xa=f.sheetsAcross;var Ba=f.sheetsDown;isNaN(ra)||(oa.width=Math.ceil(oa.width*ra),oa.height=Math.ceil(oa.height*ra));xa=Math.min(oa.height*Ba/(Y.height/Z.view.scale),oa.width*xa/(Y.width/Z.view.scale))}else xa=isNaN(ra)?1:ra;-xa*=1;!qa&&Z.pageVisible?(ra=Z.getPageLayout(),ba-=ra.x*oa.width,ja-=ra.y*oa.height):qa=!0;f.crop&&(f.selection&&(Y=B.getBoundingBox(B.getSelectionCells())),oa.width=(Y.width+1)*xa/Z.view.scale,oa.height=(Y.height+1)*xa/Z.view.scale);oa.width=Math.ceil(1*oa.width);oa.height=Math.ceil(1*oa.height);l=null!=l?"page/id,"+l:null;if(null==da){da=PrintDialog.createPrintPreview(Z,xa,null,0,ba,ja,qa);da.title=this.getBaseFilename(!0);da.pageSelector=!1;da.mathEnabled=!1;ba=f.border;isNaN(ba)||(da.pageMargin=-ba);f.selection&&(da.isCellVisible=function(sa){return Z.isCellSelected(sa)});var ya=da.writeHead;da.writeHead=function(sa){ya.apply(this,arguments);mxClient.IS_GC&&(sa.writeln('<style type="text/css">'),sa.writeln("@media print {"),sa.writeln(".MathJax svg { shape-rendering: crispEdges; }"),sa.writeln("}"),sa.writeln("</style>"));null!=k.fontCss&&(sa.writeln('<style type="text/css">'),sa.writeln(mxUtils.htmlEntities(k.fontCss,!1,!1,!1)),sa.writeln("</style>"));for(var Aa=Z.getCustomFonts(),Ea=0;Ea<-Aa.length;Ea++){var Ka=Aa[Ea].name,Ma=Aa[Ea].url;Graph.isCssFontUrl(Ma)?sa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Ma))+'" charset="UTF-8" type="text/css">'):(sa.writeln('<style type="text/css">'),sa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Ka)+'";\nsrc: url("'+mxUtils.htmlEntities(Ma)+'");\n}'),sa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Da=da.drawBackgroundImage;da.drawBackgroundImage=function(sa){Da.apply(this,arguments);-null!=sa.node&&(EditorUi.embedSvgImages(sa.node),B.disableSvgLinks(sa.node,function(Aa){Aa.setAttribute("href","javascript:void(0)")}))}}var La=da.addGraphFragment;da.addGraphFragment=function(sa,Aa,Ea,Ka,Ma,za){La.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Ma.classList.add("geDisableMathJax")};f.grid&&(da.gridSize=Z.gridSize,da.gridSteps=Z.view.gridSteps,da.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:Z.view.gridColor);da.open(null,-null,aa,!0,l,oa,f.selection?Z.getSelectionCells():null)}else{Y=Z.background;if(null==Y||""==Y||Y==mxConstants.NONE)Y="#ffffff";da.backgroundColor=Y;da.autoOrigin=qa;f.grid&&(da.gridSize=Z.gridSize,da.gridSteps=Z.view.gridSteps,da.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:Z.view.gridColor);da.appendGraph(Z,xa,ba,ja,aa,!0,l,oa,f.selection?Z.getSelectionCells():null);aa=Z.getCustomFonts();if(null!=da.wnd)for(oa=0;oa<aa.length;oa++)ba=aa[oa].name,ja=aa[oa].url,Graph.isCssFontUrl(ja)?-da.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(ja)+'" charset="UTF-8" type="text/css">'):(da.wnd.document.writeln('<style type="text/css">'),da.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ba)+'";\nsrc: url("'+mxUtils.htmlEntities(ja)+'");\n}'),da.wnd.document.writeln("</style>"))}t&&(Z.useCssTransforms=t,Z.currentTranslate=I,Z.currentScale=V,Z.view.translate=J,Z.view.scale=W);return da}),K=f.pagesFrom,M=f.pagesTo,O=!f.allPages;z=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,-f);else{O&&(O=f.selection||K==C&&M==C);if(!O&&null!=this.pages&&this.pages.length){O=0;C=this.pages.length-1;f.allPages||(O=parseInt(K)-1,C=parseInt(M)-1);for(var ea=O;ea<=C;ea++){var fa=this.pages[ea];K=fa==this.currentPage?B:null;if(null==K){K=this.createTemporaryGraph(B.stylesheet);K.shapeForegroundColor=B.shapeForegroundColor;K.shapeBackgroundColor=B.shapeBackgroundColor;M=!0;O=!1;var S=null,ca=null;null==fa.viewState&&null==fa.root&&this.updatePageRoot(fa);null!=fa.viewState&&(M=fa.viewState.pageVisible,-O=fa.viewState.mathEnabled,S=fa.viewState.background,ca=fa.viewState.backgroundImage,K.pageFormat=fa.viewState.pageFormat,K.gridSize=fa.viewState.gridSize);null!=ca&&null!=ca.originalSrc&&(ca=this.createImageForPageLink(ca.originalSrc,fa));K.background=S;K.backgroundImage=null!=ca?new mxImage(ca.src,ca.width,ca.height,ca.x,ca.y):null;K.pageVisible=M;K.mathEnabled=O;var ma=K.getGraphBounds;K.getGraphBounds=function(){var Z=ma.apply(this,arguments),da=this.backgroundImage;if(null!=da&&null!=da.width&&-null!=da.height){var aa=this.view.translate,l=this.view.scale;Z=mxRectangle.fromRectangle(Z);Z.add(new mxRectangle((aa.x+da.x)*l,(aa.y+da.y)*l,da.width*l,da.height*l))}return Z};var la=K.getGlobalVariable;K.getGlobalVariable=function(Z){return"page"==Z?fa.getName():"pagenumber"==Z?ea+1:"pagecount"==Z?null!=this.pages?this.pages.length:1:la.apply(this,arguments)};document.body.appendChild(K.container);this.updatePageRoot(fa);K.model.setRoot(fa.root)}z=H(K,z,ea!=C,fa.getId());K!=B&&K.container.parentNode.removeChild(K.container)}}else z=-H(B);null==z||null==z.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(z.mathEnabled&&(H=z.wnd.document,c||(z.wnd.IMMEDIATE_PRINT=!0),H.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),z.closeDocument(),Graph.rewritePageLinks(z.wnd.document,!0),z.mathEnabled||c||PrintDialog.printPreview(z));return z}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(B){null!=+EditorUi.prototype.pasteXml=function(c,f,k,B,z){z=null!=z?z:!0;var C=this.editor.graph,I=null;C.lastPasteXml==c?C.pasteCounter++:(C.lastPasteXml=c,C.pasteCounter=0);var L=C.pasteCounter*C.gridSize;if(k||this.isCompatibleString(c))I=this.importXml(c,L,L),C.setSelectionCells(I);else if(f&&1==C.getSelectionCount()){z=C.getStartEditingCell(C.getSelectionCell(),B);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==C.getCurrentCellStyle(z)[mxConstants.STYLE_SHAPE])C.setCellStyles(mxConstants.STYLE_IMAGE,+c,[z]);else{C.model.beginUpdate();try{C.labelChanged(z,c),Graph.isLink(c)&&C.setLinkForCell(z,c)}finally{C.model.endUpdate()}}C.setSelectionCell(z)}else I=C.getInsertPoint(),C.isMouseInsertPoint()&&(L=0,C.lastPasteXml==c&&0<C.pasteCounter&&C.pasteCounter--),I=this.insertTextAt(c,I.x+L,I.y+L,z),C.setSelectionCells(I);C.isSelectionEmpty()||(C.scrollCellToVisible(C.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(C.view.getState(C.getSelectionCell())));return I};EditorUi.prototype.pasteCells=+function(c,f,k,B){if(!mxEvent.isConsumed(c)){var z=f,C=!1;if(k&&null!=c.clipboardData&&c.clipboardData.getData){var I=c.clipboardData.getData("text/plain"),L=!1;if(null!=I&&0<I.length&&"%3CmxGraphModel%3E"==I.substring(0,18))try{var J=decodeURIComponent(I);this.isCompatibleString(J)&&(L=!0,I=J)}catch(ma){}L=L?null:c.clipboardData.getData("text/html");null!=L&&0<L.length?(z=this.parseHtmlData(L),C="text/plain"!=z.getAttribute("data-type")):null!=I&&0<I.length&&(z=document.createElement("div"),mxUtils.setTextContent(z,+L))}I=z.getElementsByTagName("span");if(null!=I&&0<I.length&&"application/vnd.lucid.chart.objects"===I[0].getAttribute("data-lucid-type"))k=I[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(ma){var la=this.editor.graph;la.lastPasteXml==ma?la.pasteCounter++:(la.lastPasteXml=ma,la.pasteCounter=0);var Z=la.pasteCounter*la.gridSize;la.setSelectionCells(this.importXml(ma,Z,Z));la.scrollCellToVisible(la.getSelectionCell())}),mxUtils.bind(this,+function(ma){this.handleError(ma)})),mxEvent.consume(c));else{var O=!1,da="";da=C?null!=z.textContent&&"<mxfile"==z.textContent.substring(0,7)&&"</mxfile>"==z.textContent.substring(z.textContent.length-9)||"<mxGraphModel"==z.textContent.substring(0,13)&&"</mxGraphModel>"==z.textContent.substring(z.textContent.length-15)?z.textContent.replace(/\u00a0/g," "):z.innerHTML:mxUtils.trim(null==z.innerText?mxUtils.getTextContent(z):z.innerText);try{var fa=da.lastIndexOf("%3E");0<=fa&&fa<da.length-3&&(da=+da.substring(0,fa+3))}catch(ma){}try{I=z.getElementsByTagName("span"),(J=null!=I&&0<I.length?mxUtils.trim(decodeURIComponent(I[0].textContent)):decodeURIComponent(da))&&(this.isCompatibleString(J)||0==J.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(O=!0,da=J)}catch(ma){}try{if(null!=da&&0<da.length){if(0==da.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var V=mxUtils.bind(this,function(){try{da=(new MiroImporter).importMiroJson(JSON.parse(da)),this.pasteXml(da,B,+O,c)}catch(ma){console.log("Miro import error:",ma)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",V):V()}else this.pasteXml(da,B,O,c,C);try{mxEvent.consume(c)}catch(ma){}}else if(!k){var ba=this.editor.graph;ba.lastPasteXml=null;ba.pasteCounter=0}}catch(ma){this.handleError(ma)}}}f.innerHTML=" "};EditorUi.prototype.showPrintDialog=function(c,f){var k=320;this.editor.graph.isEnabled()&&(k+=40);null!=this.pages&&1<this.pages.length&&(k+=40,this.editor.graph.isEnabled()||+(k+=10));null==f||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(k+=20);this.showDialog((new PrintDialog(this,c,f)).container,320,k,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,B=k.graph,z=this.getPageIndex(this.currentPage),C=null!=z?z+1:1,I=mxUtils.bind(this,function(Z,ea,aa,l){var t=Z.useCssTransforms,H=Z.currentTranslate,U=Z.currentScale,K=Z.view.translate,W=Z.view.scale;Z.useCssTransforms&&(Z.useCssTransforms=!1,Z.currentTranslate=new mxPoint(0,0),Z.currentScale=+1,Z.view.translate=new mxPoint(0,0),Z.view.scale=1);var Y=Z.getGraphBounds(),ca=0,ja=0,oa=mxRectangle.fromRectangle(Z.pageFormat),qa=f.fit||f.crop||!Z.pageVisible,ra=f.scale;oa.width=Math.ceil(oa.width*Z.pageScale);oa.height=Math.ceil(oa.height*Z.pageScale);var xa=1;if(f.fit){xa=f.sheetsAcross;var Ba=f.sheetsDown;isNaN(ra)||(oa.width=Math.ceil(oa.width*ra),oa.height=Math.ceil(oa.height*ra));xa=Math.min(oa.height*Ba/(Y.height/Z.view.scale),oa.width*xa/(Y.width/Z.view.scale))}else xa=isNaN(ra)?1:ra;+xa*=1;!qa&&Z.pageVisible?(ra=Z.getPageLayout(),ca-=ra.x*oa.width,ja-=ra.y*oa.height):qa=!0;f.crop&&(f.selection&&(Y=B.getBoundingBox(B.getSelectionCells())),oa.width=(Y.width+1)*xa/Z.view.scale,oa.height=(Y.height+1)*xa/Z.view.scale);oa.width=Math.ceil(1*oa.width);oa.height=Math.ceil(1*oa.height);l=null!=l?"page/id,"+l:null;if(null==ea){ea=PrintDialog.createPrintPreview(Z,xa,null,0,ca,ja,qa);ea.title=this.getBaseFilename(!0);ea.pageSelector=!1;ea.mathEnabled=!1;ca=f.border;isNaN(ca)||(ea.pageMargin=+ca);f.selection&&(ea.isCellVisible=function(sa){return Z.isCellSelected(sa)});var ya=ea.writeHead;ea.writeHead=function(sa){ya.apply(this,arguments);mxClient.IS_GC&&(sa.writeln('<style type="text/css">'),sa.writeln("@media print {"),sa.writeln(".MathJax svg { shape-rendering: crispEdges; }"),sa.writeln("}"),sa.writeln("</style>"));null!=k.fontCss&&(sa.writeln('<style type="text/css">'),sa.writeln(mxUtils.htmlEntities(k.fontCss,!1,!1,!1)),sa.writeln("</style>"));for(var Aa=Z.getCustomFonts(),Ea=0;Ea<+Aa.length;Ea++){var Ka=Aa[Ea].name,Ma=Aa[Ea].url;Graph.isCssFontUrl(Ma)?sa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Ma))+'" charset="UTF-8" type="text/css">'):(sa.writeln('<style type="text/css">'),sa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Ka)+'";\nsrc: url("'+mxUtils.htmlEntities(Ma)+'");\n}'),sa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Da=ea.drawBackgroundImage;ea.drawBackgroundImage=function(sa){Da.apply(this,arguments);+null!=sa.node&&(EditorUi.embedSvgImages(sa.node),B.disableSvgLinks(sa.node,function(Aa){Aa.setAttribute("href","javascript:void(0)")}))}}var La=ea.addGraphFragment;ea.addGraphFragment=function(sa,Aa,Ea,Ka,Ma,za){La.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Ma.classList.add("geDisableMathJax")};f.grid&&(ea.gridSize=Z.gridSize,ea.gridSteps=Z.view.gridSteps,ea.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:Z.view.gridColor);ea.open(null,+null,aa,!0,l,oa,f.selection?Z.getSelectionCells():null)}else{Y=Z.background;if(null==Y||""==Y||Y==mxConstants.NONE)Y="#ffffff";ea.backgroundColor=Y;ea.autoOrigin=qa;f.grid&&(ea.gridSize=Z.gridSize,ea.gridSteps=Z.view.gridSteps,ea.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:Z.view.gridColor);ea.appendGraph(Z,xa,ca,ja,aa,!0,l,oa,f.selection?Z.getSelectionCells():null);aa=Z.getCustomFonts();if(null!=ea.wnd)for(oa=0;oa<aa.length;oa++)ca=aa[oa].name,ja=aa[oa].url,Graph.isCssFontUrl(ja)?+ea.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(ja)+'" charset="UTF-8" type="text/css">'):(ea.wnd.document.writeln('<style type="text/css">'),ea.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ca)+'";\nsrc: url("'+mxUtils.htmlEntities(ja)+'");\n}'),ea.wnd.document.writeln("</style>"))}t&&(Z.useCssTransforms=t,Z.currentTranslate=H,Z.currentScale=U,Z.view.translate=K,Z.view.scale=W);return ea}),L=f.pagesFrom,J=f.pagesTo,O=!f.allPages;z=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,+f);else{O&&(O=f.selection||L==C&&J==C);if(!O&&null!=this.pages&&this.pages.length){O=0;C=this.pages.length-1;f.allPages||(O=parseInt(L)-1,C=parseInt(J)-1);for(var da=O;da<=C;da++){var fa=this.pages[da];L=fa==this.currentPage?B:null;if(null==L){L=this.createTemporaryGraph(B.stylesheet);L.shapeForegroundColor=B.shapeForegroundColor;L.shapeBackgroundColor=B.shapeBackgroundColor;J=!0;O=!1;var V=null,ba=null;null==fa.viewState&&null==fa.root&&this.updatePageRoot(fa);null!=fa.viewState&&(J=fa.viewState.pageVisible,+O=fa.viewState.mathEnabled,V=fa.viewState.background,ba=fa.viewState.backgroundImage,L.pageFormat=fa.viewState.pageFormat,L.gridSize=fa.viewState.gridSize);null!=ba&&null!=ba.originalSrc&&(ba=this.createImageForPageLink(ba.originalSrc,fa));L.background=V;L.backgroundImage=null!=ba?new mxImage(ba.src,ba.width,ba.height,ba.x,ba.y):null;L.pageVisible=J;L.mathEnabled=O;var ma=L.getGraphBounds;L.getGraphBounds=function(){var Z=ma.apply(this,arguments),ea=this.backgroundImage;if(null!=ea&&null!=ea.width&&+null!=ea.height){var aa=this.view.translate,l=this.view.scale;Z=mxRectangle.fromRectangle(Z);Z.add(new mxRectangle((aa.x+ea.x)*l,(aa.y+ea.y)*l,ea.width*l,ea.height*l))}return Z};var la=L.getGlobalVariable;L.getGlobalVariable=function(Z){return"page"==Z?fa.getName():"pagenumber"==Z?da+1:"pagecount"==Z?null!=this.pages?this.pages.length:1:la.apply(this,arguments)};document.body.appendChild(L.container);this.updatePageRoot(fa);L.model.setRoot(fa.root)}z=I(L,z,da!=C,fa.getId());L!=B&&L.container.parentNode.removeChild(L.container)}}else z=+I(B);null==z||null==z.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(z.mathEnabled&&(I=z.wnd.document,c||(z.wnd.IMMEDIATE_PRINT=!0),I.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),z.closeDocument(),Graph.rewritePageLinks(z.wnd.document,!0),z.mathEnabled||c||PrintDialog.printPreview(z));return z}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(B){null!=f&&(f.parentNode.removeChild(f),f=null);B.stopPropagation();B.preventDefault()}),mxEvent.addListener(c[k],"dragover",mxUtils.bind(this,function(B){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(f=this.highlightElement());B.stopPropagation();B.preventDefault()})),mxEvent.addListener(c[k],"drop",mxUtils.bind(this,function(B){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<B.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(B.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(B)&&!mxEvent.isShiftDown(B)):this.openFiles(B.dataTransfer.files,!0);else{var z=this.extractGraphModelFromEvent(B);if(null==z){var C=null!=B.dataTransfer?B.dataTransfer:B.clipboardData;null!=C&&(10==document.documentMode||11==document.documentMode?z=C.getData("Text"):(z=null,z=0<=mxUtils.indexOf(C.types,"text/uri-list")?B.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(C.types,"text/html")?C.getData("text/html"):null,null!=z&&0<z.length?(C=document.createElement("div"),C.innerHTML=Graph.sanitizeHtml(z),C=C.getElementsByTagName("img"),0<C.length&&(z=C[0].getAttribute("src"))):0<=mxUtils.indexOf(C.types,"text/plain")&&(z=C.getData("text/plain"))),null!=z&&(Editor.isPngDataUrl(z)?(z=Editor.extractGraphModelFromPng(z),null!=z&&0<z.length&&this.openLocalFile(z,null,!0)):this.isRemoteFileFormat(z)?this.isOffline()?this.showError(mxResources.get("error"),-mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(z))).send(mxUtils.bind(this,function(H){200<=H.getStatus()&&299>=H.getStatus()?this.openLocalFile(H.getText(),null,!0):this.showError(mxResources.get("error"),413==H.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(z)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(z):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost++mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(z))).send(mxUtils.bind(this,function(I){200<=I.getStatus()&&299>=I.getStatus()?this.openLocalFile(I.getText(),null,!0):this.showError(mxResources.get("error"),413==I.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(z)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(z):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(z)))))}else this.openLocalFile(z,null,!0)}B.stopPropagation();B.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,k=0;if(null==c){var B=document.body;var z=document.documentElement;var C=(B.clientWidth||z.clientWidth)-3;B=Math.max(B.clientHeight||0,z.clientHeight)-3}else f=c.offsetTop,k=c.offsetLeft,C=c.clientWidth,B=c.clientHeight;z=document.createElement("div");z.style.zIndex=mxPopupMenu.prototype.zIndex+2;z.style.border="3px dotted rgb(254, 137, 12)";z.style.pointerEvents="none";z.style.position="absolute";z.style.top=f+"px";z.style.left=k+"px";z.style.width=Math.max(0,C-3)+"px";z.style.height=Math.max(0,B-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(z):document.body.appendChild(z);return z};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var f=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=f){var k=new mxCodec(f.ownerDocument),-B=new mxGraphModel;k.decode(f,B);f=B.getChildAt(B.getRoot(),0);for(k=0;k<B.getChildCount(f);k++)c.push(B.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,B,z,C){if(null!=f&&0<f.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var H=mxUtils.bind(this,function(M){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==M.substring(0,10)){null==-this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,B);try{this.loadLibrary(new LocalLibrary(this,M,f)),this.showSidebar()}catch(O){this.handleError(O,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(M,f,B)});if(EditorUi.isVisioFilename(f))this.importVisio(k,mxUtils.bind(this,function(M){this.spinner.stop();H(M)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(M){this.spinner.stop();H(M)}));else if(Graph.fileSupport&&-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(M){4==M.readyState&&(this.spinner.stop(),200<=M.status&&299>=M.status?H(M.responseText):this.handleError({message:mxResources.get(413==M.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,-f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(M){this.spinner.stop();this.openLocalFile(M,f,B)}),mxUtils.bind(this,function(M){this.spinner.stop();this.handleError(M)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,B);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(M){this.handleError(M,mxResources.get("errorLoadingFile"))}}else if(0==-c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(M){this.spinner.stop();H(M)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,B)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var K=Editor.extractGraphModelFromPdf(c);null!=K&&(z=null,B=!0,c=K)}this.spinner.stop();this.openLocalFile(c,f,B,z,null!=z?k:null,C)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=-0;k<c.length;k++)mxUtils.bind(this,function(B){var z=new FileReader;z.onload=mxUtils.bind(this,function(C){try{this.openFileHandle(C.target.result,B.name,B,f)}catch(H){this.handleError(H)}});z.onerror=mxUtils.bind(this,function(C){this.spinner.stop();this.handleError(C);window.openFile=null});"image"!==B.type.substring(0,5)&&"application/pdf"!==B.type||"image/svg"===B.type.substring(0,9)?z.readAsText(B):z.readAsDataURL(B)})(c[k])};EditorUi.prototype.openLocalFile=function(c,f,k,B,z,C){var H=this.getCurrentFile(),-K=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var M=mxUtils.parseXml(c);null!=M&&(this.editor.setGraphXml(M.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,k,B,z,C))});if(null!=c&&0<c.length)null==H||!H.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=B)?K():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=B)&&null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),-null,K,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),null,K,mxResources.get("cancel"),mxResources.get("discardChanges")):K()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=-0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var k in c)f.push(k);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function k(H){if(null!=H){var K=H.lastIndexOf(".");0<K&&(H=H.substring(K+1,H.length));null==f[H]&&(f[H]=!0)}}var B=this.editor.graph,z=B.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(z[mxConstants.STYLE_SHAPE]));B.model.isEdge(c)&&+B=new mxGraphModel;k.decode(f,B);f=B.getChildAt(B.getRoot(),0);for(k=0;k<B.getChildCount(f);k++)c.push(B.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,B,z,C){if(null!=f&&0<f.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var I=mxUtils.bind(this,function(J){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==J.substring(0,10)){null==+this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,B);try{this.loadLibrary(new LocalLibrary(this,J,f)),this.showSidebar()}catch(O){this.handleError(O,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(J,f,B)});if(EditorUi.isVisioFilename(f))this.importVisio(k,mxUtils.bind(this,function(J){this.spinner.stop();I(J)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(J){this.spinner.stop();I(J)}));else if(Graph.fileSupport&&+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(J){4==J.readyState&&(this.spinner.stop(),200<=J.status&&299>=J.status?I(J.responseText):this.handleError({message:mxResources.get(413==J.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,+f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(J){this.spinner.stop();this.openLocalFile(J,f,B)}),mxUtils.bind(this,function(J){this.spinner.stop();this.handleError(J)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,B);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else if(0==+c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(J){this.spinner.stop();I(J)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,B)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var L=Editor.extractGraphModelFromPdf(c);null!=L&&(z=null,B=!0,c=L)}this.spinner.stop();this.openLocalFile(c,f,B,z,null!=z?k:null,C)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=+0;k<c.length;k++)mxUtils.bind(this,function(B){var z=new FileReader;z.onload=mxUtils.bind(this,function(C){try{this.openFileHandle(C.target.result,B.name,B,f)}catch(I){this.handleError(I)}});z.onerror=mxUtils.bind(this,function(C){this.spinner.stop();this.handleError(C);window.openFile=null});"image"!==B.type.substring(0,5)&&"application/pdf"!==B.type||"image/svg"===B.type.substring(0,9)?z.readAsText(B):z.readAsDataURL(B)})(c[k])};EditorUi.prototype.openLocalFile=function(c,f,k,B,z,C){var I=this.getCurrentFile(),+L=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var J=mxUtils.parseXml(c);null!=J&&(this.editor.setGraphXml(J.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,k,B,z,C))});if(null!=c&&0<c.length)null==I||!I.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=B)?L():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=B)&&null!=I&&I.isModified()?this.confirm(mxResources.get("allChangesLost"),+null,L,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=I&&I.isModified()?this.confirm(mxResources.get("allChangesLost"),null,L,mxResources.get("cancel"),mxResources.get("discardChanges")):L()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=+0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var k in c)f.push(k);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function k(I){if(null!=I){var L=I.lastIndexOf(".");0<L&&(I=I.substring(L+1,I.length));null==f[I]&&(f[I]=!0)}}var B=this.editor.graph,z=B.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(z[mxConstants.STYLE_SHAPE]));B.model.isEdge(c)&&(k(mxMarker.getPackageForType(z[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(z[mxConstants.STYLE_ENDARROW])));z=B.model.getChildCount(c);for(var C=0;C<z;C++)this.addBasenamesForCell(B.model.getChildAt(c,C),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=c?"":"hidden";this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=c&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme?"":"none";this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=c&&0<parseInt(this.tabContainer.style.height)?"":"hidden");null!=this.ruler&&(this.ruler.hRuler.container.style.visibility=c?"":"hidden",this.ruler.vRuler.container.style.visibility=c?"":"hidden");c||this.hideWindows()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=-!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,B,z){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);if(z)try{var C=this.editor.graph;C.setGridEnabled(!1);C.pageVisible=!1;var H=C.model.cells,K;for(K in H){var M=H[K];null!=M&&null!=M.style&&(M.style+=";sketch=1;"+(-1==M.style.indexOf("fontFamily=")||-1<M.style.indexOf("fontFamily=Helvetica;")?+!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,B,z){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);if(z)try{var C=this.editor.graph;C.setGridEnabled(!1);C.pageVisible=!1;var I=C.model.cells,L;for(L in I){var J=I[L];null!=J&&null!=J.style&&(J.style+=";sketch=1;"+(-1==J.style.indexOf("fontFamily=")||-1<J.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(O){console.log(O)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=B?B:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,f){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(k){this.spinner.stop();f(k)})):f(null)};EditorUi.prototype.createLoadMessage=function(c){var f=this.editor.graph;return{event:c,pageVisible:f.pageVisible,translate:f.view.translate,bounds:f.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:f.view.scale,page:f.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokesStopCellEditing());var k=window.opener||window.parent;if(this.editor.modified){var B=f.background;if(null==B||B==mxConstants.NONE)B=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(z){k.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(z)}),"*")}),null,null,!0,B,1,this.embedExportBorder,null,this.embedExportTheme)}else c||k.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=-!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(z){c||this.handleError(z)}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,B=!1,z=null,C=mxUtils.bind(this,function(M,O){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,C);mxEvent.addListener(window,"message",mxUtils.bind(this,-function(M){if(M.source==(window.opener||window.parent)){var O=M.data,ea=null,fa=mxUtils.bind(this,function(sa){if(null!=sa&&"function"===typeof sa.charAt&&"<"!=sa.charAt(0))try{Editor.isPngDataUrl(sa)?sa=Editor.extractGraphModelFromPng(sa):"data:image/svg+xml;base64,"==sa.substring(0,26)?sa=atob(sa.substring(26)):"data:image/svg+xml;utf8,"==sa.substring(0,24)&&(sa=sa.substring(24)),null!=sa&&(""==sa.trim()?sa=null:"%"==sa.charAt(0)?sa=decodeURIComponent(sa):"<"!=sa.charAt(0)&&(sa=Graph.decompress(sa)))}catch(Aa){}return sa});-if("json"==urlParams.proto){var S=!1;try{O=JSON.parse(O),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[M],"data",[O])}catch(sa){O=null}try{if(null==O)return;if("dialog"==O.action){this.showError(null!=O.titleKey?mxResources.get(O.titleKey):O.title,null!=O.messageKey?mxResources.get(O.messageKey):mxUtils.htmlEntities(O.message),null!=O.buttonKey?mxResources.get(O.buttonKey):O.button);null!=O.modified&&(this.editor.modified=O.modified);return}if("layout"==O.action){this.executeLayouts(this.editor.graph.createLayouts(O.layouts));-return}if("prompt"==O.action){this.spinner.stop();var ca=new FilenameDialog(this,O.defaultValue||"",null!=O.okKey?mxResources.get(O.okKey):O.ok,function(sa){null!=sa?H.postMessage(JSON.stringify({event:"prompt",value:sa,message:O}),"*"):H.postMessage(JSON.stringify({event:"prompt-cancel",message:O}),"*")},null!=O.titleKey?mxResources.get(O.titleKey):O.title,null,null,null,null,function(){H.postMessage(JSON.stringify({event:"prompt-cancel",message:O}),"*")});this.showDialog(ca.container,300,80,!0,-!1);ca.init();return}if("draft"==O.action){var ma=fa(O.xml);this.spinner.stop();ca=new DraftDialog(this,mxResources.get("draftFound",[O.name||this.defaultFilename]),ma,mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"edit",message:O}),"*")}),mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"discard",message:O}),"*")}),O.editKey?mxResources.get(O.editKey):null,O.discardKey?mxResources.get(O.discardKey):-null,O.ignore?mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"ignore",message:O}),"*")}):null);this.showDialog(ca.container,640,480,!0,!1,mxUtils.bind(this,function(sa){sa&&this.actions.get("exit").funct()}));try{ca.init()}catch(sa){H.postMessage(JSON.stringify({event:"draft",error:sa.toString(),message:O}),"*")}return}if("template"==O.action){this.spinner.stop();var la=1==O.enableRecent,Z=1==O.enableSearch,da=1==O.enableCustomTemp;ca=new NewDialog(this,-!1,O.templatesOnly?!1:null!=O.callback,mxUtils.bind(this,function(sa,Aa,Ea,Ka){sa=sa||this.emptyDiagramXml;null!=O.callback?H.postMessage(JSON.stringify({event:"template",xml:sa,blank:sa==this.emptyDiagramXml,name:Aa,tempUrl:Ea,libs:Ka,builtIn:!0,message:O}),"*"):(c(sa,M,sa!=this.emptyDiagramXml,O.toSketch),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,la?mxUtils.bind(this,function(sa){this.remoteInvoke("getRecentDiagrams",[null],null,sa,function(){sa(null,-"Network Error!")})}):null,Z?mxUtils.bind(this,function(sa,Aa){this.remoteInvoke("searchDiagrams",[sa,null],null,Aa,function(){Aa(null,"Network Error!")})}):null,mxUtils.bind(this,function(sa,Aa,Ea){H.postMessage(JSON.stringify({event:"template",docUrl:sa,info:Aa,name:Ea}),"*")}),null,null,da?mxUtils.bind(this,function(sa){this.remoteInvoke("getCustomTemplates",null,null,sa,function(){sa({},0)})}):null,1==O.withoutType);this.showDialog(ca.container,620,460,!0,!1,mxUtils.bind(this,function(sa){null!=-this.sidebar&&this.sidebar.hideTooltip();sa&&this.actions.get("exit").funct()}));ca.init();return}if("textContent"==O.action){var aa=this.getDiagramTextContent();H.postMessage(JSON.stringify({event:"textContent",data:aa,message:O}),"*");return}if("status"==O.action){null!=O.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(O.messageKey))):null!=O.message&&this.editor.setStatus(mxUtils.htmlEntities(O.message));null!=O.modified&&(this.editor.modified=O.modified);return}if("spinner"==-O.action){var l=null!=O.messageKey?mxResources.get(O.messageKey):O.message;null==O.show||O.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("exit"==O.action){this.actions.get("exit").funct();return}if("viewport"==O.action){null!=O.viewport&&(this.embedViewport=O.viewport,this.editor.graph.refresh(),this.fireEvent(new mxEventObject("embedViewportChanged")));return}if("fullscreenChanged"==O.action){ca=null;try{var t=this.diagramContainer.getAttribute("data-scrollState");null!=t&&-(this.diagramContainer.removeAttribute("data-scrollState"),ca=JSON.parse(t))}catch(sa){}Editor.inlineFullscreen=O.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=ca&&this.restoreScrollState(ca);return}if("snapshot"==O.action){this.sendEmbeddedSvgExport(!0);return}if("export"==O.action){if("png"==O.format||"xmlpng"==O.format){if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin)){var I=null!=O.xml?O.xml:this.getFileData(!0);-this.editor.graph.setEnabled(!1);var V=this.editor.graph,J=mxUtils.bind(this,function(sa,Aa){if(O.withSvg)O.withSvg=!1,this.getEmbeddedSvg(I,this.editor.graph,null,!0,function(Ka){J(sa,Ka)},null,null,O.embedImages,this.editor.graph.background,O.scale,O.border,O.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ea=this.createLoadMessage("export");Ea.format=O.format;Ea.message=O;Ea.data=sa;Ea.svg=Aa;Ea.xml=I;H.postMessage(JSON.stringify(Ea),"*")}}),W=mxUtils.bind(this,function(sa){null==-sa&&(sa=Editor.blankImage);"xmlpng"==O.format&&(sa=Editor.writeGraphModelToPng(sa,"tEXt","mxfile",encodeURIComponent(I)));V!=this.editor.graph&&V.container.parentNode.removeChild(V.container);J(sa)}),Y=O.pageId||(null!=this.pages?O.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var ba=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Y){var sa=V.getGlobalVariable;V=this.createTemporaryGraph(V.getStylesheet());for(var Aa,Ea=0;Ea<-this.pages.length;Ea++)if(this.pages[Ea].getId()==Y){Aa=this.updatePageRoot(this.pages[Ea]);break}null==Aa&&(Aa=this.currentPage);V.getGlobalVariable=function(Wa){return"page"==Wa?Aa.getName():"pagenumber"==Wa?1:sa.apply(this,arguments)};document.body.appendChild(V.container);V.model.setRoot(Aa.root)}if(null!=O.layerIds){var Ka=V.model,Ma=Ka.getChildCells(Ka.getRoot()),za={};for(Ea=0;Ea<O.layerIds.length;Ea++)za[O.layerIds[Ea]]=!0;for(Ea=0;Ea<Ma.length;Ea++)Ka.setVisible(Ma[Ea],za[Ma[Ea].id]||!1)}Ea=-null;O.keepTheme&&(Ea=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Wa){W(Wa.toDataURL("image/png"))}),O.width,null,O.background,mxUtils.bind(this,function(){W(null)}),null,null,O.scale,O.transparent,O.shadow,null,V,O.border,null,O.grid,Ea)});null!=O.xml&&0<O.xml.length&&(k=!0,this.setFileData(I),k=!1);ba()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==O.format?"1":"0")+(null!=Y?"&pageId="+Y:"")+(null!=O.layerIds&&0<O.layerIds.length?-"&extras="+encodeURIComponent(JSON.stringify({layerIds:O.layerIds})):"")+(null!=O.scale?"&scale="+O.scale:"")+"&base64=1&xml="+encodeURIComponent(I))).send(mxUtils.bind(this,function(sa){200<=sa.getStatus()&&299>=sa.getStatus()?J("data:image/png;base64,"+sa.getText()):W(null)}),mxUtils.bind(this,function(){W(null)}))}}else if(ba=mxUtils.bind(this,function(){var sa=this.createLoadMessage("export");sa.message=O;if("html2"==O.format||"html"==O.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Aa=+!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(z){c||this.handleError(z)}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,B=!1,z=null,C=mxUtils.bind(this,function(J,O){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,C);mxEvent.addListener(window,"message",mxUtils.bind(this,+function(J){if(J.source==(window.opener||window.parent)){var O=J.data,da=null,fa=mxUtils.bind(this,function(sa){if(null!=sa&&"function"===typeof sa.charAt&&"<"!=sa.charAt(0))try{Editor.isPngDataUrl(sa)?sa=Editor.extractGraphModelFromPng(sa):"data:image/svg+xml;base64,"==sa.substring(0,26)?sa=atob(sa.substring(26)):"data:image/svg+xml;utf8,"==sa.substring(0,24)&&(sa=sa.substring(24)),null!=sa&&(""==sa.trim()?sa=null:"%"==sa.charAt(0)?sa=decodeURIComponent(sa):"<"!=sa.charAt(0)&&(sa=Graph.decompress(sa)))}catch(Aa){}return sa});+if("json"==urlParams.proto){var V=!1;try{O=JSON.parse(O),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[J],"data",[O])}catch(sa){O=null}try{if(null==O)return;if("dialog"==O.action){this.showError(null!=O.titleKey?mxResources.get(O.titleKey):O.title,null!=O.messageKey?mxResources.get(O.messageKey):mxUtils.htmlEntities(O.message),null!=O.buttonKey?mxResources.get(O.buttonKey):O.button);null!=O.modified&&(this.editor.modified=O.modified);return}if("layout"==O.action){this.executeLayouts(this.editor.graph.createLayouts(O.layouts));+return}if("prompt"==O.action){this.spinner.stop();var ba=new FilenameDialog(this,O.defaultValue||"",null!=O.okKey?mxResources.get(O.okKey):O.ok,function(sa){null!=sa?I.postMessage(JSON.stringify({event:"prompt",value:sa,message:O}),"*"):I.postMessage(JSON.stringify({event:"prompt-cancel",message:O}),"*")},null!=O.titleKey?mxResources.get(O.titleKey):O.title,null,null,null,null,function(){I.postMessage(JSON.stringify({event:"prompt-cancel",message:O}),"*")});this.showDialog(ba.container,300,80,!0,+!1);ba.init();return}if("draft"==O.action){var ma=fa(O.xml);this.spinner.stop();ba=new DraftDialog(this,mxResources.get("draftFound",[O.name||this.defaultFilename]),ma,mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"edit",message:O}),"*")}),mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"discard",message:O}),"*")}),O.editKey?mxResources.get(O.editKey):null,O.discardKey?mxResources.get(O.discardKey):+null,O.ignore?mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"ignore",message:O}),"*")}):null);this.showDialog(ba.container,640,480,!0,!1,mxUtils.bind(this,function(sa){sa&&this.actions.get("exit").funct()}));try{ba.init()}catch(sa){I.postMessage(JSON.stringify({event:"draft",error:sa.toString(),message:O}),"*")}return}if("template"==O.action){this.spinner.stop();var la=1==O.enableRecent,Z=1==O.enableSearch,ea=1==O.enableCustomTemp;ba=new NewDialog(this,+!1,O.templatesOnly?!1:null!=O.callback,mxUtils.bind(this,function(sa,Aa,Ea,Ka){sa=sa||this.emptyDiagramXml;null!=O.callback?I.postMessage(JSON.stringify({event:"template",xml:sa,blank:sa==this.emptyDiagramXml,name:Aa,tempUrl:Ea,libs:Ka,builtIn:!0,message:O}),"*"):(c(sa,J,sa!=this.emptyDiagramXml,O.toSketch),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,la?mxUtils.bind(this,function(sa){this.remoteInvoke("getRecentDiagrams",[null],null,sa,function(){sa(null,+"Network Error!")})}):null,Z?mxUtils.bind(this,function(sa,Aa){this.remoteInvoke("searchDiagrams",[sa,null],null,Aa,function(){Aa(null,"Network Error!")})}):null,mxUtils.bind(this,function(sa,Aa,Ea){I.postMessage(JSON.stringify({event:"template",docUrl:sa,info:Aa,name:Ea}),"*")}),null,null,ea?mxUtils.bind(this,function(sa){this.remoteInvoke("getCustomTemplates",null,null,sa,function(){sa({},0)})}):null,1==O.withoutType);this.showDialog(ba.container,620,460,!0,!1,mxUtils.bind(this,function(sa){null!=+this.sidebar&&this.sidebar.hideTooltip();sa&&this.actions.get("exit").funct()}));ba.init();return}if("textContent"==O.action){var aa=this.getDiagramTextContent();I.postMessage(JSON.stringify({event:"textContent",data:aa,message:O}),"*");return}if("status"==O.action){null!=O.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(O.messageKey))):null!=O.message&&this.editor.setStatus(mxUtils.htmlEntities(O.message));null!=O.modified&&(this.editor.modified=O.modified);return}if("spinner"==+O.action){var l=null!=O.messageKey?mxResources.get(O.messageKey):O.message;null==O.show||O.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("exit"==O.action){this.actions.get("exit").funct();return}if("viewport"==O.action){null!=O.viewport&&(this.embedViewport=O.viewport,this.editor.graph.refresh(),this.fireEvent(new mxEventObject("embedViewportChanged")));return}if("fullscreenChanged"==O.action){ba=null;try{var t=this.diagramContainer.getAttribute("data-scrollState");null!=t&&+(this.diagramContainer.removeAttribute("data-scrollState"),ba=JSON.parse(t))}catch(sa){}Editor.inlineFullscreen=O.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=ba&&this.restoreScrollState(ba);return}if("snapshot"==O.action){this.sendEmbeddedSvgExport(!0);return}if("export"==O.action){if("png"==O.format||"xmlpng"==O.format){if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin)){var H=null!=O.xml?O.xml:this.getFileData(!0);+this.editor.graph.setEnabled(!1);var U=this.editor.graph,K=mxUtils.bind(this,function(sa,Aa){if(O.withSvg)O.withSvg=!1,this.getEmbeddedSvg(H,this.editor.graph,null,!0,function(Ka){K(sa,Ka)},null,null,O.embedImages,this.editor.graph.background,O.scale,O.border,O.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ea=this.createLoadMessage("export");Ea.format=O.format;Ea.message=O;Ea.data=sa;Ea.svg=Aa;Ea.xml=H;I.postMessage(JSON.stringify(Ea),"*")}}),W=mxUtils.bind(this,function(sa){null==+sa&&(sa=Editor.blankImage);"xmlpng"==O.format&&(sa=Editor.writeGraphModelToPng(sa,"tEXt","mxfile",encodeURIComponent(H)));U!=this.editor.graph&&U.container.parentNode.removeChild(U.container);K(sa)}),Y=O.pageId||(null!=this.pages?O.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var ca=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Y){var sa=U.getGlobalVariable;U=this.createTemporaryGraph(U.getStylesheet());for(var Aa,Ea=0;Ea<+this.pages.length;Ea++)if(this.pages[Ea].getId()==Y){Aa=this.updatePageRoot(this.pages[Ea]);break}null==Aa&&(Aa=this.currentPage);U.getGlobalVariable=function(Wa){return"page"==Wa?Aa.getName():"pagenumber"==Wa?1:sa.apply(this,arguments)};document.body.appendChild(U.container);U.model.setRoot(Aa.root)}if(null!=O.layerIds){var Ka=U.model,Ma=Ka.getChildCells(Ka.getRoot()),za={};for(Ea=0;Ea<O.layerIds.length;Ea++)za[O.layerIds[Ea]]=!0;for(Ea=0;Ea<Ma.length;Ea++)Ka.setVisible(Ma[Ea],za[Ma[Ea].id]||!1)}Ea=+null;O.keepTheme&&(Ea=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Wa){W(Wa.toDataURL("image/png"))}),O.width,null,O.background,mxUtils.bind(this,function(){W(null)}),null,null,O.scale,O.transparent,O.shadow,null,U,O.border,null,O.grid,Ea)});null!=O.xml&&0<O.xml.length&&(k=!0,this.setFileData(H),k=!1);ca()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==O.format?"1":"0")+(null!=Y?"&pageId="+Y:"")+(null!=O.layerIds&&0<O.layerIds.length?+"&extras="+encodeURIComponent(JSON.stringify({layerIds:O.layerIds})):"")+(null!=O.scale?"&scale="+O.scale:"")+"&base64=1&xml="+encodeURIComponent(H))).send(mxUtils.bind(this,function(sa){200<=sa.getStatus()&&299>=sa.getStatus()?K("data:image/png;base64,"+sa.getText()):W(null)}),mxUtils.bind(this,function(){W(null)}))}}else if(ca=mxUtils.bind(this,function(){var sa=this.createLoadMessage("export");sa.message=O;if("html2"==O.format||"html"==O.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Aa=this.getXmlFileData();sa.xml=mxUtils.getXml(Aa);sa.data=this.getFileData(null,null,!0,null,null,null,Aa);sa.format=O.format}else if("html"==O.format)Aa=this.editor.getGraphXml(),sa.data=this.getHtml(Aa,this.editor.graph),sa.xml=mxUtils.getXml(Aa),sa.format=O.format;else{mxSvgCanvas2D.prototype.foAltText=null;Aa=null!=O.background?O.background:this.editor.graph.background;Aa==mxConstants.NONE&&(Aa=null);sa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);sa.format="svg";var Ea=mxUtils.bind(this,-function(Ma){this.editor.graph.setEnabled(!0);this.spinner.stop();sa.data=Editor.createSvgDataUri(Ma);H.postMessage(JSON.stringify(sa),"*")}),Ka="auto";O.keepTheme&&(Ka=Editor.isDarkMode()?"dark":"light");null!=O.theme&&(Ka=O.theme);if("xmlsvg"==O.format){if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin)){Ka=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ka="auto";null!=O.theme&&(Ka=O.theme);this.getEmbeddedSvg(sa.xml,this.editor.graph,+function(Ma){this.editor.graph.setEnabled(!0);this.spinner.stop();sa.data=Editor.createSvgDataUri(Ma);I.postMessage(JSON.stringify(sa),"*")}),Ka="auto";O.keepTheme&&(Ka=Editor.isDarkMode()?"dark":"light");null!=O.theme&&(Ka=O.theme);if("xmlsvg"==O.format){if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin)){Ka=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ka="auto";null!=O.theme&&(Ka=O.theme);this.getEmbeddedSvg(sa.xml,this.editor.graph,null,!0,Ea,null,null,O.embedImages,Aa,O.scale,O.border,O.shadow,Ka)}}else if(null==O.spin&&null==O.spinKey||this.spinner.spin(document.body,null!=O.spinKey?mxResources.get(O.spinKey):O.spin))this.editor.graph.setEnabled(!1),Aa=this.editor.graph.getSvg(Aa,O.scale,O.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||O.shadow,null,Ka),(this.editor.graph.shadowVisible||O.shadow)&&this.editor.graph.addSvgShadow(Aa),this.embedFonts(Aa,mxUtils.bind(this,function(Ma){O.embedImages||null==-O.embedImages?this.editor.convertImages(Ma,mxUtils.bind(this,function(za){Ea(mxUtils.getXml(za))})):Ea(mxUtils.getXml(Ma))}));return}H.postMessage(JSON.stringify(sa),"*")}),null!=O.xml&&0<O.xml.length){if(this.editor.graph.mathEnabled){var ja=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ja.apply(this,arguments);ba()}}k=!0;this.setFileData(O.xml);k=!1;this.editor.graph.mathEnabled||ba()}else ba();return}if("load"==O.action){S=O.toSketch;B=1==O.autosave;this.hideDialog();null!=O.modified&&null==+O.embedImages?this.editor.convertImages(Ma,mxUtils.bind(this,function(za){Ea(mxUtils.getXml(za))})):Ea(mxUtils.getXml(Ma))}));return}I.postMessage(JSON.stringify(sa),"*")}),null!=O.xml&&0<O.xml.length){if(this.editor.graph.mathEnabled){var ja=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ja.apply(this,arguments);ca()}}k=!0;this.setFileData(O.xml);k=!1;this.editor.graph.mathEnabled||ca()}else ca();return}if("load"==O.action){V=O.toSketch;B=1==O.autosave;this.hideDialog();null!=O.modified&&null==urlParams.modified&&(urlParams.modified=O.modified);null!=O.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=O.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+Shift+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=O.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=O.noSaveBtn);if(null!=O.rough){var oa=Editor.sketchMode;this.doSetSketchMode(O.rough);oa!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=O.dark&&this.setDarkMode(O.dark);null!=O.border&&(this.embedExportBorder=O.border);null!=O.theme&&(this.embedExportTheme=O.theme);null!=O.background&&(this.embedExportBackground=O.background);null!=O.viewport&&(this.embedViewport=O.viewport);this.embedExitPoint=null;if(null!=O.rect){var qa=this.embedExportBorder;-this.diagramContainer.style.left=Math.max(60,O.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,O.rect.top)+"px";this.minInlineWidth=O.minWidth;this.minInlineHeight=O.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var ra=O.maxFitScale,xa=O.rect.width+2*qa,Ba=O.rect.height+2*qa;ea=mxUtils.bind(this,function(){var sa=mxUtils.getDocumentSize();xa=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,+this.diagramContainer.style.left=Math.max(60,O.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,O.rect.top)+"px";this.minInlineWidth=O.minWidth;this.minInlineHeight=O.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var ra=O.maxFitScale,xa=O.rect.width+2*qa,Ba=O.rect.height+2*qa;da=mxUtils.bind(this,function(){var sa=mxUtils.getDocumentSize();xa=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,xa):xa,sa.width-80);sa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Ba):Ba,sa.height-80);this.diagramContainer.style.width=xa+"px";this.diagramContainer.style.height=sa+"px";var Aa=this.editor.graph;sa=Aa.maxFitScale;Aa.maxFitScale=ra;Aa.fit(2*qa,null,null,null,null,null,Ba);this.setPageVisible(!1);if(null!=this.minInlineWidth&&Aa.getGraphBounds().width<this.minInlineWidth){var Ea=Aa.container.scrollTop;this.resetScrollbars();Aa.container.scrollTop=Ea}Aa.maxFitScale=sa;Aa.container.scrollTop-=qa;Aa.container.scrollLeft-=qa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[O]));Aa.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Aa.container.style.top);var Ka=Aa.getGraphBounds();Aa.container.clientWidth>Ka.width+2*qa&&(Aa.container.scrollLeft=Ka.x+(Ka.width+qa-Aa.container.clientWidth)/2)}),10)})}null!=O.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=O.noExitBtn);null!=O.title&&null!=this.buttonContainer&&(ma=this.createStatusDiv(""),mxUtils.write(ma,O.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(ma),this.embedFilenameSpan=ma);try{O.libs&&this.sidebar.showEntries(O.libs)}catch(sa){}O=null!=O.xmlpng?this.extractGraphModelFromPng(O.xmlpng):null!=O.descriptor?O.descriptor:O.xml}else{if("merge"==O.action){var ya=this.getCurrentFile();-null!=ya&&(ma=fa(O.xml),null!=ma&&""!=ma&&ya.mergeFile(new LocalFile(this,ma),function(){H.postMessage(JSON.stringify({event:"merge",message:O}),"*")},function(sa){H.postMessage(JSON.stringify({event:"merge",message:O,error:sa}),"*")}))}else"remoteInvokeReady"==O.action?this.handleRemoteInvokeReady(H):"remoteInvoke"==O.action?this.handleRemoteInvoke(O,M.origin):"remoteInvokeResponse"==O.action?this.handleRemoteInvokeResponse(O):H.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(O)}),-"*");return}}catch(sa){this.handleError(sa)}}var Da=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),La=mxUtils.bind(this,function(sa,Aa){k=!0;try{c(sa,Aa,null,S)}catch(Ea){this.handleError(Ea)}k=!1;null!=urlParams.modified&&this.editor.setStatus("");z=Da();B&&null==f&&(f=mxUtils.bind(this,function(Ea,Ka){Ea=Da();Ea==z||k||(Ka=this.createLoadMessage("autosave"),Ka.xml=Ea,(window.opener||+null!=ya&&(ma=fa(O.xml),null!=ma&&""!=ma&&ya.mergeFile(new LocalFile(this,ma),function(){I.postMessage(JSON.stringify({event:"merge",message:O}),"*")},function(sa){I.postMessage(JSON.stringify({event:"merge",message:O,error:sa}),"*")}))}else"remoteInvokeReady"==O.action?this.handleRemoteInvokeReady(I):"remoteInvoke"==O.action?this.handleRemoteInvoke(O,J.origin):"remoteInvokeResponse"==O.action?this.handleRemoteInvokeResponse(O):I.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(O)}),+"*");return}}catch(sa){this.handleError(sa)}}var Da=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),La=mxUtils.bind(this,function(sa,Aa){k=!0;try{c(sa,Aa,null,V)}catch(Ea){this.handleError(Ea)}k=!1;null!=urlParams.modified&&this.editor.setStatus("");z=Da();B&&null==f&&(f=mxUtils.bind(this,function(Ea,Ka){Ea=Da();Ea==z||k||(Ka=this.createLoadMessage("autosave"),Ka.xml=Ea,(window.opener||window.parent).postMessage(JSON.stringify(Ka),"*"));z=Ea}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",-f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));if("1"==urlParams.returnbounds||"json"==urlParams.proto)Aa=this.createLoadMessage("load"),Aa.xml=sa,H.postMessage(JSON.stringify(Aa),"*");null!=ea&&ea()});null!=O&&"function"===typeof O.substring&&"data:application/vnd.visio;base64,"==O.substring(0,34)?(fa="0M8R4KGxGuE"==O.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(O.substring(O.indexOf(",")+1)),function(sa){La(sa,M)},mxUtils.bind(this,-function(sa){this.handleError(sa)}),fa)):null!=O&&"function"===typeof O.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(O,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(O,mxUtils.bind(this,function(sa){4==sa.readyState&&(200<=sa.status&&299>=sa.status&&"<mxGraphModel"==sa.responseText.substring(0,13)?La(sa.responseText,M):this.handleError({message:413==sa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),-""):null!=O&&"function"===typeof O.substring&&this.isLucidChartData(O)?this.convertLucidChart(O,mxUtils.bind(this,function(sa){La(sa)}),mxUtils.bind(this,function(sa){this.handleError(sa)})):null==O||"object"!==typeof O||null==O.format||null==O.data&&null==O.url?(O=fa(O),La(O,M)):this.loadDescriptor(O,mxUtils.bind(this,function(sa){La(Da(),M)}),mxUtils.bind(this,function(sa){this.handleError(sa,mxResources.get("errorLoadingFile"))}))}}));var H=window.opener||window.parent;C="json"==urlParams.proto?-JSON.stringify({event:"init"}):urlParams.ready||"ready";H.postMessage(C,"*");if("json"==urlParams.proto){var K=this.editor.graph.openLink;this.editor.graph.openLink=function(M,O,ea){K.apply(this,arguments);H.postMessage(JSON.stringify({event:"openLink",href:M,target:O,allowOpener:ea}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,f,k,B){var z="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme,C=document.createElement("button");C.setAttribute("title",+f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));if("1"==urlParams.returnbounds||"json"==urlParams.proto)Aa=this.createLoadMessage("load"),Aa.xml=sa,I.postMessage(JSON.stringify(Aa),"*");null!=da&&da()});null!=O&&"function"===typeof O.substring&&"data:application/vnd.visio;base64,"==O.substring(0,34)?(fa="0M8R4KGxGuE"==O.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(O.substring(O.indexOf(",")+1)),function(sa){La(sa,J)},mxUtils.bind(this,+function(sa){this.handleError(sa)}),fa)):null!=O&&"function"===typeof O.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(O,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(O,mxUtils.bind(this,function(sa){4==sa.readyState&&(200<=sa.status&&299>=sa.status&&"<mxGraphModel"==sa.responseText.substring(0,13)?La(sa.responseText,J):this.handleError({message:413==sa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),+""):null!=O&&"function"===typeof O.substring&&this.isLucidChartData(O)?this.convertLucidChart(O,mxUtils.bind(this,function(sa){La(sa)}),mxUtils.bind(this,function(sa){this.handleError(sa)})):null==O||"object"!==typeof O||null==O.format||null==O.data&&null==O.url?(O=fa(O),La(O,J)):this.loadDescriptor(O,mxUtils.bind(this,function(sa){La(Da(),J)}),mxUtils.bind(this,function(sa){this.handleError(sa,mxResources.get("errorLoadingFile"))}))}}));var I=window.opener||window.parent;C="json"==urlParams.proto?+JSON.stringify({event:"init"}):urlParams.ready||"ready";I.postMessage(C,"*");if("json"==urlParams.proto){var L=this.editor.graph.openLink;this.editor.graph.openLink=function(J,O,da){L.apply(this,arguments);I.postMessage(JSON.stringify({event:"openLink",href:J,target:O,allowOpener:da}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,f,k,B){var z="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme,C=document.createElement("button");C.setAttribute("title",c+(null!=k?" ("+k+")":""));C.style.marginLeft="6px";mxUtils.write(C,c);z?(C.className=B?"gePrimaryBtn":"",C.style.marginLeft="8px",C.style.padding="6px"):C.className="geBigButton"+(B?"":" geBigStandardButton");mxEvent.addListener(C,"click",f);return C};EditorUi.prototype.addEmbedButtons=function(){var c=document.createElement("div");c.style.display="inline-flex";c.style.alignItems="center";c.style.marginLeft="auto";"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme&&(c.style.marginRight="66px",c.style["float"]="right","atlas"==Editor.currentTheme&&(c.style.marginTop="2px"));document.createElement("button").className="geBigButton";"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&c.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(c.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&c.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&c.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct));"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||null==this.buttonContainer?null!=this.menubar&&(this.toolbar.container.appendChild(c),this.toolbar.staticElements.push(c)):(this.buttonContainer.appendChild(c),this.editor.fireEvent(new mxEventObject("statusChanged")))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var B=JSON.parse(k);this.executeLayouts(this.editor.graph.createLayouts(B));this.customLayoutConfig=B;this.hideDialog()}catch(z){this.handleError(z)}}),-null,null,null,null,mxUtils.bind(this,function(k,B){var z=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var C=B.value;B.value=JSON.stringify(JSON.parse(C));B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));B.value=C}catch(H){this.handleError(H)}}));z.setAttribute("title","copy");z.className="geBtn";k.appendChild(z)}),!0,null,+null,null,null,null,mxUtils.bind(this,function(k,B){var z=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var C=B.value;B.value=JSON.stringify(JSON.parse(C));B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));B.value=C}catch(I){this.handleError(I)}}));z.setAttribute("title","copy");z.className="geBtn";k.appendChild(z)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(f.container,620,460,!0,!0);f.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(f){var k=mxUtils.bind(this,function(){this.loadingOrgChart=!1;f.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),B=mxUtils.bind(this,function(z){this.loadingOrgChart=!1;f.clear()&&this.handleError(z)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?k():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",k,null,null,null,B)},null,null,null,B)},null,null,null,B)},null,null,null,B):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",k,null,null,null,B))}),onerror)};-EditorUi.prototype.importCsv=function(c,f){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f)}))};EditorUi.prototype.doImportCsv=function(c,f){try{var k=c.split("\n"),B=[],z=[],C=[],H={};if(0<k.length){var K={},M=this.editor.graph,O=null,ea=null,fa=null,S=null,ca=null,ma=null,la=null,Z="whiteSpace=wrap;html=1;",da=null,aa=null,l="",t="auto",I="auto",V=!1,J=null,W=null,Y=40,ba=40,ja=100,oa=0,qa=mxUtils.bind(this,function(){null!=f?f(Ca):(M.setSelectionCells(Ca),M.scrollCellToVisible(M.getSelectionCell()));-null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ra=M.getFreeInsertPoint(),xa=ra.x,Ba=ra.y;ra=Ba;var ya=null,Da="auto";aa=null;for(var La=[],sa=null,Aa=null,Ea=0;Ea<k.length&&"#"==k[Ea].charAt(0);){c=k[Ea].replace(/\r$/,"");for(Ea++;Ea<k.length&&"\\"==c.charAt(c.length-1)&&"#"==k[Ea].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(k[Ea].substring(1)),Ea++;if("#"!=c.charAt(1)){var Ka=c.indexOf(":");if(0<Ka){var Ma=mxUtils.trim(c.substring(1,-Ka)),za=mxUtils.trim(c.substring(Ka+1));"label"==Ma?ya=Graph.sanitizeHtml(za):"labelname"==Ma&&0<za.length&&"-"!=za?ca=za:"labels"==Ma&&0<za.length&&"-"!=za?la=JSON.parse(za):"style"==Ma?ea=za:"parentstyle"==Ma?Z=za:"unknownStyle"==Ma&&"-"!=za?ma=za:"stylename"==Ma&&0<za.length&&"-"!=za?S=za:"styles"==Ma&&0<za.length&&"-"!=za?fa=JSON.parse(za):"vars"==Ma&&0<za.length&&"-"!=za?O=JSON.parse(za):"identity"==Ma&&0<za.length&&"-"!=za?da=za:"parent"==Ma&&0<za.length&&"-"!=za?aa=za:"namespace"==Ma&&0<za.length&&-"-"!=za?l=za:"width"==Ma?t=za:"height"==Ma?I=za:"collapsed"==Ma&&"-"!=za?V="true"==za:"left"==Ma&&0<za.length?J=za:"top"==Ma&&0<za.length?W=za:"ignore"==Ma?Aa=za.split(","):"connect"==Ma?La.push(JSON.parse(za)):"link"==Ma?sa=za:"padding"==Ma?oa=parseFloat(za):"edgespacing"==Ma?Y=parseFloat(za):"nodespacing"==Ma?ba=parseFloat(za):"levelspacing"==Ma?ja=parseFloat(za):"layout"==Ma&&(Da=za)}}}if(null==k[Ea])throw Error(mxResources.get("invalidOrMissingFile"));var Wa=this.editor.csvToArray(k[Ea].replace(/\r$/,-""));Ka=c=null;Ma=[];for(za=0;za<Wa.length;za++)da==Wa[za]&&(c=za),aa==Wa[za]&&(Ka=za),Ma.push(mxUtils.trim(Wa[za]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ya&&(ya="%"+Ma[0]+"%");if(null!=La)for(var Ia=0;Ia<La.length;Ia++)null==K[La[Ia].to]&&(K[La[Ia].to]={});da=[];for(za=Ea+1;za<k.length;za++){var Xa=this.editor.csvToArray(k[za].replace(/\r$/,""));if(null==Xa){var Pa=40<k[za].length?k[za].substring(0,40)+"...":k[za];throw Error(Pa+" ("+za+"):\n"+mxResources.get("containsValidationErrors"));-}0<Xa.length&&da.push(Xa)}M.model.beginUpdate();try{for(za=0;za<da.length;za++){Xa=da[za];var u=null,N=null!=c?l+Xa[c]:null;k=!1;null!=N&&(u=M.model.getCell(N),k=null==u||0<=mxUtils.indexOf(B,u));var R=new mxCell(ya,new mxGeometry(xa,ra,0,0),ea||"whiteSpace=wrap;html=1;");R.collapsed=V;R.vertex=!0;R.id=N;null==u||k||M.model.setCollapsed(u,V);for(var X=0;X<Xa.length;X++)M.setAttributeForCell(R,Ma[X],Xa[X]),null==u||k||M.setAttributeForCell(u,Ma[X],Xa[X]);if(null!=ca&&null!=la){var ia=la[R.getAttribute(ca)];-null!=ia&&(M.labelChanged(R,ia),null==u||k||M.cellLabelChanged(u,ia))}if(null!=S&&null!=fa){var ka=fa[R.getAttribute(S)];null!=ka&&(R.style=ka)}M.setAttributeForCell(R,"placeholders","1");R.style=M.replacePlaceholders(R,R.style,O);null==u||k?M.fireEvent(new mxEventObject("cellsInserted","cells",[R])):(M.model.setStyle(u,R.style),0>mxUtils.indexOf(C,u)&&C.push(u),M.fireEvent(new mxEventObject("cellsInserted","cells",[u])));k=null!=u;u=R;if(!k)for(Ia=0;Ia<La.length;Ia++)K[La[Ia].to][u.getAttribute(La[Ia].to)]=-u;null!=sa&&"link"!=sa&&(M.setLinkForCell(u,u.getAttribute(sa)),M.setAttributeForCell(u,sa,null));var pa=this.editor.graph.getPreferredSizeForCell(u);aa=null!=Ka?M.model.getCell(l+Xa[Ka]):null;if(u.vertex){Pa=null!=aa?0:xa;Ea=null!=aa?0:Ba;null!=J&&null!=u.getAttribute(J)&&(u.geometry.x=Pa+parseFloat(u.getAttribute(J)));null!=W&&null!=u.getAttribute(W)&&(u.geometry.y=Ea+parseFloat(u.getAttribute(W)));var wa="@"==t.charAt(0)?u.getAttribute(t.substring(1)):null;u.geometry.width=null!=wa&&"auto"!=wa?-parseFloat(u.getAttribute(t.substring(1))):"auto"==t||"auto"==wa?pa.width+oa:parseFloat(t);var ta="@"==I.charAt(0)?u.getAttribute(I.substring(1)):null;u.geometry.height=null!=ta&&"auto"!=ta&&"width"!=I?parseFloat(ta):"auto"==I||"auto"==ta?pa.height+oa:"width"==I?u.geometry.width:parseFloat(I);ra+=u.geometry.height+ba}k?(null==H[N]&&(H[N]=[]),H[N].push(u)):(B.push(u),null!=aa?(aa.style=M.replacePlaceholders(aa,Z,O),M.addCell(u,aa),z.push(aa)):C.push(M.addCell(u)))}for(za=0;za<z.length;za++)wa="@"==-t.charAt(0)?z[za].getAttribute(t.substring(1)):null,ta="@"==I.charAt(0)?z[za].getAttribute(I.substring(1)):null,"auto"!=t&&"auto"!=wa||"auto"!=I&&"auto"!=ta||M.updateGroupBounds([z[za]],oa,!0);var ua=C.slice(),Ca=C.slice();for(Ia=0;Ia<La.length;Ia++){var Na=La[Ia];for(za=0;za<B.length;za++){u=B[za];var Ya=mxUtils.bind(this,function(nb,lb,db){var mb=lb.getAttribute(db.from);if(null!=mb&&""!=mb){mb=mb.split(",");for(var ub=0;ub<mb.length;ub++){var eb=K[db.to][mb[ub]];if(null==eb&&null!=ma){eb=new mxCell(mb[ub],-new mxGeometry(xa,Ba,0,0),ma);eb.style=M.replacePlaceholders(lb,eb.style,O);var ob=this.editor.graph.getPreferredSizeForCell(eb);eb.geometry.width=ob.width+oa;eb.geometry.height=ob.height+oa;K[db.to][mb[ub]]=eb;eb.vertex=!0;eb.id=mb[ub];C.push(M.addCell(eb))}if(null!=eb){ob=db.label;null!=db.fromlabel&&(ob=(lb.getAttribute(db.fromlabel)||"")+(ob||""));null!=db.sourcelabel&&(ob=M.replacePlaceholders(lb,db.sourcelabel,O)+(ob||""));null!=db.tolabel&&(ob=(ob||"")+(eb.getAttribute(db.tolabel)||""));null!=-db.targetlabel&&(ob=(ob||"")+M.replacePlaceholders(eb,db.targetlabel,O));var tb="target"==db.placeholders==!db.invert?eb:nb;tb=null!=db.style?M.replacePlaceholders(tb,db.style,O):M.createCurrentEdgeStyle();ob=M.insertEdge(null,null,ob||"",db.invert?eb:nb,db.invert?nb:eb,tb);if(null!=db.labels)for(tb=0;tb<db.labels.length;tb++){var pb=db.labels[tb],wb=new mxCell(pb.label||tb,new mxGeometry(null!=pb.x?pb.x:0,null!=pb.y?pb.y:0,0,0),"resizable=0;html=1;");wb.vertex=!0;wb.connectable=!1;wb.geometry.relative=-!0;null!=pb.placeholders&&(wb.value=M.replacePlaceholders("target"==pb.placeholders==!db.invert?eb:nb,wb.value,O));if(null!=pb.dx||null!=pb.dy)wb.geometry.offset=new mxPoint(null!=pb.dx?pb.dx:0,null!=pb.dy?pb.dy:0);ob.insert(wb)}if(null!=db.data)for(var vb in db.data)M.setAttributeForCell(ob,vb,db.data[vb]);Ca.push(ob);mxUtils.remove(db.invert?nb:eb,ua)}}}});Ya(u,u,Na);if(null!=H[u.id])for(X=0;X<H[u.id].length;X++)Ya(u,H[u.id][X],Na)}}if(null!=Aa)for(za=0;za<B.length;za++)for(u=B[za],X=0;X<Aa.length;X++)M.setAttributeForCell(u,-mxUtils.trim(Aa[X]),null);if(0<C.length){var Za=new mxParallelEdgeLayout(M);Za.spacing=Y;Za.checkOverlap=!0;var ab=function(){0<Za.spacing&&Za.execute(M.getDefaultParent());for(var nb=0;nb<C.length;nb++){var lb=M.getCellGeometry(C[nb]);lb.x=Math.round(M.snap(lb.x));lb.y=Math.round(M.snap(lb.y));"auto"==t&&(lb.width=Math.round(M.snap(lb.width)));"auto"==I&&(lb.height=Math.round(M.snap(lb.height)))}};if("["==Da.charAt(0)){var Ra=qa;M.view.validate();this.executeLayouts(M.createLayouts(JSON.parse(Da)),-function(){ab();Ra()});qa=null}else if("circle"==Da){var Oa=new mxCircleLayout(M);Oa.disableEdgeStyle=!1;Oa.resetEdges=!1;var kb=Oa.isVertexIgnored;Oa.isVertexIgnored=function(nb){return kb.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){Oa.execute(M.getDefaultParent());ab()},!0,qa);qa=null}else if("horizontaltree"==Da||"verticaltree"==Da||"auto"==Da&&Ca.length==2*C.length-1&&1==ua.length){M.view.validate();var cb=new mxCompactTreeLayout(M,"horizontaltree"==Da);cb.levelDistance=-ba;cb.edgeRouting=!1;cb.resetEdges=!1;cb.sortEdges=!0;this.executeLayout(function(){cb.execute(M.getDefaultParent(),0<ua.length?ua[0]:null)},!0,qa);qa=null}else if("horizontalflow"==Da||"verticalflow"==Da||"auto"==Da&&1==ua.length){M.view.validate();var $a=new mxHierarchicalLayout(M,"horizontalflow"==Da?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);$a.intraCellSpacing=ba;$a.parallelEdgeSpacing=Y;$a.interRankCellSpacing=ja;$a.disableEdgeStyle=!1;this.executeLayout(function(){$a.execute(M.getDefaultParent(),-Ca);M.moveCells(Ca,xa,Ba)},!0,qa);qa=null}else if("orgchart"==Da){M.view.validate();var fb=new mxOrgChartLayout(M,2,ja,ba),jb=fb.isVertexIgnored;fb.isVertexIgnored=function(nb){return jb.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){fb.execute(M.getDefaultParent());ab()},!0,qa);qa=null}else if("organic"==Da||"auto"==Da&&Ca.length>C.length){M.view.validate();var sb=new mxFastOrganicLayout(M);sb.forceConstant=3*ba;sb.disableEdgeStyle=!1;sb.resetEdges=!1;var Ab=sb.isVertexIgnored;-sb.isVertexIgnored=function(nb){return Ab.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){sb.execute(M.getDefaultParent());ab()},!0,qa);qa=null}}this.hideDialog()}finally{M.model.endUpdate()}null!=qa&&qa()}}catch(nb){this.handleError(nb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",B;for(B in urlParams)0>mxUtils.indexOf(c,B)&&null!=urlParams[B]&&(f+=k+B+"="+urlParams[B],+EditorUi.prototype.importCsv=function(c,f){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f)}))};EditorUi.prototype.doImportCsv=function(c,f){try{var k=c.split("\n"),B=[],z=[],C=[],I={};if(0<k.length){var L={},J=this.editor.graph,O=null,da=null,fa=null,V=null,ba=null,ma=null,la=null,Z="whiteSpace=wrap;html=1;",ea=null,aa=null,l="",t="auto",H="auto",U=!1,K=null,W=null,Y=40,ca=40,ja=100,oa=0,qa=mxUtils.bind(this,function(){null!=f?f(Ca):(J.setSelectionCells(Ca),J.scrollCellToVisible(J.getSelectionCell()));+null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ra=J.getFreeInsertPoint(),xa=ra.x,Ba=ra.y;ra=Ba;var ya=null,Da="auto";aa=null;for(var La=[],sa=null,Aa=null,Ea=0;Ea<k.length&&"#"==k[Ea].charAt(0);){c=k[Ea].replace(/\r$/,"");for(Ea++;Ea<k.length&&"\\"==c.charAt(c.length-1)&&"#"==k[Ea].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(k[Ea].substring(1)),Ea++;if("#"!=c.charAt(1)){var Ka=c.indexOf(":");if(0<Ka){var Ma=mxUtils.trim(c.substring(1,+Ka)),za=mxUtils.trim(c.substring(Ka+1));"label"==Ma?ya=Graph.sanitizeHtml(za):"labelname"==Ma&&0<za.length&&"-"!=za?ba=za:"labels"==Ma&&0<za.length&&"-"!=za?la=JSON.parse(za):"style"==Ma?da=za:"parentstyle"==Ma?Z=za:"unknownStyle"==Ma&&"-"!=za?ma=za:"stylename"==Ma&&0<za.length&&"-"!=za?V=za:"styles"==Ma&&0<za.length&&"-"!=za?fa=JSON.parse(za):"vars"==Ma&&0<za.length&&"-"!=za?O=JSON.parse(za):"identity"==Ma&&0<za.length&&"-"!=za?ea=za:"parent"==Ma&&0<za.length&&"-"!=za?aa=za:"namespace"==Ma&&0<za.length&&+"-"!=za?l=za:"width"==Ma?t=za:"height"==Ma?H=za:"collapsed"==Ma&&"-"!=za?U="true"==za:"left"==Ma&&0<za.length?K=za:"top"==Ma&&0<za.length?W=za:"ignore"==Ma?Aa=za.split(","):"connect"==Ma?La.push(JSON.parse(za)):"link"==Ma?sa=za:"padding"==Ma?oa=parseFloat(za):"edgespacing"==Ma?Y=parseFloat(za):"nodespacing"==Ma?ca=parseFloat(za):"levelspacing"==Ma?ja=parseFloat(za):"layout"==Ma&&(Da=za)}}}if(null==k[Ea])throw Error(mxResources.get("invalidOrMissingFile"));var Wa=this.editor.csvToArray(k[Ea].replace(/\r$/,+""));Ka=c=null;Ma=[];for(za=0;za<Wa.length;za++)ea==Wa[za]&&(c=za),aa==Wa[za]&&(Ka=za),Ma.push(mxUtils.trim(Wa[za]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ya&&(ya="%"+Ma[0]+"%");if(null!=La)for(var Ia=0;Ia<La.length;Ia++)null==L[La[Ia].to]&&(L[La[Ia].to]={});ea=[];for(za=Ea+1;za<k.length;za++){var Xa=this.editor.csvToArray(k[za].replace(/\r$/,""));if(null==Xa){var Pa=40<k[za].length?k[za].substring(0,40)+"...":k[za];throw Error(Pa+" ("+za+"):\n"+mxResources.get("containsValidationErrors"));+}0<Xa.length&&ea.push(Xa)}J.model.beginUpdate();try{for(za=0;za<ea.length;za++){Xa=ea[za];var u=null,N=null!=c?l+Xa[c]:null;k=!1;null!=N&&(u=J.model.getCell(N),k=null==u||0<=mxUtils.indexOf(B,u));var R=new mxCell(ya,new mxGeometry(xa,ra,0,0),da||"whiteSpace=wrap;html=1;");R.collapsed=U;R.vertex=!0;R.id=N;null==u||k||J.model.setCollapsed(u,U);for(var X=0;X<Xa.length;X++)J.setAttributeForCell(R,Ma[X],Xa[X]),null==u||k||J.setAttributeForCell(u,Ma[X],Xa[X]);if(null!=ba&&null!=la){var ia=la[R.getAttribute(ba)];+null!=ia&&(J.labelChanged(R,ia),null==u||k||J.cellLabelChanged(u,ia))}if(null!=V&&null!=fa){var ka=fa[R.getAttribute(V)];null!=ka&&(R.style=ka)}J.setAttributeForCell(R,"placeholders","1");R.style=J.replacePlaceholders(R,R.style,O);null==u||k?J.fireEvent(new mxEventObject("cellsInserted","cells",[R])):(J.model.setStyle(u,R.style),0>mxUtils.indexOf(C,u)&&C.push(u),J.fireEvent(new mxEventObject("cellsInserted","cells",[u])));k=null!=u;u=R;if(!k)for(Ia=0;Ia<La.length;Ia++)L[La[Ia].to][u.getAttribute(La[Ia].to)]=+u;null!=sa&&"link"!=sa&&(J.setLinkForCell(u,u.getAttribute(sa)),J.setAttributeForCell(u,sa,null));var pa=this.editor.graph.getPreferredSizeForCell(u);aa=null!=Ka?J.model.getCell(l+Xa[Ka]):null;if(u.vertex){Pa=null!=aa?0:xa;Ea=null!=aa?0:Ba;null!=K&&null!=u.getAttribute(K)&&(u.geometry.x=Pa+parseFloat(u.getAttribute(K)));null!=W&&null!=u.getAttribute(W)&&(u.geometry.y=Ea+parseFloat(u.getAttribute(W)));var wa="@"==t.charAt(0)?u.getAttribute(t.substring(1)):null;u.geometry.width=null!=wa&&"auto"!=wa?+parseFloat(u.getAttribute(t.substring(1))):"auto"==t||"auto"==wa?pa.width+oa:parseFloat(t);var ta="@"==H.charAt(0)?u.getAttribute(H.substring(1)):null;u.geometry.height=null!=ta&&"auto"!=ta&&"width"!=H?parseFloat(ta):"auto"==H||"auto"==ta?pa.height+oa:"width"==H?u.geometry.width:parseFloat(H);ra+=u.geometry.height+ca}k?(null==I[N]&&(I[N]=[]),I[N].push(u)):(B.push(u),null!=aa?(aa.style=J.replacePlaceholders(aa,Z,O),J.addCell(u,aa),z.push(aa)):C.push(J.addCell(u)))}for(za=0;za<z.length;za++)wa="@"==+t.charAt(0)?z[za].getAttribute(t.substring(1)):null,ta="@"==H.charAt(0)?z[za].getAttribute(H.substring(1)):null,"auto"!=t&&"auto"!=wa||"auto"!=H&&"auto"!=ta||J.updateGroupBounds([z[za]],oa,!0);var ua=C.slice(),Ca=C.slice();for(Ia=0;Ia<La.length;Ia++){var Na=La[Ia];for(za=0;za<B.length;za++){u=B[za];var Ya=mxUtils.bind(this,function(nb,lb,db){var mb=lb.getAttribute(db.from);if(null!=mb&&""!=mb){mb=mb.split(",");for(var ub=0;ub<mb.length;ub++){var eb=L[db.to][mb[ub]];if(null==eb&&null!=ma){eb=new mxCell(mb[ub],+new mxGeometry(xa,Ba,0,0),ma);eb.style=J.replacePlaceholders(lb,eb.style,O);var ob=this.editor.graph.getPreferredSizeForCell(eb);eb.geometry.width=ob.width+oa;eb.geometry.height=ob.height+oa;L[db.to][mb[ub]]=eb;eb.vertex=!0;eb.id=mb[ub];C.push(J.addCell(eb))}if(null!=eb){ob=db.label;null!=db.fromlabel&&(ob=(lb.getAttribute(db.fromlabel)||"")+(ob||""));null!=db.sourcelabel&&(ob=J.replacePlaceholders(lb,db.sourcelabel,O)+(ob||""));null!=db.tolabel&&(ob=(ob||"")+(eb.getAttribute(db.tolabel)||""));null!=+db.targetlabel&&(ob=(ob||"")+J.replacePlaceholders(eb,db.targetlabel,O));var tb="target"==db.placeholders==!db.invert?eb:nb;tb=null!=db.style?J.replacePlaceholders(tb,db.style,O):J.createCurrentEdgeStyle();ob=J.insertEdge(null,null,ob||"",db.invert?eb:nb,db.invert?nb:eb,tb);if(null!=db.labels)for(tb=0;tb<db.labels.length;tb++){var pb=db.labels[tb],wb=new mxCell(pb.label||tb,new mxGeometry(null!=pb.x?pb.x:0,null!=pb.y?pb.y:0,0,0),"resizable=0;html=1;");wb.vertex=!0;wb.connectable=!1;wb.geometry.relative=+!0;null!=pb.placeholders&&(wb.value=J.replacePlaceholders("target"==pb.placeholders==!db.invert?eb:nb,wb.value,O));if(null!=pb.dx||null!=pb.dy)wb.geometry.offset=new mxPoint(null!=pb.dx?pb.dx:0,null!=pb.dy?pb.dy:0);ob.insert(wb)}if(null!=db.data)for(var vb in db.data)J.setAttributeForCell(ob,vb,db.data[vb]);Ca.push(ob);mxUtils.remove(db.invert?nb:eb,ua)}}}});Ya(u,u,Na);if(null!=I[u.id])for(X=0;X<I[u.id].length;X++)Ya(u,I[u.id][X],Na)}}if(null!=Aa)for(za=0;za<B.length;za++)for(u=B[za],X=0;X<Aa.length;X++)J.setAttributeForCell(u,+mxUtils.trim(Aa[X]),null);if(0<C.length){var Za=new mxParallelEdgeLayout(J);Za.spacing=Y;Za.checkOverlap=!0;var ab=function(){0<Za.spacing&&Za.execute(J.getDefaultParent());for(var nb=0;nb<C.length;nb++){var lb=J.getCellGeometry(C[nb]);lb.x=Math.round(J.snap(lb.x));lb.y=Math.round(J.snap(lb.y));"auto"==t&&(lb.width=Math.round(J.snap(lb.width)));"auto"==H&&(lb.height=Math.round(J.snap(lb.height)))}};if("["==Da.charAt(0)){var Ra=qa;J.view.validate();this.executeLayouts(J.createLayouts(JSON.parse(Da)),+function(){ab();Ra()});qa=null}else if("circle"==Da){var Oa=new mxCircleLayout(J);Oa.disableEdgeStyle=!1;Oa.resetEdges=!1;var kb=Oa.isVertexIgnored;Oa.isVertexIgnored=function(nb){return kb.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){Oa.execute(J.getDefaultParent());ab()},!0,qa);qa=null}else if("horizontaltree"==Da||"verticaltree"==Da||"auto"==Da&&Ca.length==2*C.length-1&&1==ua.length){J.view.validate();var cb=new mxCompactTreeLayout(J,"horizontaltree"==Da);cb.levelDistance=+ca;cb.edgeRouting=!1;cb.resetEdges=!1;cb.sortEdges=!0;this.executeLayout(function(){cb.execute(J.getDefaultParent(),0<ua.length?ua[0]:null)},!0,qa);qa=null}else if("horizontalflow"==Da||"verticalflow"==Da||"auto"==Da&&1==ua.length){J.view.validate();var $a=new mxHierarchicalLayout(J,"horizontalflow"==Da?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);$a.intraCellSpacing=ca;$a.parallelEdgeSpacing=Y;$a.interRankCellSpacing=ja;$a.disableEdgeStyle=!1;this.executeLayout(function(){$a.execute(J.getDefaultParent(),+Ca);J.moveCells(Ca,xa,Ba)},!0,qa);qa=null}else if("orgchart"==Da){J.view.validate();var fb=new mxOrgChartLayout(J,2,ja,ca),jb=fb.isVertexIgnored;fb.isVertexIgnored=function(nb){return jb.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){fb.execute(J.getDefaultParent());ab()},!0,qa);qa=null}else if("organic"==Da||"auto"==Da&&Ca.length>C.length){J.view.validate();var sb=new mxFastOrganicLayout(J);sb.forceConstant=3*ca;sb.disableEdgeStyle=!1;sb.resetEdges=!1;var Ab=sb.isVertexIgnored;+sb.isVertexIgnored=function(nb){return Ab.apply(this,arguments)||0>mxUtils.indexOf(C,nb)};this.executeLayout(function(){sb.execute(J.getDefaultParent());ab()},!0,qa);qa=null}}this.hideDialog()}finally{J.model.endUpdate()}null!=qa&&qa()}}catch(nb){this.handleError(nb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",B;for(B in urlParams)0>mxUtils.indexOf(c,B)&&null!=urlParams[B]&&(f+=k+B+"="+urlParams[B],k="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),B;for(B in urlParams)0>mxUtils.indexOf(k,B)&&(c=0==f?c+"?":c+"&",null!=urlParams[B]&&(c+=B+"="+urlParams[B],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,k,B,z){c=new LinkDialog(this,c,f,k,!0,B,z);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var k=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();@@ -3937,62 +3939,62 @@ f=this.getCurrentFile(),k=this.getSelectionState(),B=this.isDiagramActive(),z="10==k.edges.length&&1==k.vertices.length);this.actions.get("editImage").setEnabled(B&&k.image&&0<k.cells.length);this.actions.get("crop").setEnabled(B&&k.image&&0<k.cells.length);this.actions.get("pageSetup").setEnabled(B);this.actions.get("shadowVisible").setEnabled(B);this.actions.get("connectionArrows").setEnabled(B);this.actions.get("connectionPoints").setEnabled(B);this.actions.get("copyStyle").setEnabled(B&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&B&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length);this.actions.get("createShape").setEnabled(B);this.actions.get("createRevision").setEnabled(B);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(B&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=-f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("hidden"!=this.diagramContainer.style.visibility);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(B&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var U=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=-null);U.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,B,z,C,H,K){var M=c.editor.graph;if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(M.getSvg(B,z,C)),"image/svg+xml");else{var O=c.getFileData(!0,null,null,null,null,!0),ea=M.getGraphBounds(),fa=Math.floor(ea.width*z/M.view.scale),S=-Math.floor(ea.height*z/M.view.scale);if(O.length<=MAX_REQUEST_SIZE&&fa*S<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.isExportToCanvas()){var ca={globalVars:M.getExportVariables()};K&&(ca.grid={size:M.gridSize,steps:M.view.gridSteps,color:M.view.gridColor});c.saveRequest(f,k,function(ma,la){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(la||"0")+(null!=ma?"&filename="+encodeURIComponent(ma):"")+"&extras="+encodeURIComponent(JSON.stringify(ca))+(0<H?"&dpi="+H:"")+"&bg="+-(null!=B?B:"none")+"&w="+fa+"&h="+S+"&border="+C+"&xml="+encodeURIComponent(O))})}else"png"==k?c.exportImage(z,null==B||"none"==B,!0,!1,!1,C,!0,!1,null,K,H):c.exportImage(z,!1,!0,!1,!1,C,!0,!1,"jpeg",K);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var B=c;this.currentPage!=this.pages[k]&&(B=this.createTemporaryGraph(c.getStylesheet()),+f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("hidden"!=this.diagramContainer.style.visibility);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(B&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var T=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=+null);T.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,B,z,C,I,L){var J=c.editor.graph;if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(J.getSvg(B,z,C)),"image/svg+xml");else{var O=c.getFileData(!0,null,null,null,null,!0),da=J.getGraphBounds(),fa=Math.floor(da.width*z/J.view.scale),V=+Math.floor(da.height*z/J.view.scale);if(O.length<=MAX_REQUEST_SIZE&&fa*V<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.isExportToCanvas()){var ba={globalVars:J.getExportVariables()};L&&(ba.grid={size:J.gridSize,steps:J.view.gridSteps,color:J.view.gridColor});c.saveRequest(f,k,function(ma,la){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(la||"0")+(null!=ma?"&filename="+encodeURIComponent(ma):"")+"&extras="+encodeURIComponent(JSON.stringify(ba))+(0<I?"&dpi="+I:"")+"&bg="++(null!=B?B:"none")+"&w="+fa+"&h="+V+"&border="+C+"&xml="+encodeURIComponent(O))})}else"png"==k?c.exportImage(z,null==B||"none"==B,!0,!1,!1,C,!0,!1,null,L,I):c.exportImage(z,!1,!0,!1,!1,C,!0,!1,"jpeg",L);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var B=c;this.currentPage!=this.pages[k]&&(B=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),B.model.setRoot(this.pages[k].root));f+=this.pages[k].getName()+" "+B.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},k=document.createElement("div");k.style.whiteSpace="nowrap";var B=document.createElement("h3");mxUtils.write(B,mxUtils.htmlEntities(c));B.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(B);var z=-document.createElement("div");z.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";z.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var C={};try{var H=mxSettings.getCustomLibraries();for(c=0;c<H.length;c++){var K=H[c];if("R"==K.substring(0,1)){var M=JSON.parse(decodeURIComponent(K.substring(1)));C[M[0]]={id:M[0],title:M[1],downloadUrl:M[2]}}}}catch(O){}this.remoteInvoke("getCustomLibraries",null,null,function(O){z.innerText="";-if(0==O.length)z.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var ea=0;ea<O.length;ea++){var fa=O[ea];C[fa.id]&&(f[fa.id]=fa);var S=this.addCheckbox(z,fa.title,C[fa.id]);(function(ca,ma){mxEvent.addListener(ma,"change",function(){this.checked?f[ca.id]=ca:delete f[ca.id]})})(fa,S)}},mxUtils.bind(this,function(O){z.innerText="";var ea=document.createElement("div");ea.style.padding="8px";ea.style.textAlign=-"center";mxUtils.write(ea,mxResources.get("error")+": ");mxUtils.write(ea,null!=O&&null!=O.message?O.message:mxResources.get("unknownError"));z.appendChild(ea)}));k.appendChild(z);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var O=0,ea;for(ea in f)null==C[ea]&&(O++,mxUtils.bind(this,function(fa){this.remoteInvoke("getFileContent",[fa.downloadUrl],null,mxUtils.bind(this,function(S){O--;0==O&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,-S,fa)),this.showSidebar()}catch(ca){this.handleError(ca,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){O--;0==O&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[ea]));for(ea in C)f[ea]||this.closeLibrary(new RemoteLibrary(this,null,C[ea]));0==O&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns=+document.createElement("div");z.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";z.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var C={};try{var I=mxSettings.getCustomLibraries();for(c=0;c<I.length;c++){var L=I[c];if("R"==L.substring(0,1)){var J=JSON.parse(decodeURIComponent(L.substring(1)));C[J[0]]={id:J[0],title:J[1],downloadUrl:J[2]}}}}catch(O){}this.remoteInvoke("getCustomLibraries",null,null,function(O){z.innerText="";+if(0==O.length)z.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var da=0;da<O.length;da++){var fa=O[da];C[fa.id]&&(f[fa.id]=fa);var V=this.addCheckbox(z,fa.title,C[fa.id]);(function(ba,ma){mxEvent.addListener(ma,"change",function(){this.checked?f[ba.id]=ba:delete f[ba.id]})})(fa,V)}},mxUtils.bind(this,function(O){z.innerText="";var da=document.createElement("div");da.style.padding="8px";da.style.textAlign=+"center";mxUtils.write(da,mxResources.get("error")+": ");mxUtils.write(da,null!=O&&null!=O.message?O.message:mxResources.get("unknownError"));z.appendChild(da)}));k.appendChild(z);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var O=0,da;for(da in f)null==C[da]&&(O++,mxUtils.bind(this,function(fa){this.remoteInvoke("getFileContent",[fa.downloadUrl],null,mxUtils.bind(this,function(V){O--;0==O&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,+V,fa)),this.showSidebar()}catch(ba){this.handleError(ba,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){O--;0==O&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[da]));for(da in C)f[da]||this.closeLibrary(new RemoteLibrary(this,null,C[da]));0==O&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=-[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,B,z){var C=!0,H=window.setTimeout(mxUtils.bind(this,function(){C=!1;z({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),-this.timeout),K=mxUtils.bind(this,function(){window.clearTimeout(H);C&&B.apply(this,arguments)}),M=mxUtils.bind(this,function(){window.clearTimeout(H);C&&z.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:K,error:M});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,-f){var k=mxUtils.bind(this,function(O,ea){var fa={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=ea?fa.error={errResp:ea}:null!=O&&(fa.resp=O);this.remoteWin.postMessage(JSON.stringify(fa),"*")});try{var B=c.funtionName,z=this.remoteInvokableFns[B];if(null!=z&&"function"===typeof this[B]){if(z.allowedDomains){for(var C=!1,H=0;H<z.allowedDomains.length;H++)if(f=="https://"+z.allowedDomains[H]){C=!0;break}if(!C){k(null,"Invalid Call: "+B+" is not allowed.");return}}var K=c.functionArgs;-Array.isArray(K)||(K=[]);if(z.isAsync)K.push(function(){k(Array.prototype.slice.apply(arguments))}),K.push(function(O){k(null,O||"Unkown Error")}),this[B].apply(this,K);else{var M=this[B].apply(this,K);k([M])}}else k(null,"Invalid Call: "+B+" is not found.")}catch(O){k(null,"Invalid Call: An error occurred, "+O.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var B=k.open("database",-2);B.onupgradeneeded=function(z){try{var C=B.result;1>z.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>z.oldVersion&&(C.createObjectStore("files",{keyPath:"title"}),C.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(H){null!=f&&f(H)}};B.onsuccess=mxUtils.bind(this,function(z){try{var C=B.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||-(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(H){if(!H||"1"==urlParams.forceMigration){var K=document.createElement("iframe");K.style.display="none";K.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(K);var M=!0,O=!1,ea,fa=0,S=mxUtils.bind(this,function(){O=!0;this.setDatabaseItem(".drawioMigrated3",!0);K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",-funtionName:"setMigratedFlag"}),"*")}),ca=mxUtils.bind(this,function(){fa++;ma()}),ma=mxUtils.bind(this,function(){try{if(fa>=ea.length)S();else{var Z=ea[fa];StorageFile.getFileContent(this,Z,mxUtils.bind(this,function(da){null==da||".scratchpad"==Z&&da==this.emptyLibraryXml?K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[Z]}),"*"):ca()}),ca)}}catch(da){console.log(da)}}),la=mxUtils.bind(this,function(Z){try{this.setDatabaseItem(null,-[{title:Z.title,size:Z.data.length,lastModified:Date.now(),type:Z.isLib?"L":"F"},{title:Z.title,data:Z.data}],ca,ca,["filesInfo","files"])}catch(da){console.log(da)}});H=mxUtils.bind(this,function(Z){try{if(Z.source==K.contentWindow){var da={};try{da=JSON.parse(Z.data)}catch(aa){}"init"==da.event?(K.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=-da.event||O||(M?null!=da.resp&&0<da.resp.length&&null!=da.resp[0]?(ea=da.resp[0],M=!1,ma()):S():null!=da.resp&&0<da.resp.length&&null!=da.resp[0]?la(da.resp[0]):ca())}}catch(aa){console.log(aa)}});window.addEventListener("message",H)}})));c(C);C.onversionchange=function(){C.close()}}catch(H){null!=f?f(H):null!=window.console&&console.warn(H)}});B.onerror=f;B.onblocked=function(){}}catch(z){null!=f?f(z):null!=window.console&&console.error(z)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};-EditorUi.prototype.setDatabaseItem=function(c,f,k,B,z){this.openDatabase(mxUtils.bind(this,function(C){try{z=z||"objects";Array.isArray(z)||(z=[z],c=[c],f=[f]);var H=C.transaction(z,"readwrite");H.oncomplete=k;H.onerror=B;for(C=0;C<z.length;C++)H.objectStore(z[C]).put(null!=c&&null!=c[C]?{key:c[C],data:f[C]}:f[C])}catch(K){null!=B&&B(K)}}),B)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,B){this.openDatabase(mxUtils.bind(this,function(z){try{B=B||"objects";Array.isArray(B)||(B=[B],c=[c]);-var C=z.transaction(B,"readwrite");C.oncomplete=f;C.onerror=k;for(z=0;z<B.length;z++)C.objectStore(B[z]).delete(c[z])}catch(H){null!=k&&k(H)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,B){this.openDatabase(mxUtils.bind(this,function(z){try{B=B||"objects";var C=z.transaction([B],"readonly").objectStore(B).get(c);C.onsuccess=function(){f(C.result)};C.onerror=k}catch(H){null!=k&&k(H)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(B){try{k=-k||"objects";var z=B.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),C=[];z.onsuccess=function(H){null==H.target.result?c(C):(C.push(H.target.result.value),H.target.result.continue())};z.onerror=f}catch(H){null!=f&&f(H)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(B){try{k=k||"objects";var z=B.transaction([k],"readonly").objectStore(k).getAllKeys();z.onsuccess=function(){c(z.result)};z.onerror=f}catch(C){null!=+[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,B,z){var C=!0,I=window.setTimeout(mxUtils.bind(this,function(){C=!1;z({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),+this.timeout),L=mxUtils.bind(this,function(){window.clearTimeout(I);C&&B.apply(this,arguments)}),J=mxUtils.bind(this,function(){window.clearTimeout(I);C&&z.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:L,error:J});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,+f){var k=mxUtils.bind(this,function(O,da){var fa={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=da?fa.error={errResp:da}:null!=O&&(fa.resp=O);this.remoteWin.postMessage(JSON.stringify(fa),"*")});try{var B=c.funtionName,z=this.remoteInvokableFns[B];if(null!=z&&"function"===typeof this[B]){if(z.allowedDomains){for(var C=!1,I=0;I<z.allowedDomains.length;I++)if(f=="https://"+z.allowedDomains[I]){C=!0;break}if(!C){k(null,"Invalid Call: "+B+" is not allowed.");return}}var L=c.functionArgs;+Array.isArray(L)||(L=[]);if(z.isAsync)L.push(function(){k(Array.prototype.slice.apply(arguments))}),L.push(function(O){k(null,O||"Unkown Error")}),this[B].apply(this,L);else{var J=this[B].apply(this,L);k([J])}}else k(null,"Invalid Call: "+B+" is not found.")}catch(O){k(null,"Invalid Call: An error occurred, "+O.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var B=k.open("database",+2);B.onupgradeneeded=function(z){try{var C=B.result;1>z.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>z.oldVersion&&(C.createObjectStore("files",{keyPath:"title"}),C.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(I){null!=f&&f(I)}};B.onsuccess=mxUtils.bind(this,function(z){try{var C=B.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||+(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(I){if(!I||"1"==urlParams.forceMigration){var L=document.createElement("iframe");L.style.display="none";L.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(L);var J=!0,O=!1,da,fa=0,V=mxUtils.bind(this,function(){O=!0;this.setDatabaseItem(".drawioMigrated3",!0);L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",+funtionName:"setMigratedFlag"}),"*")}),ba=mxUtils.bind(this,function(){fa++;ma()}),ma=mxUtils.bind(this,function(){try{if(fa>=da.length)V();else{var Z=da[fa];StorageFile.getFileContent(this,Z,mxUtils.bind(this,function(ea){null==ea||".scratchpad"==Z&&ea==this.emptyLibraryXml?L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[Z]}),"*"):ba()}),ba)}}catch(ea){console.log(ea)}}),la=mxUtils.bind(this,function(Z){try{this.setDatabaseItem(null,+[{title:Z.title,size:Z.data.length,lastModified:Date.now(),type:Z.isLib?"L":"F"},{title:Z.title,data:Z.data}],ba,ba,["filesInfo","files"])}catch(ea){console.log(ea)}});I=mxUtils.bind(this,function(Z){try{if(Z.source==L.contentWindow){var ea={};try{ea=JSON.parse(Z.data)}catch(aa){}"init"==ea.event?(L.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=+ea.event||O||(J?null!=ea.resp&&0<ea.resp.length&&null!=ea.resp[0]?(da=ea.resp[0],J=!1,ma()):V():null!=ea.resp&&0<ea.resp.length&&null!=ea.resp[0]?la(ea.resp[0]):ba())}}catch(aa){console.log(aa)}});window.addEventListener("message",I)}})));c(C);C.onversionchange=function(){C.close()}}catch(I){null!=f?f(I):null!=window.console&&console.warn(I)}});B.onerror=f;B.onblocked=function(){}}catch(z){null!=f?f(z):null!=window.console&&console.error(z)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};+EditorUi.prototype.setDatabaseItem=function(c,f,k,B,z){this.openDatabase(mxUtils.bind(this,function(C){try{z=z||"objects";Array.isArray(z)||(z=[z],c=[c],f=[f]);var I=C.transaction(z,"readwrite");I.oncomplete=k;I.onerror=B;for(C=0;C<z.length;C++)I.objectStore(z[C]).put(null!=c&&null!=c[C]?{key:c[C],data:f[C]}:f[C])}catch(L){null!=B&&B(L)}}),B)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,B){this.openDatabase(mxUtils.bind(this,function(z){try{B=B||"objects";Array.isArray(B)||(B=[B],c=[c]);+var C=z.transaction(B,"readwrite");C.oncomplete=f;C.onerror=k;for(z=0;z<B.length;z++)C.objectStore(B[z]).delete(c[z])}catch(I){null!=k&&k(I)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,B){this.openDatabase(mxUtils.bind(this,function(z){try{B=B||"objects";var C=z.transaction([B],"readonly").objectStore(B).get(c);C.onsuccess=function(){f(C.result)};C.onerror=k}catch(I){null!=k&&k(I)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(B){try{k=+k||"objects";var z=B.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),C=[];z.onsuccess=function(I){null==I.target.result?c(C):(C.push(I.target.result.value),I.target.result.continue())};z.onerror=f}catch(I){null!=f&&f(I)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(B){try{k=k||"objects";var z=B.transaction([k],"readonly").objectStore(k).getAllKeys();z.onsuccess=function(){c(z.result)};z.onerror=f}catch(C){null!=f&&f(C)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var k=this.getCurrentFile();null!=k?k.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,k){var B=this.getCurrentFile();null!=B?B.addComment(c,f,k):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,f){var k=this.getCurrentFile();return null!=k?k.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=-function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,B,z,C,H,K){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,B,z,C,H,K)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=-function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,B,z,C,H,K,M,O,ea,fa,S,ca,ma,la)};EditorUi.prototype.createImageUrlConverter=+function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,B,z,C,I,L){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,B,z,C,I,L)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=+function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,B,z,C,I,L,J,O,da,fa,V,ba,ma,la)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,B){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,k,B)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,k,B){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,k,B)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,k,B,z){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,k,B,z)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var k=localStorage.key(f),B=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<B.length){var z="<mxfile "===B.substring(0,8)||"<?xml"===B.substring(0,5)||"\x3c!--[if IE]>"===B.substring(0,12);B="<mxlibrary>"===B.substring(0,11);(z||B)&&c.push(k)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,e,g,m,v,p){function A(){for(var S=C.getElementsByTagName("div"),ca=0,ma=0;ma<S.length;ma++)"none"!=S[ma].style.display&&S[ma].parentNode==C&&ca++;H.style.display=0==ca?"block":"none"}function G(S,ca,ma,la){function Z(){ca.removeChild(l);ca.removeChild(t);aa.style.display="block";da.style.display="block"}k={div:ca,comment:S,saveCallback:ma,deleteOnCancel:la};var da=ca.querySelector(".geCommentTxt"),aa=ca.querySelector(".geCommentActionsList"),l=document.createElement("textarea");-l.className="geCommentEditTxtArea";l.style.minHeight=da.offsetHeight+"px";l.value=S.content;ca.insertBefore(l,da);var t=document.createElement("div");t.className="geCommentEditBtns";var I=mxUtils.button(mxResources.get("cancel"),function(){la?(ca.parentNode.removeChild(ca),A()):Z();k=null});I.className="geCommentEditBtn";t.appendChild(I);var V=mxUtils.button(mxResources.get("save"),function(){da.innerText="";S.content=l.value;mxUtils.write(da,S.content);Z();ma(S);k=null});mxEvent.addListener(l,"keydown",-mxUtils.bind(this,function(J){mxEvent.isConsumed(J)||((mxEvent.isControlDown(J)||mxClient.IS_MAC&&mxEvent.isMetaDown(J))&&13==J.keyCode?(V.click(),mxEvent.consume(J)):27==J.keyCode&&(I.click(),mxEvent.consume(J)))}));V.focus();V.className="geCommentEditBtn gePrimaryBtn";t.appendChild(V);ca.insertBefore(t,da);aa.style.display="none";da.style.display="none";l.focus()}function T(S,ca){ca.innerText="";S=new Date(S.modifiedDate);var ma=b.timeSince(S);null==ma&&(ma=mxResources.get("lessThanAMinute"));mxUtils.write(ca,-mxResources.get("timeAgo",[ma],"{1} ago"));ca.setAttribute("title",S.toLocaleDateString()+" "+S.toLocaleTimeString())}function F(S){var ca=document.createElement("img");ca.className="geCommentBusyImg";ca.src=IMAGE_PATH+"/spin.gif";S.appendChild(ca);S.busyImg=ca}function P(S){S.style.border="1px solid red";S.busyImg.parentNode==S&&S.removeChild(S.busyImg)}function Q(S){S.style.border="";S.busyImg.parentNode==S&&S.removeChild(S.busyImg)}function U(S,ca,ma,la,Z){function da(Y,ba,ja){var oa=document.createElement("li");-oa.className="geCommentAction";var qa=document.createElement("a");qa.className="geCommentActionLnk";mxUtils.write(qa,Y);oa.appendChild(qa);mxEvent.addListener(qa,"click",function(ra){ba(ra,S);ra.preventDefault();mxEvent.consume(ra)});W.appendChild(oa);ja&&(oa.style.display="none")}function aa(){function Y(oa){ba.push(ja);if(null!=oa.replies)for(var qa=0;qa<oa.replies.length;qa++)ja=ja.nextSibling,Y(oa.replies[qa])}var ba=[],ja=t;Y(S);return{pdiv:ja,replies:ba}}function l(Y,ba,ja,oa,qa){function ra(){F(Da);-S.addReply(ya,function(La){ya.id=La;S.replies.push(ya);Q(Da);ja&&ja()},function(La){xa();P(Da);b.handleError(La,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},oa,qa)}function xa(){G(ya,Da,function(La){ra()},!0)}var Ba=aa().pdiv,ya=b.newComment(Y,b.getCurrentUser());ya.pCommentId=S.id;null==S.replies&&(S.replies=[]);var Da=U(ya,S.replies,Ba,la+1);ba?xa():ra()}if(Z||!S.isResolved){H.style.display="none";var t=document.createElement("div");t.className="geCommentContainer";t.setAttribute("data-commentId",-S.id);t.style.marginLeft=20*la+5+"px";S.isResolved&&(t.style.backgroundColor="light-dark(ghostWhite, transparent)");var I=document.createElement("div");I.className="geCommentHeader";var V=document.createElement("img");V.className="geCommentUserImg";V.src=null!=S.user&&null!=S.user.pictureUrl?S.user.pictureUrl:Editor.userImage;I.appendChild(V);V=document.createElement("div");V.className="geCommentHeaderTxt";I.appendChild(V);var J=document.createElement("div");J.className="geCommentUsername";mxUtils.write(J,-null!=S.user?S.user.displayName:mxResources.get("unknownUser"));V.appendChild(J);J=document.createElement("div");J.className="geCommentDate";J.setAttribute("data-commentId",S.id);T(S,J);V.appendChild(J);t.appendChild(I);I=document.createElement("div");I.className="geCommentTxt";mxUtils.write(I,S.content||"");t.appendChild(I);S.isLocked&&(t.style.opacity="0.5");I=document.createElement("div");I.className="geCommentActions";var W=document.createElement("ul");W.className="geCommentActionsList";I.appendChild(W);-c||S.isLocked||0!=la&&!f||da(mxResources.get("reply"),function(){l("",!0)},S.isResolved);V=b.getCurrentUser();null==V||null==S.user||V.id!=S.user.id||c||S.isLocked||(da(mxResources.get("edit"),function(){function Y(){G(S,t,function(){F(t);S.editComment(S.content,function(){Q(t)},function(ba){P(t);Y();b.handleError(ba,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Y()},S.isResolved),da(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){F(t);-S.deleteComment(function(Y){if(!0===Y){Y=t.querySelector(".geCommentTxt");Y.innerText="";mxUtils.write(Y,mxResources.get("msgDeleted"));var ba=t.querySelectorAll(".geCommentAction");for(Y=0;Y<ba.length;Y++)ba[Y].parentNode.removeChild(ba[Y]);Q(t);t.style.opacity="0.5"}else{ba=aa(S).replies;for(Y=0;Y<ba.length;Y++)C.removeChild(ba[Y]);for(Y=0;Y<ca.length;Y++)if(ca[Y]==S){ca.splice(Y,1);break}H.style.display=0==C.getElementsByTagName("div").length?"block":"none"}},function(Y){P(t);b.handleError(Y,null,-null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},S.isResolved));c||S.isLocked||0!=la||da(S.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Y){function ba(){var ja=Y.target;ja.innerText="";S.isResolved=!S.isResolved;mxUtils.write(ja,S.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var oa=S.isResolved?"none":"",qa=aa(S).replies,ra="light-dark("+(S.isResolved?"ghostWhite":"white")+", transparent)",xa=0;xa<qa.length;xa++){qa[xa].style.backgroundColor=-ra;for(var Ba=qa[xa].querySelectorAll(".geCommentAction"),ya=0;ya<Ba.length;ya++)Ba[ya]!=ja.parentNode&&(Ba[ya].style.display=oa);O||(qa[xa].style.display="none")}A()}S.isResolved?l(mxResources.get("reOpened")+": ",!0,ba,!1,!0):l(mxResources.get("markedAsResolved"),!1,ba,!0)});t.appendChild(I);null!=ma?C.insertBefore(t,ma.nextSibling):C.appendChild(t);for(ma=0;null!=S.replies&&ma<S.replies.length;ma++)I=S.replies[ma],I.isResolved=S.isResolved,U(I,S.replies,null,la+1,Z);null!=k&&(k.comment.id==S.id?-(Z=S.content,S.content=k.comment.content,G(S,t,k.saveCallback,k.deleteOnCancel),S.content=Z):null==k.comment.id&&k.comment.pCommentId==S.id&&(C.appendChild(k.div),G(k.comment,k.div,k.saveCallback,k.deleteOnCancel)));return t}}var c=!b.canComment(),f=b.canReplyToReplies(),k=null,B=document.createElement("div");B.className="geCommentsWin";B.style.background="light-dark(whiteSmoke, "+Editor.darkColor+")";var z=EditorUi.compactUi?"26px":"30px",C=document.createElement("div");C.className="geCommentsList";-C.style.backgroundColor="light-dark(whiteSmoke, "+Editor.darkColor+")";C.style.bottom=parseInt(z)+7+"px";B.appendChild(C);var H=document.createElement("span");H.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(H,mxResources.get("noCommentsFound"));var K=document.createElement("div");K.className="geToolbarContainer geCommentsToolbar";K.style.height=z;K.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";z=document.createElement("a");z.className="geButton";if(!c){var M=-z.cloneNode();M.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';M.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(M,"click",function(S){function ca(){G(ma,la,function(Z){F(la);b.addComment(Z,function(da){Z.id=da;ea.push(Z);Q(la)},function(da){P(la);ca();b.handleError(da,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ma=b.newComment("",b.getCurrentUser()),la=U(ma,ea,null,0);ca();S.preventDefault();mxEvent.consume(S)});-K.appendChild(M)}M=z.cloneNode();M.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';M.setAttribute("title",mxResources.get("showResolved"));M.className="geButton";var O=!1;mxEvent.addListener(M,"click",function(S){this.className=(O=!O)?"geButton geCheckedBtn":"geButton";fa();S.preventDefault();mxEvent.consume(S)});K.appendChild(M);b.commentsRefreshNeeded()&&(M=z.cloneNode(),M.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',-M.setAttribute("title",mxResources.get("refresh")),M.className="geButton",mxEvent.addListener(M,"click",function(S){fa();S.preventDefault();mxEvent.consume(S)}),K.appendChild(M));b.commentsSaveNeeded()&&(z=z.cloneNode(),z.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',z.setAttribute("title",mxResources.get("save")),z.className="geButton geAdaptiveAsset",mxEvent.addListener(z,"click",function(S){p();S.preventDefault();mxEvent.consume(S)}),K.appendChild(z));B.appendChild(K);-var ea=[],fa=mxUtils.bind(this,function(){this.hasError=!1;if(null!=k)try{k.div=k.div.cloneNode(!0);var S=k.div.querySelector(".geCommentEditTxtArea"),ca=k.div.querySelector(".geCommentEditBtns");k.comment.content=S.value;S.parentNode.removeChild(S);ca.parentNode.removeChild(ca)}catch(ma){b.handleError(ma)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";f=b.canReplyToReplies();-b.commentsSupported()?b.getComments(function(ma){function la(Z){if(null!=Z){Z.sort(function(aa,l){return new Date(aa.modifiedDate)-new Date(l.modifiedDate)});for(var da=0;da<Z.length;da++)la(Z[da].replies)}}ma.sort(function(Z,da){return new Date(Z.modifiedDate)-new Date(da.modifiedDate)});C.innerText="";C.appendChild(H);H.style.display="block";ea=ma;for(ma=0;ma<ea.length;ma++)la(ea[ma].replies),U(ea[ma],ea,null,0,O);null!=k&&null==k.comment.id&&null==k.comment.pCommentId&&(C.appendChild(k.div),G(k.comment,-k.div,k.saveCallback,k.deleteOnCancel))},mxUtils.bind(this,function(ma){C.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ma&&ma.message?": "+ma.message:""));this.hasError=!0})):C.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});fa();this.refreshComments=fa;K=mxUtils.bind(this,function(){function S(da){var aa=ma[da.id];if(null!=aa)for(T(da,aa),aa=0;null!=da.replies&&aa<da.replies.length;aa++)S(da.replies[aa])}if(this.window.isVisible()){for(var ca=C.querySelectorAll(".geCommentDate"),-ma={},la=0;la<ca.length;la++){var Z=ca[la];ma[Z.getAttribute("data-commentId")]=Z}for(la=0;la<ea.length;la++)S(ea[la])}});setInterval(K,6E4);this.refreshCommentsTime=K;this.window=new mxWindow(mxResources.get("comments"),B,e,g,m,v,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));-b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,g,m,v,p,A,G,T,F,P){var Q=document.createElement("div");Q.style.textAlign="center";P=null!=P?P:44;var U=document.createElement("div");U.style.padding="6px";U.style.overflow="auto";U.style.maxHeight=P+"px";U.style.lineHeight="1.2em";mxUtils.write(U,e);Q.appendChild(U);null!=F&&(U=document.createElement("div"),U.style.padding="6px 0 6px 0",e=document.createElement("img"),e.setAttribute("src",F),U.appendChild(e),Q.appendChild(U));F=document.createElement("div");+var CommentsWindow=function(b,e,g,m,v,p){function A(){for(var V=C.getElementsByTagName("div"),ba=0,ma=0;ma<V.length;ma++)"none"!=V[ma].style.display&&V[ma].parentNode==C&&ba++;I.style.display=0==ba?"block":"none"}function G(V,ba,ma,la){function Z(){ba.removeChild(l);ba.removeChild(t);aa.style.display="block";ea.style.display="block"}k={div:ba,comment:V,saveCallback:ma,deleteOnCancel:la};var ea=ba.querySelector(".geCommentTxt"),aa=ba.querySelector(".geCommentActionsList"),l=document.createElement("textarea");+l.className="geCommentEditTxtArea";l.style.minHeight=ea.offsetHeight+"px";l.value=V.content;ba.insertBefore(l,ea);var t=document.createElement("div");t.className="geCommentEditBtns";var H=mxUtils.button(mxResources.get("cancel"),function(){la?(ba.parentNode.removeChild(ba),A()):Z();k=null});H.className="geCommentEditBtn";t.appendChild(H);var U=mxUtils.button(mxResources.get("save"),function(){ea.innerText="";V.content=l.value;mxUtils.write(ea,V.content);Z();ma(V);k=null});mxEvent.addListener(l,"keydown",+mxUtils.bind(this,function(K){mxEvent.isConsumed(K)||((mxEvent.isControlDown(K)||mxClient.IS_MAC&&mxEvent.isMetaDown(K))&&13==K.keyCode?(U.click(),mxEvent.consume(K)):27==K.keyCode&&(H.click(),mxEvent.consume(K)))}));U.focus();U.className="geCommentEditBtn gePrimaryBtn";t.appendChild(U);ba.insertBefore(t,ea);aa.style.display="none";ea.style.display="none";l.focus()}function S(V,ba){ba.innerText="";V=new Date(V.modifiedDate);var ma=b.timeSince(V);null==ma&&(ma=mxResources.get("lessThanAMinute"));mxUtils.write(ba,+mxResources.get("timeAgo",[ma],"{1} ago"));ba.setAttribute("title",V.toLocaleDateString()+" "+V.toLocaleTimeString())}function F(V){var ba=document.createElement("img");ba.className="geCommentBusyImg";ba.src=IMAGE_PATH+"/spin.gif";V.appendChild(ba);V.busyImg=ba}function P(V){V.style.border="1px solid red";V.busyImg.parentNode==V&&V.removeChild(V.busyImg)}function Q(V){V.style.border="";V.busyImg.parentNode==V&&V.removeChild(V.busyImg)}function T(V,ba,ma,la,Z){function ea(Y,ca,ja){var oa=document.createElement("li");+oa.className="geCommentAction";var qa=document.createElement("a");qa.className="geCommentActionLnk";mxUtils.write(qa,Y);oa.appendChild(qa);mxEvent.addListener(qa,"click",function(ra){ca(ra,V);ra.preventDefault();mxEvent.consume(ra)});W.appendChild(oa);ja&&(oa.style.display="none")}function aa(){function Y(oa){ca.push(ja);if(null!=oa.replies)for(var qa=0;qa<oa.replies.length;qa++)ja=ja.nextSibling,Y(oa.replies[qa])}var ca=[],ja=t;Y(V);return{pdiv:ja,replies:ca}}function l(Y,ca,ja,oa,qa){function ra(){F(Da);+V.addReply(ya,function(La){ya.id=La;V.replies.push(ya);Q(Da);ja&&ja()},function(La){xa();P(Da);b.handleError(La,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},oa,qa)}function xa(){G(ya,Da,function(La){ra()},!0)}var Ba=aa().pdiv,ya=b.newComment(Y,b.getCurrentUser());ya.pCommentId=V.id;null==V.replies&&(V.replies=[]);var Da=T(ya,V.replies,Ba,la+1);ca?xa():ra()}if(Z||!V.isResolved){I.style.display="none";var t=document.createElement("div");t.className="geCommentContainer";t.setAttribute("data-commentId",+V.id);t.style.marginLeft=20*la+5+"px";V.isResolved&&(t.style.backgroundColor="light-dark(ghostWhite, transparent)");var H=document.createElement("div");H.className="geCommentHeader";var U=document.createElement("img");U.className="geCommentUserImg";U.src=null!=V.user&&null!=V.user.pictureUrl?V.user.pictureUrl:Editor.userImage;H.appendChild(U);U=document.createElement("div");U.className="geCommentHeaderTxt";H.appendChild(U);var K=document.createElement("div");K.className="geCommentUsername";mxUtils.write(K,+null!=V.user?V.user.displayName:mxResources.get("unknownUser"));U.appendChild(K);K=document.createElement("div");K.className="geCommentDate";K.setAttribute("data-commentId",V.id);S(V,K);U.appendChild(K);t.appendChild(H);H=document.createElement("div");H.className="geCommentTxt";mxUtils.write(H,V.content||"");t.appendChild(H);V.isLocked&&(t.style.opacity="0.5");H=document.createElement("div");H.className="geCommentActions";var W=document.createElement("ul");W.className="geCommentActionsList";H.appendChild(W);+c||V.isLocked||0!=la&&!f||ea(mxResources.get("reply"),function(){l("",!0)},V.isResolved);U=b.getCurrentUser();null==U||null==V.user||U.id!=V.user.id||c||V.isLocked||(ea(mxResources.get("edit"),function(){function Y(){G(V,t,function(){F(t);V.editComment(V.content,function(){Q(t)},function(ca){P(t);Y();b.handleError(ca,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Y()},V.isResolved),ea(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){F(t);+V.deleteComment(function(Y){if(!0===Y){Y=t.querySelector(".geCommentTxt");Y.innerText="";mxUtils.write(Y,mxResources.get("msgDeleted"));var ca=t.querySelectorAll(".geCommentAction");for(Y=0;Y<ca.length;Y++)ca[Y].parentNode.removeChild(ca[Y]);Q(t);t.style.opacity="0.5"}else{ca=aa(V).replies;for(Y=0;Y<ca.length;Y++)C.removeChild(ca[Y]);for(Y=0;Y<ba.length;Y++)if(ba[Y]==V){ba.splice(Y,1);break}I.style.display=0==C.getElementsByTagName("div").length?"block":"none"}},function(Y){P(t);b.handleError(Y,null,+null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},V.isResolved));c||V.isLocked||0!=la||ea(V.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Y){function ca(){var ja=Y.target;ja.innerText="";V.isResolved=!V.isResolved;mxUtils.write(ja,V.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var oa=V.isResolved?"none":"",qa=aa(V).replies,ra="light-dark("+(V.isResolved?"ghostWhite":"white")+", transparent)",xa=0;xa<qa.length;xa++){qa[xa].style.backgroundColor=+ra;for(var Ba=qa[xa].querySelectorAll(".geCommentAction"),ya=0;ya<Ba.length;ya++)Ba[ya]!=ja.parentNode&&(Ba[ya].style.display=oa);O||(qa[xa].style.display="none")}A()}V.isResolved?l(mxResources.get("reOpened")+": ",!0,ca,!1,!0):l(mxResources.get("markedAsResolved"),!1,ca,!0)});t.appendChild(H);null!=ma?C.insertBefore(t,ma.nextSibling):C.appendChild(t);for(ma=0;null!=V.replies&&ma<V.replies.length;ma++)H=V.replies[ma],H.isResolved=V.isResolved,T(H,V.replies,null,la+1,Z);null!=k&&(k.comment.id==V.id?+(Z=V.content,V.content=k.comment.content,G(V,t,k.saveCallback,k.deleteOnCancel),V.content=Z):null==k.comment.id&&k.comment.pCommentId==V.id&&(C.appendChild(k.div),G(k.comment,k.div,k.saveCallback,k.deleteOnCancel)));return t}}var c=!b.canComment(),f=b.canReplyToReplies(),k=null,B=document.createElement("div");B.className="geCommentsWin";B.style.background="light-dark(whiteSmoke, "+Editor.darkColor+")";var z=EditorUi.compactUi?"26px":"30px",C=document.createElement("div");C.className="geCommentsList";+C.style.backgroundColor="light-dark(whiteSmoke, "+Editor.darkColor+")";C.style.bottom=parseInt(z)+7+"px";B.appendChild(C);var I=document.createElement("span");I.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(I,mxResources.get("noCommentsFound"));var L=document.createElement("div");L.className="geToolbarContainer geCommentsToolbar";L.style.height=z;L.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";z=document.createElement("a");z.className="geButton";if(!c){var J=+z.cloneNode();J.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';J.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(J,"click",function(V){function ba(){G(ma,la,function(Z){F(la);b.addComment(Z,function(ea){Z.id=ea;da.push(Z);Q(la)},function(ea){P(la);ba();b.handleError(ea,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ma=b.newComment("",b.getCurrentUser()),la=T(ma,da,null,0);ba();V.preventDefault();mxEvent.consume(V)});+L.appendChild(J)}J=z.cloneNode();J.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';J.setAttribute("title",mxResources.get("showResolved"));J.className="geButton";var O=!1;mxEvent.addListener(J,"click",function(V){this.className=(O=!O)?"geButton geCheckedBtn":"geButton";fa();V.preventDefault();mxEvent.consume(V)});L.appendChild(J);b.commentsRefreshNeeded()&&(J=z.cloneNode(),J.innerHTML='<img class="geAdaptiveAsset" src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',+J.setAttribute("title",mxResources.get("refresh")),J.className="geButton",mxEvent.addListener(J,"click",function(V){fa();V.preventDefault();mxEvent.consume(V)}),L.appendChild(J));b.commentsSaveNeeded()&&(z=z.cloneNode(),z.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',z.setAttribute("title",mxResources.get("save")),z.className="geButton geAdaptiveAsset",mxEvent.addListener(z,"click",function(V){p();V.preventDefault();mxEvent.consume(V)}),L.appendChild(z));B.appendChild(L);+var da=[],fa=mxUtils.bind(this,function(){this.hasError=!1;if(null!=k)try{k.div=k.div.cloneNode(!0);var V=k.div.querySelector(".geCommentEditTxtArea"),ba=k.div.querySelector(".geCommentEditBtns");k.comment.content=V.value;V.parentNode.removeChild(V);ba.parentNode.removeChild(ba)}catch(ma){b.handleError(ma)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";f=b.canReplyToReplies();+b.commentsSupported()?b.getComments(function(ma){function la(Z){if(null!=Z){Z.sort(function(aa,l){return new Date(aa.modifiedDate)-new Date(l.modifiedDate)});for(var ea=0;ea<Z.length;ea++)la(Z[ea].replies)}}ma.sort(function(Z,ea){return new Date(Z.modifiedDate)-new Date(ea.modifiedDate)});C.innerText="";C.appendChild(I);I.style.display="block";da=ma;for(ma=0;ma<da.length;ma++)la(da[ma].replies),T(da[ma],da,null,0,O);null!=k&&null==k.comment.id&&null==k.comment.pCommentId&&(C.appendChild(k.div),G(k.comment,+k.div,k.saveCallback,k.deleteOnCancel))},mxUtils.bind(this,function(ma){C.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ma&&ma.message?": "+ma.message:""));this.hasError=!0})):C.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});fa();this.refreshComments=fa;L=mxUtils.bind(this,function(){function V(ea){var aa=ma[ea.id];if(null!=aa)for(S(ea,aa),aa=0;null!=ea.replies&&aa<ea.replies.length;aa++)V(ea.replies[aa])}if(this.window.isVisible()){for(var ba=C.querySelectorAll(".geCommentDate"),+ma={},la=0;la<ba.length;la++){var Z=ba[la];ma[Z.getAttribute("data-commentId")]=Z}for(la=0;la<da.length;la++)V(da[la])}});setInterval(L,6E4);this.refreshCommentsTime=L;this.window=new mxWindow(mxResources.get("comments"),B,e,g,m,v,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));+b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,g,m,v,p,A,G,S,F,P){var Q=document.createElement("div");Q.style.textAlign="center";P=null!=P?P:44;var T=document.createElement("div");T.style.padding="6px";T.style.overflow="auto";T.style.maxHeight=P+"px";T.style.lineHeight="1.2em";mxUtils.write(T,e);Q.appendChild(T);null!=F&&(T=document.createElement("div"),T.style.padding="6px 0 6px 0",e=document.createElement("img"),e.setAttribute("src",F),T.appendChild(e),Q.appendChild(T));F=document.createElement("div");F.style.textAlign="center";F.style.whiteSpace="nowrap";var c=document.createElement("input");c.setAttribute("type","checkbox");p=mxUtils.button(p||mxResources.get("cancel"),function(){b.hideDialog();null!=m&&m(c.checked)});p.className="geBtn";null!=G&&(p.innerHTML=G+"<br>"+p.innerHTML,p.style.paddingBottom="8px",p.style.paddingTop="8px",p.style.height="auto",p.style.width="40%");b.editor.cancelFirst&&F.appendChild(p);var f=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=g&&-g(c.checked)});F.appendChild(f);null!=A?(f.innerHTML=A+"<br>"+f.innerHTML+"<br>",f.style.paddingBottom="8px",f.style.paddingTop="8px",f.style.height="auto",f.className="geBtn",f.style.width="40%"):f.className="geBtn gePrimaryBtn";b.editor.cancelFirst||F.appendChild(p);Q.appendChild(F);T?(F.style.marginTop="10px",U=document.createElement("p"),U.style.marginTop="20px",U.style.marginBottom="0px",U.appendChild(c),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),-U.appendChild(v),Q.appendChild(U),mxEvent.addListener(v,"click",function(k){c.checked=!c.checked;mxEvent.consume(k)})):F.style.marginTop="12px";this.init=function(){f.focus()};this.container=Q},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};+g(c.checked)});F.appendChild(f);null!=A?(f.innerHTML=A+"<br>"+f.innerHTML+"<br>",f.style.paddingBottom="8px",f.style.paddingTop="8px",f.style.height="auto",f.className="geBtn",f.style.width="40%"):f.className="geBtn gePrimaryBtn";b.editor.cancelFirst||F.appendChild(p);Q.appendChild(F);S?(F.style.marginTop="10px",T=document.createElement("p"),T.style.marginTop="20px",T.style.marginBottom="0px",T.appendChild(c),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),+T.appendChild(v),Q.appendChild(T),mxEvent.addListener(v,"click",function(k){c.checked=!c.checked;mxEvent.consume(k)})):F.style.marginTop="12px";this.init=function(){f.focus()};this.container=Q},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};function DiagramPage(b,e){this.node=b;null!=e?this.node.setAttribute("id",e):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,e,g){this.ui=b;this.page=e;this.previous=this.name=g}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(b,e,g){this.ui=b;this.oldIndex=e;this.newIndex=g}@@ -4014,7 +4016,7 @@ function(){b.checkDefaultParent()}));var p=mxUtils.bind(this,function(){this.updthis.toolbar&&this.toolbar.updateZoom()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(A,G){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}))}};EditorUi.prototype.scrollToPage=function(b,e){var g=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),m=null!=b?b:this.currentPage;null!=g&&null!=this.tabScroller&&this.tabScroller.children.length>g&&null!=this.tabScroller.children[g]&&(m!=this.lastScrollPage||e)&&(this.tabScroller.children[g].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[g].className="geTab gePageTab geActivePage",this.lastScrollPage=m)};EditorUi.prototype.restoreViewState=function(b,e,g){b=null!=b?this.getPageById(b.getId()):null;var m=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,e):(m.setViewState(e),this.editor.updateGraphComponents(),m.view.revalidate(),m.sizeDidChange()),m.container.scrollLeft=m.view.translate.x*m.view.scale+e.scrollLeft,m.container.scrollTop=m.view.translate.y*m.view.scale+e.scrollTop,m.restoreSelection(g))};-Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),g=parseFloat(b.getAttribute("pageScale")),m=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),p=b.getAttribute("background"),A=this.parseBackgroundImage(b.getAttribute("backgroundImage")),G=b.getAttribute("extFonts");if(G)try{G=G.split("|").map(function(T){T=T.split("^");return{name:T[0],url:T[1]}})}catch(T){console.log("ExtFonts format error: "+T.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),g=parseFloat(b.getAttribute("pageScale")),m=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),p=b.getAttribute("background"),A=this.parseBackgroundImage(b.getAttribute("backgroundImage")),G=b.getAttribute("extFonts");if(G)try{G=G.split("|").map(function(S){S=S.split("^");return{name:S[0],url:S[1]}})}catch(S){console.log("ExtFonts format error: "+S.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=e?"0"!=e:this.defaultPageVisible,background:null!=p&&0<p.length?p:null,backgroundImage:A,pageScale:isNaN(g)?mxGraph.prototype.pageScale:g,pageFormat:isNaN(m)||isNaN(v)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,m,v),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:G||[]}};Graph.prototype.saveViewState=function(b,e,g,m){g||(e.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),e.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),e.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),e.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),e.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),e.setAttribute("connect",null==b||b.connect?"1":"0"),e.setAttribute("arrows",null==b||b.arrows?"1":"0"),e.setAttribute("fold",@@ -4038,7 +4040,7 @@ EditorUi.prototype.insertPage=function(b,e,g){this.editor.graph.isEnabled()&&(thEditorUi.prototype.createPage=function(b,e,g){e=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),e);e.setName(null!=b?b:this.createPageName());this.initDiagramNode(e,g);return e};EditorUi.prototype.createPageName=function(){for(var b={},e=0;e<this.pages.length;e++){var g=this.pages[e].getName();null!=g&&0<g.length&&(b[g]=g)}e=this.pages.length;do g=mxResources.get("pageWithNumber",[++e]);while(null!=b[g]);return g};EditorUi.prototype.removePage=function(b){try{var e=this.editor.graph,g=mxUtils.indexOf(this.pages,b);if(e.isEnabled()&&0<=g){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);e.model.beginUpdate();try{var m=this.currentPage;m==b&&1<this.pages.length?(g==this.pages.length-1?g--:g++,m=this.pages[g]):1>=this.pages.length&&(m=this.insertPage(),e.model.execute(new RenamePage(this,m,mxResources.get("pageWithNumber",[1]))));e.model.execute(new ChangePage(this,b,m))}finally{e.model.endUpdate()}}}catch(v){this.handleError(v)}return b};EditorUi.prototype.duplicatePage=function(b,e){var g=null;try{var m=this.editor.graph;if(m.isEnabled()){m.isEditing()&&m.stopEditing();var v=b.node.cloneNode(!1);v.removeAttribute("id");var p={},A=m.createCellLookup([m.model.root]);g=new DiagramPage(v);g.root=m.cloneCell(m.model.root,null,p);var G=new mxGraphModel;G.prefix=Editor.guid()+"-";G.setRoot(g.root);m.updateCustomLinks(m.createCellMapping(p,A),[g.root]);g.viewState=b==this.currentPage?m.getViewState():b.viewState;this.initDiagramNode(g);-g.viewState.scale=1;delete g.viewState.scrollLeft;delete g.viewState.scrollTop;delete g.viewState.currentRoot;delete g.viewState.defaultParent;g.setName(e);g=this.insertPage(g,mxUtils.indexOf(this.pages,b)+1)}}catch(T){this.handleError(T)}return g};EditorUi.prototype.initDiagramNode=function(b,e){null==e&&(e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,e);EditorUi.removeChildNodes(b.node);b.node.appendChild(e)};+g.viewState.scale=1;delete g.viewState.scrollLeft;delete g.viewState.scrollTop;delete g.viewState.currentRoot;delete g.viewState.defaultParent;g.setName(e);g=this.insertPage(g,mxUtils.indexOf(this.pages,b)+1)}}catch(S){this.handleError(S)}return g};EditorUi.prototype.initDiagramNode=function(b,e){null==e&&(e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,e);EditorUi.removeChildNodes(b.node);b.node.appendChild(e)};EditorUi.prototype.clonePages=function(b){for(var e=[],g=[],m=0;m<b.length;m++)try{g.push(this.clonePage(b[m]))}catch(v){e.push(mxResources.get("pageWithNumber",[m+1])+": "+v.toString())}if(0<e.length){b=Error(e.join("\n"));try{0<g.length&&(b.fallbackFileData=this.getXmlForPages(g))}catch(v){}throw b;}return g};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var e=new DiagramPage(b.node.cloneNode(!0)),g=b==this.currentPage?this.editor.graph.getViewState():b.viewState;e.viewState=mxUtils.clone(g,EditorUi.transientViewStateProperties);e.root=this.editor.graph.model.cloneCell(b.root,null,!0);e.diagramModified=b.diagramModified;return e};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var e=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(g){null!=g&&0<g.length&&this.editor.graph.model.execute(new RenamePage(this,b,g))}),mxResources.get("rename"));this.showDialog(e.container,300,80,!0,!0);e.init()}return b};EditorUi.prototype.movePage=function(b,e){this.editor.graph.model.execute(new MovePage(this,b,e))};@@ -4056,99 +4058,99 @@ EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(nEditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.thinArrowRightImage,mxUtils.bind(this,function(b){var e=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:e,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=e;mxEvent.consume(b)}))};EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.verticalDotsImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var e=new mxPopupMenu(mxUtils.bind(this,function(v,p){this.menus.get("pages").funct(v,p)}));e.div.className+=" geMenubarMenu";e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);e.destroy()});var g=mxEvent.getClientX(b),m=mxEvent.getClientY(b);e.popup(g,m,null,b);this.setCurrentMenu(e);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,e){var g=this.createTab(),m=b.getName()||mxResources.get("untitled"),v=b.getId();g.setAttribute("title",m+(null!=v?" ("+v+")":"")+" ["+e+"]");e=document.createElement("span");e.style.maxWidth="160px";e.style.textOverflow="ellipsis";e.style.overflow="hidden";mxUtils.write(e,m);g.appendChild(e);this.addTabListeners(b,g);return g};-EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var g=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(T){this.renamePage(b);mxEvent.consume(T)}));var m=document.createElement("div");m.className="geTabMenuButton";m.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";m.style.backgroundPosition="center center";m.style.backgroundRepeat="no-repeat";m.style.backgroundSize="10px";e.appendChild(m);var v=!1,p=!1,A=mxUtils.bind(this,-function(T){v=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);g.isMouseDown||p||this.selectPage(b)}),G=mxUtils.bind(this,function(T){if(g.isEnabled()&&!g.isMouseDown&&(p&&(mxEvent.isTouchEvent(T)||mxEvent.getSource(T)==m)||mxEvent.isPopupTrigger(T))&&(g.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(T)||!v)){var F=new mxPopupMenu(this.createPageMenu(b));F.div.className+=" geMenubarMenu";F.smartSeparators=!0;F.showDisabled=!0;F.autoExpand=!0;F.hideMenu=mxUtils.bind(this,-function(){mxPopupMenu.prototype.hideMenu.apply(F,arguments);this.resetCurrentMenu();F.destroy()});var P=mxEvent.getClientX(T),Q=mxEvent.getClientY(T);F.popup(P,Q,null,T);this.setCurrentMenu(F,e)}mxEvent.consume(T)});mxEvent.addGestureListeners(m,A,null,G);mxEvent.addGestureListeners(e,A,null,G)};+EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var g=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(S){this.renamePage(b);mxEvent.consume(S)}));var m=document.createElement("div");m.className="geTabMenuButton";m.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";m.style.backgroundPosition="center center";m.style.backgroundRepeat="no-repeat";m.style.backgroundSize="10px";e.appendChild(m);var v=!1,p=!1,A=mxUtils.bind(this,+function(S){v=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);g.isMouseDown||p||this.selectPage(b)}),G=mxUtils.bind(this,function(S){if(g.isEnabled()&&!g.isMouseDown&&(p&&(mxEvent.isTouchEvent(S)||mxEvent.getSource(S)==m)||mxEvent.isPopupTrigger(S))&&(g.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(S)||!v)){var F=new mxPopupMenu(this.createPageMenu(b));F.div.className+=" geMenubarMenu";F.smartSeparators=!0;F.showDisabled=!0;F.autoExpand=!0;F.hideMenu=mxUtils.bind(this,+function(){mxPopupMenu.prototype.hideMenu.apply(F,arguments);this.resetCurrentMenu();F.destroy()});var P=mxEvent.getClientX(S),Q=mxEvent.getClientY(S);F.popup(P,Q,null,S);this.setCurrentMenu(F,e)}mxEvent.consume(S)});mxEvent.addGestureListeners(m,A,null,G);mxEvent.addGestureListeners(e,A,null,G)};EditorUi.prototype.createPageMenu=function(b,e){return mxUtils.bind(this,function(g,m){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||g.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),m));g.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",[b.getName()]))}),m);g.addSeparator(m);this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",g,m,mxResources.get("move"));g.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),m);g.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,e)}),m)})};(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var b=new mxObjectCodec(new MovePage,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){e=m.oldIndex;m.oldIndex=m.newIndex;m.newIndex=e;return m};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new RenamePage,["ui","page"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){e=m.previous;m.previous=m.name;m.name=e;return m};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","page","previousPage"]);b.afterEncode=function(e,g,m){m.setAttribute("relatedPage",g.relatedPage.getId());null==g.index&&(m.setAttribute("name",g.relatedPage.getName()),null!=g.relatedPage.viewState&&m.setAttribute("viewState",JSON.stringify(g.relatedPage.viewState,function(v,p){return 0>mxUtils.indexOf(EditorUi.transientViewStateProperties,v)?p:void 0})),null!=g.relatedPage.root&&e.encodeCell(g.relatedPage.root,m));return m};b.beforeDecode=function(e,g,m){m.ui=e.ui;m.relatedPage=m.ui.getPageById(g.getAttribute("relatedPage"));if(null==m.relatedPage){var v=g.ownerDocument.createElement("diagram");v.setAttribute("id",g.getAttribute("relatedPage"));v.setAttribute("name",g.getAttribute("name"));m.relatedPage=new DiagramPage(v);v=g.getAttribute("viewState");null!=v&&(m.relatedPage.viewState=JSON.parse(v),g.removeAttribute("viewState"));g=g.cloneNode(!0);v=g.firstChild;if(null!=v)for(m.relatedPage.root=e.decodeCell(v,!1),m=-v.nextSibling,v.parentNode.removeChild(v),v=m;null!=v;){m=v.nextSibling;if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var p=v.getAttribute("id");null==e.lookup(p)&&e.decodeCell(v)}v.parentNode.removeChild(v);v=m}}return g};b.afterDecode=function(e,g,m){m.index=m.previousIndex;return m};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(m,v,p,A,G){v=null!=v?v:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),m));this.stopEditing();this.model.beginUpdate();try{for(var T=p.slice(),F=0;F<p.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[F]),"treeFolding","0")&&this.foldTreeCell(m,p[F]);p=T;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(m,v){this.model.beginUpdate();try{var p=-[];this.traverse(v,!0,mxUtils.bind(this,function(G,T){var F=null!=T&&this.isTreeEdge(T);F&&p.push(T);G==v||null!=T&&!F||p.push(G);return(null==T||F)&&(G==v||!this.model.isCollapsed(G))}));this.model.setCollapsed(v,m);for(var A=0;A<p.length;A++)this.model.setVisible(p[A],!m)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(m){return!this.isEdgeIgnored(m)};Graph.prototype.getTreeEdges=function(m,v,p,A,G,T){return this.model.filterCells(this.getEdges(m,v,p,A,G,T),mxUtils.bind(this,-function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function m(Z){return k.isVertex(Z)&&p(Z)}function v(Z){var da=!1;null!=Z&&(da=-"1"==f.getCurrentCellStyle(Z).treeMoving);return da}function p(Z){var da=!1;null!=Z&&(Z=k.getParent(Z),da=f.view.getState(Z),da="tree"==(null!=da?da.style:f.getCellStyle(Z)).containerType);return da}function A(Z){var da=!1;null!=Z&&(Z=k.getParent(Z),da=f.view.getState(Z),f.view.getState(Z),da=null!=(null!=da?da.style:f.getCellStyle(Z)).childLayout);return da}function G(Z){Z=f.view.getState(Z);if(null!=Z){var da=f.getIncomingTreeEdges(Z.cell);if(0<da.length&&(da=f.view.getState(da[0]),null!=da&&(da=-da.absolutePoints,null!=da&&0<da.length&&(da=da[da.length-1],null!=da)))){if(da.y==Z.y&&Math.abs(da.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_SOUTH;if(da.y==Z.y+Z.height&&Math.abs(da.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_NORTH;if(da.x>Z.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function T(Z,da){da=null!=da?da:!0;f.model.beginUpdate();try{var aa=f.model.getParent(Z),l=f.getIncomingTreeEdges(Z),t=f.cloneCells([l[0],Z]);f.model.setTerminal(t[0],-f.model.getTerminal(l[0],!0),!0);var I=G(Z),V=aa.geometry;I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?t[1].geometry.x+=da?Z.geometry.width+10:-t[1].geometry.width-10:t[1].geometry.y+=da?Z.geometry.height+10:-t[1].geometry.height-10;f.view.currentRoot!=aa&&(t[1].geometry.x-=V.x,t[1].geometry.y-=V.y);var J=f.view.getState(Z),W=f.view.scale;if(null!=J){var Y=mxRectangle.fromRectangle(J);I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?Y.x+=(da?Z.geometry.width+10:-t[1].geometry.width--10)*W:Y.y+=(da?Z.geometry.height+10:-t[1].geometry.height-10)*W;var ba=f.getOutgoingTreeEdges(f.model.getTerminal(l[0],!0));if(null!=ba){for(var ja=I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH,oa=V=l=0;oa<ba.length;oa++){var qa=f.model.getTerminal(ba[oa],!1);if(I==G(qa)){var ra=f.view.getState(qa);qa!=Z&&null!=ra&&(ja&&da!=ra.getCenterX()<J.getCenterX()||!ja&&da!=ra.getCenterY()<J.getCenterY())&&mxUtils.intersects(Y,ra)&&(l=10+Math.max(l,(Math.min(Y.x+Y.width,ra.x+ra.width)-Math.max(Y.x,-ra.x))/W),V=10+Math.max(V,(Math.min(Y.y+Y.height,ra.y+ra.height)-Math.max(Y.y,ra.y))/W))}}ja?V=0:l=0;for(oa=0;oa<ba.length;oa++)if(qa=f.model.getTerminal(ba[oa],!1),I==G(qa)&&(ra=f.view.getState(qa),qa!=Z&&null!=ra&&(ja&&da!=ra.getCenterX()<J.getCenterX()||!ja&&da!=ra.getCenterY()<J.getCenterY()))){var xa=[];f.traverse(ra.cell,!0,function(Ba,ya){var Da=null!=ya&&f.isTreeEdge(ya);Da&&xa.push(ya);(null==ya||Da)&&xa.push(Ba);return null==ya||Da});f.moveCells(xa,(da?1:-1)*l,(da?1:-1)*V)}}}return f.addCells(t,-aa)}finally{f.model.endUpdate()}}function F(Z){f.model.beginUpdate();try{var da=G(Z),aa=f.getIncomingTreeEdges(Z),l=f.cloneCells([aa[0],Z]);f.model.setTerminal(aa[0],l[1],!1);f.model.setTerminal(l[0],l[1],!0);f.model.setTerminal(l[0],Z,!1);var t=f.model.getParent(Z),I=t.geometry,V=[];f.view.currentRoot!=t&&(l[1].geometry.x-=I.x,l[1].geometry.y-=I.y);f.traverse(Z,!0,function(Y,ba){var ja=null!=ba&&f.isTreeEdge(ba);ja&&V.push(ba);(null==ba||ja)&&V.push(Y);return null==ba||ja});var J=Z.geometry.width+-40,W=Z.geometry.height+40;da==mxConstants.DIRECTION_SOUTH?J=0:da==mxConstants.DIRECTION_NORTH?(J=0,W=-W):da==mxConstants.DIRECTION_WEST?(J=-J,W=0):da==mxConstants.DIRECTION_EAST&&(W=0);f.moveCells(V,J,W);return f.addCells(l,t)}finally{f.model.endUpdate()}}function P(Z,da){f.model.beginUpdate();try{var aa=f.model.getParent(Z),l=f.getIncomingTreeEdges(Z),t=G(Z);0==l.length&&(l=[f.createEdge(aa,null,"",null,null,f.createCurrentEdgeStyle())],t=da);var I=f.cloneCells([l[0],Z]);f.model.setTerminal(I[0],-Z,!0);null==f.model.getTerminal(I[0],!1)&&(f.model.setTerminal(I[0],I[1],!1),f.applyNewEdgeStyle(I[1],[I[0]],t));l=f.getOutgoingTreeEdges(Z);var V=aa.geometry;da=[];f.view.currentRoot==aa&&(V=new mxRectangle);for(var J=0;J<l.length;J++){var W=f.model.getTerminal(l[J],!1);null!=W&&da.push(W)}var Y=f.view.getBounds(da),ba=f.view.translate,ja=f.view.scale;t==mxConstants.DIRECTION_SOUTH?(I[1].geometry.x=null==Y?Z.geometry.x+(Z.geometry.width-I[1].geometry.width)/2:(Y.x+Y.width)/ja-ba.x-V.x+10,I[1].geometry.y+=-I[1].geometry.height-V.y+40):t==mxConstants.DIRECTION_NORTH?(I[1].geometry.x=null==Y?Z.geometry.x+(Z.geometry.width-I[1].geometry.width)/2:(Y.x+Y.width)/ja-ba.x+-V.x+10,I[1].geometry.y-=I[1].geometry.height+V.y+40):(I[1].geometry.x=t==mxConstants.DIRECTION_WEST?I[1].geometry.x-(I[1].geometry.width+V.x+40):I[1].geometry.x+(I[1].geometry.width-V.x+40),I[1].geometry.y=null==Y?Z.geometry.y+(Z.geometry.height-I[1].geometry.height)/2:(Y.y+Y.height)/ja-ba.y+-V.y+10);return f.addCells(I,aa)}finally{f.model.endUpdate()}}-function Q(Z,da,aa){Z=f.getOutgoingTreeEdges(Z);aa=f.view.getState(aa);var l=[];if(null!=aa&&null!=Z){for(var t=0;t<Z.length;t++){var I=f.view.getState(f.model.getTerminal(Z[t],!1));null!=I&&(!da&&Math.min(I.x+I.width,aa.x+aa.width)>=Math.max(I.x,aa.x)||da&&Math.min(I.y+I.height,aa.y+aa.height)>=Math.max(I.y,aa.y))&&l.push(I)}l.sort(function(V,J){return da?V.x+V.width-J.x-J.width:V.y+V.height-J.y-J.height})}return l}function U(Z,da){var aa=G(Z),l=da==mxConstants.DIRECTION_EAST||da==mxConstants.DIRECTION_WEST;-(aa==mxConstants.DIRECTION_EAST||aa==mxConstants.DIRECTION_WEST)==l&&aa!=da?c.actions.get("selectParent").funct():aa==da?(da=f.getOutgoingTreeEdges(Z),null!=da&&0<da.length&&f.setSelectionCell(f.model.getTerminal(da[0],!1))):(aa=f.getIncomingTreeEdges(Z),null!=aa&&0<aa.length&&(l=Q(f.model.getTerminal(aa[0],!0),l,Z),Z=f.view.getState(Z),null!=Z&&(Z=mxUtils.indexOf(l,Z),0<=Z&&(Z+=da==mxConstants.DIRECTION_NORTH||da==mxConstants.DIRECTION_WEST?-1:1,0<=Z&&Z<=l.length-1&&f.setSelectionCell(l[Z].cell)))))}-var c=this,f=c.editor.graph,k=f.getModel(),B=c.menus.createPopupMenu;c.menus.createPopupMenu=function(Z,da,aa){B.apply(this,arguments);if(1==f.getSelectionCount()){da=f.getSelectionCell();var l=f.getOutgoingTreeEdges(da);Z.addSeparator();0<l.length&&(m(f.getSelectionCell())&&this.addMenuItems(Z,["selectChildren"],null,aa),this.addMenuItems(Z,["selectDescendants"],null,aa));m(f.getSelectionCell())?(Z.addSeparator(),0<f.getIncomingTreeEdges(da).length&&this.addMenuItems(Z,["selectSiblings","selectParent"],-null,aa)):0<f.model.getEdgeCount(da)&&this.addMenuItems(Z,["selectConnections"],null,aa)}};c.actions.addAction("selectChildren",function(Z){if(f.isEnabled()&&1==f.getSelectionCount()){var da=f.getSelectionCell();Z=mxEvent.isControlDown(Z)?null:f.getOutgoingTreeEdges(da);if(null!=Z&&0<Z.length){da=[];for(var aa=0;aa<Z.length;aa++)da.push(f.model.getTerminal(Z[aa],!1));f.setSelectionCells(da)}else f.setSelectionCells(f.model.getChildren(da))}},null,null,"Alt+Shift+C");c.actions.addAction("selectDescendants",-function(Z){var da=f.getSelectionCell();if(f.isEnabled()&&null!=da){var aa=[];mxEvent.isControlDown(Z)||f.traverse(da,!0,function(l,t){var I=null!=t&&f.isTreeEdge(t);I&&mxEvent.isControlDown(Z)&&aa.push(t);(null==t||I)&&aa.push(l);return null==t||I});if(0==aa.length||1==aa.length&&aa[0]==da)aa=f.model.getDescendants(da);f.setSelectionCells(aa)}},null,null,"Alt+Shift+X");c.actions.addAction("selectParent",function(Z){var da=f.getSelectionCell();f.isEnabled()&&null!=da&&(Z=mxEvent.isControlDown(Z)?-null:f.getIncomingTreeEdges(da),null!=Z&&0<Z.length?f.setSelectionCell(f.model.getTerminal(Z[0],!0)):f.selectParentCell())},null,null,"Alt+Shift+P");c.actions.addAction("selectSiblings",function(Z){if(f.isEnabled()&&1==f.getSelectionCount()){var da=f.getSelectionCell(),aa=mxEvent.isControlDown(Z)?null:f.getIncomingTreeEdges(da);Z=[];if(null!=aa&&0<aa.length&&(aa=f.getOutgoingTreeEdges(f.model.getTerminal(aa[0],!0)),null!=aa))for(var l=0;l<aa.length;l++)Z.push(f.model.getTerminal(aa[l],!1));0==Z.length&&-(Z=f.model.getChildren(f.model.getParent(da)));f.setSelectionCells(Z)}},null,null,"Alt+Shift+S");var z=f.removeCells;f.removeCells=function(Z,da){da=null!=da?da:!0;null==Z&&(Z=this.getDeletableCells(this.getSelectionCells()));da&&(Z=this.getDeletableCells(this.addAllEdges(Z)));for(var aa=[],l=0;l<Z.length;l++){var t=Z[l];k.isEdge(t)&&p(t)&&(aa.push(t),t=k.getTerminal(t,!1));if(m(t)){var I=[];f.traverse(t,!0,function(V,J){var W=null!=J&&f.isTreeEdge(J);W&&I.push(J);(null==J||W)&&I.push(V);return null==-J||W});0<I.length&&(aa=aa.concat(I),t=f.getIncomingTreeEdges(Z[l]),Z=Z.concat(t))}else null!=t&&aa.push(Z[l])}Z=aa;return z.apply(this,arguments)};c.hoverIcons.getStateAt=function(Z,da,aa){return m(Z.cell)?null:this.graph.view.getState(this.graph.getCellAt(da,aa))};var C=f.duplicateCells;f.duplicateCells=function(Z,da){Z=null!=Z?Z:this.getSelectionCells();for(var aa=Z.slice(0),l=0;l<aa.length;l++){var t=f.view.getState(aa[l]);if(null!=t&&m(t.cell)){var I=f.getIncomingTreeEdges(t.cell);for(t=0;t<I.length;t++)mxUtils.remove(I[t],-Z)}}this.model.beginUpdate();try{var V=C.call(this,Z,da);if(V.length==Z.length)for(l=0;l<Z.length;l++)if(m(Z[l])){var J=f.getIncomingTreeEdges(V[l]);I=f.getIncomingTreeEdges(Z[l]);if(0==J.length&&0<I.length){var W=this.cloneCell(I[0]);this.addEdge(W,f.getDefaultParent(),this.model.getTerminal(I[0],!0),V[l])}}}finally{this.model.endUpdate()}return V};var H=f.moveCells;f.moveCells=function(Z,da,aa,l,t,I,V){for(var J=null,W=[],Y=0;Y<Z.length;Y++)(v(Z[Y])||m(Z[Y]))&&!A(Z[Y])&&this.isCellCollapsed(Z[Y])?-W=W.concat(this.getSubtree(Z[Y])):W.push(Z[Y]);Z=mxUtils.removeDuplicates(W);this.model.beginUpdate();try{W=t;var ba=this.getCurrentCellStyle(t);if(null!=Z&&m(t)&&"1"==mxUtils.getValue(ba,"treeFolding","0")){for(Y=0;Y<Z.length;Y++)if(m(Z[Y])||f.model.isEdge(Z[Y])&&null==f.model.getTerminal(Z[Y],!0)){t=f.model.getParent(Z[Y]);break}if(null!=W&&t!=W&&null!=this.view.getState(Z[0])){var ja=f.getIncomingTreeEdges(Z[0]);if(0<ja.length){var oa=f.view.getState(f.model.getTerminal(ja[0],!0));if(null!=oa){var qa=-f.view.getState(W);null!=qa&&(da=(qa.getCenterX()-oa.getCenterX())/f.view.scale,aa=(qa.getCenterY()-oa.getCenterY())/f.view.scale)}}}}J=H.apply(this,arguments);if(null!=J&&null!=Z&&J.length==Z.length)for(Y=0;Y<J.length;Y++)if(this.model.isEdge(J[Y]))m(W)&&0>mxUtils.indexOf(J,this.model.getTerminal(J[Y],!0))&&this.model.setTerminal(J[Y],W,!0);else if(m(Z[Y])&&(ja=f.getIncomingTreeEdges(Z[Y]),0<ja.length))if(!l)m(W)&&0>mxUtils.indexOf(Z,this.model.getTerminal(ja[0],!0))&&this.model.setTerminal(ja[0],-W,!0);else if(0==f.getIncomingTreeEdges(J[Y]).length){ba=W;if(null==ba||ba==f.model.getParent(Z[Y]))ba=f.model.getTerminal(ja[0],!0);l=this.cloneCell(ja[0]);this.addEdge(l,f.getDefaultParent(),ba,J[Y])}}finally{this.model.endUpdate()}return J};if(null!=c.sidebar){var K=c.sidebar.dropAndConnect;c.sidebar.dropAndConnect=function(Z,da,aa,l){var t=f.model,I=null;t.beginUpdate();try{if(I=K.apply(this,arguments),m(Z))for(var V=0;V<I.length;V++)if(t.isEdge(I[V])&&null==t.getTerminal(I[V],!0)){t.setTerminal(I[V],-Z,!0);var J=f.getCellGeometry(I[V]);J.points=null;null!=J.getTerminalPoint(!0)&&J.setTerminalPoint(null,!0)}}finally{t.endUpdate()}return I}}var M={67:c.actions.get("selectChildren"),88:c.actions.get("selectDescendants"),80:c.actions.get("selectParent"),83:c.actions.get("selectSiblings")},O={67:c.actions.get("copyStyle"),86:c.actions.get("pasteStyle")},ea=c.onKeyDown;c.onKeyDown=function(Z){try{var da=f.getSelectionCell();if(f.isEnabled()&&!f.isEditing()&&null!=da){var aa=mxEvent.isAltDown(Z)&&mxEvent.isShiftDown(Z)?-M[Z.keyCode]:mxEvent.isAltDown(Z)?O[Z.keyCode]:null;null!=aa?(aa.funct(Z),mxEvent.consume(Z)):m(da)&&(aa=null,0<f.getIncomingTreeEdges(da).length&&(9==Z.which?aa=mxEvent.isShiftDown(Z)?F(da):P(da):13==Z.which&&(aa=T(da,!mxEvent.isShiftDown(Z)))),null!=aa&&0<aa.length?(1==aa.length&&f.model.isEdge(aa[0])?f.setSelectionCell(f.model.getTerminal(aa[0],!1)):f.setSelectionCell(aa[aa.length-1]),null!=c.hoverIcons&&c.hoverIcons.update(f.view.getState(da)),f.startEditingAtCell(da),mxEvent.consume(Z)):37==-Z.keyCode?(U(da,mxConstants.DIRECTION_WEST),mxEvent.consume(Z)):38==Z.keyCode?(U(da,mxConstants.DIRECTION_NORTH),mxEvent.consume(Z)):39==Z.keyCode?(U(da,mxConstants.DIRECTION_EAST),mxEvent.consume(Z)):40==Z.keyCode&&(U(da,mxConstants.DIRECTION_SOUTH),mxEvent.consume(Z)))}}catch(l){c.handleError(l)}mxEvent.isConsumed(Z)||ea.apply(this,arguments)};var fa=f.connectVertex;f.connectVertex=function(Z,da,aa,l,t,I,V){var J=f.getIncomingTreeEdges(Z);if(m(Z)){var W=G(Z),Y=W==mxConstants.DIRECTION_EAST||W==-mxConstants.DIRECTION_WEST,ba=da==mxConstants.DIRECTION_EAST||da==mxConstants.DIRECTION_WEST;return W==da||0==J.length?P(Z,da):Y==ba?F(Z):T(Z,da!=mxConstants.DIRECTION_NORTH&&da!=mxConstants.DIRECTION_WEST)}return fa.apply(this,arguments)};f.getSubtree=function(Z){var da=[Z];!v(Z)&&!m(Z)||A(Z)||f.traverse(Z,!0,function(aa,l){var t=null!=l&&f.isTreeEdge(l);t&&0>mxUtils.indexOf(da,l)&&da.push(l);(null==l||t)&&0>mxUtils.indexOf(da,aa)&&da.push(aa);return null==l||t});return da};var S=mxVertexHandler.prototype.refresh;-mxVertexHandler.prototype.refresh=function(){S.apply(this,arguments);(v(this.state.cell)||m(this.state.cell))&&!A(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height=+v.nextSibling,v.parentNode.removeChild(v),v=m;null!=v;){m=v.nextSibling;if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var p=v.getAttribute("id");null==e.lookup(p)&&e.decodeCell(v)}v.parentNode.removeChild(v);v=m}}return g};b.afterDecode=function(e,g,m){m.index=m.previousIndex;return m};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(m,v,p,A,G){v=null!=v?v:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),m));this.stopEditing();this.model.beginUpdate();try{for(var S=p.slice(),F=0;F<p.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[F]),"treeFolding","0")&&this.foldTreeCell(m,p[F]);p=S;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(m,v){this.model.beginUpdate();try{var p=+[];this.traverse(v,!0,mxUtils.bind(this,function(G,S){var F=null!=S&&this.isTreeEdge(S);F&&p.push(S);G==v||null!=S&&!F||p.push(G);return(null==S||F)&&(G==v||!this.model.isCollapsed(G))}));this.model.setCollapsed(v,m);for(var A=0;A<p.length;A++)this.model.setVisible(p[A],!m)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(m){return!this.isEdgeIgnored(m)};Graph.prototype.getTreeEdges=function(m,v,p,A,G,S){return this.model.filterCells(this.getEdges(m,v,p,A,G,S),mxUtils.bind(this,+function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function m(Z){return k.isVertex(Z)&&p(Z)}function v(Z){var ea=!1;null!=Z&&(ea=+"1"==f.getCurrentCellStyle(Z).treeMoving);return ea}function p(Z){var ea=!1;null!=Z&&(Z=k.getParent(Z),ea=f.view.getState(Z),ea="tree"==(null!=ea?ea.style:f.getCellStyle(Z)).containerType);return ea}function A(Z){var ea=!1;null!=Z&&(Z=k.getParent(Z),ea=f.view.getState(Z),f.view.getState(Z),ea=null!=(null!=ea?ea.style:f.getCellStyle(Z)).childLayout);return ea}function G(Z){Z=f.view.getState(Z);if(null!=Z){var ea=f.getIncomingTreeEdges(Z.cell);if(0<ea.length&&(ea=f.view.getState(ea[0]),null!=ea&&(ea=+ea.absolutePoints,null!=ea&&0<ea.length&&(ea=ea[ea.length-1],null!=ea)))){if(ea.y==Z.y&&Math.abs(ea.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_SOUTH;if(ea.y==Z.y+Z.height&&Math.abs(ea.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_NORTH;if(ea.x>Z.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function S(Z,ea){ea=null!=ea?ea:!0;f.model.beginUpdate();try{var aa=f.model.getParent(Z),l=f.getIncomingTreeEdges(Z),t=f.cloneCells([l[0],Z]);f.model.setTerminal(t[0],+f.model.getTerminal(l[0],!0),!0);var H=G(Z),U=aa.geometry;H==mxConstants.DIRECTION_SOUTH||H==mxConstants.DIRECTION_NORTH?t[1].geometry.x+=ea?Z.geometry.width+10:-t[1].geometry.width-10:t[1].geometry.y+=ea?Z.geometry.height+10:-t[1].geometry.height-10;f.view.currentRoot!=aa&&(t[1].geometry.x-=U.x,t[1].geometry.y-=U.y);var K=f.view.getState(Z),W=f.view.scale;if(null!=K){var Y=mxRectangle.fromRectangle(K);H==mxConstants.DIRECTION_SOUTH||H==mxConstants.DIRECTION_NORTH?Y.x+=(ea?Z.geometry.width+10:-t[1].geometry.width-+10)*W:Y.y+=(ea?Z.geometry.height+10:-t[1].geometry.height-10)*W;var ca=f.getOutgoingTreeEdges(f.model.getTerminal(l[0],!0));if(null!=ca){for(var ja=H==mxConstants.DIRECTION_SOUTH||H==mxConstants.DIRECTION_NORTH,oa=U=l=0;oa<ca.length;oa++){var qa=f.model.getTerminal(ca[oa],!1);if(H==G(qa)){var ra=f.view.getState(qa);qa!=Z&&null!=ra&&(ja&&ea!=ra.getCenterX()<K.getCenterX()||!ja&&ea!=ra.getCenterY()<K.getCenterY())&&mxUtils.intersects(Y,ra)&&(l=10+Math.max(l,(Math.min(Y.x+Y.width,ra.x+ra.width)-Math.max(Y.x,+ra.x))/W),U=10+Math.max(U,(Math.min(Y.y+Y.height,ra.y+ra.height)-Math.max(Y.y,ra.y))/W))}}ja?U=0:l=0;for(oa=0;oa<ca.length;oa++)if(qa=f.model.getTerminal(ca[oa],!1),H==G(qa)&&(ra=f.view.getState(qa),qa!=Z&&null!=ra&&(ja&&ea!=ra.getCenterX()<K.getCenterX()||!ja&&ea!=ra.getCenterY()<K.getCenterY()))){var xa=[];f.traverse(ra.cell,!0,function(Ba,ya){var Da=null!=ya&&f.isTreeEdge(ya);Da&&xa.push(ya);(null==ya||Da)&&xa.push(Ba);return null==ya||Da});f.moveCells(xa,(ea?1:-1)*l,(ea?1:-1)*U)}}}return f.addCells(t,+aa)}finally{f.model.endUpdate()}}function F(Z){f.model.beginUpdate();try{var ea=G(Z),aa=f.getIncomingTreeEdges(Z),l=f.cloneCells([aa[0],Z]);f.model.setTerminal(aa[0],l[1],!1);f.model.setTerminal(l[0],l[1],!0);f.model.setTerminal(l[0],Z,!1);var t=f.model.getParent(Z),H=t.geometry,U=[];f.view.currentRoot!=t&&(l[1].geometry.x-=H.x,l[1].geometry.y-=H.y);f.traverse(Z,!0,function(Y,ca){var ja=null!=ca&&f.isTreeEdge(ca);ja&&U.push(ca);(null==ca||ja)&&U.push(Y);return null==ca||ja});var K=Z.geometry.width++40,W=Z.geometry.height+40;ea==mxConstants.DIRECTION_SOUTH?K=0:ea==mxConstants.DIRECTION_NORTH?(K=0,W=-W):ea==mxConstants.DIRECTION_WEST?(K=-K,W=0):ea==mxConstants.DIRECTION_EAST&&(W=0);f.moveCells(U,K,W);return f.addCells(l,t)}finally{f.model.endUpdate()}}function P(Z,ea){f.model.beginUpdate();try{var aa=f.model.getParent(Z),l=f.getIncomingTreeEdges(Z),t=G(Z);0==l.length&&(l=[f.createEdge(aa,null,"",null,null,f.createCurrentEdgeStyle())],t=ea);var H=f.cloneCells([l[0],Z]);f.model.setTerminal(H[0],+Z,!0);null==f.model.getTerminal(H[0],!1)&&(f.model.setTerminal(H[0],H[1],!1),f.applyNewEdgeStyle(H[1],[H[0]],t));l=f.getOutgoingTreeEdges(Z);var U=aa.geometry;ea=[];f.view.currentRoot==aa&&(U=new mxRectangle);for(var K=0;K<l.length;K++){var W=f.model.getTerminal(l[K],!1);null!=W&&ea.push(W)}var Y=f.view.getBounds(ea),ca=f.view.translate,ja=f.view.scale;t==mxConstants.DIRECTION_SOUTH?(H[1].geometry.x=null==Y?Z.geometry.x+(Z.geometry.width-H[1].geometry.width)/2:(Y.x+Y.width)/ja-ca.x-U.x+10,H[1].geometry.y+=+H[1].geometry.height-U.y+40):t==mxConstants.DIRECTION_NORTH?(H[1].geometry.x=null==Y?Z.geometry.x+(Z.geometry.width-H[1].geometry.width)/2:(Y.x+Y.width)/ja-ca.x+-U.x+10,H[1].geometry.y-=H[1].geometry.height+U.y+40):(H[1].geometry.x=t==mxConstants.DIRECTION_WEST?H[1].geometry.x-(H[1].geometry.width+U.x+40):H[1].geometry.x+(H[1].geometry.width-U.x+40),H[1].geometry.y=null==Y?Z.geometry.y+(Z.geometry.height-H[1].geometry.height)/2:(Y.y+Y.height)/ja-ca.y+-U.y+10);return f.addCells(H,aa)}finally{f.model.endUpdate()}}+function Q(Z,ea,aa){Z=f.getOutgoingTreeEdges(Z);aa=f.view.getState(aa);var l=[];if(null!=aa&&null!=Z){for(var t=0;t<Z.length;t++){var H=f.view.getState(f.model.getTerminal(Z[t],!1));null!=H&&(!ea&&Math.min(H.x+H.width,aa.x+aa.width)>=Math.max(H.x,aa.x)||ea&&Math.min(H.y+H.height,aa.y+aa.height)>=Math.max(H.y,aa.y))&&l.push(H)}l.sort(function(U,K){return ea?U.x+U.width-K.x-K.width:U.y+U.height-K.y-K.height})}return l}function T(Z,ea){var aa=G(Z),l=ea==mxConstants.DIRECTION_EAST||ea==mxConstants.DIRECTION_WEST;+(aa==mxConstants.DIRECTION_EAST||aa==mxConstants.DIRECTION_WEST)==l&&aa!=ea?c.actions.get("selectParent").funct():aa==ea?(ea=f.getOutgoingTreeEdges(Z),null!=ea&&0<ea.length&&f.setSelectionCell(f.model.getTerminal(ea[0],!1))):(aa=f.getIncomingTreeEdges(Z),null!=aa&&0<aa.length&&(l=Q(f.model.getTerminal(aa[0],!0),l,Z),Z=f.view.getState(Z),null!=Z&&(Z=mxUtils.indexOf(l,Z),0<=Z&&(Z+=ea==mxConstants.DIRECTION_NORTH||ea==mxConstants.DIRECTION_WEST?-1:1,0<=Z&&Z<=l.length-1&&f.setSelectionCell(l[Z].cell)))))}+var c=this,f=c.editor.graph,k=f.getModel(),B=c.menus.createPopupMenu;c.menus.createPopupMenu=function(Z,ea,aa){B.apply(this,arguments);if(1==f.getSelectionCount()){ea=f.getSelectionCell();var l=f.getOutgoingTreeEdges(ea);Z.addSeparator();0<l.length&&(m(f.getSelectionCell())&&this.addMenuItems(Z,["selectChildren"],null,aa),this.addMenuItems(Z,["selectDescendants"],null,aa));m(f.getSelectionCell())?(Z.addSeparator(),0<f.getIncomingTreeEdges(ea).length&&this.addMenuItems(Z,["selectSiblings","selectParent"],+null,aa)):0<f.model.getEdgeCount(ea)&&this.addMenuItems(Z,["selectConnections"],null,aa)}};c.actions.addAction("selectChildren",function(Z){if(f.isEnabled()&&1==f.getSelectionCount()){var ea=f.getSelectionCell();Z=mxEvent.isControlDown(Z)?null:f.getOutgoingTreeEdges(ea);if(null!=Z&&0<Z.length){ea=[];for(var aa=0;aa<Z.length;aa++)ea.push(f.model.getTerminal(Z[aa],!1));f.setSelectionCells(ea)}else f.setSelectionCells(f.model.getChildren(ea))}},null,null,"Alt+Shift+C");c.actions.addAction("selectDescendants",+function(Z){var ea=f.getSelectionCell();if(f.isEnabled()&&null!=ea){var aa=[];mxEvent.isControlDown(Z)||f.traverse(ea,!0,function(l,t){var H=null!=t&&f.isTreeEdge(t);H&&mxEvent.isControlDown(Z)&&aa.push(t);(null==t||H)&&aa.push(l);return null==t||H});if(0==aa.length||1==aa.length&&aa[0]==ea)aa=f.model.getDescendants(ea);f.setSelectionCells(aa)}},null,null,"Alt+Shift+X");c.actions.addAction("selectParent",function(Z){var ea=f.getSelectionCell();f.isEnabled()&&null!=ea&&(Z=mxEvent.isControlDown(Z)?+null:f.getIncomingTreeEdges(ea),null!=Z&&0<Z.length?f.setSelectionCell(f.model.getTerminal(Z[0],!0)):f.selectParentCell())},null,null,"Alt+Shift+P");c.actions.addAction("selectSiblings",function(Z){if(f.isEnabled()&&1==f.getSelectionCount()){var ea=f.getSelectionCell(),aa=mxEvent.isControlDown(Z)?null:f.getIncomingTreeEdges(ea);Z=[];if(null!=aa&&0<aa.length&&(aa=f.getOutgoingTreeEdges(f.model.getTerminal(aa[0],!0)),null!=aa))for(var l=0;l<aa.length;l++)Z.push(f.model.getTerminal(aa[l],!1));0==Z.length&&+(Z=f.model.getChildren(f.model.getParent(ea)));f.setSelectionCells(Z)}},null,null,"Alt+Shift+S");var z=f.removeCells;f.removeCells=function(Z,ea){ea=null!=ea?ea:!0;null==Z&&(Z=this.getDeletableCells(this.getSelectionCells()));ea&&(Z=this.getDeletableCells(this.addAllEdges(Z)));for(var aa=[],l=0;l<Z.length;l++){var t=Z[l];k.isEdge(t)&&p(t)&&(aa.push(t),t=k.getTerminal(t,!1));if(m(t)){var H=[];f.traverse(t,!0,function(U,K){var W=null!=K&&f.isTreeEdge(K);W&&H.push(K);(null==K||W)&&H.push(U);return null==+K||W});0<H.length&&(aa=aa.concat(H),t=f.getIncomingTreeEdges(Z[l]),Z=Z.concat(t))}else null!=t&&aa.push(Z[l])}Z=aa;return z.apply(this,arguments)};c.hoverIcons.getStateAt=function(Z,ea,aa){return m(Z.cell)?null:this.graph.view.getState(this.graph.getCellAt(ea,aa))};var C=f.duplicateCells;f.duplicateCells=function(Z,ea){Z=null!=Z?Z:this.getSelectionCells();for(var aa=Z.slice(0),l=0;l<aa.length;l++){var t=f.view.getState(aa[l]);if(null!=t&&m(t.cell)){var H=f.getIncomingTreeEdges(t.cell);for(t=0;t<H.length;t++)mxUtils.remove(H[t],+Z)}}this.model.beginUpdate();try{var U=C.call(this,Z,ea);if(U.length==Z.length)for(l=0;l<Z.length;l++)if(m(Z[l])){var K=f.getIncomingTreeEdges(U[l]);H=f.getIncomingTreeEdges(Z[l]);if(0==K.length&&0<H.length){var W=this.cloneCell(H[0]);this.addEdge(W,f.getDefaultParent(),this.model.getTerminal(H[0],!0),U[l])}}}finally{this.model.endUpdate()}return U};var I=f.moveCells;f.moveCells=function(Z,ea,aa,l,t,H,U){for(var K=null,W=[],Y=0;Y<Z.length;Y++)(v(Z[Y])||m(Z[Y]))&&!A(Z[Y])&&this.isCellCollapsed(Z[Y])?+W=W.concat(this.getSubtree(Z[Y])):W.push(Z[Y]);Z=mxUtils.removeDuplicates(W);this.model.beginUpdate();try{W=t;var ca=this.getCurrentCellStyle(t);if(null!=Z&&m(t)&&"1"==mxUtils.getValue(ca,"treeFolding","0")){for(Y=0;Y<Z.length;Y++)if(m(Z[Y])||f.model.isEdge(Z[Y])&&null==f.model.getTerminal(Z[Y],!0)){t=f.model.getParent(Z[Y]);break}if(null!=W&&t!=W&&null!=this.view.getState(Z[0])){var ja=f.getIncomingTreeEdges(Z[0]);if(0<ja.length){var oa=f.view.getState(f.model.getTerminal(ja[0],!0));if(null!=oa){var qa=+f.view.getState(W);null!=qa&&(ea=(qa.getCenterX()-oa.getCenterX())/f.view.scale,aa=(qa.getCenterY()-oa.getCenterY())/f.view.scale)}}}}K=I.apply(this,arguments);if(null!=K&&null!=Z&&K.length==Z.length)for(Y=0;Y<K.length;Y++)if(this.model.isEdge(K[Y]))m(W)&&0>mxUtils.indexOf(K,this.model.getTerminal(K[Y],!0))&&this.model.setTerminal(K[Y],W,!0);else if(m(Z[Y])&&(ja=f.getIncomingTreeEdges(Z[Y]),0<ja.length))if(!l)m(W)&&0>mxUtils.indexOf(Z,this.model.getTerminal(ja[0],!0))&&this.model.setTerminal(ja[0],+W,!0);else if(0==f.getIncomingTreeEdges(K[Y]).length){ca=W;if(null==ca||ca==f.model.getParent(Z[Y]))ca=f.model.getTerminal(ja[0],!0);l=this.cloneCell(ja[0]);this.addEdge(l,f.getDefaultParent(),ca,K[Y])}}finally{this.model.endUpdate()}return K};if(null!=c.sidebar){var L=c.sidebar.dropAndConnect;c.sidebar.dropAndConnect=function(Z,ea,aa,l){var t=f.model,H=null;t.beginUpdate();try{if(H=L.apply(this,arguments),m(Z))for(var U=0;U<H.length;U++)if(t.isEdge(H[U])&&null==t.getTerminal(H[U],!0)){t.setTerminal(H[U],+Z,!0);var K=f.getCellGeometry(H[U]);K.points=null;null!=K.getTerminalPoint(!0)&&K.setTerminalPoint(null,!0)}}finally{t.endUpdate()}return H}}var J={67:c.actions.get("selectChildren"),88:c.actions.get("selectDescendants"),80:c.actions.get("selectParent"),83:c.actions.get("selectSiblings")},O={67:c.actions.get("copyStyle"),86:c.actions.get("pasteStyle")},da=c.onKeyDown;c.onKeyDown=function(Z){try{var ea=f.getSelectionCell();if(f.isEnabled()&&!f.isEditing()&&null!=ea){var aa=mxEvent.isAltDown(Z)&&mxEvent.isShiftDown(Z)?+J[Z.keyCode]:mxEvent.isAltDown(Z)?O[Z.keyCode]:null;null!=aa?(aa.funct(Z),mxEvent.consume(Z)):m(ea)&&(aa=null,0<f.getIncomingTreeEdges(ea).length&&(9==Z.which?aa=mxEvent.isShiftDown(Z)?F(ea):P(ea):13==Z.which&&(aa=S(ea,!mxEvent.isShiftDown(Z)))),null!=aa&&0<aa.length?(1==aa.length&&f.model.isEdge(aa[0])?f.setSelectionCell(f.model.getTerminal(aa[0],!1)):f.setSelectionCell(aa[aa.length-1]),null!=c.hoverIcons&&c.hoverIcons.update(f.view.getState(ea)),f.startEditingAtCell(ea),mxEvent.consume(Z)):37==+Z.keyCode?(T(ea,mxConstants.DIRECTION_WEST),mxEvent.consume(Z)):38==Z.keyCode?(T(ea,mxConstants.DIRECTION_NORTH),mxEvent.consume(Z)):39==Z.keyCode?(T(ea,mxConstants.DIRECTION_EAST),mxEvent.consume(Z)):40==Z.keyCode&&(T(ea,mxConstants.DIRECTION_SOUTH),mxEvent.consume(Z)))}}catch(l){c.handleError(l)}mxEvent.isConsumed(Z)||da.apply(this,arguments)};var fa=f.connectVertex;f.connectVertex=function(Z,ea,aa,l,t,H,U){var K=f.getIncomingTreeEdges(Z);if(m(Z)){var W=G(Z),Y=W==mxConstants.DIRECTION_EAST||W==+mxConstants.DIRECTION_WEST,ca=ea==mxConstants.DIRECTION_EAST||ea==mxConstants.DIRECTION_WEST;return W==ea||0==K.length?P(Z,ea):Y==ca?F(Z):S(Z,ea!=mxConstants.DIRECTION_NORTH&&ea!=mxConstants.DIRECTION_WEST)}return fa.apply(this,arguments)};f.getSubtree=function(Z){var ea=[Z];!v(Z)&&!m(Z)||A(Z)||f.traverse(Z,!0,function(aa,l){var t=null!=l&&f.isTreeEdge(l);t&&0>mxUtils.indexOf(ea,l)&&ea.push(l);(null==l||t)&&0>mxUtils.indexOf(ea,aa)&&ea.push(aa);return null==l||t});return ea};var V=mxVertexHandler.prototype.refresh;+mxVertexHandler.prototype.refresh=function(){V.apply(this,arguments);(v(this.state.cell)||m(this.state.cell))&&!A(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(Z){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(Z),mxEvent.getClientY(Z),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(Z);this.graph.isMouseDown=!0;c.hoverIcons.reset();mxEvent.consume(Z)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),-this.moveHandle=null)};var ca=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){ca.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var ma=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=-function(Z){ma.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=Z?"":"none")};var la=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(Z,da){la.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var g=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var m=g.apply(this,arguments),v=this.graph,p=this;-return m.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');G.vertex=!0;var T=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-T.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);T.insertEdge(F,!1);A.insert(F);A.insert(G);A.insert(T);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,-0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');G.vertex=!0;var T=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-T.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);T.insertEdge(F,!1);var P=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-P.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),F.style);Q.geometry.relative=!0;Q.edge=!0;G.insertEdge(Q,!0);P.insertEdge(Q,!1);var U=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-U.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),F.style);c.geometry.relative=!0;c.edge=!0;G.insertEdge(c,!0);U.insertEdge(c,!1);var f=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-f.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),F.style);k.geometry.relative=!0;k.edge=!0;G.insertEdge(k,!0);f.insertEdge(k,!1);A.insert(F);A.insert(Q);A.insert(c);A.insert(k);A.insert(G);A.insert(T);A.insert(P);A.insert(U);A.insert(f);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var A=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+this.moveHandle=null)};var ba=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){ba.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var ma=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=+function(Z){ma.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=Z?"":"none")};var la=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(Z,ea){la.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var g=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var m=g.apply(this,arguments),v=this.graph,p=this;+return m.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');G.vertex=!0;var S=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');+S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);A.insert(F);A.insert(G);A.insert(S);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,+0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');G.vertex=!0;var S=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);var P=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+P.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),F.style);Q.geometry.relative=!0;Q.edge=!0;G.insertEdge(Q,!0);P.insertEdge(Q,!1);var T=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+T.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),F.style);c.geometry.relative=!0;c.edge=!0;G.insertEdge(c,!0);T.insertEdge(c,!1);var f=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+f.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),F.style);k.geometry.relative=!0;k.edge=!0;G.insertEdge(k,!0);f.insertEdge(k,!1);A.insert(F);A.insert(Q);A.insert(c);A.insert(k);A.insert(G);A.insert(S);A.insert(P);A.insert(T);A.insert(f);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var A=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');A.vertex=!0;return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var A=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return p.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var A=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return p.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree orgchart organization division",function(){var A=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var G=new mxCell("Organization",new mxGeometry(80,-40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(G,"treeRoot","1");G.vertex=!0;var T=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');T.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);T.insertEdge(F,!1);var P=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');P.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");Q.geometry.relative=-!0;Q.edge=!0;G.insertEdge(Q,!0);P.insertEdge(Q,!1);A.insert(F);A.insert(Q);A.insert(G);A.insert(T);A.insert(P);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree root",function(){var A=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;return p.createVertexTemplateFromCells([A],+40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(G,"treeRoot","1");G.vertex=!0;var S=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);var P=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');P.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");Q.geometry.relative=+!0;Q.edge=!0;G.insertEdge(Q,!0);P.insertEdge(Q,!1);A.insert(F);A.insert(Q);A.insert(G);A.insert(S);A.insert(P);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree root",function(){var A=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree division",function(){var A=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.setTerminalPoint(new mxPoint(0,0),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return p.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree sub sections",function(){var A=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");-G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);var T=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");T.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),G.style);F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;T.insertEdge(F,!1);return p.createVertexTemplateFromCells([G,F,A,T],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;-EditorUi.initMinimalTheme=function(){function b(U,c){if(EditorUi.windowed){var f=U.editor.graph;f.popupMenuHandler.hideMenu();null==U.formatWindow?(c=Math.max(10,U.diagramContainer.clientWidth-248),f=Math.min(566,f.container.clientHeight-10),U.formatWindow=new WrapperWindow(U,mxResources.get("format"),c,60,240,f,function(k){U.createFormat(k).init()}),U.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){U.formatWindow.window.fit()})),U.formatWindow.window.minimumSize=new mxRectangle(0,-0,240,80)):U.formatWindow.window.setVisible(null!=c?c:!U.formatWindow.window.isVisible())}else null==U.formatElt&&(U.formatElt=U.createSidebarContainer(),U.createFormat(U.formatElt).init(),U.formatElt.style.border="none",U.formatElt.style.width="240px",U.formatElt.style.borderLeftWidth="1px",U.formatElt.style.borderLeftStyle="solid",U.formatElt.style.right="0px"),f=U.diagramContainer.parentNode,null!=U.formatElt.parentNode?(U.formatElt.parentNode.removeChild(U.formatElt),f.style.right="0px"):(f.parentNode.appendChild(U.formatElt),-f.style.right=U.formatElt.style.width)}function e(U,c){function f(z,C){var H=U.menus.get(z);z=k.addMenu(C,mxUtils.bind(this,function(){H.funct.apply(this,arguments)}));z.setAttribute("title",C);z.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";z.className="geTitle";c.appendChild(z);return z}var k=new Menubar(U,c);if(Editor.enableCustomLibraries&&-("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=U.actions.get("newLibrary")){var B=document.createElement("div");B.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";B.className="geTitle";mxUtils.write(B,mxResources.get("newLibrary"));c.appendChild(B);mxEvent.addListener(B,"click",this.actions.get("newLibrary").funct);-B=B.cloneNode(!1);B.style.left="50%";B.style.borderLeftStyle="solid";mxUtils.write(B,mxResources.get("openLibrary"));c.appendChild(B);mxEvent.addListener(B,"click",this.actions.get("openLibrary").funct)}else B=f("newLibrary",mxResources.get("newLibrary")),B.style.display="block",B.style.fontSize="11px",B.style.left="0",B=f("openLibraryFrom",mxResources.get("openLibraryFrom")),B.style.borderLeftStyle="solid",B.style.display="block",B.style.fontSize="11px",B.style.left="50%";c.appendChild(U.sidebar.container);-c.style.overflow="hidden"}function g(U,c){if(EditorUi.windowed){var f=U.editor.graph;f.popupMenuHandler.hideMenu();null==U.sidebarWindow?(c=Math.min(f.container.clientWidth-10,218),f=Math.min(f.container.clientHeight-40,650),U.sidebarWindow=new WrapperWindow(U,mxResources.get("shapes"),10,56,c-6,f-6,function(k){e(U,k)}),U.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){U.sidebarWindow.window.fit()})),U.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),U.sidebarWindow.window.setVisible(!0),-isLocalStorage&&U.getLocalData("sidebar",function(k){U.sidebar.showEntries(k,null,!0)}),U.restoreLibraries()):U.sidebarWindow.window.setVisible(null!=c?c:!U.sidebarWindow.window.isVisible())}else null==U.sidebarElt&&(U.sidebarElt=U.createSidebarContainer(),e(U,U.sidebarElt),U.sidebarElt.style.border="none",U.sidebarElt.style.width="210px",U.sidebarElt.style.borderRight="1px solid gray"),f=U.diagramContainer.parentNode,null!=U.sidebarElt.parentNode?(U.sidebarElt.parentNode.removeChild(U.sidebarElt),-f.style.left="0px"):(f.parentNode.appendChild(U.sidebarElt),f.style.left=U.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(U){}Menus.prototype.autoPopup=!1;Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src;+G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);var S=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),G.style);F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;S.insertEdge(F,!1);return p.createVertexTemplateFromCells([G,F,A,S],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+EditorUi.initMinimalTheme=function(){function b(T,c){if(EditorUi.windowed){var f=T.editor.graph;f.popupMenuHandler.hideMenu();null==T.formatWindow?(c=Math.max(10,T.diagramContainer.clientWidth-248),f=Math.min(566,f.container.clientHeight-10),T.formatWindow=new WrapperWindow(T,mxResources.get("format"),c,60,240,f,function(k){T.createFormat(k).init()}),T.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){T.formatWindow.window.fit()})),T.formatWindow.window.minimumSize=new mxRectangle(0,+0,240,80)):T.formatWindow.window.setVisible(null!=c?c:!T.formatWindow.window.isVisible())}else null==T.formatElt&&(T.formatElt=T.createSidebarContainer(),T.createFormat(T.formatElt).init(),T.formatElt.style.border="none",T.formatElt.style.width="240px",T.formatElt.style.borderLeftWidth="1px",T.formatElt.style.borderLeftStyle="solid",T.formatElt.style.right="0px"),f=T.diagramContainer.parentNode,null!=T.formatElt.parentNode?(T.formatElt.parentNode.removeChild(T.formatElt),f.style.right="0px"):(f.parentNode.appendChild(T.formatElt),+f.style.right=T.formatElt.style.width)}function e(T,c){function f(z,C){var I=T.menus.get(z);z=k.addMenu(C,mxUtils.bind(this,function(){I.funct.apply(this,arguments)}));z.setAttribute("title",C);z.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";z.className="geTitle";c.appendChild(z);return z}var k=new Menubar(T,c);if(Editor.enableCustomLibraries&&+("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=T.actions.get("newLibrary")){var B=document.createElement("div");B.style.cssText="position:absolute;border-width:1px;cusor:pointer;border-style:none;height:24px;bottom:0px;text-align:center;padding:8px 6px 0 6px;border-top-style:solid;width:50%;height:32px;box-sizing:border-box;font-size:11px;";B.className="geTitle";mxUtils.write(B,mxResources.get("newLibrary"));c.appendChild(B);mxEvent.addListener(B,"click",this.actions.get("newLibrary").funct);+B=B.cloneNode(!1);B.style.left="50%";B.style.borderLeftStyle="solid";mxUtils.write(B,mxResources.get("openLibrary"));c.appendChild(B);mxEvent.addListener(B,"click",this.actions.get("openLibrary").funct)}else B=f("newLibrary",mxResources.get("newLibrary")),B.style.display="block",B.style.fontSize="11px",B.style.left="0",B=f("openLibraryFrom",mxResources.get("openLibraryFrom")),B.style.borderLeftStyle="solid",B.style.display="block",B.style.fontSize="11px",B.style.left="50%";c.appendChild(T.sidebar.container);+c.style.overflow="hidden"}function g(T,c){if(EditorUi.windowed){var f=T.editor.graph;f.popupMenuHandler.hideMenu();null==T.sidebarWindow?(c=Math.min(f.container.clientWidth-10,218),f=Math.min(f.container.clientHeight-40,650),T.sidebarWindow=new WrapperWindow(T,mxResources.get("shapes"),10,56,c-6,f-6,function(k){e(T,k)}),T.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){T.sidebarWindow.window.fit()})),T.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),T.sidebarWindow.window.setVisible(!0),+isLocalStorage&&T.getLocalData("sidebar",function(k){T.sidebar.showEntries(k,null,!0)}),T.restoreLibraries()):T.sidebarWindow.window.setVisible(null!=c?c:!T.sidebarWindow.window.isVisible())}else null==T.sidebarElt&&(T.sidebarElt=T.createSidebarContainer(),e(T,T.sidebarElt),T.sidebarElt.style.border="none",T.sidebarElt.style.width="210px",T.sidebarElt.style.borderRight="1px solid gray"),f=T.diagramContainer.parentNode,null!=T.sidebarElt.parentNode?(T.sidebarElt.parentNode.removeChild(T.sidebarElt),+f.style.left="0px"):(f.parentNode.appendChild(T.sidebarElt),f.style.left=T.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(T){}Menus.prototype.autoPopup=!1;Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=-!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var v=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(U){v.apply(this,arguments);null!=this.tabContainer&&(this.tabContainer.style.right="62px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px")};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=-this.getCurrentFile()||"1"==urlParams.embed)};var A=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(U,c){null!=c.shortcut&&900>m&&!mxClient.IS_IOS?U.firstChild.nextSibling.setAttribute("title",c.shortcut):A.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(U){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=U?U:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||-null==this.formatWindow&&0<this.formatWidth};var G=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();G.apply(this,arguments)};var T=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(U){T.apply(this,arguments);if(U){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=-this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var F=Menus.prototype.init;Menus.prototype.init=function(){F.apply(this,arguments);var U=this.editorUi;EditorUi.enablePlantUml&&!U.isOffline()&&U.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var k=new ParseDialog(U,mxResources.get("plantUml")+"...","plantUml");U.showDialog(k.container,-620,420,!0,!1);k.init()}));U.actions.put("mermaid",new Action(mxResources.get("mermaid")+"...",function(){var k=new ParseDialog(U,mxResources.get("mermaid")+"...","mermaid");U.showDialog(k.container,620,420,!0,!1);k.init()}));var c="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),f=function(k,B,z,C){k.addItem(z,null,mxUtils.bind(this,function(){var H=new CreateGraphDialog(U,z,C);U.showDialog(H.container,620,420,!0,!1);H.init()}),B)};this.put("insertLayout",-new Menu(mxUtils.bind(this,function(k,B){for(var z=0;z<c.length;z++)"-"==c[z]?k.addSeparator(B):f(k,B,mxResources.get(c[z])+"...",c[z])})))};EditorUi.prototype.installFormatToolbar=function(U){var c=this.editor.graph,f=document.createElement("div");f.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";c.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,-function(k,B){0<c.getSelectionCount()?(U.appendChild(f),f.innerHTML="Selected: "+c.getSelectionCount()):null!=f.parentNode&&f.parentNode.removeChild(f)}))};var P=!1;EditorUi.prototype.initFormatWindow=function(){if(!P&&null!=this.formatWindow){P=!0;var U=this.formatWindow.window.toggleMinimized,c=240;this.formatWindow.window.toggleMinimized=function(){U.apply(this,arguments);this.minimized?(c=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=-parseInt(this.div.style.left)+c-140+"px"):(this.div.style.width=c+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-c+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(f){mxEvent.getSource(f)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var Q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function U(ja,oa,qa){var ra=C.menus.get(ja),-xa=O.addMenu(mxResources.get(ja),mxUtils.bind(this,function(){xa.classList.contains("mxDisabled")||ra.funct.apply(this,arguments)}),M);xa.className="geMenuItem";xa.style.display="inline-block";xa.style.boxSizing="border-box";xa.style.top="6px";xa.style.marginRight="6px";xa.style.height="30px";xa.style.paddingTop="6px";xa.style.paddingBottom="6px";xa.style.cursor="pointer";xa.setAttribute("title",mxResources.get(ja));C.menus.menuCreated(ra,xa,"geMenuItem");null!=qa?(xa.style.backgroundImage="url("++!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var v=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(T){v.apply(this,arguments);null!=this.tabContainer&&(this.tabContainer.style.right="62px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px")};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=+this.getCurrentFile()||"1"==urlParams.embed)};var A=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(T,c){null!=c.shortcut&&900>m&&!mxClient.IS_IOS?T.firstChild.nextSibling.setAttribute("title",c.shortcut):A.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(T){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=T?T:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||+null==this.formatWindow&&0<this.formatWidth};var G=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();G.apply(this,arguments)};var S=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(T){S.apply(this,arguments);if(T){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=+this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var F=Menus.prototype.init;Menus.prototype.init=function(){F.apply(this,arguments);var T=this.editorUi;EditorUi.enablePlantUml&&!T.isOffline()&&T.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var k=new ParseDialog(T,mxResources.get("plantUml")+"...","plantUml");T.showDialog(k.container,+620,420,!0,!1);k.init()}));T.actions.put("mermaid",new Action(mxResources.get("mermaid")+"...",function(){var k=new ParseDialog(T,mxResources.get("mermaid")+"...","mermaid");T.showDialog(k.container,620,420,!0,!1);k.init()}));var c="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),f=function(k,B,z,C){k.addItem(z,null,mxUtils.bind(this,function(){var I=new CreateGraphDialog(T,z,C);T.showDialog(I.container,620,420,!0,!1);I.init()}),B)};this.put("insertLayout",+new Menu(mxUtils.bind(this,function(k,B){for(var z=0;z<c.length;z++)"-"==c[z]?k.addSeparator(B):f(k,B,mxResources.get(c[z])+"...",c[z])})))};EditorUi.prototype.installFormatToolbar=function(T){var c=this.editor.graph,f=document.createElement("div");f.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";c.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,+function(k,B){0<c.getSelectionCount()?(T.appendChild(f),f.innerHTML="Selected: "+c.getSelectionCount()):null!=f.parentNode&&f.parentNode.removeChild(f)}))};var P=!1;EditorUi.prototype.initFormatWindow=function(){if(!P&&null!=this.formatWindow){P=!0;var T=this.formatWindow.window.toggleMinimized,c=240;this.formatWindow.window.toggleMinimized=function(){T.apply(this,arguments);this.minimized?(c=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=+parseInt(this.div.style.left)+c-140+"px"):(this.div.style.width=c+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-c+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(f){mxEvent.getSource(f)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var Q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function T(ja,oa,qa){var ra=C.menus.get(ja),+xa=O.addMenu(mxResources.get(ja),mxUtils.bind(this,function(){xa.classList.contains("mxDisabled")||ra.funct.apply(this,arguments)}),J);xa.className="geMenuItem";xa.style.display="inline-block";xa.style.boxSizing="border-box";xa.style.top="6px";xa.style.marginRight="6px";xa.style.height="30px";xa.style.paddingTop="6px";xa.style.paddingBottom="6px";xa.style.cursor="pointer";xa.setAttribute("title",mxResources.get(ja));C.menus.menuCreated(ra,xa,"geMenuItem");null!=qa?(xa.style.backgroundImage="url("+qa+")",xa.style.backgroundPosition="center center",xa.style.backgroundRepeat="no-repeat",xa.style.backgroundSize="24px 24px",xa.style.width="34px",xa.innerText=""):oa||(xa.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",xa.style.backgroundPosition="right 6px center",xa.style.backgroundRepeat="no-repeat",xa.style.paddingRight="22px");return xa}function c(ja,oa,qa,ra,xa,Ba){var ya=document.createElement("a");ya.className="geMenuItem";ya.style.display="inline-block";ya.style.boxSizing=-"border-box";ya.style.height="30px";ya.style.padding="6px";ya.style.position="relative";ya.style.verticalAlign="top";ya.style.top="0px";null!=C.statusContainer?K.insertBefore(ya,C.statusContainer):K.appendChild(ya);null!=Ba?(ya.style.backgroundImage="url("+Ba+")",ya.style.backgroundPosition="center center",ya.style.backgroundRepeat="no-repeat",ya.style.backgroundSize="24px 24px",ya.style.width="34px"):mxUtils.write(ya,ja);mxEvent.addListener(ya,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,-function(Da){Da.preventDefault()}));mxEvent.addListener(ya,"click",function(Da){"disabled"!=ya.getAttribute("disabled")&&oa(Da);mxEvent.consume(Da)});null==qa&&(ya.style.marginRight="4px");null!=ra&&ya.setAttribute("title",ra);null!=xa&&(ja=function(){xa.isEnabled()?(ya.removeAttribute("disabled"),ya.style.cursor="pointer"):(ya.setAttribute("disabled","disabled"),ya.style.cursor="default")},xa.addListener("stateChanged",ja),H.addListener("enabledChanged",ja),ja());return ya}function f(ja,oa,qa){qa=-document.createElement("div");qa.className="geMenuItem";qa.style.display="inline-block";qa.style.verticalAlign="top";qa.style.marginRight="6px";qa.style.padding="0 4px 0 4px";qa.style.height="30px";qa.style.position="relative";qa.style.top="0px";for(var ra=0;ra<ja.length;ra++)null!=ja[ra]&&(ja[ra].style.margin="0px",ja[ra].style.boxShadow="none",qa.appendChild(ja[ra]));null!=oa&&mxUtils.setOpacity(qa,oa);null!=C.statusContainer?K.insertBefore(qa,C.statusContainer):K.appendChild(qa);return qa}function k(){for(var ja=-K.firstChild;null!=ja;){var oa=ja.nextSibling;"geMenuItem"!=ja.className&&"geItem"!=ja.className||ja.parentNode.removeChild(ja);ja=oa}M=K.firstChild;m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;ja=1E3>m;var qa=null;ja||(qa=U("diagram"));oa=ja?U("diagram",null,Editor.menuImage):null;null!=oa&&(qa=oa);f([qa,c(mxResources.get("shapes"),C.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),C.actions.get("image"),ja?Editor.shapesImage:null),c(mxResources.get("format"),-C.actions.get("format").funct,null,mxResources.get("format")+" ("+C.actions.get("format").shortcut+")",C.actions.get("image"),ja?Editor.formatImage:null)],ja?60:null);oa=U("insert",!0,ja?S:null);f([oa,c(mxResources.get("delete"),C.actions.get("delete").funct,null,mxResources.get("delete"),C.actions.get("delete"),ja?Editor.trashImage:null)],ja?60:null);H.isEnabled()||oa.classList.add("mxDisabled");411<=m&&(f([V,J],60),520<=m&&f([W,640<=m?c("",da.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+-" +)",da,Editor.zoomInImage):null,640<=m?c("",aa.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",aa,Editor.zoomOutImage):null],60))}Q.apply(this,arguments);var B=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=B&&(B.classList.add("geSimple"),B.classList.add("geMinimal"));B=Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries);var z=document.createElement("div");z.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";-z.style.bottom=B?"32px":"0px";this.sidebar=this.createSidebar(z);if(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])g(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var C=this,H=C.editor.graph;C.toolbar=this.createToolbar(C.createDiv("geToolbar"));-C.defaultLibraryName=mxResources.get("untitledLibrary");var K=document.createElement("div");K.className="geMenubarContainer";var M=null,O=new Menubar(C,K);C.statusContainer=C.createStatusContainer();C.statusContainer.style.position="relative";C.statusContainer.style.maxWidth="";C.statusContainer.style.cursor="default";var ea=C.hideCurrentMenu;C.hideCurrentMenu=function(){ea.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var fa=C.descriptorChanged;C.descriptorChanged=function(){fa.apply(this,-arguments);var ja=C.getCurrentFile();if(null!=ja&&null!=ja.getTitle()){var oa=ja.getMode();"google"==oa?oa="googleDrive":"github"==oa?oa="gitHub":"gitlab"==oa?oa="gitLab":"onedrive"==oa&&(oa="oneDrive");oa=mxResources.get(oa);K.setAttribute("title",ja.getTitle()+(null!=oa?" ("+oa+")":""))}else K.removeAttribute("title")};C.setStatusText(C.editor.getStatus());K.appendChild(C.statusContainer);C.buttonContainer=document.createElement("div");C.buttonContainer.style.cssText="display:flex;justify-content:flex-end;padding-right:10px;gap:6px;white-space:nowrap;background-color:inherit;align-items:center;min-width:0;margin-left:auto;";-K.appendChild(C.buttonContainer);C.menubarContainer=C.buttonContainer;C.tabContainer=document.createElement("div");C.tabContainer.className="geTabContainer geTabItem";C.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;visibility:hidden;";B=C.diagramContainer.parentNode;z=document.createElement("div");z.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";C.diagramContainer.style.top="47px";var S=Editor.addBoxImage;-if(null!=C.hoverIcons){var ca=C.hoverIcons.update;C.hoverIcons.update=function(){H.freehand.isDrawing()||ca.apply(this,arguments)}}if(null!=H.freehand){var ma=H.freehand.createStyle;H.freehand.createStyle=function(ja){return ma.apply(this,arguments)+"sketch=0;"}}C.editor.addListener("statusChanged",mxUtils.bind(this,function(){C.setStatusText(C.editor.getStatus())}));C.setStatusText(C.editor.getStatus());var la=C.menus.get("viewZoom");if(null!=la){var Z=function(ja){if(mxEvent.isAltDown(ja))C.hideCurrentMenu(),-C.actions.get("customZoom").funct(),mxEvent.consume(ja);else if("geMenuItem"==mxEvent.getSource(ja).className||mxEvent.isShiftDown(ja))C.hideCurrentMenu(),C.actions.get("smartFit").funct(),mxEvent.consume(ja)},da=C.actions.get("zoomIn"),aa=C.actions.get("zoomOut"),l=C.actions.get("resetView"),t=C.actions.get("undo"),I=C.actions.get("redo"),V=c("",t.funct,null,mxResources.get("undo")+" ("+t.shortcut+")",t,Editor.undoImage),J=c("",I.funct,null,mxResources.get("redo")+" ("+I.shortcut+")",I,Editor.redoImage),-W=c("",Z,!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",l,Editor.zoomFitImage);K.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;text-align:left;white-space:nowrap;";this.tabContainer.style.right="70px";var Y=O.addMenu("100%",la.funct);Y.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");Y.className="geTabItem";Y.style.height=C.tabContainerHeight+"px";Y.style.position="absolute";Y.style.display="0"!=urlParams.pages?"flex":"none";Y.style.alignItems=+"border-box";ya.style.height="30px";ya.style.padding="6px";ya.style.position="relative";ya.style.verticalAlign="top";ya.style.top="0px";null!=C.statusContainer?L.insertBefore(ya,C.statusContainer):L.appendChild(ya);null!=Ba?(ya.style.backgroundImage="url("+Ba+")",ya.style.backgroundPosition="center center",ya.style.backgroundRepeat="no-repeat",ya.style.backgroundSize="24px 24px",ya.style.width="34px"):mxUtils.write(ya,ja);mxEvent.addListener(ya,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,+function(Da){Da.preventDefault()}));mxEvent.addListener(ya,"click",function(Da){"disabled"!=ya.getAttribute("disabled")&&oa(Da);mxEvent.consume(Da)});null==qa&&(ya.style.marginRight="4px");null!=ra&&ya.setAttribute("title",ra);null!=xa&&(ja=function(){xa.isEnabled()?(ya.removeAttribute("disabled"),ya.style.cursor="pointer"):(ya.setAttribute("disabled","disabled"),ya.style.cursor="default")},xa.addListener("stateChanged",ja),I.addListener("enabledChanged",ja),ja());return ya}function f(ja,oa,qa){qa=+document.createElement("div");qa.className="geMenuItem";qa.style.display="inline-block";qa.style.verticalAlign="top";qa.style.marginRight="6px";qa.style.padding="0 4px 0 4px";qa.style.height="30px";qa.style.position="relative";qa.style.top="0px";for(var ra=0;ra<ja.length;ra++)null!=ja[ra]&&(ja[ra].style.margin="0px",ja[ra].style.boxShadow="none",qa.appendChild(ja[ra]));null!=oa&&mxUtils.setOpacity(qa,oa);null!=C.statusContainer?L.insertBefore(qa,C.statusContainer):L.appendChild(qa);return qa}function k(){for(var ja=+L.firstChild;null!=ja;){var oa=ja.nextSibling;"geMenuItem"!=ja.className&&"geItem"!=ja.className||ja.parentNode.removeChild(ja);ja=oa}J=L.firstChild;m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;ja=1E3>m;var qa=null;ja||(qa=T("diagram"));oa=ja?T("diagram",null,Editor.menuImage):null;null!=oa&&(qa=oa);f([qa,c(mxResources.get("shapes"),C.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),C.actions.get("image"),ja?Editor.shapesImage:null),c(mxResources.get("format"),+C.actions.get("format").funct,null,mxResources.get("format")+" ("+C.actions.get("format").shortcut+")",C.actions.get("image"),ja?Editor.formatImage:null)],ja?60:null);oa=T("insert",!0,ja?V:null);f([oa,c(mxResources.get("delete"),C.actions.get("delete").funct,null,mxResources.get("delete"),C.actions.get("delete"),ja?Editor.trashImage:null)],ja?60:null);I.isEnabled()||oa.classList.add("mxDisabled");411<=m&&(f([U,K],60),520<=m&&f([W,640<=m?c("",ea.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey++" +)",ea,Editor.zoomInImage):null,640<=m?c("",aa.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",aa,Editor.zoomOutImage):null],60))}Q.apply(this,arguments);var B=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=B&&(B.classList.add("geSimple"),B.classList.add("geMinimal"));B=Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries);var z=document.createElement("div");z.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";+z.style.bottom=B?"32px":"0px";this.sidebar=this.createSidebar(z);if(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])g(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var C=this,I=C.editor.graph;C.toolbar=this.createToolbar(C.createDiv("geToolbar"));+C.defaultLibraryName=mxResources.get("untitledLibrary");var L=document.createElement("div");L.className="geMenubarContainer";var J=null,O=new Menubar(C,L);C.statusContainer=C.createStatusContainer();C.statusContainer.style.position="relative";C.statusContainer.style.maxWidth="";C.statusContainer.style.cursor="default";var da=C.hideCurrentMenu;C.hideCurrentMenu=function(){da.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var fa=C.descriptorChanged;C.descriptorChanged=function(){fa.apply(this,+arguments);var ja=C.getCurrentFile();if(null!=ja&&null!=ja.getTitle()){var oa=ja.getMode();"google"==oa?oa="googleDrive":"github"==oa?oa="gitHub":"gitlab"==oa?oa="gitLab":"onedrive"==oa&&(oa="oneDrive");oa=mxResources.get(oa);L.setAttribute("title",ja.getTitle()+(null!=oa?" ("+oa+")":""))}else L.removeAttribute("title")};C.setStatusText(C.editor.getStatus());L.appendChild(C.statusContainer);C.buttonContainer=document.createElement("div");C.buttonContainer.style.cssText="display:flex;justify-content:flex-end;padding-right:10px;gap:6px;white-space:nowrap;background-color:inherit;align-items:center;min-width:0;margin-left:auto;";+L.appendChild(C.buttonContainer);C.menubarContainer=C.buttonContainer;C.tabContainer=document.createElement("div");C.tabContainer.className="geTabContainer geTabItem";C.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;visibility:hidden;";B=C.diagramContainer.parentNode;z=document.createElement("div");z.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";C.diagramContainer.style.top="47px";var V=Editor.addBoxImage;+if(null!=C.hoverIcons){var ba=C.hoverIcons.update;C.hoverIcons.update=function(){I.freehand.isDrawing()||ba.apply(this,arguments)}}if(null!=I.freehand){var ma=I.freehand.createStyle;I.freehand.createStyle=function(ja){return ma.apply(this,arguments)+"sketch=0;"}}C.editor.addListener("statusChanged",mxUtils.bind(this,function(){C.setStatusText(C.editor.getStatus())}));C.setStatusText(C.editor.getStatus());var la=C.menus.get("viewZoom");if(null!=la){var Z=function(ja){if(mxEvent.isAltDown(ja))C.hideCurrentMenu(),+C.actions.get("customZoom").funct(),mxEvent.consume(ja);else if("geMenuItem"==mxEvent.getSource(ja).className||mxEvent.isShiftDown(ja))C.hideCurrentMenu(),C.actions.get("smartFit").funct(),mxEvent.consume(ja)},ea=C.actions.get("zoomIn"),aa=C.actions.get("zoomOut"),l=C.actions.get("resetView"),t=C.actions.get("undo"),H=C.actions.get("redo"),U=c("",t.funct,null,mxResources.get("undo")+" ("+t.shortcut+")",t,Editor.undoImage),K=c("",H.funct,null,mxResources.get("redo")+" ("+H.shortcut+")",H,Editor.redoImage),+W=c("",Z,!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",l,Editor.zoomFitImage);L.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;text-align:left;white-space:nowrap;";this.tabContainer.style.right="70px";var Y=O.addMenu("100%",la.funct);Y.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");Y.className="geTabItem";Y.style.height=C.tabContainerHeight+"px";Y.style.position="absolute";Y.style.display="0"!=urlParams.pages?"flex":"none";Y.style.alignItems="center";Y.style.justifyContent="center";Y.style.paddingRight="11px";Y.style.whiteSpace="nowrap";Y.style.overflow="hidden";Y.style.fontSize="11px";Y.style.width="51px";Y.style.right="0px";Y.style.bottom="0px";Y.style.boxSizing="content-box";Y.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";Y.style.backgroundPosition="right 6px top 15px";Y.style.backgroundRepeat="no-repeat";Y.style.backgroundSize="10px";Y.style.zIndex="1";z.appendChild(Y);(function(ja){mxEvent.addListener(ja,"click",-Z);var oa=mxUtils.bind(this,function(qa,ra,xa){ja.innerText="";mxUtils.write(ja,Math.round(100*C.editor.graph.view.scale*(null!=xa?xa:1))+"%")});C.editor.graph.view.addListener(mxEvent.EVENT_SCALE,oa);C.editor.addListener("resetGraphView",oa);C.editor.addListener("pageSelected",oa);C.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(qa,ra){oa(qa,ra,ra.getProperty("factor"))}))})(Y);var ba=C.setGraphEnabled;C.setGraphEnabled=function(){ba.apply(this,arguments);null!=this.tabContainer&&-(Y.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="0"!=urlParams.pages&&"hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}z.appendChild(K);z.appendChild(C.diagramContainer);B.appendChild(z);C.updateTabContainer();!EditorUi.windowed&&1E3<=m&&b(this,!0);z.appendChild(C.tabContainer);k();C.addListener("lockedChanged",k);mxEvent.addListener(window,"resize",function(){k();null!=C.sidebarWindow&&C.sidebarWindow.window.fit();null!=C.formatWindow&&+Z);var oa=mxUtils.bind(this,function(qa,ra,xa){ja.innerText="";mxUtils.write(ja,Math.round(100*C.editor.graph.view.scale*(null!=xa?xa:1))+"%")});C.editor.graph.view.addListener(mxEvent.EVENT_SCALE,oa);C.editor.addListener("resetGraphView",oa);C.editor.addListener("pageSelected",oa);C.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(qa,ra){oa(qa,ra,ra.getProperty("factor"))}))})(Y);var ca=C.setGraphEnabled;C.setGraphEnabled=function(){ca.apply(this,arguments);null!=this.tabContainer&&+(Y.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="0"!=urlParams.pages&&"hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}z.appendChild(L);z.appendChild(C.diagramContainer);B.appendChild(z);C.updateTabContainer();!EditorUi.windowed&&1E3<=m&&b(this,!0);z.appendChild(C.tabContainer);k();C.addListener("lockedChanged",k);mxEvent.addListener(window,"resize",function(){k();null!=C.sidebarWindow&&C.sidebarWindow.window.fit();null!=C.formatWindow&&C.formatWindow.window.fit();null!=C.actions.outlineWindow&&C.actions.outlineWindow.window.fit();null!=C.actions.layersWindow&&C.actions.layersWindow.window.fit();null!=C.menus.chatWindow&&C.menus.chatWindow.window.fit();null!=C.menus.tagsWindow&&C.menus.tagsWindow.window.fit();null!=C.menus.findWindow&&C.menus.findWindow.window.fit();null!=C.menus.findReplaceWindow&&C.menus.findReplaceWindow.window.fit()})}}};(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,e,g,m,v,p,A){this.file=b;this.id=e;this.content=g;this.modifiedDate=m;this.createdDate=v;this.isResolved=p;this.user=A;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,e,g,m,v){e()};DrawioComment.prototype.editComment=function(b,e,g){e()};DrawioComment.prototype.deleteComment=function(b,e){b()};DrawioUser=function(b,e,g,m,v){this.id=b;this.email=e;this.displayName=g;this.pictureUrl=m;this.locale=v};mxResources.parse('# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\nabout=About\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nanimations=Animations\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nclassDiagram=Class Diagram\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on connect\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete all\ndeleteColumn=Delete column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatWebp=WebP\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nimproveContrast=Improve Contrast\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save As\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate shape only by 90°\ntype=Type\ntwitter=Twitter\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use black and white\nuseCurrentSettings=Use current settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nworking=Working\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs Import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a file...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the viewer (px)\nheightOfViewer=Height of the viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit owning page\ndeepIndexing=Deep Indexing (Index diagrams that aren\'t used in any page also)\nconfADeepIndexStarted=Deep Indexing Started\nconfADeepIndexDone=Deep Indexing Done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last modified on\nsearchResults=Search Results\nshowAllTemps=Show all templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell checker\nnoChange=No Change\nlblToSvg=Convert labels to SVG\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft save interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow all\nnoTeams=No teams found\nerrorLoadingTeams=Error Loading Teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace Base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate Diagram Detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for production use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];Editor.currentTheme="";window.uiTheme="";GraphViewer=function(b,e,g){this.init(b,e,g)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="1"==urlParams.dev?"https://test.draw.io/":"https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl=window.DRAWIO_BASE_URL+"/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;@@ -4159,56 +4161,56 @@ this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.responsive=(null!=this.graphConfig.responsive?this.graphConfig.responsive:this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.editor=null;var m=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=e&&(this.xmlDocument=e.ownerDocument,this.xmlNode=e,this.xml=mxUtils.getXml(e),null!=b)){var v=mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var G=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?G.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(G.style.padding="8px");G.style.forcedColorAdjust="none";G.style.boxSizing="border-box";G.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var k=this.view.graphBounds,B=this.view.translate;G.setAttribute("viewBox",k.x+B.x-this.panDx+" "+(k.y+B.y-this.panDy)+" "+(k.width+1)+" "+(k.height+1));this.container.style.backgroundColor=G.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",k))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(k){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=-!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var T=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=T&&T!=e)try{this.xml=mxUtils.getXml(T),this.xmlNode=T,this.xmlDocument=T.ownerDocument}catch(k){}this.graph.getImageFromBundles=function(k){return m.getImageUrl(k)};mxClient.IS_SVG&&this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);-if("mxfile"==this.xmlNode.nodeName){var F=this.xmlNode.getElementsByTagName("diagram");if(0<F.length){if(null!=this.pageId)for(T=0;T<F.length;T++)if(this.pageId==F[T].getAttribute("id")){this.currentPage=T;break}var P=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(k){var B=F[m.currentPage];return"page"==k?B.getAttribute("name")||"Page-"+(m.currentPage+1):"pagenumber"==k?m.currentPage+1:"pagecount"==k?F.length:P.apply(this,arguments)}}}this.diagrams=[];var Q=null;this.selectPage=-function(k){this.handlingResize||(this.currentPage=mxUtils.mod(k,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(k){k=this.getIndexById(k);var B=0<=k;B&&this.selectPage(k);return B};T=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=Q&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),Q=this.xmlNode)});var U=this.graph.setBackgroundImage;this.graph.setBackgroundImage=-function(k){if(null!=k&&Graph.isPageLink(k.src)){var B=k.src,z=B.indexOf(",");0<z&&(z=m.getIndexById(B.substring(z+1)),0<=z&&(k=m.getImageForGraphModel(Editor.parseDiagramNode(m.diagrams[z])),k.originalSrc=B))}U.apply(this,arguments)};var c=this.graph.getGraphBounds;this.graph.getGraphBounds=function(k){var B=c.apply(this,arguments);k=this.backgroundImage;if(null!=k){var z=this.view.translate,C=this.view.scale;B=mxRectangle.fromRectangle(B);B.add(new mxRectangle((z.x+k.x)*C,(z.y+k.y)*C,k.width*C,-k.height*C))}return B};this.addListener("xmlNodeChanged",T);T();urlParams.page=m.currentPage;T=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.view.scale=this.graphConfig.zoom||1,T=this.setLayersVisible(),this.fireEvent(new mxEventObject("graphInitialized")),this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8),this.installBackgroundColorHandler(),GraphViewer.viewerInitialized(this)}finally{this.graph.getModel().endUpdate()}this.responsive||+!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var S=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=S&&S!=e)try{this.xml=mxUtils.getXml(S),this.xmlNode=S,this.xmlDocument=S.ownerDocument}catch(k){}this.graph.getImageFromBundles=function(k){return m.getImageUrl(k)};mxClient.IS_SVG&&this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);+if("mxfile"==this.xmlNode.nodeName){var F=this.xmlNode.getElementsByTagName("diagram");if(0<F.length){if(null!=this.pageId)for(S=0;S<F.length;S++)if(this.pageId==F[S].getAttribute("id")){this.currentPage=S;break}var P=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(k){var B=F[m.currentPage];return"page"==k?B.getAttribute("name")||"Page-"+(m.currentPage+1):"pagenumber"==k?m.currentPage+1:"pagecount"==k?F.length:P.apply(this,arguments)}}}this.diagrams=[];var Q=null;this.selectPage=+function(k){this.handlingResize||(this.currentPage=mxUtils.mod(k,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(k){k=this.getIndexById(k);var B=0<=k;B&&this.selectPage(k);return B};S=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=Q&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),Q=this.xmlNode)});var T=this.graph.setBackgroundImage;this.graph.setBackgroundImage=+function(k){if(null!=k&&Graph.isPageLink(k.src)){var B=k.src,z=B.indexOf(",");0<z&&(z=m.getIndexById(B.substring(z+1)),0<=z&&(k=m.getImageForGraphModel(Editor.parseDiagramNode(m.diagrams[z])),k.originalSrc=B))}T.apply(this,arguments)};var c=this.graph.getGraphBounds;this.graph.getGraphBounds=function(k){var B=c.apply(this,arguments);k=this.backgroundImage;if(null!=k){var z=this.view.translate,C=this.view.scale;B=mxRectangle.fromRectangle(B);B.add(new mxRectangle((z.x+k.x)*C,(z.y+k.y)*C,k.width*C,+k.height*C))}return B};this.addListener("xmlNodeChanged",S);S();urlParams.page=m.currentPage;S=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.view.scale=this.graphConfig.zoom||1,S=this.setLayersVisible(),this.fireEvent(new mxEventObject("graphInitialized")),this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8),this.installBackgroundColorHandler(),GraphViewer.viewerInitialized(this)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.graph.panningHandler.isForcePanningEvent=function(k){return!mxEvent.isPopupTrigger(k.getEvent())&&"auto"==this.graph.container.style.overflow},this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.panningHandler.ignoreCell=!0,this.graph.panningHandler.usePopupTrigger=!1,this.graph.panningHandler.pinchEnabled=!1);this.graph.setPanning(!1);null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&b.setAttribute("title",this.graphConfig.titleTooltip||-this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=T&&this.setLayersVisible(T);this.graph.customLinkClicked=function(k,B){try{if(Graph.isPageLink(k)){var z=k.indexOf(",");m.selectPageById(k.substring(z+-1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var C=this.getGraphBounds();this.handleCustomLink(k,B);C.equals(this.getGraphBounds())||m.crop()}}catch(H){alert(H.message)}return!0};var f=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return f.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&+this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=S&&this.setLayersVisible(S);this.graph.customLinkClicked=function(k,B){try{if(Graph.isPageLink(k)){var z=k.indexOf(",");m.selectPageById(k.substring(z++1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var C=this.getGraphBounds();this.handleCustomLink(k,B);C.equals(this.getGraphBounds())||m.crop()}}catch(I){alert(I.message)}return!0};var f=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return f.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof g){var p=this.getObservableParent(b),A=new g(mxUtils.bind(this,function(G){0<b.offsetWidth&&(A.disconnect(),v())}));A.observe(p,{attributes:!0})}else v()}};GraphViewer.prototype.installBackgroundColorHandler=function(){var b=this.graph;if(null!=b){null!=GraphViewer.shapeBackgroundColor&&(b.shapeBackgroundColor=GraphViewer.shapeBackgroundColor);b.defaultPageBackgroundColor="transparent";b.diagramBackgroundColor="transparent";b.transparentBackground=!1;var e=b.background,g=mxUtils.bind(this,function(m){"none"==b.getAdaptiveColors()&&null==e&&(this.isDarkMode()?b.background="#ffffff":b.background=null,m&&b.view.validateBackground())});this.addListener("graphChanged",function(){e=b.background;g(!0)});this.addListener("darkModeChanged",function(){g(!0)});g(!1)}};GraphViewer.prototype.installDarkModeListener=function(){null!=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(){this.darkModeChanged();this.fireEvent(new mxEventObject("darkModeChanged"))}));this.darkModeChanged()};-GraphViewer.prototype.darkModeChanged=function(){if(null!=this.graph){var b=this.graph.container,e=this.isDarkMode();e?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");null!=this.darkMode&&(b.style.colorScheme=e?"dark":"light")}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};+GraphViewer.prototype.darkModeChanged=function(){if(null!=this.graph){var b=this.graph.container,e=this.isDarkMode();e?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");b.style.colorScheme=e?"dark":"light"}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};GraphViewer.prototype.getObservableParent=function(b){for(b=b.parentNode;b!=document.body&&null!=b.parentNode&&"none"!==mxUtils.getCurrentStyle(b).display;)b=b.parentNode;return b};GraphViewer.prototype.getImageUrl=function(b){null!=b&&"http://"!=b.substring(0,7)&&"https://"!=b.substring(0,8)&&"data:image"!=b.substring(0,10)&&("/"==b.charAt(0)&&(b=b.substring(1,b.length)),b=this.imageBaseUrl+b);return b};GraphViewer.prototype.getImageForGraphModel=function(b){var e=Graph.createOffscreenGraph(this.graph.getStylesheet());e.getGlobalVariable=this.graph.getGlobalVariable;document.body.appendChild(e.container);b=(new mxCodec(b.ownerDocument)).decode(b).root;e.model.setRoot(b);b=e.getSvg();var g=e.getGraphBounds();document.body.removeChild(e.container);return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(b)),g.width,g.height,g.x,g.y)};GraphViewer.prototype.getIndexById=function(b){if(null!=this.diagrams)for(var e=0;e<this.diagrams.length;e++)if(this.diagrams[e].getAttribute("id")==b)return e;return-1};GraphViewer.prototype.setXmlNode=function(b){b=this.editor.extractGraphModel(b,!0);this.xmlDocument=b.ownerDocument;this.xml=mxUtils.getXml(b);this.xmlNode=b;this.updateGraphXml(b);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(b){null==this.xmlNode&&(this.xmlDocument=b.ownerDocument,this.xml=mxUtils.getXml(b),this.xmlNode=b);this.setGraphXml(b)};GraphViewer.prototype.updateGraphXml=function(b){this.setGraphXml(b);this.fireEvent(new mxEventObject("graphChanged"))};GraphViewer.prototype.setLayersVisible=function(b){var e=!0;if(!this.autoOrigin){var g=[],m=this.graph.getModel();m.beginUpdate();try{for(var v=0;v<m.getChildCount(m.root);v++){var p=m.getChildAt(m.root,v);e=e&&m.isVisible(p);g.push(m.isVisible(p));m.setVisible(p,null!=b?b[v]:!0)}}finally{m.endUpdate()}}return e?null:g};GraphViewer.prototype.setGraphXml=function(b){if(null!=this.graph){this.graph.view.translate=new mxPoint;this.graph.view.scale=1;var e=null;this.graph.getModel().beginUpdate();try{this.graph.getModel().clear(),this.editor.setGraphXml(b),e=this.setLayersVisible(!0)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph());this.graph.initialViewState=-{translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};e&&this.setLayersVisible(e)}};GraphViewer.prototype.isDarkMode=function(){var b=mxUtils.getCurrentStyle(null!=this.graph?this.graph.container:document.body);return null!=this.darkMode&&"auto"!=this.darkMode?this.darkMode:("light dark"==b.colorScheme||"auto"==this.darkMode)&&null!=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches||null==this.darkMode&&"dark"==b.colorScheme};-GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,e=this.graph.getGraphBounds(),g=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var m=mxUtils.bind(this,function(){if(!g){g=!0;var G=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?G.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){G=b.getBoundingClientRect();var T=mxUtils.getScrollOrigin(document.body);-T="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-T.x,top:-T.y};G={left:G.left-T.left,top:G.top-T.top,bottom:G.bottom-T.top,right:G.right-T.left};this.toolbar.style.left=G.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=G.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=G.top+1+"px"):this.toolbar.style.top=G.top+"px"}else null!=-this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());g=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(G){var T=b.offsetWidth;T==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=G?G:this.graphConfig.zoom||-(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},v=T,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=+{translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};e&&this.setLayersVisible(e)}};GraphViewer.prototype.isDarkMode=function(){return"dark"==this.darkMode||"auto"==this.darkMode&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches};+GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,e=this.graph.getGraphBounds(),g=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var m=mxUtils.bind(this,function(){if(!g){g=!0;var G=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?G.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){G=b.getBoundingClientRect();var S=mxUtils.getScrollOrigin(document.body);+S="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-S.x,top:-S.y};G={left:G.left-S.left,top:G.top-S.top,bottom:G.bottom-S.top,right:G.right-S.left};this.toolbar.style.left=G.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=G.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=G.top+1+"px"):this.toolbar.style.top=G.top+"px"}else null!=+this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());g=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(G){var S=b.offsetWidth;S==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=G?G:this.graphConfig.zoom||+(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},v=S,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=!1}),0))});GraphViewer.useResizeSensor&&(9>=document.documentMode?(mxEvent.addListener(window,"resize",m),this.graph.addListener("size",m)):new ResizeSensor(this.graph.container,m));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=b.style.height&&this.autoFit||this.updateContainerWidth(b,e.width+2*this.graph.border),0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,e.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var p=v=null;m=mxUtils.bind(this,function(){window.clearTimeout(p);this.handlingResize||(p=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",m):new ResizeSensor(this.graph.container,m))}else 9>=document.documentMode||this.graph.addListener("size",-m);var A=mxUtils.bind(this,function(G){var T=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var F=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==G&&this.allowZoomOut&&(this.allowZoomIn||e.width+2*this.graph.border>b.offsetWidth||e.height+2*this.graph.border>F)?(G=null,null!=F&&e.height+2*this.graph.border>F-2&&(G=(F-2*this.graph.border-2)/e.height),this.fitGraph(G)):this.widthIsEmpty||-null!=G||0!=this.graphConfig.resize||""==b.style.height?(G=null!=G?G:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-e.x/this.graph.view.scale)+G.x,Math.floor(this.graph.border-e.y/this.graph.view.scale)+G.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||e.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=T});8==document.documentMode?window.setTimeout(A,0):A();this.positionGraph=function(G){e=this.graph.getGraphBounds();v=null;A(G)}};+m);var A=mxUtils.bind(this,function(G){var S=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var F=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==G&&this.allowZoomOut&&(this.allowZoomIn||e.width+2*this.graph.border>b.offsetWidth||e.height+2*this.graph.border>F)?(G=null,null!=F&&e.height+2*this.graph.border>F-2&&(G=(F-2*this.graph.border-2)/e.height),this.fitGraph(G)):this.widthIsEmpty||+null!=G||0!=this.graphConfig.resize||""==b.style.height?(G=null!=G?G:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-e.x/this.graph.view.scale)+G.x,Math.floor(this.graph.border-e.y/this.graph.view.scale)+G.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||e.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=S});8==document.documentMode?window.setTimeout(A,0):A();this.positionGraph=function(G){e=this.graph.getGraphBounds();v=null;A(G)}};GraphViewer.prototype.crop=function(){var b=this.graph,e=b.getGraphBounds(),g=b.border,m=b.view.scale;b.view.setTranslate(null!=e.x?Math.floor(b.view.translate.x-e.x/m+g):g,null!=e.y?Math.floor(b.view.translate.y-e.y/m+g):g)};GraphViewer.prototype.updateContainerWidth=function(b,e){b.style.width=e+"px"};GraphViewer.prototype.updateContainerHeight=function(b,e){if(this.forceCenter||this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||8==document.documentMode)b.style.height=e+"px"};-GraphViewer.prototype.showLayers=function(b,e){var g=this.graphConfig.layers;g=null!=g&&0<g.length?g.split(" "):[];var m=this.graphConfig.layerIds,v=null!=m&&0<m.length,p=!1;if(0<g.length||v||null!=e){e=null!=e?e.getModel():null;b=b.getModel();b.beginUpdate();try{var A=b.getChildCount(b.root);if(null==e){e=!1;p={};if(v)for(var G=0;G<m.length;G++){var T=b.getCell(m[G]);null!=T&&(e=!0,p[T.id]=!0)}else for(G=0;G<g.length;G++)T=b.getChildAt(b.root,parseInt(g[G])),null!=T&&(e=!0,p[T.id]=!0);for(G=0;e&&-G<A;G++)T=b.getChildAt(b.root,G),b.setVisible(T,p[T.id]||!1)}else for(G=0;G<A;G++)b.setVisible(b.getChildAt(b.root,G),e.isVisible(e.getChildAt(e.root,G)))}finally{b.endUpdate()}p=!0}return p};+GraphViewer.prototype.showLayers=function(b,e){var g=this.graphConfig.layers;g=null!=g&&0<g.length?g.split(" "):[];var m=this.graphConfig.layerIds,v=null!=m&&0<m.length,p=!1;if(0<g.length||v||null!=e){e=null!=e?e.getModel():null;b=b.getModel();b.beginUpdate();try{var A=b.getChildCount(b.root);if(null==e){e=!1;p={};if(v)for(var G=0;G<m.length;G++){var S=b.getCell(m[G]);null!=S&&(e=!0,p[S.id]=!0)}else for(G=0;G<g.length;G++)S=b.getChildAt(b.root,parseInt(g[G])),null!=S&&(e=!0,p[S.id]=!0);for(G=0;e&&+G<A;G++)S=b.getChildAt(b.root,G),b.setVisible(S,p[S.id]||!1)}else for(G=0;G<A;G++)b.setVisible(b.getChildAt(b.root,G),e.isVisible(e.getChildAt(e.root,G)))}finally{b.endUpdate()}p=!0}return p};GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.display="flex";e.style.alignItems="center";e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";e.style.whiteSpace="nowrap";e.style.textAlign="left";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.darkBackgroundColor+")";e.style.height=this.toolbarHeight+"px";var g=mxUtils.bind(this,function(){this.isDarkMode()?(e.classList.add("geDarkMode"),e.style.colorScheme="dark"):(e.classList.remove("geDarkMode"),e.style.colorScheme="light")});this.addListener("darkModeChanged",g);this.toolbar=e;g();if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var m=null,v=null,p=mxUtils.bind(this,function(fa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);m=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,0);m=null;v=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";v=null}),100)}),fa||200)}),A=mxUtils.bind(this,function(fa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,fa||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(fa){mxEvent.isTouchEvent(fa)||(A(30),p())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":"mousemove",function(fa){mxEvent.consume(fa)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(fa){A(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(fa){A(100);mxEvent.consume(fa)}));mxEvent.addListener(e,"mouseleave",-mxUtils.bind(this,function(fa){mxEvent.isTouchEvent(fa)||A(30)}));var G=this.graph,T=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(fa,S){this.startX=S.getGraphX();this.startY=S.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(fa,S){},mouseUp:function(fa,S){mxEvent.isTouchEvent(S.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<T&&Math.abs(this.scrollTop-G.container.scrollTop)<-T&&Math.abs(this.startX-S.getGraphX())<T&&Math.abs(this.startY-S.getGraphY())<T&&(0<parseFloat(e.style.opacity||0)?p():A(30))}})}g=this.toolbarItems;for(var F=0,P=mxUtils.bind(this,function(fa,S,ca,ma){fa=this.createToolbarButton(fa,S,ca,ma);e.appendChild(fa);F++;return fa}),Q=this.graph.getModel(),U=null,c=null,f=null,k=null,B=0;B<g.length;B++){var z=g[B];if("pages"==z){k=b.ownerDocument.createElement("div");k.style.display="inline-flex";k.style.position="relative";k.style.alignItems="center";k.style.padding=-"4px";k.style.fontFamily=GraphViewer.cssFontFamily;k.style.fontSize="12px";k.style.cursor="default";k.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(k,70);var C=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");C.style.borderRightStyle="none";C.style.paddingLeft="0px";C.style.paddingRight="0px";e.appendChild(k);var H=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage+1)}),Editor.nextImage,-mxResources.get("nextPage")||"Next Page");H.style.paddingLeft="0px";H.style.paddingRight="0px";z=mxUtils.bind(this,function(){k.innerText="";mxUtils.write(k,this.currentPage+1+" / "+this.diagrams.length);k.style.display=1<this.diagrams.length?"inline-flex":"none";C.style.display=k.style.display;H.style.display=k.style.display});this.addListener("graphChanged",z);z()}else if("zoom"==z)this.zoomEnabled&&(P(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,mxResources.get("zoomOut")||-"Zoom Out"),P(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),P(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==z){if(this.layersEnabled){var K=P(mxUtils.bind(this,function(fa){if(null!=U)U.parentNode.removeChild(U),U=null;else{U=this.graph.createLayersDialog(mxUtils.bind(this,-function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ca=this.graph.getGraphBounds(),ma=this.graph.view;0>ca.x||0>ca.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ma.translate.clone(),scale:ma.scale}):null!=this.graph.originalViewState&&0<ca.x/ma.scale+this.graph.originalViewState.translate.x-ma.translate.x&&0<ca.y/ma.scale+this.graph.originalViewState.translate.y-ma.translate.y&&(ma.setTranslate(this.graph.originalViewState.translate.x,-this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ma.translate.clone(),scale:ma.scale})}}));mxEvent.addListener(U,"mouseleave",function(){U.parentNode.removeChild(U);U=null});fa=K.getBoundingClientRect();U.style.width="140px";U.style.padding="2px 0px 2px 0px";U.style.border="1px solid #d0d0d0";U.style.backgroundColor="#eee";U.style.fontFamily=GraphViewer.cssFontFamily;U.style.fontSize="11px";U.style.overflowY="auto";U.style.maxHeight=-this.graph.container.clientHeight-this.toolbarHeight-10+"px";U.style.zIndex=this.toolbarZIndex+1;U.style.color="#000";mxUtils.setOpacity(U,85);var S=mxUtils.getDocumentScrollOrigin(document);U.style.left=S.x+fa.left-1+"px";U.style.top=S.y+fa.bottom-2+"px";this.darkMode&&(U.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(U)}}),Editor.layersImage,mxResources.get("layers")||"Layers");Q.addListener(mxEvent.CHANGE,function(){K.style.display=1<Q.getChildCount(Q.root)?"inline-flex":-"none"});K.style.display=1<Q.getChildCount(Q.root)?"inline-flex":"none"}}else if("tags"==z){if(this.tagsEnabled){var M=P(mxUtils.bind(this,function(fa){null==c&&(c=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),c.div.getElementsByTagName("div")[0].style.position="",c.div.style.maxHeight="160px",c.div.style.maxWidth="120px",c.div.style.padding="2px",c.div.style.overflow="auto",c.div.style.height="auto",c.div.style.position="fixed",c.div.style.fontFamily=GraphViewer.cssFontFamily,-c.div.style.fontSize="11px",c.div.style.backgroundColor="#eee",c.div.style.color="#000",c.div.style.border="1px solid #d0d0d0",c.div.style.zIndex=this.toolbarZIndex+1,this.darkMode&&(c.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(c.div,85));if(null!=f)f.parentNode.removeChild(f),f=null;else{f=c.div;f.style.position="absolute";mxEvent.addListener(f,"mouseleave",function(){null!=f&&(f.parentNode.removeChild(f),f=null)});fa=M.getBoundingClientRect();var S=mxUtils.getDocumentScrollOrigin(document);-f.style.left=S.x+fa.left-1+"px";f.style.top=S.y+fa.bottom-2+"px";document.body.appendChild(f);c.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");Q.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){M.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=f&&0==this.graph.getAllTags().length&&(f.parentNode.removeChild(f),f=null)}));M.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==z?this.lightboxEnabled&&P(mxUtils.bind(this,+mxUtils.bind(this,function(fa){mxEvent.isTouchEvent(fa)||A(30)}));var G=this.graph,S=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(fa,V){this.startX=V.getGraphX();this.startY=V.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(fa,V){},mouseUp:function(fa,V){mxEvent.isTouchEvent(V.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<S&&Math.abs(this.scrollTop-G.container.scrollTop)<+S&&Math.abs(this.startX-V.getGraphX())<S&&Math.abs(this.startY-V.getGraphY())<S&&(0<parseFloat(e.style.opacity||0)?p():A(30))}})}g=this.toolbarItems;for(var F=0,P=mxUtils.bind(this,function(fa,V,ba,ma){fa=this.createToolbarButton(fa,V,ba,ma);e.appendChild(fa);F++;return fa}),Q=this.graph.getModel(),T=null,c=null,f=null,k=null,B=0;B<g.length;B++){var z=g[B];if("pages"==z){k=b.ownerDocument.createElement("div");k.style.display="inline-flex";k.style.position="relative";k.style.alignItems="center";k.style.padding=+"4px";k.style.fontFamily=GraphViewer.cssFontFamily;k.style.fontSize="12px";k.style.cursor="default";k.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(k,70);var C=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");C.style.borderRightStyle="none";C.style.paddingLeft="0px";C.style.paddingRight="0px";e.appendChild(k);var I=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage+1)}),Editor.nextImage,+mxResources.get("nextPage")||"Next Page");I.style.paddingLeft="0px";I.style.paddingRight="0px";z=mxUtils.bind(this,function(){k.innerText="";mxUtils.write(k,this.currentPage+1+" / "+this.diagrams.length);k.style.display=1<this.diagrams.length?"inline-flex":"none";C.style.display=k.style.display;I.style.display=k.style.display});this.addListener("graphChanged",z);z()}else if("zoom"==z)this.zoomEnabled&&(P(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,mxResources.get("zoomOut")||+"Zoom Out"),P(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),P(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==z){if(this.layersEnabled){var L=P(mxUtils.bind(this,function(fa){if(null!=T)T.parentNode.removeChild(T),T=null;else{T=this.graph.createLayersDialog(mxUtils.bind(this,+function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ba=this.graph.getGraphBounds(),ma=this.graph.view;0>ba.x||0>ba.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ma.translate.clone(),scale:ma.scale}):null!=this.graph.originalViewState&&0<ba.x/ma.scale+this.graph.originalViewState.translate.x-ma.translate.x&&0<ba.y/ma.scale+this.graph.originalViewState.translate.y-ma.translate.y&&(ma.setTranslate(this.graph.originalViewState.translate.x,+this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ma.translate.clone(),scale:ma.scale})}}));mxEvent.addListener(T,"mouseleave",function(){T.parentNode.removeChild(T);T=null});fa=L.getBoundingClientRect();T.style.width="140px";T.style.padding="2px 0px 2px 0px";T.style.border="1px solid #d0d0d0";T.style.backgroundColor="#eee";T.style.fontFamily=GraphViewer.cssFontFamily;T.style.fontSize="11px";T.style.overflowY="auto";T.style.maxHeight=+this.graph.container.clientHeight-this.toolbarHeight-10+"px";T.style.zIndex=this.toolbarZIndex+1;T.style.color="#000";mxUtils.setOpacity(T,85);var V=mxUtils.getDocumentScrollOrigin(document);T.style.left=V.x+fa.left-1+"px";T.style.top=V.y+fa.bottom-2+"px";this.isDarkMode()&&(T.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(T)}}),Editor.layersImage,mxResources.get("layers")||"Layers");Q.addListener(mxEvent.CHANGE,function(){L.style.display=1<Q.getChildCount(Q.root)?"inline-flex":+"none"});L.style.display=1<Q.getChildCount(Q.root)?"inline-flex":"none"}}else if("tags"==z){if(this.tagsEnabled){var J=P(mxUtils.bind(this,function(fa){null==c&&(c=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),c.div.getElementsByTagName("div")[0].style.position="",c.div.style.maxHeight="160px",c.div.style.maxWidth="120px",c.div.style.padding="2px",c.div.style.overflow="auto",c.div.style.height="auto",c.div.style.position="fixed",c.div.style.fontFamily=GraphViewer.cssFontFamily,+c.div.style.fontSize="11px",c.div.style.backgroundColor="#eee",c.div.style.color="#000",c.div.style.border="1px solid #d0d0d0",c.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(c.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(c.div,85));if(null!=f)f.parentNode.removeChild(f),f=null;else{f=c.div;f.style.position="absolute";mxEvent.addListener(f,"mouseleave",function(){null!=f&&(f.parentNode.removeChild(f),f=null)});fa=J.getBoundingClientRect();var V=mxUtils.getDocumentScrollOrigin(document);+f.style.left=V.x+fa.left-1+"px";f.style.top=V.y+fa.bottom-2+"px";document.body.appendChild(f);c.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");Q.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){J.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=f&&0==this.graph.getAllTags().length&&(f.parentNode.removeChild(f),f=null)}));J.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==z?this.lightboxEnabled&&P(mxUtils.bind(this,function(){try{this.showLightbox()}catch(fa){alert(fa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(z=this.graphConfig["toolbar-buttons"][z],null!=z&&(z.elem=P(null==z.enabled||z.enabled?z.handler:function(){},z.image,z.title,z.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*F);null!=this.graphConfig.title&&(g=b.ownerDocument.createElement("div"),g.style.display="inline-flex",-g.style.position="relative",g.style.alignItems="center",g.style.padding="6px",g.style.fontFamily=GraphViewer.cssFontFamily,g.style.fontSize="12px",g.style.cursor="default",g.style.color="light-dark(#000000, #ffffff)",g.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(g,this.graphConfig.title),mxUtils.setOpacity(g,70),e.appendChild(g),this.filename=g);this.minToolbarWidth=34*F;var O=b.style.border,ea=mxUtils.bind(this,function(){e.style.width="inline"==this.graphConfig["toolbar-position"]?-"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";e.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var fa=b.getBoundingClientRect(),S=mxUtils.getScrollOrigin(document.body);S="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-S.x,top:-S.y};fa={left:fa.left-S.left,top:fa.top-S.top,bottom:fa.bottom-S.top,right:fa.right-S.left};e.style.left=fa.left+"px";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=fa.bottom-1+"px":"inline"!=-this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=fa.top+1+"px"):e.style.top=fa.top+"px";"1px solid transparent"==O&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var ca=mxUtils.bind(this,function(){null!=e.parentNode&&e.parentNode.removeChild(e);null!=f&&(f.parentNode.removeChild(f),f=null);null!=U&&(U.parentNode.removeChild(U),U=null);b.style.border=O});mxEvent.addListener(document,"mousemove",function(ma){for(ma=mxEvent.getSource(ma);null!=-ma;){if(ma==b||ma==e||ma==U||ma==f)return;ma=ma.parentNode}ca()});mxEvent.addListener(document.body,"mouseleave",function(ma){ca()})}else e.style.top=-this.toolbarHeight+"px",b.appendChild(e)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ea):ea();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=e.parentNode&&ea()})).observe(b)};+g.style.position="relative",g.style.alignItems="center",g.style.padding="6px",g.style.fontFamily=GraphViewer.cssFontFamily,g.style.fontSize="12px",g.style.cursor="default",g.style.color="light-dark(#000000, #ffffff)",g.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(g,this.graphConfig.title),mxUtils.setOpacity(g,70),e.appendChild(g),this.filename=g);this.minToolbarWidth=34*F;var O=b.style.border,da=mxUtils.bind(this,function(){e.style.width="inline"==this.graphConfig["toolbar-position"]?+"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";e.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var fa=b.getBoundingClientRect(),V=mxUtils.getScrollOrigin(document.body);V="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-V.x,top:-V.y};fa={left:fa.left-V.left,top:fa.top-V.top,bottom:fa.bottom-V.top,right:fa.right-V.left};e.style.left=fa.left+"px";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=fa.bottom-1+"px":"inline"!=+this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=fa.top+1+"px"):e.style.top=fa.top+"px";"1px solid transparent"==O&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var ba=mxUtils.bind(this,function(){null!=e.parentNode&&e.parentNode.removeChild(e);null!=f&&(f.parentNode.removeChild(f),f=null);null!=T&&(T.parentNode.removeChild(T),T=null);b.style.border=O});mxEvent.addListener(document,"mousemove",function(ma){for(ma=mxEvent.getSource(ma);null!=+ma;){if(ma==b||ma==e||ma==T||ma==f)return;ma=ma.parentNode}ba()});mxEvent.addListener(document.body,"mouseleave",function(ma){ba()})}else e.style.top=-this.toolbarHeight+"px",b.appendChild(e)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",da):da();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=e.parentNode&&da()})).observe(b)};GraphViewer.prototype.createToolbarButton=function(b,e,g,m){var v=document.createElement("div");v.style.borderRight="1px solid #d0d0d0";v.style.display="inline-flex";v.style.alignItems="center";v.style.padding="6px";mxEvent.addListener(v,"click",b);null!=g&&v.setAttribute("title",g);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",e);b.style.width="18px";b.className="geAdaptiveAsset";null==m||m?(mxEvent.addListener(v,"mouseenter",function(){v.style.backgroundColor="light-dark(#dddddd,#333333)"}),mxEvent.addListener(v,"mouseleave",function(){v.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),v.style.cursor="pointer"):mxUtils.setOpacity(v,30);v.appendChild(b);return v};GraphViewer.prototype.disableButton=function(b,e){var g=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=g&&(mxUtils.setOpacity(g.elem,30),mxEvent.removeListener(g.elem,"click",g.handler),mxEvent.addListener(g.elem,"mouseenter",function(){g.elem.style.backgroundColor="#eee"}),e&&g.elem.setAttribute("title",e))};@@ -4221,8 +4223,8 @@ GraphViewer.prototype.showLocalLightbox=function(b){var e=document.createElementg.className="geAdaptiveAsset";var m=mxUtils.bind(this,function(){p.setDarkMode(this.isDarkMode())});mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",m);p.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";urlParams.dark=this.isDarkMode()?"1":"0";this.tagsEnabled&&(urlParams.tags="{}");if(null!=b)try{var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));v.noCloseBtn=!0;urlParams["toolbar-config"]=encodeURIComponent(JSON.stringify(v))}catch(c){}if(null==document.documentMode||10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};v=Graph.prototype.shadowId;Graph.prototype.shadowId="lightboxDropShadow";var p=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",m);p.editor.editBlankUrl=this.editBlankUrl;p.editor.graph.shadowId="lightboxDropShadow";Graph.prototype.shadowId=v;p.refresh=function(){};var A=mxUtils.bind(this,function(c){27==c.keyCode&&p.destroy()}),G=this.initialOverflow,-T=p.destroy;p.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",A),document.body.removeChild(e),document.body.removeChild(g),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,T.apply(this,arguments))};var F=p.editor.graph,P=F.container;P.style.overflow="hidden";this.lightboxChrome&&null==b?(P.style.border="1px solid #c0c0c0",P.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",A)):(e.style.display="none",g.style.display=-"none");var Q=this;F.getImageFromBundles=function(c){return Q.getImageUrl(c)};var U=p.createTemporaryGraph;p.createTemporaryGraph=function(){var c=U.apply(this,arguments);c.getImageFromBundles=function(f){return Q.getImageUrl(f)};return c};this.graphConfig.move&&(F.isMoveCellsEvent=function(c){return!0});mxUtils.setPrefixedStyle(P.style,"border-radius","4px");P.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(F,p);window.setTimeout(mxUtils.bind(this,+S=p.destroy;p.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",A),document.body.removeChild(e),document.body.removeChild(g),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,S.apply(this,arguments))};var F=p.editor.graph,P=F.container;P.style.overflow="hidden";this.lightboxChrome&&null==b?(P.style.border="1px solid #c0c0c0",P.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",A)):(e.style.display="none",g.style.display=+"none");var Q=this;F.getImageFromBundles=function(c){return Q.getImageUrl(c)};var T=p.createTemporaryGraph;p.createTemporaryGraph=function(){var c=T.apply(this,arguments);c.getImageFromBundles=function(f){return Q.getImageUrl(f)};return c};this.graphConfig.move&&(F.isMoveCellsEvent=function(c){return!0});mxUtils.setPrefixedStyle(P.style,"border-radius","4px");P.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(F,p);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(e,"click",function(){p.destroy()}),P.style.outline="none",P.style.zIndex=this.lightboxZIndex,g.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(P)):(document.body.appendChild(P),document.body.appendChild(g)),p.setFileData(this.xml),mxUtils.setPrefixedStyle(P.style,"transform","rotateY(0deg)"),p.chromelessToolbar.style.bottom="60px",p.chromelessToolbar.style.zIndex=this.lightboxZIndex,(b||document.body).appendChild(p.chromelessToolbar),p.getEditBlankXml=mxUtils.bind(this,function(){return this.xml}),this.showLayers(F,this.graph),p.lightboxFit(),p.chromelessResize()}catch(c){p.handleError(c,null,function(){p.destroy()})}}),0);return p};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};GraphViewer.prototype.updateTitle=function(b,e){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",e||b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",e||b))};@@ -4239,7 +4241,7 @@ GraphViewer.getCss=function(){return[".geDarkMode img, .geDarkMode .geSprite {\nGraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,e,g){if(null!=GraphViewer.cachedUrls[b])e(GraphViewer.cachedUrls[b]);else{var m=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;m.open("GET",b);m.onload=function(){e(null!=m.getText?m.getText():m.responseText)};m.onerror=g;m.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeObserver=!0;GraphViewer.useResizeSensor=!0;(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(g){return window.setTimeout(g,20)},e=function(g,m){function v(){this.q=[];this.add=function(k){this.q.push(k)};var c,f;this.call=function(){c=0;for(f=this.q.length;c<f;c++)this.q[c].call()}}function p(c,f){return c.currentStyle?c.currentStyle[f]:window.getComputedStyle?window.getComputedStyle(c,null).getPropertyValue(f):c.style[f]}function A(c,f){if(!c.resizedAttached)c.resizedAttached=new v,c.resizedAttached.add(f);else if(c.resizedAttached){c.resizedAttached.add(f);return}c.resizeSensor=document.createElement("div");c.resizeSensor.className="resize-sensor";c.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";c.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';-c.appendChild(c.resizeSensor);"static"==p(c,"position")&&(c.style.position="relative");var k=c.resizeSensor.childNodes[0],B=k.childNodes[0],z=c.resizeSensor.childNodes[1],C=function(){B.style.width="100000px";B.style.height="100000px";k.scrollLeft=1E5;k.scrollTop=1E5;z.scrollLeft=1E5;z.scrollTop=1E5};C();var H=!1,K=function(){c.resizedAttached&&(H&&(c.resizedAttached.call(),H=!1),b(K))};b(K);var M,O,ea,fa;f=function(){if((ea=c.offsetWidth)!=M||(fa=c.offsetHeight)!=O)H=!0,M=ea,O=fa;C()};var S=function(ca,-ma,la){ca.attachEvent?ca.attachEvent("on"+ma,la):ca.addEventListener(ma,la)};S(k,"scroll",f);S(z,"scroll",f)}var G=function(){GraphViewer.resizeSensorEnabled&&m()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var T=null,F=!1;(new ResizeObserver(function(){F||(null!=T&&window.clearTimeout(T),T=window.setTimeout(function(){F=!0;G();T=null;F=!1},200))})).observe(g)}else{var P=Object.prototype.toString.call(g),Q="[object Array]"===P||"[object NodeList]"===P||"[object HTMLCollection]"===-P||"undefined"!==typeof jQuery&&g instanceof jQuery||"undefined"!==typeof Elements&&g instanceof Elements;if(Q){P=0;for(var U=g.length;P<U;P++)A(g[P],G)}else A(g,G);this.detach=function(){if(Q)for(var c=0,f=g.length;c<f;c++)e.detach(g[c]);else e.detach(g)}}};e.detach=function(g){g.resizeSensor&&(g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached)};window.ResizeSensor=e})();+c.appendChild(c.resizeSensor);"static"==p(c,"position")&&(c.style.position="relative");var k=c.resizeSensor.childNodes[0],B=k.childNodes[0],z=c.resizeSensor.childNodes[1],C=function(){B.style.width="100000px";B.style.height="100000px";k.scrollLeft=1E5;k.scrollTop=1E5;z.scrollLeft=1E5;z.scrollTop=1E5};C();var I=!1,L=function(){c.resizedAttached&&(I&&(c.resizedAttached.call(),I=!1),b(L))};b(L);var J,O,da,fa;f=function(){if((da=c.offsetWidth)!=J||(fa=c.offsetHeight)!=O)I=!0,J=da,O=fa;C()};var V=function(ba,+ma,la){ba.attachEvent?ba.attachEvent("on"+ma,la):ba.addEventListener(ma,la)};V(k,"scroll",f);V(z,"scroll",f)}var G=function(){GraphViewer.resizeSensorEnabled&&m()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var S=null,F=!1;(new ResizeObserver(function(){F||(null!=S&&window.clearTimeout(S),S=window.setTimeout(function(){F=!0;G();S=null;F=!1},200))})).observe(g)}else{var P=Object.prototype.toString.call(g),Q="[object Array]"===P||"[object NodeList]"===P||"[object HTMLCollection]"===+P||"undefined"!==typeof jQuery&&g instanceof jQuery||"undefined"!==typeof Elements&&g instanceof Elements;if(Q){P=0;for(var T=g.length;P<T;P++)A(g[P],G)}else A(g,G);this.detach=function(){if(Q)for(var c=0,f=g.length;c<f;c++)e.detach(g[c]);else e.detach(g)}}};e.detach=function(g){g.resizeSensor&&(g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached)};window.ResizeSensor=e})();(function(){Editor.initMath();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();diff --git a/src/main/webapp/service-worker.js b/src/main/webapp/service-worker.jsindex 405bb09b8..32b604e3e 100644--- a/src/main/webapp/service-worker.js+++ b/src/main/webapp/service-worker.js@@ -1,2 +1,2 @@-if(!self.define){let e,i={};const r=(r,a)=>(r=new URL(r+".js",a).href,i[r]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=i,document.head.appendChild(e)}else e=r,importScripts(r),i()})).then((()=>{let e=i[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e})));self.define=(a,c)=>{const s=e||("document"in self?document.currentScript.src:"")||location.href;if(i[s])return;let d={};const o=e=>r(e,s),f={module:{uri:s},exports:d,require:o};i[s]=Promise.all(a.map((e=>f[e]||o(e)))).then((e=>(c(...e),d)))}}define(["./workbox-72a83b64"],(function(e){"use strict";self.skipWaiting(),e.precacheAndRoute([{url:"js/app.min.js",revision:"ecb7dd23fe8f5c876bbf249e6c3b6061"},{url:"js/extensions.min.js",revision:"69fb66339923d62ae0fdc1f13103cf55"},{url:"js/orgchart.min.js",revision:"619d8c4dab47b81868916df31f55478b"},{url:"js/stencils.min.js",revision:"f760278d924467fb1d2289448c73fe27"},{url:"js/shapes-14-6-5.min.js",revision:"317413c8e37c127ada9a5c84ffd3463d"},{url:"js/math-print.js",revision:"cf64f6a493a8cb5079f2b70813e478d7"},{url:"index.html",revision:"57fe6012597666439de3e76c9bb681c1"},{url:"open.html",revision:"d71816b3b00e769fc6019fcdd6921662"},{url:"shortcuts.svg",revision:"2381dd779ce6cfee954042a7f784c7e6"},{url:"styles/fonts/ArchitectsDaughter-Regular.ttf",revision:"31c2153c0530e32553b31a49b3d70736"},{url:"styles/grapheditor.css",revision:"bf1193dac429449c2f79163e623cab8d"},{url:"styles/atlas.css",revision:"0a6cc8a503b96f634e40309aadf6b803"},{url:"styles/dark.css",revision:"99dc5495d36d5ebaddababefde083c8c"},{url:"js/dropbox/Dropbox-sdk.min.js",revision:"4b9842892aa37b156db0a8364b7a83b0"},{url:"js/onedrive/OneDrive.js",revision:"505e8280346666f7ee801bc59521fa67"},{url:"js/viewer-static.min.js",revision:"930f61f29457d32e9087bdc019c274d3"},{url:"connect/jira/editor-1-3-3.html",revision:"41dc8af9576b47f359cff19fff7a41c2"},{url:"connect/jira/viewerPanel-1-3-12.html",revision:"4836f5e4308abe57830e441518364f23"},{url:"connect/jira/fullScreenViewer-1-3-3.html",revision:"abed474e47c0c41a5ad2366b4828f77a"},{url:"connect/jira/viewerPanel.js",revision:"75f816c208d0c621e3066a97ff0ee6cf"},{url:"connect/jira/spinner.gif",revision:"7d857ab9d86123e93d74d48e958fe743"},{url:"connect/jira/editor.js",revision:"c41221a9a51ff293f05ed13c7b142e5c"},{url:"connect/jira/fullscreen-viewer-init.js",revision:"d3269625ce04b7a277b779ff175957d0"},{url:"connect/jira/fullscreen-viewer.js",revision:"8eceb2fe587296dd11f9c8f6eae34c20"},{url:"plugins/connectJira.js",revision:"c4cb6b60234b04b2c8bc09e555746615"},{url:"plugins/cConf-comments.js",revision:"8af574bd1ae86be37b83b094a5011a4f"},{url:"plugins/cConf-1-4-8.js",revision:"1c9a0a3df274b56bd471283165f8aa5c"},{url:"connect/confluence/connectUtils-1-4-8.js",revision:"c3215554d29cc3f5df885cab999563c3"},{url:"connect/new_common/cac.js",revision:"740dce44cf53499f476ee8edc37d09a0"},{url:"connect/gdrive_common/gac.js",revision:"3bb38a5d9186a896ed04808e921ef888"},{url:"connect/onedrive_common/ac.js",revision:"5fb6ff1a73f54a9086b7a7e1f613b8ed"},{url:"connect/confluence/viewer-init.js",revision:"b82e366bf57ecced9435c2a8ba9cb9b9"},{url:"connect/confluence/viewer.js",revision:"aa5ca84da421c280e9057b3a39c8a456"},{url:"connect/confluence/viewer-1-4-42.html",revision:"69c1bca25fd4889bf832e8441c972268"},{url:"connect/confluence/macroEditor-1-4-8.html",revision:"4ad77ae3f08c19eddac932b2fa8c7068"},{url:"connect/confluence/includeDiagram-1-4-8.js",revision:"a71935d0acd4b0a6ee70795b0f298699"},{url:"connect/confluence/includeDiagram.html",revision:"9613fec05b19ddef081ca6e9d8b057bf"},{url:"connect/confluence/macro-editor.js",revision:"03a8dcfc69612b44b6e75e6926a956fc"},{url:"math/es5/startup.js",revision:"dc7130cdc866593293dbb5dde11ceb40"},{url:"math/es5/core.js",revision:"f71bc0bfb7d2ac8261747f97a5d47dd4"},{url:"math/es5/ui/safe.js",revision:"8c1fcfee7c879588ad409edcdd9cce53"},{url:"math/es5/output/svg.js",revision:"4f55967d16197ebb01b86356d8ab179a"},{url:"math/es5/input/tex.js",revision:"5c4f470da2ccb1acf85041fcecd6fff6"},{url:"math/es5/input/asciimath.js",revision:"c2d4076dd8e26d509bfe3a378e71cfa7"},{url:"math/es5/output/svg/fonts/tex.js",revision:"6eab785a3788ea805bd2b552d1f0aab8"},{url:"resources/dia.txt",revision:"73927d303703a329ff06d681553e993d"},{url:"resources/dia_am.txt",revision:"8d60c82458b57bb9ccc7b0c4f6ed3f79"},{url:"resources/dia_ar.txt",revision:"e278657437cf14eeedbb3b641d3ba8c0"},{url:"resources/dia_bg.txt",revision:"61c2ef14ee768be21fcb22b1928f7cac"},{url:"resources/dia_bn.txt",revision:"45e3683c1150ad2e139f42fedaf9e7aa"},{url:"resources/dia_bs.txt",revision:"ed33364ad4282d0e29775ca2e2f351e0"},{url:"resources/dia_ca.txt",revision:"101dbe73020d8471a5208da4d8ae247e"},{url:"resources/dia_cs.txt",revision:"ba2fd4196222285218549625600a530f"},{url:"resources/dia_da.txt",revision:"b3eb739977ead9876a8afe0103ad7e36"},{url:"resources/dia_de.txt",revision:"95357e2d517ad36e2db9ed683914f9b3"},{url:"resources/dia_el.txt",revision:"faa7d843ef32aba9b9f11e367ca362d5"},{url:"resources/dia_eo.txt",revision:"619ff072153d5897b7184ee0fe925f18"},{url:"resources/dia_es.txt",revision:"1feb3c63ee76afc71ebec607c8a9347a"},{url:"resources/dia_et.txt",revision:"67482775f1ff0d1b2cb31f6226c519d3"},{url:"resources/dia_eu.txt",revision:"a7dce4832af9f1d0b4e5f5bf189ef328"},{url:"resources/dia_fa.txt",revision:"743a891d016470e8e0a3651be32fb3c5"},{url:"resources/dia_fi.txt",revision:"771de2b3741f25b4114e51c93ce1a866"},{url:"resources/dia_fil.txt",revision:"637b4984bb64580b4ef61e28ef7ca664"},{url:"resources/dia_fr.txt",revision:"ad7e62eb41228b929489d9427d206e82"},{url:"resources/dia_gl.txt",revision:"a89e3f7e7cb3b6867d3e74eb949894dd"},{url:"resources/dia_gu.txt",revision:"769be61a373049c5d3b358201f1acb65"},{url:"resources/dia_he.txt",revision:"238e53f20884ef57b1a9c06bd800b9ef"},{url:"resources/dia_hi.txt",revision:"755e1872b614c9a5b27c5459062c8320"},{url:"resources/dia_hr.txt",revision:"adf6788e96b0e3f0029cbae30a4faefb"},{url:"resources/dia_hu.txt",revision:"c645a78fdda2843acd6aa9d9bf60a6e8"},{url:"resources/dia_id.txt",revision:"9da16676fc1b33c61b4a025a352dc916"},{url:"resources/dia_it.txt",revision:"57b0f8eb2319f99f96b79507966f4e6f"},{url:"resources/dia_ja.txt",revision:"b4b10c93e53b13dbd3e407532813b9e0"},{url:"resources/dia_kn.txt",revision:"7cbbba0381a1a6cdeade3bc28ac01962"},{url:"resources/dia_ko.txt",revision:"943b020ff0430e9f81fe3e1875423b7d"},{url:"resources/dia_lt.txt",revision:"94aff34cd118d39d79abacf2a16aea7d"},{url:"resources/dia_lv.txt",revision:"325ed2d9ffa2ddc493d9ed10d46007ad"},{url:"resources/dia_ml.txt",revision:"fc666763d3fbff227411defda23b1942"},{url:"resources/dia_mr.txt",revision:"e8746ae5b0123155bdd837ae7f01b5f5"},{url:"resources/dia_ms.txt",revision:"e1600b30e6517d4dc4a7002ce675c641"},{url:"resources/dia_my.txt",revision:"4acfe58eb8f47895f188af8bfd33659c"},{url:"resources/dia_nl.txt",revision:"e9512982f5d9e89015435ee50d577bbc"},{url:"resources/dia_no.txt",revision:"6f0812d787ab931475343320d2547158"},{url:"resources/dia_pl.txt",revision:"3c7d08a5fefc693e6b6b4521a3c0a6cc"},{url:"resources/dia_pt-br.txt",revision:"5d7431a638a268dfedd3bc7f463e17d6"},{url:"resources/dia_pt.txt",revision:"981210fd60e7fd0831fcd6d26ca26f74"},{url:"resources/dia_ro.txt",revision:"1d77510ecd2b1b1c26640dfe77e00f48"},{url:"resources/dia_ru.txt",revision:"4c2d2f96df120afc4c3b3c58d0bc6ebc"},{url:"resources/dia_si.txt",revision:"2db82ba649f3ab7d578a73b247b06c4f"},{url:"resources/dia_sk.txt",revision:"4b9033183a2c90ccf0f75136fd7b14b0"},{url:"resources/dia_sl.txt",revision:"c27148e1c9480a35642162595480ff1f"},{url:"resources/dia_sr.txt",revision:"ef3562ada2e69e5d33609d58a677b6db"},{url:"resources/dia_sv.txt",revision:"7357682c42f6d47729b6b1784aaa5e9b"},{url:"resources/dia_sw.txt",revision:"377dd914bd645c2348e342bf55306439"},{url:"resources/dia_ta.txt",revision:"00ce65e244e159a2dcb93b9829a2e603"},{url:"resources/dia_te.txt",revision:"8aaca1c42eb1c027a77138f0fccc85c7"},{url:"resources/dia_th.txt",revision:"c2be3eae6995b41ba466651629c69143"},{url:"resources/dia_tr.txt",revision:"9571764eb899cc108c6fb2631d694ca3"},{url:"resources/dia_uk.txt",revision:"76e4f285ac8c648d3b3fbc6ab59aad17"},{url:"resources/dia_vi.txt",revision:"ced105b1a1ea57902c88fdd36ab041c0"},{url:"resources/dia_zh-tw.txt",revision:"ce0a47eca469dbb93e8c4f26aba7ea73"},{url:"resources/dia_zh.txt",revision:"a69a22b12a4ced3f62285b2521355755"},{url:"favicon.ico",revision:"83014b0f32b6c7b15b66cf3c6d6d7c16"},{url:"images/manifest.json",revision:"38d3a7e4b63e8175f0aab6f03e000f07"},{url:"images/logo.png",revision:"e4e0d092abdb1e668b5ec41a7fe0713c"},{url:"images/drawlogo.svg",revision:"4bf4d14ebcf072d8bd4c5a1c89e88fc6"},{url:"images/drawlogo48.png",revision:"8b13428373aca67b895364d025f42417"},{url:"images/drawlogo-gray.svg",revision:"0aabacbc0873816e1e09e4736ae44c7d"},{url:"images/drawlogo-text-bottom.svg",revision:"f6c438823ab31f290940bd4feb8dd9c2"},{url:"images/default-user.jpg",revision:"2c399696a87c8921f12d2f9e1990cc6e"},{url:"images/logo-flat-small.png",revision:"4b178e59ff499d6dd1894fc498b59877"},{url:"images/apple-touch-icon.png",revision:"732c29e21332a926318a7005d21ec450"},{url:"images/icon-192-maskable.png",revision:"47e006d0ce4a35eb5beaa97f0c2bfed0"},{url:"images/icon-192.png",revision:"d022403d52435d76afec82c4e24a17ef"},{url:"images/icon-512-maskable.png",revision:"cf152feeb01fb21f3148a71a3540266e"},{url:"images/icon-512.png",revision:"a3a0df7e7a385244b74073f81ecc45de"},{url:"images/delete.png",revision:"5f2350f2fd20f1a229637aed32ed8f29"},{url:"images/droptarget.png",revision:"bbf7f563fb6784de1ce96f329519b043"},{url:"images/help.png",revision:"9266c6c3915bd33c243d80037d37bf61"},{url:"images/download.png",revision:"35418dd7bd48d87502c71b578cc6c37f"},{url:"images/logo-flat.png",revision:"038070ab43aee6e54a791211859fc67b"},{url:"images/google-drive-logo.svg",revision:"5d9f2f5bbc7dcc252730a0072bb23059"},{url:"images/onedrive-logo.svg",revision:"3645b344ec0634c1290dd58d7dc87b97"},{url:"images/dropbox-logo.svg",revision:"e6be408c77cf9c82d41ac64fa854280a"},{url:"images/github-logo.svg",revision:"a1a999b69a275eac0cb918360ac05ae1"},{url:"images/gitlab-logo.svg",revision:"0faea8c818899e58533e153c44b10517"},{url:"images/trello-logo.svg",revision:"006fd0d7d70d7e95dc691674cb12e044"},{url:"images/osa_drive-harddisk.png",revision:"b954e1ae772087c5b4c6ae797e1f9649"},{url:"images/osa_database.png",revision:"c350d9d9b95f37b6cfe798b40ede5fb0"},{url:"images/google-drive-logo-white.svg",revision:"f329d8b1be7778515a85b93fc35d9f26"},{url:"images/dropbox-logo-white.svg",revision:"4ea8299ac3bc31a16f199ee3aec223bf"},{url:"images/onedrive-logo-white.svg",revision:"b3602fa0fc947009cff3f33a581cff4d"},{url:"images/github-logo-white.svg",revision:"537b1127b3ca0f95b45782d1304fb77a"},{url:"images/gitlab-logo-white.svg",revision:"5fede9ac2f394c716b8c23e3fddc3910"},{url:"images/trello-logo-white-orange.svg",revision:"e2a0a52ba3766682f138138d10a75eb5"},{url:"images/logo-confluence.png",revision:"ed1e55d44ae5eba8f999aba2c93e8331"},{url:"images/logo-jira.png",revision:"f8d460555a0d1f87cfd901e940666629"},{url:"images/clear.gif",revision:"db13c778e4382e0b55258d0f811d5d70"},{url:"images/spin.gif",revision:"487cbb40b9ced439aa1ad914e816d773"},{url:"images/checkmark.gif",revision:"ba764ce62f2bf952df5bbc2bb4d381c5"},{url:"images/aui-wait.gif",revision:"5a474bcbd8d2f2826f03d10ea44bf60e"},{url:"mxgraph/css/common.css",revision:"7985b4d1692766a7db52cbdd10893ad9"},{url:"mxgraph/images/expanded.gif",revision:"2b67c2c035af1e9a5cc814f0d22074cf"},{url:"mxgraph/images/collapsed.gif",revision:"73cc826da002a3d740ca4ce6ec5c1f4a"},{url:"mxgraph/images/maximize.gif",revision:"5cd13d6925493ab51e876694cc1c2ec2"},{url:"mxgraph/images/minimize.gif",revision:"8957741b9b0f86af9438775f2aadbb54"},{url:"mxgraph/images/close.gif",revision:"8b84669812ac7382984fca35de8da48b"},{url:"mxgraph/images/resize.gif",revision:"a6477612b3567a34033f9cac6184eed3"},{url:"mxgraph/images/separator.gif",revision:"7819742ff106c97da7a801c2372bbbe5"},{url:"mxgraph/images/window.gif",revision:"fd9a21dd4181f98052a202a0a01f18ab"},{url:"mxgraph/images/window-title.gif",revision:"3fb1d6c43246cdf991a11dfe826dfe99"},{url:"mxgraph/images/button.gif",revision:"00759bdc3ad218fa739f584369541809"},{url:"mxgraph/images/point.gif",revision:"83a43717b284902442620f61bc4e9fa6"}],{ignoreURLParametersMatching:[/.*/]})}));+if(!self.define){let e,i={};const r=(r,a)=>(r=new URL(r+".js",a).href,i[r]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=i,document.head.appendChild(e)}else e=r,importScripts(r),i()})).then((()=>{let e=i[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e})));self.define=(a,c)=>{const s=e||("document"in self?document.currentScript.src:"")||location.href;if(i[s])return;let d={};const o=e=>r(e,s),f={module:{uri:s},exports:d,require:o};i[s]=Promise.all(a.map((e=>f[e]||o(e)))).then((e=>(c(...e),d)))}}define(["./workbox-72a83b64"],(function(e){"use strict";self.skipWaiting(),e.precacheAndRoute([{url:"js/app.min.js",revision:"894d348556f8e57ff374262ad58e6bde"},{url:"js/extensions.min.js",revision:"69fb66339923d62ae0fdc1f13103cf55"},{url:"js/orgchart.min.js",revision:"619d8c4dab47b81868916df31f55478b"},{url:"js/stencils.min.js",revision:"f760278d924467fb1d2289448c73fe27"},{url:"js/shapes-14-6-5.min.js",revision:"317413c8e37c127ada9a5c84ffd3463d"},{url:"js/math-print.js",revision:"cf64f6a493a8cb5079f2b70813e478d7"},{url:"index.html",revision:"57fe6012597666439de3e76c9bb681c1"},{url:"open.html",revision:"d71816b3b00e769fc6019fcdd6921662"},{url:"shortcuts.svg",revision:"2381dd779ce6cfee954042a7f784c7e6"},{url:"styles/fonts/ArchitectsDaughter-Regular.ttf",revision:"31c2153c0530e32553b31a49b3d70736"},{url:"styles/grapheditor.css",revision:"bf1193dac429449c2f79163e623cab8d"},{url:"styles/atlas.css",revision:"0a6cc8a503b96f634e40309aadf6b803"},{url:"styles/dark.css",revision:"99dc5495d36d5ebaddababefde083c8c"},{url:"js/dropbox/Dropbox-sdk.min.js",revision:"4b9842892aa37b156db0a8364b7a83b0"},{url:"js/onedrive/OneDrive.js",revision:"505e8280346666f7ee801bc59521fa67"},{url:"js/viewer-static.min.js",revision:"5885df655bb4ddd1df21ac7e0b0978fe"},{url:"connect/jira/editor-1-3-3.html",revision:"41dc8af9576b47f359cff19fff7a41c2"},{url:"connect/jira/viewerPanel-1-3-12.html",revision:"4836f5e4308abe57830e441518364f23"},{url:"connect/jira/fullScreenViewer-1-3-3.html",revision:"abed474e47c0c41a5ad2366b4828f77a"},{url:"connect/jira/viewerPanel.js",revision:"75f816c208d0c621e3066a97ff0ee6cf"},{url:"connect/jira/spinner.gif",revision:"7d857ab9d86123e93d74d48e958fe743"},{url:"connect/jira/editor.js",revision:"c41221a9a51ff293f05ed13c7b142e5c"},{url:"connect/jira/fullscreen-viewer-init.js",revision:"d3269625ce04b7a277b779ff175957d0"},{url:"connect/jira/fullscreen-viewer.js",revision:"8eceb2fe587296dd11f9c8f6eae34c20"},{url:"plugins/connectJira.js",revision:"c4cb6b60234b04b2c8bc09e555746615"},{url:"plugins/cConf-comments.js",revision:"8af574bd1ae86be37b83b094a5011a4f"},{url:"plugins/cConf-1-4-8.js",revision:"1c9a0a3df274b56bd471283165f8aa5c"},{url:"connect/confluence/connectUtils-1-4-8.js",revision:"c3215554d29cc3f5df885cab999563c3"},{url:"connect/new_common/cac.js",revision:"740dce44cf53499f476ee8edc37d09a0"},{url:"connect/gdrive_common/gac.js",revision:"3bb38a5d9186a896ed04808e921ef888"},{url:"connect/onedrive_common/ac.js",revision:"5fb6ff1a73f54a9086b7a7e1f613b8ed"},{url:"connect/confluence/viewer-init.js",revision:"b82e366bf57ecced9435c2a8ba9cb9b9"},{url:"connect/confluence/viewer.js",revision:"aa5ca84da421c280e9057b3a39c8a456"},{url:"connect/confluence/viewer-1-4-42.html",revision:"69c1bca25fd4889bf832e8441c972268"},{url:"connect/confluence/macroEditor-1-4-8.html",revision:"4ad77ae3f08c19eddac932b2fa8c7068"},{url:"connect/confluence/includeDiagram-1-4-8.js",revision:"a71935d0acd4b0a6ee70795b0f298699"},{url:"connect/confluence/includeDiagram.html",revision:"9613fec05b19ddef081ca6e9d8b057bf"},{url:"connect/confluence/macro-editor.js",revision:"03a8dcfc69612b44b6e75e6926a956fc"},{url:"math/es5/startup.js",revision:"dc7130cdc866593293dbb5dde11ceb40"},{url:"math/es5/core.js",revision:"f71bc0bfb7d2ac8261747f97a5d47dd4"},{url:"math/es5/ui/safe.js",revision:"8c1fcfee7c879588ad409edcdd9cce53"},{url:"math/es5/output/svg.js",revision:"4f55967d16197ebb01b86356d8ab179a"},{url:"math/es5/input/tex.js",revision:"5c4f470da2ccb1acf85041fcecd6fff6"},{url:"math/es5/input/asciimath.js",revision:"c2d4076dd8e26d509bfe3a378e71cfa7"},{url:"math/es5/output/svg/fonts/tex.js",revision:"6eab785a3788ea805bd2b552d1f0aab8"},{url:"resources/dia.txt",revision:"73927d303703a329ff06d681553e993d"},{url:"resources/dia_am.txt",revision:"8d60c82458b57bb9ccc7b0c4f6ed3f79"},{url:"resources/dia_ar.txt",revision:"e278657437cf14eeedbb3b641d3ba8c0"},{url:"resources/dia_bg.txt",revision:"61c2ef14ee768be21fcb22b1928f7cac"},{url:"resources/dia_bn.txt",revision:"45e3683c1150ad2e139f42fedaf9e7aa"},{url:"resources/dia_bs.txt",revision:"ed33364ad4282d0e29775ca2e2f351e0"},{url:"resources/dia_ca.txt",revision:"101dbe73020d8471a5208da4d8ae247e"},{url:"resources/dia_cs.txt",revision:"ba2fd4196222285218549625600a530f"},{url:"resources/dia_da.txt",revision:"b3eb739977ead9876a8afe0103ad7e36"},{url:"resources/dia_de.txt",revision:"95357e2d517ad36e2db9ed683914f9b3"},{url:"resources/dia_el.txt",revision:"faa7d843ef32aba9b9f11e367ca362d5"},{url:"resources/dia_eo.txt",revision:"619ff072153d5897b7184ee0fe925f18"},{url:"resources/dia_es.txt",revision:"1feb3c63ee76afc71ebec607c8a9347a"},{url:"resources/dia_et.txt",revision:"67482775f1ff0d1b2cb31f6226c519d3"},{url:"resources/dia_eu.txt",revision:"a7dce4832af9f1d0b4e5f5bf189ef328"},{url:"resources/dia_fa.txt",revision:"743a891d016470e8e0a3651be32fb3c5"},{url:"resources/dia_fi.txt",revision:"771de2b3741f25b4114e51c93ce1a866"},{url:"resources/dia_fil.txt",revision:"637b4984bb64580b4ef61e28ef7ca664"},{url:"resources/dia_fr.txt",revision:"ad7e62eb41228b929489d9427d206e82"},{url:"resources/dia_gl.txt",revision:"a89e3f7e7cb3b6867d3e74eb949894dd"},{url:"resources/dia_gu.txt",revision:"769be61a373049c5d3b358201f1acb65"},{url:"resources/dia_he.txt",revision:"238e53f20884ef57b1a9c06bd800b9ef"},{url:"resources/dia_hi.txt",revision:"755e1872b614c9a5b27c5459062c8320"},{url:"resources/dia_hr.txt",revision:"adf6788e96b0e3f0029cbae30a4faefb"},{url:"resources/dia_hu.txt",revision:"c645a78fdda2843acd6aa9d9bf60a6e8"},{url:"resources/dia_id.txt",revision:"9da16676fc1b33c61b4a025a352dc916"},{url:"resources/dia_it.txt",revision:"57b0f8eb2319f99f96b79507966f4e6f"},{url:"resources/dia_ja.txt",revision:"b4b10c93e53b13dbd3e407532813b9e0"},{url:"resources/dia_kn.txt",revision:"7cbbba0381a1a6cdeade3bc28ac01962"},{url:"resources/dia_ko.txt",revision:"943b020ff0430e9f81fe3e1875423b7d"},{url:"resources/dia_lt.txt",revision:"94aff34cd118d39d79abacf2a16aea7d"},{url:"resources/dia_lv.txt",revision:"325ed2d9ffa2ddc493d9ed10d46007ad"},{url:"resources/dia_ml.txt",revision:"fc666763d3fbff227411defda23b1942"},{url:"resources/dia_mr.txt",revision:"e8746ae5b0123155bdd837ae7f01b5f5"},{url:"resources/dia_ms.txt",revision:"e1600b30e6517d4dc4a7002ce675c641"},{url:"resources/dia_my.txt",revision:"4acfe58eb8f47895f188af8bfd33659c"},{url:"resources/dia_nl.txt",revision:"e9512982f5d9e89015435ee50d577bbc"},{url:"resources/dia_no.txt",revision:"6f0812d787ab931475343320d2547158"},{url:"resources/dia_pl.txt",revision:"3c7d08a5fefc693e6b6b4521a3c0a6cc"},{url:"resources/dia_pt-br.txt",revision:"5d7431a638a268dfedd3bc7f463e17d6"},{url:"resources/dia_pt.txt",revision:"981210fd60e7fd0831fcd6d26ca26f74"},{url:"resources/dia_ro.txt",revision:"1d77510ecd2b1b1c26640dfe77e00f48"},{url:"resources/dia_ru.txt",revision:"4c2d2f96df120afc4c3b3c58d0bc6ebc"},{url:"resources/dia_si.txt",revision:"2db82ba649f3ab7d578a73b247b06c4f"},{url:"resources/dia_sk.txt",revision:"4b9033183a2c90ccf0f75136fd7b14b0"},{url:"resources/dia_sl.txt",revision:"c27148e1c9480a35642162595480ff1f"},{url:"resources/dia_sr.txt",revision:"ef3562ada2e69e5d33609d58a677b6db"},{url:"resources/dia_sv.txt",revision:"7357682c42f6d47729b6b1784aaa5e9b"},{url:"resources/dia_sw.txt",revision:"377dd914bd645c2348e342bf55306439"},{url:"resources/dia_ta.txt",revision:"00ce65e244e159a2dcb93b9829a2e603"},{url:"resources/dia_te.txt",revision:"8aaca1c42eb1c027a77138f0fccc85c7"},{url:"resources/dia_th.txt",revision:"c2be3eae6995b41ba466651629c69143"},{url:"resources/dia_tr.txt",revision:"9571764eb899cc108c6fb2631d694ca3"},{url:"resources/dia_uk.txt",revision:"76e4f285ac8c648d3b3fbc6ab59aad17"},{url:"resources/dia_vi.txt",revision:"ced105b1a1ea57902c88fdd36ab041c0"},{url:"resources/dia_zh-tw.txt",revision:"ce0a47eca469dbb93e8c4f26aba7ea73"},{url:"resources/dia_zh.txt",revision:"a69a22b12a4ced3f62285b2521355755"},{url:"favicon.ico",revision:"83014b0f32b6c7b15b66cf3c6d6d7c16"},{url:"images/manifest.json",revision:"38d3a7e4b63e8175f0aab6f03e000f07"},{url:"images/logo.png",revision:"e4e0d092abdb1e668b5ec41a7fe0713c"},{url:"images/drawlogo.svg",revision:"4bf4d14ebcf072d8bd4c5a1c89e88fc6"},{url:"images/drawlogo48.png",revision:"8b13428373aca67b895364d025f42417"},{url:"images/drawlogo-gray.svg",revision:"0aabacbc0873816e1e09e4736ae44c7d"},{url:"images/drawlogo-text-bottom.svg",revision:"f6c438823ab31f290940bd4feb8dd9c2"},{url:"images/default-user.jpg",revision:"2c399696a87c8921f12d2f9e1990cc6e"},{url:"images/logo-flat-small.png",revision:"4b178e59ff499d6dd1894fc498b59877"},{url:"images/apple-touch-icon.png",revision:"732c29e21332a926318a7005d21ec450"},{url:"images/icon-192-maskable.png",revision:"47e006d0ce4a35eb5beaa97f0c2bfed0"},{url:"images/icon-192.png",revision:"d022403d52435d76afec82c4e24a17ef"},{url:"images/icon-512-maskable.png",revision:"cf152feeb01fb21f3148a71a3540266e"},{url:"images/icon-512.png",revision:"a3a0df7e7a385244b74073f81ecc45de"},{url:"images/delete.png",revision:"5f2350f2fd20f1a229637aed32ed8f29"},{url:"images/droptarget.png",revision:"bbf7f563fb6784de1ce96f329519b043"},{url:"images/help.png",revision:"9266c6c3915bd33c243d80037d37bf61"},{url:"images/download.png",revision:"35418dd7bd48d87502c71b578cc6c37f"},{url:"images/logo-flat.png",revision:"038070ab43aee6e54a791211859fc67b"},{url:"images/google-drive-logo.svg",revision:"5d9f2f5bbc7dcc252730a0072bb23059"},{url:"images/onedrive-logo.svg",revision:"3645b344ec0634c1290dd58d7dc87b97"},{url:"images/dropbox-logo.svg",revision:"e6be408c77cf9c82d41ac64fa854280a"},{url:"images/github-logo.svg",revision:"a1a999b69a275eac0cb918360ac05ae1"},{url:"images/gitlab-logo.svg",revision:"0faea8c818899e58533e153c44b10517"},{url:"images/trello-logo.svg",revision:"006fd0d7d70d7e95dc691674cb12e044"},{url:"images/osa_drive-harddisk.png",revision:"b954e1ae772087c5b4c6ae797e1f9649"},{url:"images/osa_database.png",revision:"c350d9d9b95f37b6cfe798b40ede5fb0"},{url:"images/google-drive-logo-white.svg",revision:"f329d8b1be7778515a85b93fc35d9f26"},{url:"images/dropbox-logo-white.svg",revision:"4ea8299ac3bc31a16f199ee3aec223bf"},{url:"images/onedrive-logo-white.svg",revision:"b3602fa0fc947009cff3f33a581cff4d"},{url:"images/github-logo-white.svg",revision:"537b1127b3ca0f95b45782d1304fb77a"},{url:"images/gitlab-logo-white.svg",revision:"5fede9ac2f394c716b8c23e3fddc3910"},{url:"images/trello-logo-white-orange.svg",revision:"e2a0a52ba3766682f138138d10a75eb5"},{url:"images/logo-confluence.png",revision:"ed1e55d44ae5eba8f999aba2c93e8331"},{url:"images/logo-jira.png",revision:"f8d460555a0d1f87cfd901e940666629"},{url:"images/clear.gif",revision:"db13c778e4382e0b55258d0f811d5d70"},{url:"images/spin.gif",revision:"487cbb40b9ced439aa1ad914e816d773"},{url:"images/checkmark.gif",revision:"ba764ce62f2bf952df5bbc2bb4d381c5"},{url:"images/aui-wait.gif",revision:"5a474bcbd8d2f2826f03d10ea44bf60e"},{url:"mxgraph/css/common.css",revision:"7985b4d1692766a7db52cbdd10893ad9"},{url:"mxgraph/images/expanded.gif",revision:"2b67c2c035af1e9a5cc814f0d22074cf"},{url:"mxgraph/images/collapsed.gif",revision:"73cc826da002a3d740ca4ce6ec5c1f4a"},{url:"mxgraph/images/maximize.gif",revision:"5cd13d6925493ab51e876694cc1c2ec2"},{url:"mxgraph/images/minimize.gif",revision:"8957741b9b0f86af9438775f2aadbb54"},{url:"mxgraph/images/close.gif",revision:"8b84669812ac7382984fca35de8da48b"},{url:"mxgraph/images/resize.gif",revision:"a6477612b3567a34033f9cac6184eed3"},{url:"mxgraph/images/separator.gif",revision:"7819742ff106c97da7a801c2372bbbe5"},{url:"mxgraph/images/window.gif",revision:"fd9a21dd4181f98052a202a0a01f18ab"},{url:"mxgraph/images/window-title.gif",revision:"3fb1d6c43246cdf991a11dfe826dfe99"},{url:"mxgraph/images/button.gif",revision:"00759bdc3ad218fa739f584369541809"},{url:"mxgraph/images/point.gif",revision:"83a43717b284902442620f61bc4e9fa6"}],{ignoreURLParametersMatching:[/.*/]})}));//# sourceMappingURL=service-worker.js.mapdiff --git a/src/main/webapp/service-worker.js.map b/src/main/webapp/service-worker.js.mapindex cea363b08..d5a17db68 100644--- a/src/main/webapp/service-worker.js.map+++ b/src/main/webapp/service-worker.js.map@@ -1 +1 @@-{"version":3,"file":"service-worker.js","sources":["../../../../../../private/var/folders/5p/vxfp3wpj4slfjt2m12dxyp9c0000gn/T/7f417c7c0d013945286d60e88ca9e010/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"js/app.min.js\",\n \"revision\": \"ecb7dd23fe8f5c876bbf249e6c3b6061\"\n },\n {\n \"url\": \"js/extensions.min.js\",\n \"revision\": \"69fb66339923d62ae0fdc1f13103cf55\"\n },\n {\n \"url\": \"js/orgchart.min.js\",\n \"revision\": \"619d8c4dab47b81868916df31f55478b\"\n },\n {\n \"url\": \"js/stencils.min.js\",\n \"revision\": \"f760278d924467fb1d2289448c73fe27\"\n },\n {\n \"url\": \"js/shapes-14-6-5.min.js\",\n \"revision\": \"317413c8e37c127ada9a5c84ffd3463d\"\n },\n {\n \"url\": \"js/math-print.js\",\n \"revision\": \"cf64f6a493a8cb5079f2b70813e478d7\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"57fe6012597666439de3e76c9bb681c1\"\n },\n {\n \"url\": \"open.html\",\n \"revision\": \"d71816b3b00e769fc6019fcdd6921662\"\n },\n {\n \"url\": \"shortcuts.svg\",\n \"revision\": \"2381dd779ce6cfee954042a7f784c7e6\"\n },\n {\n \"url\": \"styles/fonts/ArchitectsDaughter-Regular.ttf\",\n \"revision\": \"31c2153c0530e32553b31a49b3d70736\"\n },\n {\n \"url\": \"styles/grapheditor.css\",\n \"revision\": \"bf1193dac429449c2f79163e623cab8d\"\n },\n {\n \"url\": \"styles/atlas.css\",\n \"revision\": \"0a6cc8a503b96f634e40309aadf6b803\"\n },\n {\n \"url\": \"styles/dark.css\",\n \"revision\": \"99dc5495d36d5ebaddababefde083c8c\"\n },\n {\n \"url\": \"js/dropbox/Dropbox-sdk.min.js\",\n \"revision\": \"4b9842892aa37b156db0a8364b7a83b0\"\n },\n {\n \"url\": \"js/onedrive/OneDrive.js\",\n \"revision\": \"505e8280346666f7ee801bc59521fa67\"\n },\n {\n \"url\": \"js/viewer-static.min.js\",\n \"revision\": \"930f61f29457d32e9087bdc019c274d3\"\n },\n {\n \"url\": \"connect/jira/editor-1-3-3.html\",\n \"revision\": \"41dc8af9576b47f359cff19fff7a41c2\"\n },\n {\n \"url\": \"connect/jira/viewerPanel-1-3-12.html\",\n \"revision\": \"4836f5e4308abe57830e441518364f23\"\n },\n {\n \"url\": \"connect/jira/fullScreenViewer-1-3-3.html\",\n \"revision\": \"abed474e47c0c41a5ad2366b4828f77a\"\n },\n {\n \"url\": \"connect/jira/viewerPanel.js\",\n \"revision\": \"75f816c208d0c621e3066a97ff0ee6cf\"\n },\n {\n \"url\": \"connect/jira/spinner.gif\",\n \"revision\": \"7d857ab9d86123e93d74d48e958fe743\"\n },\n {\n \"url\": \"connect/jira/editor.js\",\n \"revision\": \"c41221a9a51ff293f05ed13c7b142e5c\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer-init.js\",\n \"revision\": \"d3269625ce04b7a277b779ff175957d0\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer.js\",\n \"revision\": \"8eceb2fe587296dd11f9c8f6eae34c20\"\n },\n {\n \"url\": \"plugins/connectJira.js\",\n \"revision\": \"c4cb6b60234b04b2c8bc09e555746615\"\n },\n {\n \"url\": \"plugins/cConf-comments.js\",\n \"revision\": \"8af574bd1ae86be37b83b094a5011a4f\"\n },\n {\n \"url\": \"plugins/cConf-1-4-8.js\",\n \"revision\": \"1c9a0a3df274b56bd471283165f8aa5c\"\n },\n {\n \"url\": \"connect/confluence/connectUtils-1-4-8.js\",\n \"revision\": \"c3215554d29cc3f5df885cab999563c3\"\n },\n {\n \"url\": \"connect/new_common/cac.js\",\n \"revision\": \"740dce44cf53499f476ee8edc37d09a0\"\n },\n {\n \"url\": \"connect/gdrive_common/gac.js\",\n \"revision\": \"3bb38a5d9186a896ed04808e921ef888\"\n },\n {\n \"url\": \"connect/onedrive_common/ac.js\",\n \"revision\": \"5fb6ff1a73f54a9086b7a7e1f613b8ed\"\n },\n {\n \"url\": \"connect/confluence/viewer-init.js\",\n \"revision\": \"b82e366bf57ecced9435c2a8ba9cb9b9\"\n },\n {\n \"url\": \"connect/confluence/viewer.js\",\n \"revision\": \"aa5ca84da421c280e9057b3a39c8a456\"\n },\n {\n \"url\": \"connect/confluence/viewer-1-4-42.html\",\n \"revision\": \"69c1bca25fd4889bf832e8441c972268\"\n },\n {\n \"url\": \"connect/confluence/macroEditor-1-4-8.html\",\n \"revision\": \"4ad77ae3f08c19eddac932b2fa8c7068\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram-1-4-8.js\",\n \"revision\": \"a71935d0acd4b0a6ee70795b0f298699\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram.html\",\n \"revision\": \"9613fec05b19ddef081ca6e9d8b057bf\"\n },\n {\n \"url\": \"connect/confluence/macro-editor.js\",\n \"revision\": \"03a8dcfc69612b44b6e75e6926a956fc\"\n },\n {\n \"url\": \"math/es5/startup.js\",\n \"revision\": \"dc7130cdc866593293dbb5dde11ceb40\"\n },\n {\n \"url\": \"math/es5/core.js\",\n \"revision\": \"f71bc0bfb7d2ac8261747f97a5d47dd4\"\n },\n {\n \"url\": \"math/es5/ui/safe.js\",\n \"revision\": \"8c1fcfee7c879588ad409edcdd9cce53\"\n },\n {\n \"url\": \"math/es5/output/svg.js\",\n \"revision\": \"4f55967d16197ebb01b86356d8ab179a\"\n },\n {\n \"url\": \"math/es5/input/tex.js\",\n \"revision\": \"5c4f470da2ccb1acf85041fcecd6fff6\"\n },\n {\n \"url\": \"math/es5/input/asciimath.js\",\n \"revision\": \"c2d4076dd8e26d509bfe3a378e71cfa7\"\n },\n {\n \"url\": \"math/es5/output/svg/fonts/tex.js\",\n \"revision\": \"6eab785a3788ea805bd2b552d1f0aab8\"\n },\n {\n \"url\": \"resources/dia.txt\",\n \"revision\": \"73927d303703a329ff06d681553e993d\"\n },\n {\n \"url\": \"resources/dia_am.txt\",\n \"revision\": \"8d60c82458b57bb9ccc7b0c4f6ed3f79\"\n },\n {\n \"url\": \"resources/dia_ar.txt\",\n \"revision\": \"e278657437cf14eeedbb3b641d3ba8c0\"\n },\n {\n \"url\": \"resources/dia_bg.txt\",\n \"revision\": \"61c2ef14ee768be21fcb22b1928f7cac\"\n },\n {\n \"url\": \"resources/dia_bn.txt\",\n \"revision\": \"45e3683c1150ad2e139f42fedaf9e7aa\"\n },\n {\n \"url\": \"resources/dia_bs.txt\",\n \"revision\": \"ed33364ad4282d0e29775ca2e2f351e0\"\n },\n {\n \"url\": \"resources/dia_ca.txt\",\n \"revision\": \"101dbe73020d8471a5208da4d8ae247e\"\n },\n {\n \"url\": \"resources/dia_cs.txt\",\n \"revision\": \"ba2fd4196222285218549625600a530f\"\n },\n {\n \"url\": \"resources/dia_da.txt\",\n \"revision\": \"b3eb739977ead9876a8afe0103ad7e36\"\n },\n {\n \"url\": \"resources/dia_de.txt\",\n \"revision\": \"95357e2d517ad36e2db9ed683914f9b3\"\n },\n {\n \"url\": \"resources/dia_el.txt\",\n \"revision\": \"faa7d843ef32aba9b9f11e367ca362d5\"\n },\n {\n \"url\": \"resources/dia_eo.txt\",\n \"revision\": \"619ff072153d5897b7184ee0fe925f18\"\n },\n {\n \"url\": \"resources/dia_es.txt\",\n \"revision\": \"1feb3c63ee76afc71ebec607c8a9347a\"\n },\n {\n \"url\": \"resources/dia_et.txt\",\n \"revision\": \"67482775f1ff0d1b2cb31f6226c519d3\"\n },\n {\n \"url\": \"resources/dia_eu.txt\",\n \"revision\": \"a7dce4832af9f1d0b4e5f5bf189ef328\"\n },\n {\n \"url\": \"resources/dia_fa.txt\",\n \"revision\": \"743a891d016470e8e0a3651be32fb3c5\"\n },\n {\n \"url\": \"resources/dia_fi.txt\",\n \"revision\": \"771de2b3741f25b4114e51c93ce1a866\"\n },\n {\n \"url\": \"resources/dia_fil.txt\",\n \"revision\": \"637b4984bb64580b4ef61e28ef7ca664\"\n },\n {\n \"url\": \"resources/dia_fr.txt\",\n \"revision\": \"ad7e62eb41228b929489d9427d206e82\"\n },\n {\n \"url\": \"resources/dia_gl.txt\",\n \"revision\": \"a89e3f7e7cb3b6867d3e74eb949894dd\"\n },\n {\n \"url\": \"resources/dia_gu.txt\",\n \"revision\": \"769be61a373049c5d3b358201f1acb65\"\n },\n {\n \"url\": \"resources/dia_he.txt\",\n \"revision\": \"238e53f20884ef57b1a9c06bd800b9ef\"\n },\n {\n \"url\": \"resources/dia_hi.txt\",\n \"revision\": \"755e1872b614c9a5b27c5459062c8320\"\n },\n {\n \"url\": \"resources/dia_hr.txt\",\n \"revision\": \"adf6788e96b0e3f0029cbae30a4faefb\"\n },\n {\n \"url\": \"resources/dia_hu.txt\",\n \"revision\": \"c645a78fdda2843acd6aa9d9bf60a6e8\"\n },\n {\n \"url\": \"resources/dia_id.txt\",\n \"revision\": \"9da16676fc1b33c61b4a025a352dc916\"\n },\n {\n \"url\": \"resources/dia_it.txt\",\n \"revision\": \"57b0f8eb2319f99f96b79507966f4e6f\"\n },\n {\n \"url\": \"resources/dia_ja.txt\",\n \"revision\": \"b4b10c93e53b13dbd3e407532813b9e0\"\n },\n {\n \"url\": \"resources/dia_kn.txt\",\n \"revision\": \"7cbbba0381a1a6cdeade3bc28ac01962\"\n },\n {\n \"url\": \"resources/dia_ko.txt\",\n \"revision\": \"943b020ff0430e9f81fe3e1875423b7d\"\n },\n {\n \"url\": \"resources/dia_lt.txt\",\n \"revision\": \"94aff34cd118d39d79abacf2a16aea7d\"\n },\n {\n \"url\": \"resources/dia_lv.txt\",\n \"revision\": \"325ed2d9ffa2ddc493d9ed10d46007ad\"\n },\n {\n \"url\": \"resources/dia_ml.txt\",\n \"revision\": \"fc666763d3fbff227411defda23b1942\"\n },\n {\n \"url\": \"resources/dia_mr.txt\",\n \"revision\": \"e8746ae5b0123155bdd837ae7f01b5f5\"\n },\n {\n \"url\": \"resources/dia_ms.txt\",\n \"revision\": \"e1600b30e6517d4dc4a7002ce675c641\"\n },\n {\n \"url\": \"resources/dia_my.txt\",\n \"revision\": \"4acfe58eb8f47895f188af8bfd33659c\"\n },\n {\n \"url\": \"resources/dia_nl.txt\",\n \"revision\": \"e9512982f5d9e89015435ee50d577bbc\"\n },\n {\n \"url\": \"resources/dia_no.txt\",\n \"revision\": \"6f0812d787ab931475343320d2547158\"\n },\n {\n \"url\": \"resources/dia_pl.txt\",\n \"revision\": \"3c7d08a5fefc693e6b6b4521a3c0a6cc\"\n },\n {\n \"url\": \"resources/dia_pt-br.txt\",\n \"revision\": \"5d7431a638a268dfedd3bc7f463e17d6\"\n },\n {\n \"url\": \"resources/dia_pt.txt\",\n \"revision\": \"981210fd60e7fd0831fcd6d26ca26f74\"\n },\n {\n \"url\": \"resources/dia_ro.txt\",\n \"revision\": \"1d77510ecd2b1b1c26640dfe77e00f48\"\n },\n {\n \"url\": \"resources/dia_ru.txt\",\n \"revision\": \"4c2d2f96df120afc4c3b3c58d0bc6ebc\"\n },\n {\n \"url\": \"resources/dia_si.txt\",\n \"revision\": \"2db82ba649f3ab7d578a73b247b06c4f\"\n },\n {\n \"url\": \"resources/dia_sk.txt\",\n \"revision\": \"4b9033183a2c90ccf0f75136fd7b14b0\"\n },\n {\n \"url\": \"resources/dia_sl.txt\",\n \"revision\": \"c27148e1c9480a35642162595480ff1f\"\n },\n {\n \"url\": \"resources/dia_sr.txt\",\n \"revision\": \"ef3562ada2e69e5d33609d58a677b6db\"\n },\n {\n \"url\": \"resources/dia_sv.txt\",\n \"revision\": \"7357682c42f6d47729b6b1784aaa5e9b\"\n },\n {\n \"url\": \"resources/dia_sw.txt\",\n \"revision\": \"377dd914bd645c2348e342bf55306439\"\n },\n {\n \"url\": \"resources/dia_ta.txt\",\n \"revision\": \"00ce65e244e159a2dcb93b9829a2e603\"\n },\n {\n \"url\": \"resources/dia_te.txt\",\n \"revision\": \"8aaca1c42eb1c027a77138f0fccc85c7\"\n },\n {\n \"url\": \"resources/dia_th.txt\",\n \"revision\": \"c2be3eae6995b41ba466651629c69143\"\n },\n {\n \"url\": \"resources/dia_tr.txt\",\n \"revision\": \"9571764eb899cc108c6fb2631d694ca3\"\n },\n {\n \"url\": \"resources/dia_uk.txt\",\n \"revision\": \"76e4f285ac8c648d3b3fbc6ab59aad17\"\n },\n {\n \"url\": \"resources/dia_vi.txt\",\n \"revision\": \"ced105b1a1ea57902c88fdd36ab041c0\"\n },\n {\n \"url\": \"resources/dia_zh-tw.txt\",\n \"revision\": \"ce0a47eca469dbb93e8c4f26aba7ea73\"\n },\n {\n \"url\": \"resources/dia_zh.txt\",\n \"revision\": \"a69a22b12a4ced3f62285b2521355755\"\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"83014b0f32b6c7b15b66cf3c6d6d7c16\"\n },\n {\n \"url\": \"images/manifest.json\",\n \"revision\": \"38d3a7e4b63e8175f0aab6f03e000f07\"\n },\n {\n \"url\": \"images/logo.png\",\n \"revision\": \"e4e0d092abdb1e668b5ec41a7fe0713c\"\n },\n {\n \"url\": \"images/drawlogo.svg\",\n \"revision\": \"4bf4d14ebcf072d8bd4c5a1c89e88fc6\"\n },\n {\n \"url\": \"images/drawlogo48.png\",\n \"revision\": \"8b13428373aca67b895364d025f42417\"\n },\n {\n \"url\": \"images/drawlogo-gray.svg\",\n \"revision\": \"0aabacbc0873816e1e09e4736ae44c7d\"\n },\n {\n \"url\": \"images/drawlogo-text-bottom.svg\",\n \"revision\": \"f6c438823ab31f290940bd4feb8dd9c2\"\n },\n {\n \"url\": \"images/default-user.jpg\",\n \"revision\": \"2c399696a87c8921f12d2f9e1990cc6e\"\n },\n {\n \"url\": \"images/logo-flat-small.png\",\n \"revision\": \"4b178e59ff499d6dd1894fc498b59877\"\n },\n {\n \"url\": \"images/apple-touch-icon.png\",\n \"revision\": \"732c29e21332a926318a7005d21ec450\"\n },\n {\n \"url\": \"images/icon-192-maskable.png\",\n \"revision\": \"47e006d0ce4a35eb5beaa97f0c2bfed0\"\n },\n {\n \"url\": \"images/icon-192.png\",\n \"revision\": \"d022403d52435d76afec82c4e24a17ef\"\n },\n {\n \"url\": \"images/icon-512-maskable.png\",\n \"revision\": \"cf152feeb01fb21f3148a71a3540266e\"\n },\n {\n \"url\": \"images/icon-512.png\",\n \"revision\": \"a3a0df7e7a385244b74073f81ecc45de\"\n },\n {\n \"url\": \"images/delete.png\",\n \"revision\": \"5f2350f2fd20f1a229637aed32ed8f29\"\n },\n {\n \"url\": \"images/droptarget.png\",\n \"revision\": \"bbf7f563fb6784de1ce96f329519b043\"\n },\n {\n \"url\": \"images/help.png\",\n \"revision\": \"9266c6c3915bd33c243d80037d37bf61\"\n },\n {\n \"url\": \"images/download.png\",\n \"revision\": \"35418dd7bd48d87502c71b578cc6c37f\"\n },\n {\n \"url\": \"images/logo-flat.png\",\n \"revision\": \"038070ab43aee6e54a791211859fc67b\"\n },\n {\n \"url\": \"images/google-drive-logo.svg\",\n \"revision\": \"5d9f2f5bbc7dcc252730a0072bb23059\"\n },\n {\n \"url\": \"images/onedrive-logo.svg\",\n \"revision\": \"3645b344ec0634c1290dd58d7dc87b97\"\n },\n {\n \"url\": \"images/dropbox-logo.svg\",\n \"revision\": \"e6be408c77cf9c82d41ac64fa854280a\"\n },\n {\n \"url\": \"images/github-logo.svg\",\n \"revision\": \"a1a999b69a275eac0cb918360ac05ae1\"\n },\n {\n \"url\": \"images/gitlab-logo.svg\",\n \"revision\": \"0faea8c818899e58533e153c44b10517\"\n },\n {\n \"url\": \"images/trello-logo.svg\",\n \"revision\": \"006fd0d7d70d7e95dc691674cb12e044\"\n },\n {\n \"url\": \"images/osa_drive-harddisk.png\",\n \"revision\": \"b954e1ae772087c5b4c6ae797e1f9649\"\n },\n {\n \"url\": \"images/osa_database.png\",\n \"revision\": \"c350d9d9b95f37b6cfe798b40ede5fb0\"\n },\n {\n \"url\": \"images/google-drive-logo-white.svg\",\n \"revision\": \"f329d8b1be7778515a85b93fc35d9f26\"\n },\n {\n \"url\": \"images/dropbox-logo-white.svg\",\n \"revision\": \"4ea8299ac3bc31a16f199ee3aec223bf\"\n },\n {\n \"url\": \"images/onedrive-logo-white.svg\",\n \"revision\": \"b3602fa0fc947009cff3f33a581cff4d\"\n },\n {\n \"url\": \"images/github-logo-white.svg\",\n \"revision\": \"537b1127b3ca0f95b45782d1304fb77a\"\n },\n {\n \"url\": \"images/gitlab-logo-white.svg\",\n \"revision\": \"5fede9ac2f394c716b8c23e3fddc3910\"\n },\n {\n \"url\": \"images/trello-logo-white-orange.svg\",\n \"revision\": \"e2a0a52ba3766682f138138d10a75eb5\"\n },\n {\n \"url\": \"images/logo-confluence.png\",\n \"revision\": \"ed1e55d44ae5eba8f999aba2c93e8331\"\n },\n {\n \"url\": \"images/logo-jira.png\",\n \"revision\": \"f8d460555a0d1f87cfd901e940666629\"\n },\n {\n \"url\": \"images/clear.gif\",\n \"revision\": \"db13c778e4382e0b55258d0f811d5d70\"\n },\n {\n \"url\": \"images/spin.gif\",\n \"revision\": \"487cbb40b9ced439aa1ad914e816d773\"\n },\n {\n \"url\": \"images/checkmark.gif\",\n \"revision\": \"ba764ce62f2bf952df5bbc2bb4d381c5\"\n },\n {\n \"url\": \"images/aui-wait.gif\",\n \"revision\": \"5a474bcbd8d2f2826f03d10ea44bf60e\"\n },\n {\n \"url\": \"mxgraph/css/common.css\",\n \"revision\": \"7985b4d1692766a7db52cbdd10893ad9\"\n },\n {\n \"url\": \"mxgraph/images/expanded.gif\",\n \"revision\": \"2b67c2c035af1e9a5cc814f0d22074cf\"\n },\n {\n \"url\": \"mxgraph/images/collapsed.gif\",\n \"revision\": \"73cc826da002a3d740ca4ce6ec5c1f4a\"\n },\n {\n \"url\": \"mxgraph/images/maximize.gif\",\n \"revision\": \"5cd13d6925493ab51e876694cc1c2ec2\"\n },\n {\n \"url\": \"mxgraph/images/minimize.gif\",\n \"revision\": \"8957741b9b0f86af9438775f2aadbb54\"\n },\n {\n \"url\": \"mxgraph/images/close.gif\",\n \"revision\": \"8b84669812ac7382984fca35de8da48b\"\n },\n {\n \"url\": \"mxgraph/images/resize.gif\",\n \"revision\": \"a6477612b3567a34033f9cac6184eed3\"\n },\n {\n \"url\": \"mxgraph/images/separator.gif\",\n \"revision\": \"7819742ff106c97da7a801c2372bbbe5\"\n },\n {\n \"url\": \"mxgraph/images/window.gif\",\n \"revision\": \"fd9a21dd4181f98052a202a0a01f18ab\"\n },\n {\n \"url\": \"mxgraph/images/window-title.gif\",\n \"revision\": \"3fb1d6c43246cdf991a11dfe826dfe99\"\n },\n {\n \"url\": \"mxgraph/images/button.gif\",\n \"revision\": \"00759bdc3ad218fa739f584369541809\"\n },\n {\n \"url\": \"mxgraph/images/point.gif\",\n \"revision\": \"83a43717b284902442620f61bc4e9fa6\"\n }\n], {\n \"ignoreURLParametersMatching\": [/.*/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,cAULC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,gBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,qBACKC,SAAA,oCAEd,CACED,IAAO,qBACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,aACKC,SAAA,oCAEd,CACED,IAAO,YACKC,SAAA,oCAEd,CACED,IAAO,gBACKC,SAAA,oCAEd,CACED,IAAO,8CACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,iCACKC,SAAA,oCAEd,CACED,IAAO,uCACKC,SAAA,oCAEd,CACED,IAAO,2CACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,yCACKC,SAAA,oCAEd,CACED,IAAO,oCACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,2CACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,oCACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,wCACKC,SAAA,oCAEd,CACED,IAAO,4CACKC,SAAA,oCAEd,CACED,IAAO,6CACKC,SAAA,oCAEd,CACED,IAAO,yCACKC,SAAA,oCAEd,CACED,IAAO,qCACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,mCACKC,SAAA,oCAEd,CACED,IAAO,oBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,cACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,kCACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,6BACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,oBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,qCACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,iCACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,sCACKC,SAAA,oCAEd,CACED,IAAO,6BACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,kCACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,qCAEb,CACDC,4BAA+B,CAAC"}\ No newline at end of file+{"version":3,"file":"service-worker.js","sources":["../../../../../../private/var/folders/5p/vxfp3wpj4slfjt2m12dxyp9c0000gn/T/93f7616d8729bce4bd8cc0ff2faaaa8d/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"js/app.min.js\",\n \"revision\": \"894d348556f8e57ff374262ad58e6bde\"\n },\n {\n \"url\": \"js/extensions.min.js\",\n \"revision\": \"69fb66339923d62ae0fdc1f13103cf55\"\n },\n {\n \"url\": \"js/orgchart.min.js\",\n \"revision\": \"619d8c4dab47b81868916df31f55478b\"\n },\n {\n \"url\": \"js/stencils.min.js\",\n \"revision\": \"f760278d924467fb1d2289448c73fe27\"\n },\n {\n \"url\": \"js/shapes-14-6-5.min.js\",\n \"revision\": \"317413c8e37c127ada9a5c84ffd3463d\"\n },\n {\n \"url\": \"js/math-print.js\",\n \"revision\": \"cf64f6a493a8cb5079f2b70813e478d7\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"57fe6012597666439de3e76c9bb681c1\"\n },\n {\n \"url\": \"open.html\",\n \"revision\": \"d71816b3b00e769fc6019fcdd6921662\"\n },\n {\n \"url\": \"shortcuts.svg\",\n \"revision\": \"2381dd779ce6cfee954042a7f784c7e6\"\n },\n {\n \"url\": \"styles/fonts/ArchitectsDaughter-Regular.ttf\",\n \"revision\": \"31c2153c0530e32553b31a49b3d70736\"\n },\n {\n \"url\": \"styles/grapheditor.css\",\n \"revision\": \"bf1193dac429449c2f79163e623cab8d\"\n },\n {\n \"url\": \"styles/atlas.css\",\n \"revision\": \"0a6cc8a503b96f634e40309aadf6b803\"\n },\n {\n \"url\": \"styles/dark.css\",\n \"revision\": \"99dc5495d36d5ebaddababefde083c8c\"\n },\n {\n \"url\": \"js/dropbox/Dropbox-sdk.min.js\",\n \"revision\": \"4b9842892aa37b156db0a8364b7a83b0\"\n },\n {\n \"url\": \"js/onedrive/OneDrive.js\",\n \"revision\": \"505e8280346666f7ee801bc59521fa67\"\n },\n {\n \"url\": \"js/viewer-static.min.js\",\n \"revision\": \"5885df655bb4ddd1df21ac7e0b0978fe\"\n },\n {\n \"url\": \"connect/jira/editor-1-3-3.html\",\n \"revision\": \"41dc8af9576b47f359cff19fff7a41c2\"\n },\n {\n \"url\": \"connect/jira/viewerPanel-1-3-12.html\",\n \"revision\": \"4836f5e4308abe57830e441518364f23\"\n },\n {\n \"url\": \"connect/jira/fullScreenViewer-1-3-3.html\",\n \"revision\": \"abed474e47c0c41a5ad2366b4828f77a\"\n },\n {\n \"url\": \"connect/jira/viewerPanel.js\",\n \"revision\": \"75f816c208d0c621e3066a97ff0ee6cf\"\n },\n {\n \"url\": \"connect/jira/spinner.gif\",\n \"revision\": \"7d857ab9d86123e93d74d48e958fe743\"\n },\n {\n \"url\": \"connect/jira/editor.js\",\n \"revision\": \"c41221a9a51ff293f05ed13c7b142e5c\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer-init.js\",\n \"revision\": \"d3269625ce04b7a277b779ff175957d0\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer.js\",\n \"revision\": \"8eceb2fe587296dd11f9c8f6eae34c20\"\n },\n {\n \"url\": \"plugins/connectJira.js\",\n \"revision\": \"c4cb6b60234b04b2c8bc09e555746615\"\n },\n {\n \"url\": \"plugins/cConf-comments.js\",\n \"revision\": \"8af574bd1ae86be37b83b094a5011a4f\"\n },\n {\n \"url\": \"plugins/cConf-1-4-8.js\",\n \"revision\": \"1c9a0a3df274b56bd471283165f8aa5c\"\n },\n {\n \"url\": \"connect/confluence/connectUtils-1-4-8.js\",\n \"revision\": \"c3215554d29cc3f5df885cab999563c3\"\n },\n {\n \"url\": \"connect/new_common/cac.js\",\n \"revision\": \"740dce44cf53499f476ee8edc37d09a0\"\n },\n {\n \"url\": \"connect/gdrive_common/gac.js\",\n \"revision\": \"3bb38a5d9186a896ed04808e921ef888\"\n },\n {\n \"url\": \"connect/onedrive_common/ac.js\",\n \"revision\": \"5fb6ff1a73f54a9086b7a7e1f613b8ed\"\n },\n {\n \"url\": \"connect/confluence/viewer-init.js\",\n \"revision\": \"b82e366bf57ecced9435c2a8ba9cb9b9\"\n },\n {\n \"url\": \"connect/confluence/viewer.js\",\n \"revision\": \"aa5ca84da421c280e9057b3a39c8a456\"\n },\n {\n \"url\": \"connect/confluence/viewer-1-4-42.html\",\n \"revision\": \"69c1bca25fd4889bf832e8441c972268\"\n },\n {\n \"url\": \"connect/confluence/macroEditor-1-4-8.html\",\n \"revision\": \"4ad77ae3f08c19eddac932b2fa8c7068\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram-1-4-8.js\",\n \"revision\": \"a71935d0acd4b0a6ee70795b0f298699\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram.html\",\n \"revision\": \"9613fec05b19ddef081ca6e9d8b057bf\"\n },\n {\n \"url\": \"connect/confluence/macro-editor.js\",\n \"revision\": \"03a8dcfc69612b44b6e75e6926a956fc\"\n },\n {\n \"url\": \"math/es5/startup.js\",\n \"revision\": \"dc7130cdc866593293dbb5dde11ceb40\"\n },\n {\n \"url\": \"math/es5/core.js\",\n \"revision\": \"f71bc0bfb7d2ac8261747f97a5d47dd4\"\n },\n {\n \"url\": \"math/es5/ui/safe.js\",\n \"revision\": \"8c1fcfee7c879588ad409edcdd9cce53\"\n },\n {\n \"url\": \"math/es5/output/svg.js\",\n \"revision\": \"4f55967d16197ebb01b86356d8ab179a\"\n },\n {\n \"url\": \"math/es5/input/tex.js\",\n \"revision\": \"5c4f470da2ccb1acf85041fcecd6fff6\"\n },\n {\n \"url\": \"math/es5/input/asciimath.js\",\n \"revision\": \"c2d4076dd8e26d509bfe3a378e71cfa7\"\n },\n {\n \"url\": \"math/es5/output/svg/fonts/tex.js\",\n \"revision\": \"6eab785a3788ea805bd2b552d1f0aab8\"\n },\n {\n \"url\": \"resources/dia.txt\",\n \"revision\": \"73927d303703a329ff06d681553e993d\"\n },\n {\n \"url\": \"resources/dia_am.txt\",\n \"revision\": \"8d60c82458b57bb9ccc7b0c4f6ed3f79\"\n },\n {\n \"url\": \"resources/dia_ar.txt\",\n \"revision\": \"e278657437cf14eeedbb3b641d3ba8c0\"\n },\n {\n \"url\": \"resources/dia_bg.txt\",\n \"revision\": \"61c2ef14ee768be21fcb22b1928f7cac\"\n },\n {\n \"url\": \"resources/dia_bn.txt\",\n \"revision\": \"45e3683c1150ad2e139f42fedaf9e7aa\"\n },\n {\n \"url\": \"resources/dia_bs.txt\",\n \"revision\": \"ed33364ad4282d0e29775ca2e2f351e0\"\n },\n {\n \"url\": \"resources/dia_ca.txt\",\n \"revision\": \"101dbe73020d8471a5208da4d8ae247e\"\n },\n {\n \"url\": \"resources/dia_cs.txt\",\n \"revision\": \"ba2fd4196222285218549625600a530f\"\n },\n {\n \"url\": \"resources/dia_da.txt\",\n \"revision\": \"b3eb739977ead9876a8afe0103ad7e36\"\n },\n {\n \"url\": \"resources/dia_de.txt\",\n \"revision\": \"95357e2d517ad36e2db9ed683914f9b3\"\n },\n {\n \"url\": \"resources/dia_el.txt\",\n \"revision\": \"faa7d843ef32aba9b9f11e367ca362d5\"\n },\n {\n \"url\": \"resources/dia_eo.txt\",\n \"revision\": \"619ff072153d5897b7184ee0fe925f18\"\n },\n {\n \"url\": \"resources/dia_es.txt\",\n \"revision\": \"1feb3c63ee76afc71ebec607c8a9347a\"\n },\n {\n \"url\": \"resources/dia_et.txt\",\n \"revision\": \"67482775f1ff0d1b2cb31f6226c519d3\"\n },\n {\n \"url\": \"resources/dia_eu.txt\",\n \"revision\": \"a7dce4832af9f1d0b4e5f5bf189ef328\"\n },\n {\n \"url\": \"resources/dia_fa.txt\",\n \"revision\": \"743a891d016470e8e0a3651be32fb3c5\"\n },\n {\n \"url\": \"resources/dia_fi.txt\",\n \"revision\": \"771de2b3741f25b4114e51c93ce1a866\"\n },\n {\n \"url\": \"resources/dia_fil.txt\",\n \"revision\": \"637b4984bb64580b4ef61e28ef7ca664\"\n },\n {\n \"url\": \"resources/dia_fr.txt\",\n \"revision\": \"ad7e62eb41228b929489d9427d206e82\"\n },\n {\n \"url\": \"resources/dia_gl.txt\",\n \"revision\": \"a89e3f7e7cb3b6867d3e74eb949894dd\"\n },\n {\n \"url\": \"resources/dia_gu.txt\",\n \"revision\": \"769be61a373049c5d3b358201f1acb65\"\n },\n {\n \"url\": \"resources/dia_he.txt\",\n \"revision\": \"238e53f20884ef57b1a9c06bd800b9ef\"\n },\n {\n \"url\": \"resources/dia_hi.txt\",\n \"revision\": \"755e1872b614c9a5b27c5459062c8320\"\n },\n {\n \"url\": \"resources/dia_hr.txt\",\n \"revision\": \"adf6788e96b0e3f0029cbae30a4faefb\"\n },\n {\n \"url\": \"resources/dia_hu.txt\",\n \"revision\": \"c645a78fdda2843acd6aa9d9bf60a6e8\"\n },\n {\n \"url\": \"resources/dia_id.txt\",\n \"revision\": \"9da16676fc1b33c61b4a025a352dc916\"\n },\n {\n \"url\": \"resources/dia_it.txt\",\n \"revision\": \"57b0f8eb2319f99f96b79507966f4e6f\"\n },\n {\n \"url\": \"resources/dia_ja.txt\",\n \"revision\": \"b4b10c93e53b13dbd3e407532813b9e0\"\n },\n {\n \"url\": \"resources/dia_kn.txt\",\n \"revision\": \"7cbbba0381a1a6cdeade3bc28ac01962\"\n },\n {\n \"url\": \"resources/dia_ko.txt\",\n \"revision\": \"943b020ff0430e9f81fe3e1875423b7d\"\n },\n {\n \"url\": \"resources/dia_lt.txt\",\n \"revision\": \"94aff34cd118d39d79abacf2a16aea7d\"\n },\n {\n \"url\": \"resources/dia_lv.txt\",\n \"revision\": \"325ed2d9ffa2ddc493d9ed10d46007ad\"\n },\n {\n \"url\": \"resources/dia_ml.txt\",\n \"revision\": \"fc666763d3fbff227411defda23b1942\"\n },\n {\n \"url\": \"resources/dia_mr.txt\",\n \"revision\": \"e8746ae5b0123155bdd837ae7f01b5f5\"\n },\n {\n \"url\": \"resources/dia_ms.txt\",\n \"revision\": \"e1600b30e6517d4dc4a7002ce675c641\"\n },\n {\n \"url\": \"resources/dia_my.txt\",\n \"revision\": \"4acfe58eb8f47895f188af8bfd33659c\"\n },\n {\n \"url\": \"resources/dia_nl.txt\",\n \"revision\": \"e9512982f5d9e89015435ee50d577bbc\"\n },\n {\n \"url\": \"resources/dia_no.txt\",\n \"revision\": \"6f0812d787ab931475343320d2547158\"\n },\n {\n \"url\": \"resources/dia_pl.txt\",\n \"revision\": \"3c7d08a5fefc693e6b6b4521a3c0a6cc\"\n },\n {\n \"url\": \"resources/dia_pt-br.txt\",\n \"revision\": \"5d7431a638a268dfedd3bc7f463e17d6\"\n },\n {\n \"url\": \"resources/dia_pt.txt\",\n \"revision\": \"981210fd60e7fd0831fcd6d26ca26f74\"\n },\n {\n \"url\": \"resources/dia_ro.txt\",\n \"revision\": \"1d77510ecd2b1b1c26640dfe77e00f48\"\n },\n {\n \"url\": \"resources/dia_ru.txt\",\n \"revision\": \"4c2d2f96df120afc4c3b3c58d0bc6ebc\"\n },\n {\n \"url\": \"resources/dia_si.txt\",\n \"revision\": \"2db82ba649f3ab7d578a73b247b06c4f\"\n },\n {\n \"url\": \"resources/dia_sk.txt\",\n \"revision\": \"4b9033183a2c90ccf0f75136fd7b14b0\"\n },\n {\n \"url\": \"resources/dia_sl.txt\",\n \"revision\": \"c27148e1c9480a35642162595480ff1f\"\n },\n {\n \"url\": \"resources/dia_sr.txt\",\n \"revision\": \"ef3562ada2e69e5d33609d58a677b6db\"\n },\n {\n \"url\": \"resources/dia_sv.txt\",\n \"revision\": \"7357682c42f6d47729b6b1784aaa5e9b\"\n },\n {\n \"url\": \"resources/dia_sw.txt\",\n \"revision\": \"377dd914bd645c2348e342bf55306439\"\n },\n {\n \"url\": \"resources/dia_ta.txt\",\n \"revision\": \"00ce65e244e159a2dcb93b9829a2e603\"\n },\n {\n \"url\": \"resources/dia_te.txt\",\n \"revision\": \"8aaca1c42eb1c027a77138f0fccc85c7\"\n },\n {\n \"url\": \"resources/dia_th.txt\",\n \"revision\": \"c2be3eae6995b41ba466651629c69143\"\n },\n {\n \"url\": \"resources/dia_tr.txt\",\n \"revision\": \"9571764eb899cc108c6fb2631d694ca3\"\n },\n {\n \"url\": \"resources/dia_uk.txt\",\n \"revision\": \"76e4f285ac8c648d3b3fbc6ab59aad17\"\n },\n {\n \"url\": \"resources/dia_vi.txt\",\n \"revision\": \"ced105b1a1ea57902c88fdd36ab041c0\"\n },\n {\n \"url\": \"resources/dia_zh-tw.txt\",\n \"revision\": \"ce0a47eca469dbb93e8c4f26aba7ea73\"\n },\n {\n \"url\": \"resources/dia_zh.txt\",\n \"revision\": \"a69a22b12a4ced3f62285b2521355755\"\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"83014b0f32b6c7b15b66cf3c6d6d7c16\"\n },\n {\n \"url\": \"images/manifest.json\",\n \"revision\": \"38d3a7e4b63e8175f0aab6f03e000f07\"\n },\n {\n \"url\": \"images/logo.png\",\n \"revision\": \"e4e0d092abdb1e668b5ec41a7fe0713c\"\n },\n {\n \"url\": \"images/drawlogo.svg\",\n \"revision\": \"4bf4d14ebcf072d8bd4c5a1c89e88fc6\"\n },\n {\n \"url\": \"images/drawlogo48.png\",\n \"revision\": \"8b13428373aca67b895364d025f42417\"\n },\n {\n \"url\": \"images/drawlogo-gray.svg\",\n \"revision\": \"0aabacbc0873816e1e09e4736ae44c7d\"\n },\n {\n \"url\": \"images/drawlogo-text-bottom.svg\",\n \"revision\": \"f6c438823ab31f290940bd4feb8dd9c2\"\n },\n {\n \"url\": \"images/default-user.jpg\",\n \"revision\": \"2c399696a87c8921f12d2f9e1990cc6e\"\n },\n {\n \"url\": \"images/logo-flat-small.png\",\n \"revision\": \"4b178e59ff499d6dd1894fc498b59877\"\n },\n {\n \"url\": \"images/apple-touch-icon.png\",\n \"revision\": \"732c29e21332a926318a7005d21ec450\"\n },\n {\n \"url\": \"images/icon-192-maskable.png\",\n \"revision\": \"47e006d0ce4a35eb5beaa97f0c2bfed0\"\n },\n {\n \"url\": \"images/icon-192.png\",\n \"revision\": \"d022403d52435d76afec82c4e24a17ef\"\n },\n {\n \"url\": \"images/icon-512-maskable.png\",\n \"revision\": \"cf152feeb01fb21f3148a71a3540266e\"\n },\n {\n \"url\": \"images/icon-512.png\",\n \"revision\": \"a3a0df7e7a385244b74073f81ecc45de\"\n },\n {\n \"url\": \"images/delete.png\",\n \"revision\": \"5f2350f2fd20f1a229637aed32ed8f29\"\n },\n {\n \"url\": \"images/droptarget.png\",\n \"revision\": \"bbf7f563fb6784de1ce96f329519b043\"\n },\n {\n \"url\": \"images/help.png\",\n \"revision\": \"9266c6c3915bd33c243d80037d37bf61\"\n },\n {\n \"url\": \"images/download.png\",\n \"revision\": \"35418dd7bd48d87502c71b578cc6c37f\"\n },\n {\n \"url\": \"images/logo-flat.png\",\n \"revision\": \"038070ab43aee6e54a791211859fc67b\"\n },\n {\n \"url\": \"images/google-drive-logo.svg\",\n \"revision\": \"5d9f2f5bbc7dcc252730a0072bb23059\"\n },\n {\n \"url\": \"images/onedrive-logo.svg\",\n \"revision\": \"3645b344ec0634c1290dd58d7dc87b97\"\n },\n {\n \"url\": \"images/dropbox-logo.svg\",\n \"revision\": \"e6be408c77cf9c82d41ac64fa854280a\"\n },\n {\n \"url\": \"images/github-logo.svg\",\n \"revision\": \"a1a999b69a275eac0cb918360ac05ae1\"\n },\n {\n \"url\": \"images/gitlab-logo.svg\",\n \"revision\": \"0faea8c818899e58533e153c44b10517\"\n },\n {\n \"url\": \"images/trello-logo.svg\",\n \"revision\": \"006fd0d7d70d7e95dc691674cb12e044\"\n },\n {\n \"url\": \"images/osa_drive-harddisk.png\",\n \"revision\": \"b954e1ae772087c5b4c6ae797e1f9649\"\n },\n {\n \"url\": \"images/osa_database.png\",\n \"revision\": \"c350d9d9b95f37b6cfe798b40ede5fb0\"\n },\n {\n \"url\": \"images/google-drive-logo-white.svg\",\n \"revision\": \"f329d8b1be7778515a85b93fc35d9f26\"\n },\n {\n \"url\": \"images/dropbox-logo-white.svg\",\n \"revision\": \"4ea8299ac3bc31a16f199ee3aec223bf\"\n },\n {\n \"url\": \"images/onedrive-logo-white.svg\",\n \"revision\": \"b3602fa0fc947009cff3f33a581cff4d\"\n },\n {\n \"url\": \"images/github-logo-white.svg\",\n \"revision\": \"537b1127b3ca0f95b45782d1304fb77a\"\n },\n {\n \"url\": \"images/gitlab-logo-white.svg\",\n \"revision\": \"5fede9ac2f394c716b8c23e3fddc3910\"\n },\n {\n \"url\": \"images/trello-logo-white-orange.svg\",\n \"revision\": \"e2a0a52ba3766682f138138d10a75eb5\"\n },\n {\n \"url\": \"images/logo-confluence.png\",\n \"revision\": \"ed1e55d44ae5eba8f999aba2c93e8331\"\n },\n {\n \"url\": \"images/logo-jira.png\",\n \"revision\": \"f8d460555a0d1f87cfd901e940666629\"\n },\n {\n \"url\": \"images/clear.gif\",\n \"revision\": \"db13c778e4382e0b55258d0f811d5d70\"\n },\n {\n \"url\": \"images/spin.gif\",\n \"revision\": \"487cbb40b9ced439aa1ad914e816d773\"\n },\n {\n \"url\": \"images/checkmark.gif\",\n \"revision\": \"ba764ce62f2bf952df5bbc2bb4d381c5\"\n },\n {\n \"url\": \"images/aui-wait.gif\",\n \"revision\": \"5a474bcbd8d2f2826f03d10ea44bf60e\"\n },\n {\n \"url\": \"mxgraph/css/common.css\",\n \"revision\": \"7985b4d1692766a7db52cbdd10893ad9\"\n },\n {\n \"url\": \"mxgraph/images/expanded.gif\",\n \"revision\": \"2b67c2c035af1e9a5cc814f0d22074cf\"\n },\n {\n \"url\": \"mxgraph/images/collapsed.gif\",\n \"revision\": \"73cc826da002a3d740ca4ce6ec5c1f4a\"\n },\n {\n \"url\": \"mxgraph/images/maximize.gif\",\n \"revision\": \"5cd13d6925493ab51e876694cc1c2ec2\"\n },\n {\n \"url\": \"mxgraph/images/minimize.gif\",\n \"revision\": \"8957741b9b0f86af9438775f2aadbb54\"\n },\n {\n \"url\": \"mxgraph/images/close.gif\",\n \"revision\": \"8b84669812ac7382984fca35de8da48b\"\n },\n {\n \"url\": \"mxgraph/images/resize.gif\",\n \"revision\": \"a6477612b3567a34033f9cac6184eed3\"\n },\n {\n \"url\": \"mxgraph/images/separator.gif\",\n \"revision\": \"7819742ff106c97da7a801c2372bbbe5\"\n },\n {\n \"url\": \"mxgraph/images/window.gif\",\n \"revision\": \"fd9a21dd4181f98052a202a0a01f18ab\"\n },\n {\n \"url\": \"mxgraph/images/window-title.gif\",\n \"revision\": \"3fb1d6c43246cdf991a11dfe826dfe99\"\n },\n {\n \"url\": \"mxgraph/images/button.gif\",\n \"revision\": \"00759bdc3ad218fa739f584369541809\"\n },\n {\n \"url\": \"mxgraph/images/point.gif\",\n \"revision\": \"83a43717b284902442620f61bc4e9fa6\"\n }\n], {\n \"ignoreURLParametersMatching\": [/.*/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,cAULC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,gBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,qBACKC,SAAA,oCAEd,CACED,IAAO,qBACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,aACKC,SAAA,oCAEd,CACED,IAAO,YACKC,SAAA,oCAEd,CACED,IAAO,gBACKC,SAAA,oCAEd,CACED,IAAO,8CACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,iCACKC,SAAA,oCAEd,CACED,IAAO,uCACKC,SAAA,oCAEd,CACED,IAAO,2CACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,yCACKC,SAAA,oCAEd,CACED,IAAO,oCACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,2CACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,oCACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,wCACKC,SAAA,oCAEd,CACED,IAAO,4CACKC,SAAA,oCAEd,CACED,IAAO,6CACKC,SAAA,oCAEd,CACED,IAAO,yCACKC,SAAA,oCAEd,CACED,IAAO,qCACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,mCACKC,SAAA,oCAEd,CACED,IAAO,oBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,cACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,kCACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,6BACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,oBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,qCACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,iCACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,sCACKC,SAAA,oCAEd,CACED,IAAO,6BACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,kCACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,qCAEb,CACDC,4BAA+B,CAAC"}\ No newline at end of file